Call NVIC_SystemReset() instead of custom code.

This commit is contained in:
László Monda
2017-10-20 00:34:01 +02:00
parent 0b4ca43ed6
commit 968c6c0416

View File

@@ -73,8 +73,7 @@ void reenumerate(void)
Wormhole.magicNumber = WORMHOLE_MAGIC_NUMBER;
Wormhole.enumerationMode = GenericHidInBuffer[1];
Wormhole.timeoutMs = *((uint32_t*)(GenericHidInBuffer+2));
SCB->AIRCR = 0x5FA<<SCB_AIRCR_VECTKEY_Pos | SCB_AIRCR_SYSRESETREQ_Msk; // Reset the MCU.
for (;;);
NVIC_SystemReset();
}
void setTestLed(void)