~ruther/qmk_firmware

0bde920817ef458f2ad61a66ce76a2535bbc261b — Drashna Jaelre 4 years ago 8f78be0
Convert Dip Switch callbacks to boolean functions (#13399)

40 files changed, 117 insertions(+), 75 deletions(-)

M docs/feature_dip_switch.md
M docs/ja/feature_dip_switch.md
M keyboards/abacus/keymaps/unicodemap/keymap.c
M keyboards/handwired/6key/keymaps/default/keymap.c
M keyboards/helix/rev3_4rows/rev3_4rows.c
M keyboards/helix/rev3_5rows/rev3_5rows.c
M keyboards/pandora/keymaps/default/keymap.c
M keyboards/pandora/keymaps/via/keymap.c
M keyboards/planck/keymaps/abishalom/keymap.c
M keyboards/planck/keymaps/atreus/keymap.c
M keyboards/planck/keymaps/dear_vehicle_owner/keymap.c
M keyboards/planck/keymaps/default/keymap.c
M keyboards/planck/keymaps/gitdrik/keymap.c
M keyboards/planck/keymaps/grant24/keymap.c
M keyboards/planck/keymaps/hvp/keymap.c
M keyboards/planck/keymaps/jdelkins/keymap.c
M keyboards/planck/keymaps/lja83/keymap.c
M keyboards/planck/keymaps/mjuma/keymap.c
M keyboards/planck/keymaps/rjhilgefort/keymap.c
M keyboards/planck/rev6/rev6.c
M keyboards/planck/thk/keymaps/thk/keymap.c
M keyboards/preonic/keymaps/AlexDaigre/keymap.c
M keyboards/preonic/keymaps/default/keymap.c
M keyboards/preonic/keymaps/drasbeck/keymap.c
M keyboards/preonic/keymaps/elisiano/keymap.c
M keyboards/preonic/keymaps/keelhauler/keymap.c
M keyboards/preonic/keymaps/kjwon15/keymap.c
M keyboards/preonic/keymaps/laurentlaurent/keymap.c
M keyboards/preonic/keymaps/mguterl/keymap.c
M keyboards/preonic/keymaps/mverteuil/keymap.c
M keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c
M keyboards/preonic/keymaps/pezhore/keymap.c
M keyboards/preonic/keymaps/senseored/keymap.c
M keyboards/preonic/keymaps/via/keymap.c
M keyboards/preonic/rev3/rev3.c
M layouts/community/ortho_4x12/brandonschlack/keymap.c
M layouts/community/ortho_4x12/mguterl/keymap.c
M layouts/community/ortho_5x12/brandonschlack/keymap.c
M quantum/dip_switch.c
M quantum/dip_switch.h
M docs/feature_dip_switch.md => docs/feature_dip_switch.md +10 -6
@@ 23,8 23,9 @@ or
The callback functions can be inserted into your `<keyboard>.c`:

```c
void dip_switch_update_kb(uint8_t index, bool active) { 
    dip_switch_update_user(index, active); 
bool dip_switch_update_kb(uint8_t index, bool active) { 
    if !(dip_switch_update_user(index, active)) { return false; }
    return true;
}
```



@@ 32,7 33,7 @@ void dip_switch_update_kb(uint8_t index, bool active) {
or `keymap.c`:

```c
void dip_switch_update_user(uint8_t index, bool active) { 
bool dip_switch_update_user(uint8_t index, bool active) { 
    switch (index) {
        case 0:
            if(active) { audio_on(); } else { audio_off(); }


@@ 57,6 58,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
            }
            break;
    }
    return true;
}
```



@@ 64,8 66,9 @@ Additionally, we support bit mask functions which allow for more complex handlin


```c
void dip_switch_update_mask_kb(uint32_t state) { 
    dip_switch_update_mask_user(state); 
bool dip_switch_update_mask_kb(uint32_t state) { 
    if (!dip_switch_update_mask_user(state)) { return false; }
    return true;
}
```



@@ 73,7 76,7 @@ void dip_switch_update_mask_kb(uint32_t state) {
or `keymap.c`:

```c
void dip_switch_update_mask_user(uint32_t state) { 
bool dip_switch_update_mask_user(uint32_t state) { 
    if (state & (1UL<<0) && state & (1UL<<1)) {
        layer_on(_ADJUST); // C on esc
    } else {


@@ 89,6 92,7 @@ void dip_switch_update_mask_user(uint32_t state) {
    } else {
        layer_off(_TEST_B);
    }
    return true;
}
```


M docs/ja/feature_dip_switch.md => docs/ja/feature_dip_switch.md +10 -6
@@ 28,8 28,9 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート
コールバック関数を `<keyboard>.c` に記述することができます:

```c
void dip_switch_update_kb(uint8_t index, bool active) { 
    dip_switch_update_user(index, active); 
bool dip_switch_update_kb(uint8_t index, bool active) { 
    if !(dip_switch_update_user(index, active)) { return false; }
    return true;
}
```



@@ 37,7 38,7 @@ void dip_switch_update_kb(uint8_t index, bool active) {
あるいは `keymap.c` に記述することもできます:

```c
void dip_switch_update_user(uint8_t index, bool active) { 
bool dip_switch_update_user(uint8_t index, bool active) { 
    switch (index) {
        case 0:
            if(active) { audio_on(); } else { audio_off(); }


@@ 62,6 63,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
            }
            break;
    }
    return true;
}
```



@@ 69,8 71,9 @@ void dip_switch_update_user(uint8_t index, bool active) {


```c
void dip_switch_update_mask_kb(uint32_t state) { 
    dip_switch_update_mask_user(state); 
bool dip_switch_update_mask_kb(uint32_t state) { 
    if (!dip_switch_update_mask_user(state)) { return false; }
    return true;
}
```



@@ 78,7 81,7 @@ void dip_switch_update_mask_kb(uint32_t state) {
あるいは `keymap.c` に記述することもできます:

```c
void dip_switch_update_mask_user(uint32_t state) { 
bool dip_switch_update_mask_user(uint32_t state) { 
    if (state & (1UL<<0) && state & (1UL<<1)) {
        layer_on(_ADJUST); // C on esc
    } else {


@@ 94,6 97,7 @@ void dip_switch_update_mask_user(uint32_t state) {
    } else {
        layer_off(_TEST_B);
    }
    return true;
}
```


M keyboards/abacus/keymaps/unicodemap/keymap.c => keyboards/abacus/keymaps/unicodemap/keymap.c +2 -1
@@ 108,7 108,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}


void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if(active) {


@@ 125,6 125,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                }
        }
    }
    return true;
}



M keyboards/handwired/6key/keymaps/default/keymap.c => keyboards/handwired/6key/keymaps/default/keymap.c +17 -16
@@ 1,17 1,17 @@
 /* Copyright 2020 Bratzworth 
  * 
  * This program 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 2 of the License, or 
  * (at your option) any later version. 
  * 
  * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>. 
 /* Copyright 2020 Bratzworth
  *
  * This program 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 2 of the License, or
  * (at your option) any later version.
  *
  * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
  */
#include QMK_KEYBOARD_H



@@ 33,7 33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  )
};

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
            if (active) {


@@ 43,4 43,5 @@ void dip_switch_update_user(uint8_t index, bool active) {
            }
        }
    }
}
\ No newline at end of file
    return true;
}

