From 3ef06aa732ce8063e11b2f983592529883f7ecbc Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 26 Nov 2023 03:59:18 -0800 Subject: Improve and Cleanup Shutdown callbacks (#21060) Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> --- users/kuchosauronad0/kuchosauronad0.c | 15 +++++++++------ users/kuchosauronad0/kuchosauronad0.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'users/kuchosauronad0') diff --git a/users/kuchosauronad0/kuchosauronad0.c b/users/kuchosauronad0/kuchosauronad0.c index 2c63eadfd1..3fc66d809b 100644 --- a/users/kuchosauronad0/kuchosauronad0.c +++ b/users/kuchosauronad0/kuchosauronad0.c @@ -62,11 +62,14 @@ void keyboard_post_init_user(void){ keyboard_post_init_keymap(); } -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -void shutdown_user (void) { - #ifdef RGBLIGHT_ENABLE +__attribute__((weak)) bool shutdown_keymap(bool jump_to_bootloader) { + return true; +} +bool shutdown_user(bool jump_to_bootloader) { + if (!shutdown_keymap(jump_to_bootloader)) { + return false; + } + #ifdef RGBLIGHT_ENABLE rgblight_enable_noeeprom(); rgblight_mode_noeeprom(1); rgblight_setrgb(RGB_TEAL); @@ -76,7 +79,7 @@ void shutdown_user (void) { // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } #endif //RGB_MATRIX_ENABLE - shutdown_keymap(); + return true; } __attribute__ ((weak)) diff --git a/users/kuchosauronad0/kuchosauronad0.h b/users/kuchosauronad0/kuchosauronad0.h index 5cbd517d67..244c3cbf55 100644 --- a/users/kuchosauronad0/kuchosauronad0.h +++ b/users/kuchosauronad0/kuchosauronad0.h @@ -61,7 +61,7 @@ bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); bool send_game_macro(const char *str, keyrecord_t *record, bool override); void matrix_init_keymap(void); -void shutdown_keymap(void); +bool shutdown_keymap(bool jump_to_bootloader); void suspend_power_down_keymap(void); void suspend_wakeup_init_keymap(void); void matrix_scan_keymap(void); -- cgit v1.2.3