Preserve state across resets by putting Wormhole to the newly added .noinit section. Rename The jump to bootloader USB command to reenumerate and generalize accordingly by handling the passed reenumeration mode.
This commit is contained in:
@@ -72,16 +72,12 @@ void UpdateUsbReports()
|
||||
IsUsbBasicKeyboardReportSent = false;
|
||||
}
|
||||
|
||||
wormhole_t wormhole;
|
||||
|
||||
void main() {
|
||||
InitPeripherials();
|
||||
InitClock();
|
||||
Wormhole = &wormhole; // TODO: Remove this as soon as the wormhole stabilizes.
|
||||
Wormhole->enumerationMode = EnumerationMode_NormalKeyboard;
|
||||
// Wormhole->enumerationMode = EnumerationMode_BusPal;
|
||||
if (/*Wormhole->magicNumber == WORMHOLE_MAGIC_NUMBER && */ Wormhole->enumerationMode == EnumerationMode_BusPal) {
|
||||
//Wormhole->magicNumber = 0;
|
||||
|
||||
if (Wormhole.magicNumber == WORMHOLE_MAGIC_NUMBER && Wormhole.enumerationMode == EnumerationMode_BusPal) {
|
||||
Wormhole.magicNumber = 0;
|
||||
init_hardware();
|
||||
handleUsbBusPalCommand();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user