|
|
@@ -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;
|
|
|
}
|