diff options
Diffstat (limited to 'keyboards/keebio/foldkb/rev2_1/rev2_1.c')
| -rw-r--r-- | keyboards/keebio/foldkb/rev2_1/rev2_1.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/keyboards/keebio/foldkb/rev2_1/rev2_1.c b/keyboards/keebio/foldkb/rev2_1/rev2_1.c new file mode 100644 index 0000000000..0fc47b1483 --- /dev/null +++ b/keyboards/keebio/foldkb/rev2_1/rev2_1.c | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | // Copyright 2025 Keebio (@keebio) | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "quantum.h" | ||
| 5 | |||
| 6 | void keyboard_pre_init_kb(void) { | ||
| 7 | // Disable the PD peripheral in pre-init because its pins are being used in the matrix: | ||
| 8 | PWR->CR3 |= PWR_CR3_UCPD_DBDIS; | ||
| 9 | // Call the corresponding _user() function (see https://docs.qmk.fm/#/custom_quantum_functions) | ||
| 10 | keyboard_pre_init_user(); | ||
| 11 | } | ||
| 12 | |||
| 13 | bool encoder_update_kb(uint8_t index, bool clockwise) { | ||
| 14 | if (!encoder_update_user(index, clockwise)) { return false; } | ||
| 15 | if (index == 0) { | ||
| 16 | if (clockwise) { | ||
| 17 | tap_code(KC_VOLU); | ||
| 18 | } else { | ||
| 19 | tap_code(KC_VOLD); | ||
| 20 | } | ||
| 21 | } else if (index == 1) { | ||
| 22 | if (clockwise) { | ||
| 23 | tap_code(KC_PGDN); | ||
| 24 | } else { | ||
| 25 | tap_code(KC_PGUP); | ||
| 26 | } | ||
| 27 | } | ||
| 28 | return false; | ||
| 29 | } | ||
