Skip to content

Commit

Permalink
bug fix quantum/dip_switch.c
Browse files Browse the repository at this point in the history
  • Loading branch information
mtei committed Apr 8, 2020
1 parent 4b13ebb commit 7bc8d03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quantum/dip_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ void dip_switch_read(bool forced) {
for (uint8_t i = 0; i < NUMBER_OF_DIP_SWITCHES; i++) {
dip_switch_state[i] = !readPin(dip_switch_pad[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;
dip_switch_update_kb(i, dip_switch_state[i]);
}
}
if (has_dip_state_changed) {
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));
}

0 comments on commit 7bc8d03

Please sign in to comment.