1
0
Fork 0

[Core] Add Reboot keycode to core (#15990)

This commit is contained in:
Drashna Jael're 2022-05-13 20:35:49 -07:00 committed by GitHub
parent 425c54cf8c
commit 787a68948f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 124 additions and 5 deletions

View file

@ -31,3 +31,10 @@ __attribute__((weak)) void bootloader_jump(void) {
for (;;)
;
}
__attribute__((weak)) void mcu_reset(void) {
// watchdog reset
wdt_enable(WDTO_250MS);
for (;;)
;
}

View file

@ -37,3 +37,12 @@ __attribute__((weak)) void bootloader_jump(void) {
while (1) {
}
}
__attribute__((weak)) void mcu_reset(void) {
// setup watchdog timeout
wdt_enable(WDTO_60MS);
// wait for watchdog timer to trigger
while (1) {
}
}

View file

@ -15,5 +15,14 @@
*/
#include "bootloader.h"
#include <avr/wdt.h>
__attribute__((weak)) void bootloader_jump(void) {}
__attribute__((weak)) void mcu_reset(void) {
// setup watchdog timeout
wdt_enable(WDTO_60MS);
// wait for watchdog timer to trigger
while (1) {
}
}

View file

@ -34,8 +34,15 @@ __attribute__((weak)) void bootloader_jump(void) {
UCSR1B = 0;
_delay_ms(5); // 5 seems to work fine
// watchdog reset
reset_key = BOOTLOADER_RESET_KEY;
// watchdog reset
wdt_enable(WDTO_250MS);
for (;;)
;
}
__attribute__((weak)) void mcu_reset(void) {
// watchdog reset
wdt_enable(WDTO_250MS);
for (;;)
;

View file

@ -17,6 +17,7 @@
#include "bootloader.h"
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <util/delay.h>
__attribute__((weak)) void bootloader_jump(void) {
@ -126,3 +127,12 @@ __attribute__((weak)) void bootloader_jump(void) {
asm volatile("jmp 0x1FC00");
#endif
}
__attribute__((weak)) void mcu_reset(void) {
// setup watchdog timeout
wdt_enable(WDTO_60MS);
// wait for watchdog timer to trigger
while (1) {
}
}

View file

@ -54,3 +54,12 @@ __attribute__((weak)) void bootloader_jump(void) {
#endif
[bootaddrme] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), [bootaddrlo] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff));
}
__attribute__((weak)) void mcu_reset(void) {
// setup watchdog timeout
wdt_enable(WDTO_15MS);
// wait for watchdog timer to trigger
while (1) {
}
}