1
0
Fork 0

Keymap introspection for Dip Switches (#22543)

This commit is contained in:
Joel Challis 2023-12-11 23:06:18 +00:00 committed by GitHub
parent d85f954d30
commit 4682226e20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 138 additions and 1 deletions

View file

@ -71,6 +71,24 @@ __attribute__((weak)) uint16_t keycode_at_encodermap_location(uint8_t layer_num,
#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Dip Switch mapping
#if defined(DIP_SWITCH_ENABLE) && defined(DIP_SWITCH_MAP_ENABLE)
uint16_t keycode_at_dip_switch_map_location_raw(uint8_t switch_idx, bool on) {
if (switch_idx < NUM_DIP_SWITCHES) {
return pgm_read_word(&dip_switch_map[switch_idx][!!on]);
}
return KC_TRNS;
}
uint16_t keycode_at_dip_switch_map_location(uint8_t switch_idx, bool on) {
return keycode_at_dip_switch_map_location_raw(switch_idx, on);
}
#endif // defined(DIP_SWITCH_ENABLE) && defined(DIP_SWITCH_MAP_ENABLE)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Combos