M keyboards/helix/rev3_4rows/rev3_4rows.c => keyboards/helix/rev3_4rows/rev3_4rows.c +2 -1
@@ 30,7 30,7 @@ void set_mac_mode(bool macmode) {
    eeconfig_update_keymap(keymap_config.raw);
}

void dip_switch_update_kb(uint8_t index, bool active) {
bool dip_switch_update_kb(uint8_t index, bool active) {
    switch (index) {
    case 0:
        if(active) { // Left no.1  Helix rev3 common


@@ 43,4 43,5 @@ void dip_switch_update_kb(uint8_t index, bool active) {
        dip_switch_update_user(index, active);
        break;
    }
    return true;
}

M keyboards/helix/rev3_5rows/rev3_5rows.c => keyboards/helix/rev3_5rows/rev3_5rows.c +2 -1
@@ 30,7 30,7 @@ void set_mac_mode(bool macmode) {
    eeconfig_update_keymap(keymap_config.raw);
}

void dip_switch_update_kb(uint8_t index, bool active) {
bool dip_switch_update_kb(uint8_t index, bool active) {
    switch (index) {
    case 0:
        if(active) { // Left no.1  Helix rev3 common


@@ 43,4 43,5 @@ void dip_switch_update_kb(uint8_t index, bool active) {
        dip_switch_update_user(index, active);
        break;
    }
    return true;
}

M keyboards/pandora/keymaps/default/keymap.c => keyboards/pandora/keymaps/default/keymap.c +2 -1
@@ 30,7 30,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
}

// Encoder click function
void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
    /* First encoder */
    case 0:


@@ 39,4 39,5 @@ void dip_switch_update_user(uint8_t index, bool active) {
        }
        break;
    }
    return true;
}

M keyboards/pandora/keymaps/via/keymap.c => keyboards/pandora/keymaps/via/keymap.c +2 -1
@@ 45,7 45,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
}

// Encoder click function
void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
    /* First encoder */
    case 0:


@@ 54,4 54,5 @@ void dip_switch_update_user(uint8_t index, bool active) {
        }
        break;
    }
    return true;
}

