mirror of
https://github.com/jmwtsn/qmk_firmware.git
synced 2026-06-03 19:53:31 -03:00
Add an mcu_reset impl for the kiibohd bootloader. (#25963)
* Fixes resetting and split watchdog on the Ergodox Infinity.
This commit is contained in:
@@ -30,4 +30,21 @@ __attribute__((weak)) void bootloader_jump(void) {
|
||||
// request reset
|
||||
SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk;
|
||||
}
|
||||
__attribute__((weak)) void mcu_reset(void) {}
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {
|
||||
/* Ensure all outstanding memory operations complete */
|
||||
__DSB();
|
||||
__ISB();
|
||||
|
||||
/* Request system reset (preserve PRIGROUP) */
|
||||
uint32_t aircr = SCB->AIRCR;
|
||||
aircr &= ~SCB_AIRCR_VECTKEY_Msk;
|
||||
aircr |= SCB_AIRCR_VECTKEY_WRITEMAGIC;
|
||||
aircr |= SCB_AIRCR_SYSRESETREQ_Msk;
|
||||
SCB->AIRCR = aircr;
|
||||
|
||||
/* Wait for reset to occur */
|
||||
while (true) {
|
||||
__NOP();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user