diff options
author | Drashna Jaelre <[email protected]> | 2023-11-26 03:59:18 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-26 22:59:18 +1100 |
commit | 3ef06aa732ce8063e11b2f983592529883f7ecbc (patch) | |
tree | 7fa143f938e711b6db1c2ed40c36298b8f7604c7 /users/jjerrell | |
parent | 4601f339e48b0116ca139dd06ce55ef0b9ed598f (diff) | |
download | qmk_firmware-3ef06aa732ce8063e11b2f983592529883f7ecbc.tar.gz qmk_firmware-3ef06aa732ce8063e11b2f983592529883f7ecbc.zip |
Improve and Cleanup Shutdown callbacks (#21060)
Co-authored-by: Dasky <[email protected]>
Diffstat (limited to 'users/jjerrell')
-rw-r--r-- | users/jjerrell/jjerrell.c | 20 | ||||
-rw-r--r-- | users/jjerrell/jjerrell.h | 12 |
2 files changed, 18 insertions, 14 deletions
diff --git a/users/jjerrell/jjerrell.c b/users/jjerrell/jjerrell.c index 47aa9bc042..e061977ab6 100644 --- a/users/jjerrell/jjerrell.c +++ b/users/jjerrell/jjerrell.c @@ -1,18 +1,18 @@ /** * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> - * + * * This file is part of qmk_firmware. - * + * * qmk_firmware is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * qmk_firmware is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with qmk_firmware. If not, see <http://www.gnu.org/licenses/>. */ @@ -114,12 +114,16 @@ void startup_user(void) startup_keymap(); } -__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; + } wait_ms(TAP_CODE_DELAY); stop_all_notes(); - shutdown_keymap(); + return true; } __attribute__((weak)) void music_on_keymap(void) {} diff --git a/users/jjerrell/jjerrell.h b/users/jjerrell/jjerrell.h index 92b95ccc01..a5488b28ab 100644 --- a/users/jjerrell/jjerrell.h +++ b/users/jjerrell/jjerrell.h @@ -1,18 +1,18 @@ /** * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> - * + * * This file is part of qmk_firmware. - * + * * qmk_firmware is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * qmk_firmware is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with qmk_firmware. If not, see <http://www.gnu.org/licenses/>. */ @@ -30,7 +30,7 @@ /************************* Userspace Layers ************************* * Keymaps can define additional layers by making the first case - * equal to `LAYER_SAFE_RANGE` + * equal to `LAYER_SAFE_RANGE` ********************************************************************/ enum userspace_layers { _WORKMAN, @@ -49,5 +49,5 @@ void dip_switch_update_keymap(uint8_t index, bool active); bool music_mask_keymap(uint16_t keycode); layer_state_t default_layer_state_set_keymap(layer_state_t state); void startup_keymap(void); -void shutdown_keymap(void); +bool shutdown_keymap(bool jump_to_bootloader); void music_on_keymap(void); |