Improve and Cleanup Shutdown callbacks (#21060)

Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
This commit is contained in:
Drashna Jaelre
2023-11-26 03:59:18 -08:00
committed by GitHub
parent 4601f339e4
commit 3ef06aa732
79 changed files with 277 additions and 1684 deletions

View File

@@ -92,13 +92,8 @@ bool led_update_kb(led_t led_state) {
}
#define REBOOT_MAGIC 0x41544B42
void shutdown_user(void)
{
// set the magic number for resetting to the bootloader
*(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC;
}
void bootloader_jump(void) {
shutdown_user();
*(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC;
NVIC_SystemReset();
}

View File

@@ -54,13 +54,9 @@ bool led_update_kb(led_t led_state) {
}
#define REBOOT_MAGIC 0x41544B42
void shutdown_user(void)
{
// set the magic number for resetting to the bootloader
*(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC;
}
void bootloader_jump(void) {
shutdown_user();
// set the magic number for resetting to the bootloader
*(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC;
NVIC_SystemReset();
}