mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 04:41:28 +00:00
bug fix quantum/dip_switch.c
This commit is contained in:
parent
4b13ebb996
commit
7bc8d033bc
@ -52,7 +52,7 @@ void dip_switch_read(bool forced) {
|
|||||||
for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) {
|
for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) {
|
||||||
dip_switch_state[i] = !readPin(dip_switch_pad[i]);
|
dip_switch_state[i] = !readPin(dip_switch_pad[i]);
|
||||||
dip_switch_mask |= dip_switch_state[i] << i;
|
dip_switch_mask |= dip_switch_state[i] << i;
|
||||||
if (last_dip_switch_state[i] ^ dip_switch_state[i] || forced) {
|
if (last_dip_switch_state[i] != dip_switch_state[i] || forced) {
|
||||||
has_dip_state_changed = true;
|
has_dip_state_changed = true;
|
||||||
dip_switch_update_kb(i, dip_switch_state[i]);
|
dip_switch_update_kb(i, dip_switch_state[i]);
|
||||||
}
|
}
|
||||||
@ -60,5 +60,5 @@ void dip_switch_read(bool forced) {
|
|||||||
if (has_dip_state_changed) {
|
if (has_dip_state_changed) {
|
||||||
dip_switch_update_mask_kb(dip_switch_mask);
|
dip_switch_update_mask_kb(dip_switch_mask);
|
||||||
}
|
}
|
||||||
memcpy(last_dip_switch_state, dip_switch_state, sizeof(&dip_switch_state));
|
memcpy(last_dip_switch_state, dip_switch_state, sizeof(dip_switch_state));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user