aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/capsunlocked/cu75/cu75.c12
-rw-r--r--keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c19
-rw-r--r--keyboards/lfkeyboards/lfk78/lfk78.c13
-rw-r--r--keyboards/lfkeyboards/lfk87/lfk87.c12
-rw-r--r--keyboards/lfkeyboards/mini1800/mini1800.c12
-rw-r--r--keyboards/lfkeyboards/smk65/revb/revb.c12
-rw-r--r--keyboards/nullbitsco/tidbit/tidbit.c29
-rw-r--r--keyboards/snes_macropad/snes_macropad.c11
-rw-r--r--keyboards/woodkeys/meira/meira.c25
9 files changed, 63 insertions, 82 deletions
diff --git a/keyboards/capsunlocked/cu75/cu75.c b/keyboards/capsunlocked/cu75/cu75.c
index 42d5f4e290..155b8958fc 100644
--- a/keyboards/capsunlocked/cu75/cu75.c
+++ b/keyboards/capsunlocked/cu75/cu75.c
@@ -54,17 +54,19 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record)
if (click_toggle && record->event.pressed){
click(click_hz, click_time);
}
- if (keycode == QK_BOOT) {
- reset_keyboard_kb();
- }
return process_record_user(keycode, record);
}
-void reset_keyboard_kb(void){
+bool shutdown_kb(bool jump_to_bootloader) {
#ifdef WATCHDOG_ENABLE
+ // Unconditionally run so shutdown_user can't mess up watchdog
MCUSR = 0;
wdt_disable();
wdt_reset();
#endif
- reset_keyboard();
+
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ return true;
}
diff --git a/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c b/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c
deleted file mode 100644
index ee8d8b2e73..0000000000
--- a/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "lfk65_hs.h"
-#include <avr/wdt.h>
-
-bool process_record_kb(uint16_t keycode, keyrecord_t* record)
-{
- if (keycode == QK_BOOT) {
- reset_keyboard_kb();
- }
- return process_record_user(keycode, record);
-}
-
-void reset_keyboard_kb(void){
-#ifdef WATCHDOG_ENABLE
- MCUSR = 0;
- wdt_disable();
- wdt_reset();
-#endif
- reset_keyboard();
-}
diff --git a/keyboards/lfkeyboards/lfk78/lfk78.c b/keyboards/lfkeyboards/lfk78/lfk78.c
index 3f6cb61263..6fe282bb0b 100644
--- a/keyboards/lfkeyboards/lfk78/lfk78.c
+++ b/keyboards/lfkeyboards/lfk78/lfk78.c
@@ -43,20 +43,19 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (click_toggle && record->event.pressed) {
clicking_notes(click_hz, click_time);
}
-
- if (keycode == QK_BOOT) {
- reset_keyboard_kb();
- }
-
return process_record_user(keycode, record);
}
-void reset_keyboard_kb(void) {
+bool shutdown_kb(bool jump_to_bootloader) {
#ifdef WATCHDOG_ENABLE
+ // Unconditionally run so shutdown_user can't mess up watchdog
MCUSR = 0;
wdt_disable();
wdt_reset();
#endif
- reset_keyboard();
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ return true;
}
diff --git a/keyboards/lfkeyboards/lfk87/lfk87.c b/keyboards/lfkeyboards/lfk87/lfk87.c
index e6288eb6c1..ff0a038114 100644
--- a/keyboards/lfkeyboards/lfk87/lfk87.c
+++ b/keyboards/lfkeyboards/lfk87/lfk87.c
@@ -45,17 +45,19 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record)
if (click_toggle && record->event.pressed){
clicking_notes(click_hz, click_time);
}
- if (keycode == QK_BOOT) {
- reset_keyboard_kb();
- }
return process_record_user(keycode, record);
}
-void reset_keyboard_kb(void){
+bool shutdown_kb(bool jump_to_bootloader) {
#ifdef WATCHDOG_ENABLE
+ // Unconditionally run so shutdown_user can't mess up watchdog
MCUSR = 0;
wdt_disable();
wdt_reset();
#endif
- reset_keyboard();
+
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ return true;
}
diff --git a/keyboards/lfkeyboards/mini1800/mini1800.c b/keyboards/lfkeyboards/mini1800/mini1800.c
index 96dc56c03c..1d07ea7b0d 100644
--- a/keyboards/lfkeyboards/mini1800/mini1800.c
+++ b/keyboards/lfkeyboards/mini1800/mini1800.c
@@ -47,17 +47,19 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record)
if (click_toggle && record->event.pressed){
click(click_hz, click_time);
}
- if (keycode == QK_BOOT) {
- reset_keyboard_kb();
- }
return process_record_user(keycode, record);
}
-void reset_keyboard_kb(void){
+bool shutdown_kb(bool jump_to_bootloader) {
#ifdef WATCHDOG_ENABLE
+ // Unconditionally run so shutdown_user can't mess up watchdog
MCUSR = 0;
wdt_disable();
wdt_reset();
#endif
- reset_keyboard();
+
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ return true;
}
diff --git a/keyboards/lfkeyboards/smk65/revb/revb.c b/keyboards/lfkeyboards/smk65/revb/revb.c
index c183ae1b02..970a4d3a10 100644
--- a/keyboards/lfkeyboards/smk65/revb/revb.c
+++ b/keyboards/lfkeyboards/smk65/revb/revb.c
@@ -61,17 +61,19 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record)
if (click_toggle && record->event.pressed){
click(click_hz, click_time);
}
- if (keycode == QK_BOOT) {
- reset_keyboard_kb();
- }
return process_record_user(keycode, record);
}
-void reset_keyboard_kb(void){
+bool shutdown_kb(bool jump_to_bootloader) {
#ifdef WATCHDOG_ENABLE
+ // Unconditionally run so shutdown_user can't mess up watchdog
MCUSR = 0;
wdt_disable();
wdt_reset();
#endif
- reset_keyboard();
+
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ return true;
}
diff --git a/keyboards/nullbitsco/tidbit/tidbit.c b/keyboards/nullbitsco/tidbit/tidbit.c
index 15bc0f6a7a..0ccdda01d8 100644
--- a/keyboards/nullbitsco/tidbit/tidbit.c
+++ b/keyboards/nullbitsco/tidbit/tidbit.c
@@ -92,22 +92,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
numlock_set = true;
}
- switch (keycode) {
- case QK_BOOT:
- if (record->event.pressed) {
- set_bitc_LED(LED_DIM);
- rgblight_disable_noeeprom();
- #ifdef OLED_ENABLE
- oled_off();
- #endif
- bootloader_jump(); // jump to bootloader
- }
- return false;
-
- default:
- break;
- }
-
return true;
}
@@ -121,3 +105,16 @@ void matrix_scan_kb(void) {
matrix_scan_remote_kb();
matrix_scan_user();
}
+
+bool shutdown_kb(bool jump_to_bootloader) {
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+
+ set_bitc_LED(LED_DIM);
+ rgblight_disable_noeeprom();
+#ifdef OLED_ENABLE
+ oled_off();
+#endif
+ return true;
+}
diff --git a/keyboards/snes_macropad/snes_macropad.c b/keyboards/snes_macropad/snes_macropad.c
index 74fa434fb2..97e942e026 100644
--- a/keyboards/snes_macropad/snes_macropad.c
+++ b/keyboards/snes_macropad/snes_macropad.c
@@ -92,9 +92,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
set_keylog(keycode, record);
}
- if (keycode == QK_BOOT) {
- setupForFlashing();
- }
return process_record_user(keycode, record);
}
@@ -104,3 +101,11 @@ void keyboard_post_init_kb(void) {
rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL);
keyboard_post_init_user();
}
+
+bool shutdown_kb(bool jump_to_bootloader) {
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ setupForFlashing();
+ return true;
+}
diff --git a/keyboards/woodkeys/meira/meira.c b/keyboards/woodkeys/meira/meira.c
index 2141c171c8..6cb7affcb3 100644
--- a/keyboards/woodkeys/meira/meira.c
+++ b/keyboards/woodkeys/meira/meira.c
@@ -15,11 +15,7 @@
*/
#include "meira.h"
-void matrix_init_kb(void)
-{
- debug_enable=true;
- print("meira matrix_init_kb\n");
-
+void matrix_init_kb(void) {
#ifdef WATCHDOG_ENABLE
// This is done after turning the layer LED red, if we're caught in a loop
// we should get a flashing red light
@@ -37,21 +33,16 @@ void housekeeping_task_kb(void) {
#endif
}
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
- // Test code that turns on the switch led for the key that is pressed
- // set_backlight_by_keymap(record->event.key.col, record->event.key.row);
- if (keycode == QK_BOOT) {
- reset_keyboard_kb();
- }
- return process_record_user(keycode, record);
-}
-
-void reset_keyboard_kb(void){
+bool shutdown_kb(bool jump_to_bootloader) {
#ifdef WATCHDOG_ENABLE
+ // Unconditionally run so shutdown_user can't mess up watchdog
MCUSR = 0;
wdt_disable();
wdt_reset();
#endif
- xprintf("programming!\n");
- reset_keyboard();
+
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ return true;
}