Improve and Cleanup Shutdown callbacks (#21060)

Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
This commit is contained in:
Drashna Jaelre
2023-11-26 03:59:18 -08:00
committed by GitHub
parent 4601f339e4
commit 3ef06aa732
79 changed files with 277 additions and 1684 deletions
+8 -9
View File
@@ -73,8 +73,13 @@ void keyboard_post_init_user(void) {
void rgb_matrix_update_pwm_buffers(void);
#endif
__attribute__((weak)) void shutdown_keymap(void) {}
void shutdown_user(void) {
__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);
@@ -87,8 +92,7 @@ void shutdown_user(void) {
#ifdef OLED_ENABLE
oled_off();
#endif
shutdown_keymap();
return true;
}
__attribute__((weak)) void suspend_power_down_keymap(void) {}
@@ -268,11 +272,6 @@ void matrix_slave_scan_user(void) {
__attribute__((weak)) void housekeeping_task_keymap(void) {}
void housekeeping_task_user(void) {
static bool has_ran_yet;
if (!has_ran_yet) {
has_ran_yet = true;
startup_user();
}
#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
run_diablo_macro_check();
#endif // TAP_DANCE_ENABLE
+1 -1
View File
@@ -7,7 +7,7 @@
void keyboard_post_init_keymap(void);
void matrix_init_secret(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);
+8 -3
View File
@@ -53,9 +53,14 @@ void suspend_wakeup_init_user(void) {
}
__attribute__ ((weak)) void shutdown_keymap(void) {}
void shutdown_user (void) {
shutdown_keymap();
__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;
}
return true;
}
__attribute__ ((weak)) void eeconfig_init_keymap(void) {}
-13
View File
@@ -55,16 +55,3 @@ void suspend_wakeup_init_user(void) {
wait_ms(10);
#endif
}
__attribute__((weak)) void startup_keymap(void) {}
void startup_user(void) {
#ifdef RGBLIGHT_ENABLE
matrix_init_rgb();
#endif // RGBLIGHT_ENABLE
startup_keymap();
}
__attribute__((weak)) void shutdown_keymap(void) {}
void shutdown_user(void) { shutdown_keymap(); }