Extract UsbCommand_Reenumerate() into its own file.

This commit is contained in:
László Monda
2017-11-05 01:18:37 +01:00
parent 0febc9dd69
commit e907e65751
3 changed files with 22 additions and 9 deletions

View File

@@ -24,6 +24,7 @@
#include "usb_commands/usb_command_launch_eeprom_transfer_legacy.h"
#include "usb_commands/usb_command_get_keyboard_state.h"
#include "usb_commands/usb_command_get_debug_info.h"
#include "usb_commands/usb_command_reenumerate.h"
uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
@@ -46,14 +47,6 @@ void SetUsbResponseWord(uint16_t response)
// Per command protocol command handlers
void reenumerate(void)
{
Wormhole.magicNumber = WORMHOLE_MAGIC_NUMBER;
Wormhole.enumerationMode = GenericHidInBuffer[1];
Wormhole.timeoutMs = *((uint32_t*)(GenericHidInBuffer+2));
NVIC_SystemReset();
}
void setTestLed(void)
{
uint8_t ledState = GenericHidInBuffer[1];
@@ -90,7 +83,7 @@ void UsbProtocolHandler(void)
UsbCommand_GetProperty();
break;
case UsbCommandId_Reenumerate:
reenumerate();
UsbCommand_Reenumerate();
break;
case UsbCommandId_SetTestLed:
setTestLed();