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

@ -20,6 +20,27 @@ or
#define DIP_SWITCH_MATRIX_GRID { {0,6}, {1,6}, {2,6} } // List of row and col pairs
```
## DIP Switch map :id=dip-switch-map
DIP Switch mapping may be added to your `keymap.c`, which replicates the normal keyswitch functionality, but with dip switches. Add this to your keymap's `rules.mk`:
```make
DIP_SWITCH_MAP_ENABLE = yes
```
Your `keymap.c` will then need a dip switch mapping defined (for two dip switches):
```c
#if defined(DIP_SWITCH_MAP_ENABLE)
const uint16_t PROGMEM dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES] = {
DIP_SWITCH_OFF_ON(DF(0), DF(1)),
DIP_SWITCH_OFF_ON(EC_NORM, EC_SWAP)
};
#endif
```
?> This should only be enabled at the keymap level.
## Callbacks
The callback functions can be inserted into your `<keyboard>.c`: