mirror of
https://github.com/Cian-H/qmk_firmware.git
synced 2025-12-22 22:21:58 +00:00
Improve and Cleanup Shutdown callbacks (#21060)
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user