M keyboards/planck/keymaps/abishalom/keymap.c => keyboards/planck/keymaps/abishalom/keymap.c +2 -1
@@ 254,7 254,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 283,6 283,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/atreus/keymap.c => keyboards/planck/keymaps/atreus/keymap.c +2 -1
@@ 177,7 177,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 206,6 206,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/dear_vehicle_owner/keymap.c => keyboards/planck/keymaps/dear_vehicle_owner/keymap.c +2 -1
@@ 296,7 296,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 325,6 325,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/default/keymap.c => keyboards/planck/keymaps/default/keymap.c +2 -1
@@ 289,7 289,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 318,6 318,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/gitdrik/keymap.c => keyboards/planck/keymaps/gitdrik/keymap.c +2 -1
@@ 170,7 170,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 199,6 199,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/grant24/keymap.c => keyboards/planck/keymaps/grant24/keymap.c +2 -1
@@ 312,7 312,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 341,6 341,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/hvp/keymap.c => keyboards/planck/keymaps/hvp/keymap.c +2 -1
@@ 122,7 122,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 151,6 151,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/jdelkins/keymap.c => keyboards/planck/keymaps/jdelkins/keymap.c +2 -1
@@ 291,7 291,7 @@ void encoder_update(bool clockwise) {
  }
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 320,6 320,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void keyboard_post_init_keymap(void) {

M keyboards/planck/keymaps/lja83/keymap.c => keyboards/planck/keymaps/lja83/keymap.c +2 -1
@@ 299,7 299,7 @@ bool encoder_update_user(uint16_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 328,6 328,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/mjuma/keymap.c => keyboards/planck/keymaps/mjuma/keymap.c +2 -1
@@ 190,7 190,7 @@ uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 50;

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 1:
            if (active) {


@@ 199,6 199,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/keymaps/rjhilgefort/keymap.c => keyboards/planck/keymaps/rjhilgefort/keymap.c +2 -1
@@ 187,7 187,7 @@ bool encoder_update(bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 216,6 216,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/planck/rev6/rev6.c => keyboards/planck/rev6/rev6.c +3 -3
@@ 61,10 61,10 @@ void matrix_scan_kb(void) {

#ifdef DIP_SWITCH_ENABLE
__attribute__((weak))
void dip_update(uint8_t index, bool active) {}
bool dip_update(uint8_t index, bool active) { return true; }

__attribute__((weak))
void dip_switch_update_user(uint8_t index, bool active) {
    dip_update(index, active);
bool dip_switch_update_user(uint8_t index, bool active) {
    return dip_update(index, active);
}
#endif

M keyboards/planck/thk/keymaps/thk/keymap.c => keyboards/planck/thk/keymaps/thk/keymap.c +2 -1
@@ 213,7 213,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
  return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
  switch (index) {
    case 0: {
      if (active) {


@@ 237,4 237,5 @@ void dip_switch_update_user(uint8_t index, bool active) {
      SEND_STRING("This is a Planck THK");
      break;
  }
    return true;
}

M keyboards/preonic/keymaps/AlexDaigre/keymap.c => keyboards/preonic/keymaps/AlexDaigre/keymap.c +2 -1
@@ 276,7 276,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 292,6 292,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/default/keymap.c => keyboards/preonic/keymaps/default/keymap.c +2 -1
@@ 263,7 263,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 279,6 279,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/drasbeck/keymap.c => keyboards/preonic/keymaps/drasbeck/keymap.c +2 -1
@@ 190,7 190,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 206,6 206,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/elisiano/keymap.c => keyboards/preonic/keymaps/elisiano/keymap.c +2 -1
@@ 257,7 257,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 273,6 273,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/keelhauler/keymap.c => keyboards/preonic/keymaps/keelhauler/keymap.c +2 -1
@@ 264,7 264,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 280,6 280,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/kjwon15/keymap.c => keyboards/preonic/keymaps/kjwon15/keymap.c +2 -1
@@ 327,7 327,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 343,6 343,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/preonic/keymaps/laurentlaurent/keymap.c => keyboards/preonic/keymaps/laurentlaurent/keymap.c +2 -1
@@ 554,7 554,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 570,6 570,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/preonic/keymaps/mguterl/keymap.c => keyboards/preonic/keymaps/mguterl/keymap.c +2 -1
@@ 273,7 273,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 289,6 289,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/mverteuil/keymap.c => keyboards/preonic/keymaps/mverteuil/keymap.c +2 -1
@@ 459,7 459,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 475,6 475,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c => keyboards/preonic/keymaps/mverteuil_2x2u/keymap.c +2 -1
@@ 395,7 395,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 411,4 411,5 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

M keyboards/preonic/keymaps/pezhore/keymap.c => keyboards/preonic/keymaps/pezhore/keymap.c +2 -1
@@ 257,7 257,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 273,6 273,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/senseored/keymap.c => keyboards/preonic/keymaps/senseored/keymap.c +2 -1
@@ 345,7 345,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 361,6 361,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/keymaps/via/keymap.c => keyboards/preonic/keymaps/via/keymap.c +2 -1
@@ 147,7 147,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0:
            if (active) {


@@ 163,6 163,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M keyboards/preonic/rev3/rev3.c => keyboards/preonic/rev3/rev3.c +3 -3
@@ 53,11 53,11 @@ void matrix_scan_kb(void) {

#ifdef DIP_SWITCH_ENABLE
 __attribute__((weak))
void dip_update(uint8_t index, bool active) {}
bool dip_update(uint8_t index, bool active) { return true;}

 __attribute__((weak))
void dip_switch_update_user(uint8_t index, bool active) {
    dip_update(index, active);
bool dip_switch_update_user(uint8_t index, bool active) {
    return dip_update(index, active);
}
#endif


M layouts/community/ortho_4x12/brandonschlack/keymap.c => layouts/community/ortho_4x12/brandonschlack/keymap.c +2 -1
@@ 154,7 154,7 @@ bool encoder_update_keymap(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 183,6 183,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_keymap(void) {

M layouts/community/ortho_4x12/mguterl/keymap.c => layouts/community/ortho_4x12/mguterl/keymap.c +2 -1
@@ 290,7 290,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 319,6 319,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}

void matrix_scan_user(void) {

M layouts/community/ortho_5x12/brandonschlack/keymap.c => layouts/community/ortho_5x12/brandonschlack/keymap.c +2 -1
@@ 149,7 149,7 @@ bool encoder_update_keymap(uint8_t index, bool clockwise) {
    return true;
}

void dip_switch_update_user(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
    switch (index) {
        case 0: {
#ifdef AUDIO_ENABLE


@@ 178,6 178,7 @@ void dip_switch_update_user(uint8_t index, bool active) {
                muse_mode = false;
            }
    }
    return true;
}



M quantum/dip_switch.c => quantum/dip_switch.c +4 -4
@@ 49,13 49,13 @@ static uint16_t       scan_count;
static bool dip_switch_state[NUMBER_OF_DIP_SWITCHES]      = {0};
static bool last_dip_switch_state[NUMBER_OF_DIP_SWITCHES] = {0};

__attribute__((weak)) void dip_switch_update_user(uint8_t index, bool active) {}
__attribute__((weak)) bool dip_switch_update_user(uint8_t index, bool active) { return true; }

__attribute__((weak)) void dip_switch_update_kb(uint8_t index, bool active) { dip_switch_update_user(index, active); }
__attribute__((weak)) bool dip_switch_update_kb(uint8_t index, bool active) { return dip_switch_update_user(index, active); }

__attribute__((weak)) void dip_switch_update_mask_user(uint32_t state) {}
__attribute__((weak)) bool dip_switch_update_mask_user(uint32_t state) { return true; }

__attribute__((weak)) void dip_switch_update_mask_kb(uint32_t state) { dip_switch_update_mask_user(state); }
__attribute__((weak)) bool dip_switch_update_mask_kb(uint32_t state) { return dip_switch_update_mask_user(state); }

void dip_switch_init(void) {
#ifdef DIP_SWITCH_PINS

M quantum/dip_switch.h => quantum/dip_switch.h +4 -4
@@ 20,10 20,10 @@

#include "quantum.h"

void dip_switch_update_kb(uint8_t index, bool active);
void dip_switch_update_user(uint8_t index, bool active);
void dip_switch_update_mask_user(uint32_t state);
void dip_switch_update_mask_kb(uint32_t state);
bool dip_switch_update_kb(uint8_t index, bool active);
bool dip_switch_update_user(uint8_t index, bool active);
bool dip_switch_update_mask_user(uint32_t state);
bool dip_switch_update_mask_kb(uint32_t state);

void dip_switch_init(void);
void dip_switch_read(bool forced);