diff options
40 files changed, 117 insertions, 75 deletions
diff --git a/docs/feature_dip_switch.md b/docs/feature_dip_switch.md index 15e449c4c..5e8c19bfa 100644 --- a/docs/feature_dip_switch.md +++ b/docs/feature_dip_switch.md | |||
| @@ -23,8 +23,9 @@ or | |||
| 23 | The callback functions can be inserted into your `<keyboard>.c`: | 23 | The callback functions can be inserted into your `<keyboard>.c`: |
| 24 | 24 | ||
| 25 | ```c | 25 | ```c |
| 26 | void dip_switch_update_kb(uint8_t index, bool active) { | 26 | bool dip_switch_update_kb(uint8_t index, bool active) { |
| 27 | dip_switch_update_user(index, active); | 27 | if !(dip_switch_update_user(index, active)) { return false; } |
| 28 | return true; | ||
| 28 | } | 29 | } |
| 29 | ``` | 30 | ``` |
| 30 | 31 | ||
| @@ -32,7 +33,7 @@ void dip_switch_update_kb(uint8_t index, bool active) { | |||
| 32 | or `keymap.c`: | 33 | or `keymap.c`: |
| 33 | 34 | ||
| 34 | ```c | 35 | ```c |
| 35 | void dip_switch_update_user(uint8_t index, bool active) { | 36 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 36 | switch (index) { | 37 | switch (index) { |
| 37 | case 0: | 38 | case 0: |
| 38 | if(active) { audio_on(); } else { audio_off(); } | 39 | if(active) { audio_on(); } else { audio_off(); } |
| @@ -57,6 +58,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 57 | } | 58 | } |
| 58 | break; | 59 | break; |
| 59 | } | 60 | } |
| 61 | return true; | ||
| 60 | } | 62 | } |
| 61 | ``` | 63 | ``` |
| 62 | 64 | ||
| @@ -64,8 +66,9 @@ Additionally, we support bit mask functions which allow for more complex handlin | |||
| 64 | 66 | ||
| 65 | 67 | ||
| 66 | ```c | 68 | ```c |
| 67 | void dip_switch_update_mask_kb(uint32_t state) { | 69 | bool dip_switch_update_mask_kb(uint32_t state) { |
| 68 | dip_switch_update_mask_user(state); | 70 | if (!dip_switch_update_mask_user(state)) { return false; } |
| 71 | return true; | ||
| 69 | } | 72 | } |
| 70 | ``` | 73 | ``` |
| 71 | 74 | ||
| @@ -73,7 +76,7 @@ void dip_switch_update_mask_kb(uint32_t state) { | |||
| 73 | or `keymap.c`: | 76 | or `keymap.c`: |
| 74 | 77 | ||
| 75 | ```c | 78 | ```c |
| 76 | void dip_switch_update_mask_user(uint32_t state) { | 79 | bool dip_switch_update_mask_user(uint32_t state) { |
| 77 | if (state & (1UL<<0) && state & (1UL<<1)) { | 80 | if (state & (1UL<<0) && state & (1UL<<1)) { |
| 78 | layer_on(_ADJUST); // C on esc | 81 | layer_on(_ADJUST); // C on esc |
| 79 | } else { | 82 | } else { |
| @@ -89,6 +92,7 @@ void dip_switch_update_mask_user(uint32_t state) { | |||
| 89 | } else { | 92 | } else { |
| 90 | layer_off(_TEST_B); | 93 | layer_off(_TEST_B); |
| 91 | } | 94 | } |
| 95 | return true; | ||
| 92 | } | 96 | } |
| 93 | ``` | 97 | ``` |
| 94 | 98 | ||
diff --git a/docs/ja/feature_dip_switch.md b/docs/ja/feature_dip_switch.md index a0f6aeb00..a5436779f 100644 --- a/docs/ja/feature_dip_switch.md +++ b/docs/ja/feature_dip_switch.md | |||
| @@ -28,8 +28,9 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート | |||
| 28 | コールバック関数を `<keyboard>.c` に記述することができます: | 28 | コールバック関数を `<keyboard>.c` に記述することができます: |
| 29 | 29 | ||
| 30 | ```c | 30 | ```c |
| 31 | void dip_switch_update_kb(uint8_t index, bool active) { | 31 | bool dip_switch_update_kb(uint8_t index, bool active) { |
| 32 | dip_switch_update_user(index, active); | 32 | if !(dip_switch_update_user(index, active)) { return false; } |
| 33 | return true; | ||
| 33 | } | 34 | } |
| 34 | ``` | 35 | ``` |
| 35 | 36 | ||
| @@ -37,7 +38,7 @@ void dip_switch_update_kb(uint8_t index, bool active) { | |||
| 37 | あるいは `keymap.c` に記述することもできます: | 38 | あるいは `keymap.c` に記述することもできます: |
| 38 | 39 | ||
| 39 | ```c | 40 | ```c |
| 40 | void dip_switch_update_user(uint8_t index, bool active) { | 41 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 41 | switch (index) { | 42 | switch (index) { |
| 42 | case 0: | 43 | case 0: |
| 43 | if(active) { audio_on(); } else { audio_off(); } | 44 | if(active) { audio_on(); } else { audio_off(); } |
| @@ -62,6 +63,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 62 | } | 63 | } |
| 63 | break; | 64 | break; |
| 64 | } | 65 | } |
| 66 | return true; | ||
| 65 | } | 67 | } |
| 66 | ``` | 68 | ``` |
| 67 | 69 | ||
| @@ -69,8 +71,9 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 69 | 71 | ||
| 70 | 72 | ||
| 71 | ```c | 73 | ```c |
| 72 | void dip_switch_update_mask_kb(uint32_t state) { | 74 | bool dip_switch_update_mask_kb(uint32_t state) { |
| 73 | dip_switch_update_mask_user(state); | 75 | if (!dip_switch_update_mask_user(state)) { return false; } |
| 76 | return true; | ||
| 74 | } | 77 | } |
| 75 | ``` | 78 | ``` |
| 76 | 79 | ||
| @@ -78,7 +81,7 @@ void dip_switch_update_mask_kb(uint32_t state) { | |||
| 78 | あるいは `keymap.c` に記述することもできます: | 81 | あるいは `keymap.c` に記述することもできます: |
| 79 | 82 | ||
| 80 | ```c | 83 | ```c |
| 81 | void dip_switch_update_mask_user(uint32_t state) { | 84 | bool dip_switch_update_mask_user(uint32_t state) { |
| 82 | if (state & (1UL<<0) && state & (1UL<<1)) { | 85 | if (state & (1UL<<0) && state & (1UL<<1)) { |
| 83 | layer_on(_ADJUST); // C on esc | 86 | layer_on(_ADJUST); // C on esc |
| 84 | } else { | 87 | } else { |
| @@ -94,6 +97,7 @@ void dip_switch_update_mask_user(uint32_t state) { | |||
| 94 | } else { | 97 | } else { |
| 95 | layer_off(_TEST_B); | 98 | layer_off(_TEST_B); |
| 96 | } | 99 | } |
| 100 | return true; | ||
| 97 | } | 101 | } |
| 98 | ``` | 102 | ``` |
| 99 | 103 | ||
diff --git a/keyboards/abacus/keymaps/unicodemap/keymap.c b/keyboards/abacus/keymaps/unicodemap/keymap.c index 8a2a33889..c31b268ca 100644 --- a/keyboards/abacus/keymaps/unicodemap/keymap.c +++ b/keyboards/abacus/keymaps/unicodemap/keymap.c | |||
| @@ -108,7 +108,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | 110 | ||
| 111 | void dip_switch_update_user(uint8_t index, bool active) { | 111 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 112 | switch (index) { | 112 | switch (index) { |
| 113 | case 0: | 113 | case 0: |
| 114 | if(active) { | 114 | if(active) { |
| @@ -125,6 +125,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 125 | } | 125 | } |
| 126 | } | 126 | } |
| 127 | } | 127 | } |
| 128 | return true; | ||
| 128 | } | 129 | } |
| 129 | 130 | ||
| 130 | 131 | ||
diff --git a/keyboards/handwired/6key/keymaps/default/keymap.c b/keyboards/handwired/6key/keymaps/default/keymap.c index 509d999e5..ad73597ba 100644 --- a/keyboards/handwired/6key/keymaps/default/keymap.c +++ b/keyboards/handwired/6key/keymaps/default/keymap.c | |||
| @@ -1,17 +1,17 @@ | |||
| 1 | /* Copyright 2020 Bratzworth | 1 | /* Copyright 2020 Bratzworth |
| 2 | * | 2 | * |
| 3 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation, either version 2 of the License, or | 5 | * the Free Software Foundation, either version 2 of the License, or |
| 6 | * (at your option) any later version. | 6 | * (at your option) any later version. |
| 7 | * | 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, | 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
| 12 | * | 12 | * |
| 13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include QMK_KEYBOARD_H | 16 | #include QMK_KEYBOARD_H |
| 17 | 17 | ||
| @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 33 | ) | 33 | ) |
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | void dip_switch_update_user(uint8_t index, bool active) { | 36 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 37 | switch (index) { | 37 | switch (index) { |
| 38 | case 0: { | 38 | case 0: { |
| 39 | if (active) { | 39 | if (active) { |
| @@ -43,4 +43,5 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | } \ No newline at end of file | 46 | return true; |
| 47 | } | ||
diff --git a/keyboards/helix/rev3_4rows/rev3_4rows.c b/keyboards/helix/rev3_4rows/rev3_4rows.c index c034c8338..884c244e3 100644 --- a/keyboards/helix/rev3_4rows/rev3_4rows.c +++ b/keyboards/helix/rev3_4rows/rev3_4rows.c | |||
| @@ -30,7 +30,7 @@ void set_mac_mode(bool macmode) { | |||
| 30 | eeconfig_update_keymap(keymap_config.raw); | 30 | eeconfig_update_keymap(keymap_config.raw); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void dip_switch_update_kb(uint8_t index, bool active) { | 33 | bool dip_switch_update_kb(uint8_t index, bool active) { |
| 34 | switch (index) { | 34 | switch (index) { |
| 35 | case 0: | 35 | case 0: |
| 36 | if(active) { // Left no.1 Helix rev3 common | 36 | if(active) { // Left no.1 Helix rev3 common |
| @@ -43,4 +43,5 @@ void dip_switch_update_kb(uint8_t index, bool active) { | |||
| 43 | dip_switch_update_user(index, active); | 43 | dip_switch_update_user(index, active); |
| 44 | break; | 44 | break; |
| 45 | } | 45 | } |
| 46 | return true; | ||
| 46 | } | 47 | } |
diff --git a/keyboards/helix/rev3_5rows/rev3_5rows.c b/keyboards/helix/rev3_5rows/rev3_5rows.c index c034c8338..884c244e3 100644 --- a/keyboards/helix/rev3_5rows/rev3_5rows.c +++ b/keyboards/helix/rev3_5rows/rev3_5rows.c | |||
| @@ -30,7 +30,7 @@ void set_mac_mode(bool macmode) { | |||
| 30 | eeconfig_update_keymap(keymap_config.raw); | 30 | eeconfig_update_keymap(keymap_config.raw); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void dip_switch_update_kb(uint8_t index, bool active) { | 33 | bool dip_switch_update_kb(uint8_t index, bool active) { |
| 34 | switch (index) { | 34 | switch (index) { |
| 35 | case 0: | 35 | case 0: |
| 36 | if(active) { // Left no.1 Helix rev3 common | 36 | if(active) { // Left no.1 Helix rev3 common |
| @@ -43,4 +43,5 @@ void dip_switch_update_kb(uint8_t index, bool active) { | |||
| 43 | dip_switch_update_user(index, active); | 43 | dip_switch_update_user(index, active); |
| 44 | break; | 44 | break; |
| 45 | } | 45 | } |
| 46 | return true; | ||
| 46 | } | 47 | } |
diff --git a/keyboards/pandora/keymaps/default/keymap.c b/keyboards/pandora/keymaps/default/keymap.c index eea641d19..1878f078c 100644 --- a/keyboards/pandora/keymaps/default/keymap.c +++ b/keyboards/pandora/keymaps/default/keymap.c | |||
| @@ -30,7 +30,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | // Encoder click function | 32 | // Encoder click function |
| 33 | void dip_switch_update_user(uint8_t index, bool active) { | 33 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 34 | switch (index) { | 34 | switch (index) { |
| 35 | /* First encoder */ | 35 | /* First encoder */ |
| 36 | case 0: | 36 | case 0: |
| @@ -39,4 +39,5 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 39 | } | 39 | } |
| 40 | break; | 40 | break; |
| 41 | } | 41 | } |
| 42 | return true; | ||
| 42 | } | 43 | } |
diff --git a/keyboards/pandora/keymaps/via/keymap.c b/keyboards/pandora/keymaps/via/keymap.c index ae97463f6..eb2007447 100644 --- a/keyboards/pandora/keymaps/via/keymap.c +++ b/keyboards/pandora/keymaps/via/keymap.c | |||
| @@ -45,7 +45,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | // Encoder click function | 47 | // Encoder click function |
| 48 | void dip_switch_update_user(uint8_t index, bool active) { | 48 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 49 | switch (index) { | 49 | switch (index) { |
| 50 | /* First encoder */ | 50 | /* First encoder */ |
| 51 | case 0: | 51 | case 0: |
| @@ -54,4 +54,5 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 54 | } | 54 | } |
| 55 | break; | 55 | break; |
| 56 | } | 56 | } |
| 57 | return true; | ||
| 57 | } | 58 | } |
diff --git a/keyboards/planck/keymaps/abishalom/keymap.c b/keyboards/planck/keymaps/abishalom/keymap.c index bd53cfb7a..e2ca81cc0 100644 --- a/keyboards/planck/keymaps/abishalom/keymap.c +++ b/keyboards/planck/keymaps/abishalom/keymap.c | |||
| @@ -254,7 +254,7 @@ bool encoder_update(bool clockwise) { | |||
| 254 | return true; | 254 | return true; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | void dip_switch_update_user(uint8_t index, bool active) { | 257 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 258 | switch (index) { | 258 | switch (index) { |
| 259 | case 0: { | 259 | case 0: { |
| 260 | #ifdef AUDIO_ENABLE | 260 | #ifdef AUDIO_ENABLE |
| @@ -283,6 +283,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 283 | muse_mode = false; | 283 | muse_mode = false; |
| 284 | } | 284 | } |
| 285 | } | 285 | } |
| 286 | return true; | ||
| 286 | } | 287 | } |
| 287 | 288 | ||
| 288 | void matrix_scan_user(void) { | 289 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/atreus/keymap.c b/keyboards/planck/keymaps/atreus/keymap.c index c9a721a1f..ce3d254d4 100644 --- a/keyboards/planck/keymaps/atreus/keymap.c +++ b/keyboards/planck/keymaps/atreus/keymap.c | |||
| @@ -177,7 +177,7 @@ bool encoder_update(bool clockwise) { | |||
| 177 | return true; | 177 | return true; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | void dip_switch_update_user(uint8_t index, bool active) { | 180 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 181 | switch (index) { | 181 | switch (index) { |
| 182 | case 0: { | 182 | case 0: { |
| 183 | #ifdef AUDIO_ENABLE | 183 | #ifdef AUDIO_ENABLE |
| @@ -206,6 +206,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 206 | muse_mode = false; | 206 | muse_mode = false; |
| 207 | } | 207 | } |
| 208 | } | 208 | } |
| 209 | return true; | ||
| 209 | } | 210 | } |
| 210 | 211 | ||
| 211 | void matrix_scan_user(void) { | 212 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/dear_vehicle_owner/keymap.c b/keyboards/planck/keymaps/dear_vehicle_owner/keymap.c index aec7bcdd7..d83df6d4b 100644 --- a/keyboards/planck/keymaps/dear_vehicle_owner/keymap.c +++ b/keyboards/planck/keymaps/dear_vehicle_owner/keymap.c | |||
| @@ -296,7 +296,7 @@ bool encoder_update(bool clockwise) { | |||
| 296 | return true; | 296 | return true; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | void dip_switch_update_user(uint8_t index, bool active) { | 299 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 300 | switch (index) { | 300 | switch (index) { |
| 301 | case 0: { | 301 | case 0: { |
| 302 | #ifdef AUDIO_ENABLE | 302 | #ifdef AUDIO_ENABLE |
| @@ -325,6 +325,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 325 | muse_mode = false; | 325 | muse_mode = false; |
| 326 | } | 326 | } |
| 327 | } | 327 | } |
| 328 | return true; | ||
| 328 | } | 329 | } |
| 329 | 330 | ||
| 330 | void matrix_scan_user(void) { | 331 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index 304d320b6..644dae6b9 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c | |||
| @@ -289,7 +289,7 @@ bool encoder_update(bool clockwise) { | |||
| 289 | return true; | 289 | return true; |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | void dip_switch_update_user(uint8_t index, bool active) { | 292 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 293 | switch (index) { | 293 | switch (index) { |
| 294 | case 0: { | 294 | case 0: { |
| 295 | #ifdef AUDIO_ENABLE | 295 | #ifdef AUDIO_ENABLE |
| @@ -318,6 +318,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 318 | muse_mode = false; | 318 | muse_mode = false; |
| 319 | } | 319 | } |
| 320 | } | 320 | } |
| 321 | return true; | ||
| 321 | } | 322 | } |
| 322 | 323 | ||
| 323 | void matrix_scan_user(void) { | 324 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/gitdrik/keymap.c b/keyboards/planck/keymaps/gitdrik/keymap.c index 9cc5f7517..e3e03929a 100644 --- a/keyboards/planck/keymaps/gitdrik/keymap.c +++ b/keyboards/planck/keymaps/gitdrik/keymap.c | |||
| @@ -170,7 +170,7 @@ bool encoder_update(bool clockwise) { | |||
| 170 | return true; | 170 | return true; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | void dip_switch_update_user(uint8_t index, bool active) { | 173 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 174 | switch (index) { | 174 | switch (index) { |
| 175 | case 0: { | 175 | case 0: { |
| 176 | #ifdef AUDIO_ENABLE | 176 | #ifdef AUDIO_ENABLE |
| @@ -199,6 +199,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 199 | muse_mode = false; | 199 | muse_mode = false; |
| 200 | } | 200 | } |
| 201 | } | 201 | } |
| 202 | return true; | ||
| 202 | } | 203 | } |
| 203 | 204 | ||
| 204 | void matrix_scan_user(void) { | 205 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/grant24/keymap.c b/keyboards/planck/keymaps/grant24/keymap.c index 7ed9a794e..469cf08c7 100644 --- a/keyboards/planck/keymaps/grant24/keymap.c +++ b/keyboards/planck/keymaps/grant24/keymap.c | |||
| @@ -312,7 +312,7 @@ bool encoder_update(bool clockwise) { | |||
| 312 | return true; | 312 | return true; |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | void dip_switch_update_user(uint8_t index, bool active) { | 315 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 316 | switch (index) { | 316 | switch (index) { |
| 317 | case 0: { | 317 | case 0: { |
| 318 | #ifdef AUDIO_ENABLE | 318 | #ifdef AUDIO_ENABLE |
| @@ -341,6 +341,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 341 | muse_mode = false; | 341 | muse_mode = false; |
| 342 | } | 342 | } |
| 343 | } | 343 | } |
| 344 | return true; | ||
| 344 | } | 345 | } |
| 345 | 346 | ||
| 346 | void matrix_scan_user(void) { | 347 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/hvp/keymap.c b/keyboards/planck/keymaps/hvp/keymap.c index 1af3771ae..c8325b646 100644 --- a/keyboards/planck/keymaps/hvp/keymap.c +++ b/keyboards/planck/keymaps/hvp/keymap.c | |||
| @@ -122,7 +122,7 @@ bool encoder_update(bool clockwise) { | |||
| 122 | return true; | 122 | return true; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | void dip_switch_update_user(uint8_t index, bool active) { | 125 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 126 | switch (index) { | 126 | switch (index) { |
| 127 | case 0: { | 127 | case 0: { |
| 128 | #ifdef AUDIO_ENABLE | 128 | #ifdef AUDIO_ENABLE |
| @@ -151,6 +151,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 151 | muse_mode = false; | 151 | muse_mode = false; |
| 152 | } | 152 | } |
| 153 | } | 153 | } |
| 154 | return true; | ||
| 154 | } | 155 | } |
| 155 | 156 | ||
| 156 | void matrix_scan_user(void) { | 157 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/jdelkins/keymap.c b/keyboards/planck/keymaps/jdelkins/keymap.c index 3d109e9e8..620c36129 100644 --- a/keyboards/planck/keymaps/jdelkins/keymap.c +++ b/keyboards/planck/keymaps/jdelkins/keymap.c | |||
| @@ -291,7 +291,7 @@ void encoder_update(bool clockwise) { | |||
| 291 | } | 291 | } |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | void dip_switch_update_user(uint8_t index, bool active) { | 294 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 295 | switch (index) { | 295 | switch (index) { |
| 296 | case 0: { | 296 | case 0: { |
| 297 | #ifdef AUDIO_ENABLE | 297 | #ifdef AUDIO_ENABLE |
| @@ -320,6 +320,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 320 | muse_mode = false; | 320 | muse_mode = false; |
| 321 | } | 321 | } |
| 322 | } | 322 | } |
| 323 | return true; | ||
| 323 | } | 324 | } |
| 324 | 325 | ||
| 325 | void keyboard_post_init_keymap(void) { | 326 | void keyboard_post_init_keymap(void) { |
diff --git a/keyboards/planck/keymaps/lja83/keymap.c b/keyboards/planck/keymaps/lja83/keymap.c index d42c5b645..2b4b9adcc 100644 --- a/keyboards/planck/keymaps/lja83/keymap.c +++ b/keyboards/planck/keymaps/lja83/keymap.c | |||
| @@ -299,7 +299,7 @@ bool encoder_update_user(uint16_t index, bool clockwise) { | |||
| 299 | return true; | 299 | return true; |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | void dip_switch_update_user(uint8_t index, bool active) { | 302 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 303 | switch (index) { | 303 | switch (index) { |
| 304 | case 0: { | 304 | case 0: { |
| 305 | #ifdef AUDIO_ENABLE | 305 | #ifdef AUDIO_ENABLE |
| @@ -328,6 +328,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 328 | muse_mode = false; | 328 | muse_mode = false; |
| 329 | } | 329 | } |
| 330 | } | 330 | } |
| 331 | return true; | ||
| 331 | } | 332 | } |
| 332 | 333 | ||
| 333 | void matrix_scan_user(void) { | 334 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/mjuma/keymap.c b/keyboards/planck/keymaps/mjuma/keymap.c index 2204fb288..8aaa05864 100644 --- a/keyboards/planck/keymaps/mjuma/keymap.c +++ b/keyboards/planck/keymaps/mjuma/keymap.c | |||
| @@ -190,7 +190,7 @@ uint16_t muse_counter = 0; | |||
| 190 | uint8_t muse_offset = 70; | 190 | uint8_t muse_offset = 70; |
| 191 | uint16_t muse_tempo = 50; | 191 | uint16_t muse_tempo = 50; |
| 192 | 192 | ||
| 193 | void dip_switch_update_user(uint8_t index, bool active) { | 193 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 194 | switch (index) { | 194 | switch (index) { |
| 195 | case 1: | 195 | case 1: |
| 196 | if (active) { | 196 | if (active) { |
| @@ -199,6 +199,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 199 | muse_mode = false; | 199 | muse_mode = false; |
| 200 | } | 200 | } |
| 201 | } | 201 | } |
| 202 | return true; | ||
| 202 | } | 203 | } |
| 203 | 204 | ||
| 204 | void matrix_scan_user(void) { | 205 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/keymaps/rjhilgefort/keymap.c b/keyboards/planck/keymaps/rjhilgefort/keymap.c index d832e7051..9eb178823 100644 --- a/keyboards/planck/keymaps/rjhilgefort/keymap.c +++ b/keyboards/planck/keymaps/rjhilgefort/keymap.c | |||
| @@ -187,7 +187,7 @@ bool encoder_update(bool clockwise) { | |||
| 187 | return true; | 187 | return true; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | void dip_switch_update_user(uint8_t index, bool active) { | 190 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 191 | switch (index) { | 191 | switch (index) { |
| 192 | case 0: { | 192 | case 0: { |
| 193 | #ifdef AUDIO_ENABLE | 193 | #ifdef AUDIO_ENABLE |
| @@ -216,6 +216,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 216 | muse_mode = false; | 216 | muse_mode = false; |
| 217 | } | 217 | } |
| 218 | } | 218 | } |
| 219 | return true; | ||
| 219 | } | 220 | } |
| 220 | 221 | ||
| 221 | void matrix_scan_user(void) { | 222 | void matrix_scan_user(void) { |
diff --git a/keyboards/planck/rev6/rev6.c b/keyboards/planck/rev6/rev6.c index 4f2ff8681..e6c49ae1c 100644 --- a/keyboards/planck/rev6/rev6.c +++ b/keyboards/planck/rev6/rev6.c | |||
| @@ -61,10 +61,10 @@ void matrix_scan_kb(void) { | |||
| 61 | 61 | ||
| 62 | #ifdef DIP_SWITCH_ENABLE | 62 | #ifdef DIP_SWITCH_ENABLE |
| 63 | __attribute__((weak)) | 63 | __attribute__((weak)) |
| 64 | void dip_update(uint8_t index, bool active) {} | 64 | bool dip_update(uint8_t index, bool active) { return true; } |
| 65 | 65 | ||
| 66 | __attribute__((weak)) | 66 | __attribute__((weak)) |
| 67 | void dip_switch_update_user(uint8_t index, bool active) { | 67 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 68 | dip_update(index, active); | 68 | return dip_update(index, active); |
| 69 | } | 69 | } |
| 70 | #endif | 70 | #endif |
diff --git a/keyboards/planck/thk/keymaps/thk/keymap.c b/keyboards/planck/thk/keymaps/thk/keymap.c index 948393b53..ae2420250 100644 --- a/keyboards/planck/thk/keymaps/thk/keymap.c +++ b/keyboards/planck/thk/keymaps/thk/keymap.c | |||
| @@ -213,7 +213,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 213 | return true; | 213 | return true; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | void dip_switch_update_user(uint8_t index, bool active) { | 216 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 217 | switch (index) { | 217 | switch (index) { |
| 218 | case 0: { | 218 | case 0: { |
| 219 | if (active) { | 219 | if (active) { |
| @@ -237,4 +237,5 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 237 | SEND_STRING("This is a Planck THK"); | 237 | SEND_STRING("This is a Planck THK"); |
| 238 | break; | 238 | break; |
| 239 | } | 239 | } |
| 240 | return true; | ||
| 240 | } | 241 | } |
diff --git a/keyboards/preonic/keymaps/AlexDaigre/keymap.c b/keyboards/preonic/keymaps/AlexDaigre/keymap.c index 3ea61a26e..ef4707f64 100644 --- a/keyboards/preonic/keymaps/AlexDaigre/keymap.c +++ b/keyboards/preonic/keymaps/AlexDaigre/keymap.c | |||
| @@ -276,7 +276,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 276 | return true; | 276 | return true; |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | void dip_switch_update_user(uint8_t index, bool active) { | 279 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 280 | switch (index) { | 280 | switch (index) { |
| 281 | case 0: | 281 | case 0: |
| 282 | if (active) { | 282 | if (active) { |
| @@ -292,6 +292,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 292 | muse_mode = false; | 292 | muse_mode = false; |
| 293 | } | 293 | } |
| 294 | } | 294 | } |
| 295 | return true; | ||
| 295 | } | 296 | } |
| 296 | 297 | ||
| 297 | 298 | ||
diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c index b70aa31c1..3a82f7151 100644 --- a/keyboards/preonic/keymaps/default/keymap.c +++ b/keyboards/preonic/keymaps/default/keymap.c | |||
| @@ -263,7 +263,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 263 | return true; | 263 | return true; |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | void dip_switch_update_user(uint8_t index, bool active) { | 266 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 267 | switch (index) { | 267 | switch (index) { |
| 268 | case 0: | 268 | case 0: |
| 269 | if (active) { | 269 | if (active) { |
| @@ -279,6 +279,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 279 | muse_mode = false; | 279 | muse_mode = false; |
| 280 | } | 280 | } |
| 281 | } | 281 | } |
| 282 | return true; | ||
| 282 | } | 283 | } |
| 283 | 284 | ||
| 284 | 285 | ||
diff --git a/keyboards/preonic/keymaps/drasbeck/keymap.c b/keyboards/preonic/keymaps/drasbeck/keymap.c index 909e86a97..ae4804ce3 100644 --- a/keyboards/preonic/keymaps/drasbeck/keymap.c +++ b/keyboards/preonic/keymaps/drasbeck/keymap.c | |||
| @@ -190,7 +190,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 190 | return true; | 190 | return true; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | void dip_switch_update_user(uint8_t index, bool active) { | 193 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 194 | switch (index) { | 194 | switch (index) { |
| 195 | case 0: | 195 | case 0: |
| 196 | if (active) { | 196 | if (active) { |
| @@ -206,6 +206,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 206 | muse_mode = false; | 206 | muse_mode = false; |
| 207 | } | 207 | } |
| 208 | } | 208 | } |
| 209 | return true; | ||
| 209 | } | 210 | } |
| 210 | 211 | ||
| 211 | 212 | ||
diff --git a/keyboards/preonic/keymaps/elisiano/keymap.c b/keyboards/preonic/keymaps/elisiano/keymap.c index 8d3898922..d885d1f02 100644 --- a/keyboards/preonic/keymaps/elisiano/keymap.c +++ b/keyboards/preonic/keymaps/elisiano/keymap.c | |||
| @@ -257,7 +257,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 257 | return true; | 257 | return true; |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | void dip_switch_update_user(uint8_t index, bool active) { | 260 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 261 | switch (index) { | 261 | switch (index) { |
| 262 | case 0: | 262 | case 0: |
| 263 | if (active) { | 263 | if (active) { |
| @@ -273,6 +273,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 273 | muse_mode = false; | 273 | muse_mode = false; |
| 274 | } | 274 | } |
| 275 | } | 275 | } |
| 276 | return true; | ||
| 276 | } | 277 | } |
| 277 | 278 | ||
| 278 | 279 | ||
diff --git a/keyboards/preonic/keymaps/keelhauler/keymap.c b/keyboards/preonic/keymaps/keelhauler/keymap.c index c7e076692..dc0cffe09 100644 --- a/keyboards/preonic/keymaps/keelhauler/keymap.c +++ b/keyboards/preonic/keymaps/keelhauler/keymap.c | |||
| @@ -264,7 +264,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 264 | return true; | 264 | return true; |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | void dip_switch_update_user(uint8_t index, bool active) { | 267 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 268 | switch (index) { | 268 | switch (index) { |
| 269 | case 0: | 269 | case 0: |
| 270 | if (active) { | 270 | if (active) { |
| @@ -280,6 +280,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 280 | muse_mode = false; | 280 | muse_mode = false; |
| 281 | } | 281 | } |
| 282 | } | 282 | } |
| 283 | return true; | ||
| 283 | } | 284 | } |
| 284 | 285 | ||
| 285 | 286 | ||
diff --git a/keyboards/preonic/keymaps/kjwon15/keymap.c b/keyboards/preonic/keymaps/kjwon15/keymap.c index 6f1d5f30a..2f25cdfa8 100644 --- a/keyboards/preonic/keymaps/kjwon15/keymap.c +++ b/keyboards/preonic/keymaps/kjwon15/keymap.c | |||
| @@ -327,7 +327,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 327 | return true; | 327 | return true; |
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | void dip_switch_update_user(uint8_t index, bool active) { | 330 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 331 | switch (index) { | 331 | switch (index) { |
| 332 | case 0: | 332 | case 0: |
| 333 | if (active) { | 333 | if (active) { |
| @@ -343,6 +343,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 343 | muse_mode = false; | 343 | muse_mode = false; |
| 344 | } | 344 | } |
| 345 | } | 345 | } |
| 346 | return true; | ||
| 346 | } | 347 | } |
| 347 | 348 | ||
| 348 | void matrix_scan_user(void) { | 349 | void matrix_scan_user(void) { |
diff --git a/keyboards/preonic/keymaps/laurentlaurent/keymap.c b/keyboards/preonic/keymaps/laurentlaurent/keymap.c index b1a73035b..62943a420 100644 --- a/keyboards/preonic/keymaps/laurentlaurent/keymap.c +++ b/keyboards/preonic/keymaps/laurentlaurent/keymap.c | |||
| @@ -554,7 +554,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 554 | return true; | 554 | return true; |
| 555 | } | 555 | } |
| 556 | 556 | ||
| 557 | void dip_switch_update_user(uint8_t index, bool active) { | 557 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 558 | switch (index) { | 558 | switch (index) { |
| 559 | case 0: | 559 | case 0: |
| 560 | if (active) { | 560 | if (active) { |
| @@ -570,6 +570,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 570 | muse_mode = false; | 570 | muse_mode = false; |
| 571 | } | 571 | } |
| 572 | } | 572 | } |
| 573 | return true; | ||
| 573 | } | 574 | } |
| 574 | 575 | ||
| 575 | void matrix_scan_user(void) { | 576 | void matrix_scan_user(void) { |
diff --git a/keyboards/preonic/keymaps/mguterl/keymap.c b/keyboards/preonic/keymaps/mguterl/keymap.c index 4e8738be2..87a9cd32b 100644 --- a/keyboards/preonic/keymaps/mguterl/keymap.c +++ b/keyboards/preonic/keymaps/mguterl/keymap.c | |||
| @@ -273,7 +273,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 273 | return true; | 273 | return true; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | void dip_switch_update_user(uint8_t index, bool active) { | 276 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 277 | switch (index) { | 277 | switch (index) { |
| 278 | case 0: | 278 | case 0: |
| 279 | if (active) { | 279 | if (active) { |
| @@ -289,6 +289,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 289 | muse_mode = false; | 289 | muse_mode = false; |
| 290 | } | 290 | } |
| 291 | } | 291 | } |
| 292 | return true; | ||
| 292 | } | 293 | } |
| 293 | 294 | ||
| 294 | 295 | ||
diff --git a/keyboards/preonic/keymaps/mverteuil/keymap.c b/keyboards/preonic/keymaps/mverteuil/keymap.c index 60677701c..ef0185169 100644 --- a/keyboards/preonic/keymaps/mverteuil/keymap.c +++ b/keyboards/preonic/keymaps/mverteuil/keymap.c | |||
| @@ -459,7 +459,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 459 | return true; | 459 | return true; |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | void dip_switch_update_user(uint8_t index, bool active) { | 462 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 463 | switch (index) { | 463 | switch (index) { |
| 464 | case 0: | 464 | case 0: |
| 465 | if (active) { | 465 | if (active) { |
| @@ -475,6 +475,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 475 | muse_mode = false; | 475 | muse_mode = false; |
| 476 | } | 476 | } |
| 477 | } | 477 | } |
| 478 | return true; | ||
| 478 | } | 479 | } |
| 479 | 480 | ||
| 480 | void matrix_scan_user(void) { | 481 | void matrix_scan_user(void) { |
diff --git a/keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c b/keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c index 290ea1638..4b2805854 100644 --- a/keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c +++ b/keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c | |||
| @@ -395,7 +395,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 395 | return true; | 395 | return true; |
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | void dip_switch_update_user(uint8_t index, bool active) { | 398 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 399 | switch (index) { | 399 | switch (index) { |
| 400 | case 0: | 400 | case 0: |
| 401 | if (active) { | 401 | if (active) { |
| @@ -411,4 +411,5 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 411 | muse_mode = false; | 411 | muse_mode = false; |
| 412 | } | 412 | } |
| 413 | } | 413 | } |
| 414 | return true; | ||
| 414 | } | 415 | } |
diff --git a/keyboards/preonic/keymaps/pezhore/keymap.c b/keyboards/preonic/keymaps/pezhore/keymap.c index 71d9306dc..c41fb4500 100644 --- a/keyboards/preonic/keymaps/pezhore/keymap.c +++ b/keyboards/preonic/keymaps/pezhore/keymap.c | |||
| @@ -257,7 +257,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 257 | return true; | 257 | return true; |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | void dip_switch_update_user(uint8_t index, bool active) { | 260 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 261 | switch (index) { | 261 | switch (index) { |
| 262 | case 0: | 262 | case 0: |
| 263 | if (active) { | 263 | if (active) { |
| @@ -273,6 +273,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 273 | muse_mode = false; | 273 | muse_mode = false; |
| 274 | } | 274 | } |
| 275 | } | 275 | } |
| 276 | return true; | ||
| 276 | } | 277 | } |
| 277 | 278 | ||
| 278 | 279 | ||
diff --git a/keyboards/preonic/keymaps/senseored/keymap.c b/keyboards/preonic/keymaps/senseored/keymap.c index c78528d8c..cf354eed1 100644 --- a/keyboards/preonic/keymaps/senseored/keymap.c +++ b/keyboards/preonic/keymaps/senseored/keymap.c | |||
| @@ -345,7 +345,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 345 | return true; | 345 | return true; |
| 346 | } | 346 | } |
| 347 | 347 | ||
| 348 | void dip_switch_update_user(uint8_t index, bool active) { | 348 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 349 | switch (index) { | 349 | switch (index) { |
| 350 | case 0: | 350 | case 0: |
| 351 | if (active) { | 351 | if (active) { |
| @@ -361,6 +361,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 361 | muse_mode = false; | 361 | muse_mode = false; |
| 362 | } | 362 | } |
| 363 | } | 363 | } |
| 364 | return true; | ||
| 364 | } | 365 | } |
| 365 | 366 | ||
| 366 | 367 | ||
diff --git a/keyboards/preonic/keymaps/via/keymap.c b/keyboards/preonic/keymaps/via/keymap.c index 5df57fd3d..fe6244104 100644 --- a/keyboards/preonic/keymaps/via/keymap.c +++ b/keyboards/preonic/keymaps/via/keymap.c | |||
| @@ -147,7 +147,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 147 | return true; | 147 | return true; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | void dip_switch_update_user(uint8_t index, bool active) { | 150 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 151 | switch (index) { | 151 | switch (index) { |
| 152 | case 0: | 152 | case 0: |
| 153 | if (active) { | 153 | if (active) { |
| @@ -163,6 +163,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 163 | muse_mode = false; | 163 | muse_mode = false; |
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | return true; | ||
| 166 | } | 167 | } |
| 167 | 168 | ||
| 168 | 169 | ||
diff --git a/keyboards/preonic/rev3/rev3.c b/keyboards/preonic/rev3/rev3.c index ec8a56108..0410d9a29 100644 --- a/keyboards/preonic/rev3/rev3.c +++ b/keyboards/preonic/rev3/rev3.c | |||
| @@ -53,11 +53,11 @@ void matrix_scan_kb(void) { | |||
| 53 | 53 | ||
| 54 | #ifdef DIP_SWITCH_ENABLE | 54 | #ifdef DIP_SWITCH_ENABLE |
| 55 | __attribute__((weak)) | 55 | __attribute__((weak)) |
| 56 | void dip_update(uint8_t index, bool active) {} | 56 | bool dip_update(uint8_t index, bool active) { return true;} |
| 57 | 57 | ||
| 58 | __attribute__((weak)) | 58 | __attribute__((weak)) |
| 59 | void dip_switch_update_user(uint8_t index, bool active) { | 59 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 60 | dip_update(index, active); | 60 | return dip_update(index, active); |
| 61 | } | 61 | } |
| 62 | #endif | 62 | #endif |
| 63 | 63 | ||
diff --git a/layouts/community/ortho_4x12/brandonschlack/keymap.c b/layouts/community/ortho_4x12/brandonschlack/keymap.c index ea9d29506..4877a0b44 100644 --- a/layouts/community/ortho_4x12/brandonschlack/keymap.c +++ b/layouts/community/ortho_4x12/brandonschlack/keymap.c | |||
| @@ -154,7 +154,7 @@ bool encoder_update_keymap(uint8_t index, bool clockwise) { | |||
| 154 | return true; | 154 | return true; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | void dip_switch_update_user(uint8_t index, bool active) { | 157 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 158 | switch (index) { | 158 | switch (index) { |
| 159 | case 0: { | 159 | case 0: { |
| 160 | #ifdef AUDIO_ENABLE | 160 | #ifdef AUDIO_ENABLE |
| @@ -183,6 +183,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 183 | muse_mode = false; | 183 | muse_mode = false; |
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | return true; | ||
| 186 | } | 187 | } |
| 187 | 188 | ||
| 188 | void matrix_scan_keymap(void) { | 189 | void matrix_scan_keymap(void) { |
diff --git a/layouts/community/ortho_4x12/mguterl/keymap.c b/layouts/community/ortho_4x12/mguterl/keymap.c index 66039b61e..f18ae14d4 100644 --- a/layouts/community/ortho_4x12/mguterl/keymap.c +++ b/layouts/community/ortho_4x12/mguterl/keymap.c | |||
| @@ -290,7 +290,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { | |||
| 290 | return true; | 290 | return true; |
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | void dip_switch_update_user(uint8_t index, bool active) { | 293 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 294 | switch (index) { | 294 | switch (index) { |
| 295 | case 0: { | 295 | case 0: { |
| 296 | #ifdef AUDIO_ENABLE | 296 | #ifdef AUDIO_ENABLE |
| @@ -319,6 +319,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 319 | muse_mode = false; | 319 | muse_mode = false; |
| 320 | } | 320 | } |
| 321 | } | 321 | } |
| 322 | return true; | ||
| 322 | } | 323 | } |
| 323 | 324 | ||
| 324 | void matrix_scan_user(void) { | 325 | void matrix_scan_user(void) { |
diff --git a/layouts/community/ortho_5x12/brandonschlack/keymap.c b/layouts/community/ortho_5x12/brandonschlack/keymap.c index c9c94fc96..1b423157b 100644 --- a/layouts/community/ortho_5x12/brandonschlack/keymap.c +++ b/layouts/community/ortho_5x12/brandonschlack/keymap.c | |||
| @@ -149,7 +149,7 @@ bool encoder_update_keymap(uint8_t index, bool clockwise) { | |||
| 149 | return true; | 149 | return true; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | void dip_switch_update_user(uint8_t index, bool active) { | 152 | bool dip_switch_update_user(uint8_t index, bool active) { |
| 153 | switch (index) { | 153 | switch (index) { |
| 154 | case 0: { | 154 | case 0: { |
| 155 | #ifdef AUDIO_ENABLE | 155 | #ifdef AUDIO_ENABLE |
| @@ -178,6 +178,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
| 178 | muse_mode = false; | 178 | muse_mode = false; |
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | return true; | ||
| 181 | } | 182 | } |
| 182 | 183 | ||
| 183 | 184 | ||
diff --git a/quantum/dip_switch.c b/quantum/dip_switch.c index cda69bd0e..72789ca8e 100644 --- a/quantum/dip_switch.c +++ b/quantum/dip_switch.c | |||
| @@ -49,13 +49,13 @@ static uint16_t scan_count; | |||
| 49 | static bool dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; | 49 | static bool dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; |
| 50 | static bool last_dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; | 50 | static bool last_dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0}; |
| 51 | 51 | ||
| 52 | __attribute__((weak)) void dip_switch_update_user(uint8_t index, bool active) {} | 52 | __attribute__((weak)) bool dip_switch_update_user(uint8_t index, bool active) { return true; } |
| 53 | 53 | ||
| 54 | __attribute__((weak)) void dip_switch_update_kb(uint8_t index, bool active) { dip_switch_update_user(index, active); } | 54 | __attribute__((weak)) bool dip_switch_update_kb(uint8_t index, bool active) { return dip_switch_update_user(index, active); } |
| 55 | 55 | ||
| 56 | __attribute__((weak)) void dip_switch_update_mask_user(uint32_t state) {} | 56 | __attribute__((weak)) bool dip_switch_update_mask_user(uint32_t state) { return true; } |
| 57 | 57 | ||
| 58 | __attribute__((weak)) void dip_switch_update_mask_kb(uint32_t state) { dip_switch_update_mask_user(state); } | 58 | __attribute__((weak)) bool dip_switch_update_mask_kb(uint32_t state) { return dip_switch_update_mask_user(state); } |
| 59 | 59 | ||
| 60 | void dip_switch_init(void) { | 60 | void dip_switch_init(void) { |
| 61 | #ifdef DIP_SWITCH_PINS | 61 | #ifdef DIP_SWITCH_PINS |
diff --git a/quantum/dip_switch.h b/quantum/dip_switch.h index 61ef1cc19..058a10f41 100644 --- a/quantum/dip_switch.h +++ b/quantum/dip_switch.h | |||
| @@ -20,10 +20,10 @@ | |||
| 20 | 20 | ||
| 21 | #include "quantum.h" | 21 | #include "quantum.h" |
| 22 | 22 | ||
| 23 | void dip_switch_update_kb(uint8_t index, bool active); | 23 | bool dip_switch_update_kb(uint8_t index, bool active); |
| 24 | void dip_switch_update_user(uint8_t index, bool active); | 24 | bool dip_switch_update_user(uint8_t index, bool active); |
| 25 | void dip_switch_update_mask_user(uint32_t state); | 25 | bool dip_switch_update_mask_user(uint32_t state); |
| 26 | void dip_switch_update_mask_kb(uint32_t state); | 26 | bool dip_switch_update_mask_kb(uint32_t state); |
| 27 | 27 | ||
| 28 | void dip_switch_init(void); | 28 | void dip_switch_init(void); |
| 29 | void dip_switch_read(bool forced); | 29 | void dip_switch_read(bool forced); |
