[Core] Add Reboot keycode to core (#15990)
This commit is contained in:
parent
425c54cf8c
commit
787a68948f
25 changed files with 124 additions and 5 deletions
|
@ -17,5 +17,6 @@
|
|||
#include "bootloader.h"
|
||||
|
||||
__attribute__((weak)) void bootloader_jump(void) {}
|
||||
__attribute__((weak)) void mcu_reset(void) {}
|
||||
|
||||
__attribute__((weak)) void enter_bootloader_mode_if_requested(void) {}
|
||||
|
|
|
@ -36,5 +36,12 @@ __attribute__((weak)) void bootloader_jump(void) {
|
|||
*DBGMCU_CMD = DBGMCU_CMD_RESET;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {
|
||||
// Confirmed by karlk90, there is no actual reset to bootloader.
|
||||
// This just resets the controller.
|
||||
*DBGMCU_KEY = DBGMCU_KEY_UNLOCK;
|
||||
*DBGMCU_CMD = DBGMCU_CMD_RESET;
|
||||
}
|
||||
|
||||
/* Jumping to bootloader is not possible from user code. */
|
||||
void enter_bootloader_mode_if_requested(void) {}
|
||||
|
|
|
@ -23,3 +23,5 @@ __attribute__((weak)) void bootloader_jump(void) {
|
|||
wait_ms(100);
|
||||
__BKPT(0);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {}
|
||||
|
|
|
@ -30,3 +30,4 @@ __attribute__((weak)) void bootloader_jump(void) {
|
|||
// request reset
|
||||
SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk;
|
||||
}
|
||||
__attribute__((weak)) void mcu_reset(void) {}
|
||||
|
|
|
@ -61,6 +61,9 @@ __attribute__((weak)) void bootloader_jump(void) {
|
|||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
// not needed at all, but if anybody attempts to invoke it....
|
||||
void enter_bootloader_mode_if_requested(void) {}
|
||||
|
||||
|
@ -76,6 +79,10 @@ __attribute__((weak)) void bootloader_jump(void) {
|
|||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
void enter_bootloader_mode_if_requested(void) {
|
||||
unsigned long *check = MAGIC_ADDR;
|
||||
if (*check == BOOTLOADER_MAGIC) {
|
||||
|
|
|
@ -21,3 +21,8 @@
|
|||
__attribute__((weak)) void bootloader_jump(void) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {
|
||||
BKP->DR10 = RTC_BOOTLOADER_JUST_UPLOADED;
|
||||
NVIC_SystemReset();
|
||||
}
|
|
@ -25,6 +25,10 @@
|
|||
extern uint32_t _board_dfu_dbl_tap[];
|
||||
#define DBL_TAP_REG _board_dfu_dbl_tap[0]
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
__attribute__((weak)) void bootloader_jump(void) {
|
||||
DBL_TAP_REG = DBL_TAP_MAGIC;
|
||||
NVIC_SystemReset();
|
||||
|
|
|
@ -47,3 +47,7 @@ void enter_bootloader_mode_if_requested(void) {
|
|||
;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak)) void mcu_reset(void) {
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue