Upon receiving the reset BusPal command, reset the MCU and reenumerate in normal keyboard mode.
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#if FIXED_BUSPAL_BOOTLOADER
|
||||
#include "microseconds/microseconds.h"
|
||||
#endif
|
||||
#include "bootloader/wormhole.h"
|
||||
|
||||
|
||||
command_processor_data_t g_commandData;
|
||||
buspal_state_t g_buspalState = kBuspal_Idle;
|
||||
@@ -483,6 +485,10 @@ status_t bootloader_command_pump()
|
||||
handle_write_memory_command(g_commandData.packet, g_commandData.packetLength);
|
||||
|
||||
g_commandData.state = kCommandState_DataPhaseWrite;
|
||||
} else if (cmdTag == kCommandTag_Reset) {
|
||||
Wormhole.magicNumber = WORMHOLE_MAGIC_NUMBER;
|
||||
Wormhole.enumerationMode = EnumerationMode_NormalKeyboard;
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
status = handle_command_internal(g_commandData.packet, g_commandData.packetLength);
|
||||
|
||||
Reference in New Issue
Block a user