aboutsummaryrefslogtreecommitdiff
path: root/keyboards/keebio/bdn9/rev3/rev3.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/keebio/bdn9/rev3/rev3.c')
-rw-r--r--keyboards/keebio/bdn9/rev3/rev3.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/keyboards/keebio/bdn9/rev3/rev3.c b/keyboards/keebio/bdn9/rev3/rev3.c
new file mode 100644
index 0000000000..f15abf9d85
--- /dev/null
+++ b/keyboards/keebio/bdn9/rev3/rev3.c
@@ -0,0 +1,36 @@
+// Copyright 2025 Danny Nguyen (@nooges)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "quantum.h"
+
+void keyboard_pre_init_kb(void) {
+ // Disable the PD peripheral in pre-init because its pins (B4, B6) are being used in the matrix:
+ PWR->CR3 |= PWR_CR3_UCPD_DBDIS;
+ // Call the corresponding _user() function (see https://docs.qmk.fm/#/custom_quantum_functions)
+ keyboard_pre_init_user();
+}
+bool encoder_update_kb(uint8_t index, bool clockwise) {
+ if (!encoder_update_user(index, clockwise)) { return false; }
+ if (index == 0) {
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
+ }
+ else if (index == 1) {
+ if (clockwise) {
+ tap_code(KC_DOWN);
+ } else {
+ tap_code(KC_UP);
+ }
+ }
+ else if (index == 2) {
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
+ }
+ }
+ return false;
+}