Improve and Cleanup Shutdown callbacks (#21060)
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
This commit is contained in:
parent
4601f339e4
commit
3ef06aa732
79 changed files with 277 additions and 1684 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue