ChibiOS: Update infinity bootloader code to match updated ChibiOS.
This commit is contained in:
parent
aef7a2973e
commit
d3f4b01d22
@ -26,10 +26,9 @@ void bootloader_jump(void) {
|
|||||||
#if defined(KIIBOHD_BOOTLOADER)
|
#if defined(KIIBOHD_BOOTLOADER)
|
||||||
/* Kiibohd Bootloader (MCHCK and Infinity KB) */
|
/* Kiibohd Bootloader (MCHCK and Infinity KB) */
|
||||||
#define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000
|
#define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000
|
||||||
#define VBAT (*(volatile uint8_t *)0x4003E000) // VBAT register file (32 bytes)
|
|
||||||
const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff";
|
const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff";
|
||||||
void bootloader_jump(void) {
|
void bootloader_jump(void) {
|
||||||
__builtin_memcpy((void *)&VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic));
|
__builtin_memcpy((void *)VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic));
|
||||||
// request reset
|
// request reset
|
||||||
SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk;
|
SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user