aboutsummaryrefslogtreecommitdiff
path: root/keyboards/rubi/rubi.c
diff options
context:
space:
mode:
authorXelus22 <17491233+Xelus22@users.noreply.github.com>2021-06-01 14:56:23 +1000
committerGitHub <noreply@github.com>2021-05-31 21:56:23 -0700
commit5a06813b105277998b80771f094059047916f4e4 (patch)
tree96794823b1e1a2396488a7d53a4c7f5919f73b38 /keyboards/rubi/rubi.c
parent6bafefa88602c8032f6f861844ba0ac886d312a0 (diff)
downloadqmk_firmware-5a06813b105277998b80771f094059047916f4e4.tar.gz
qmk_firmware-5a06813b105277998b80771f094059047916f4e4.zip
VIA compile fixes (#13054)
Diffstat (limited to 'keyboards/rubi/rubi.c')
-rw-r--r--keyboards/rubi/rubi.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/keyboards/rubi/rubi.c b/keyboards/rubi/rubi.c
index 6cdf8302c..50e5fcf78 100644
--- a/keyboards/rubi/rubi.c
+++ b/keyboards/rubi/rubi.c
@@ -73,36 +73,7 @@ bool led_update_kb(led_t led_state) {
73 return true; 73 return true;
74} 74}
75 75
76__attribute__ ((weak)) void encoder_update_user(uint8_t index, bool clockwise) { 76bool encoder_update_kb(uint8_t index, bool clockwise) {
77 if (index == 0) { 77 if (!encoder_update_user(index, clockwise)) { return false; }
78 if (get_highest_layer(layer_state) == 0) { 78 return true;
79 uint16_t mapped_code = 0;
80 if (clockwise) {
81 mapped_code = handle_encoder_cw();
82 } else {
83 mapped_code = handle_encoder_ccw();
84 }
85 if (mapped_code != 0) {
86 tap_code16(mapped_code);
87 }
88 } else {
89 if (clockwise) {
90 if (oled_mode == OLED_MODE_CALC) {
91 handle_encoder_cw();
92 } else if (oled_mode == OLED_MODE_DEFAULT) {
93 change_encoder_mode(false);
94 }
95 } else {
96 if (oled_mode == OLED_MODE_CALC) {
97 handle_encoder_ccw();
98 } else if (oled_mode == OLED_MODE_DEFAULT) {
99 change_encoder_mode(true);
100 }
101 }
102 }
103 }
104}
105
106void encoder_update_kb(uint8_t index, bool clockwise) {
107 encoder_update_user(index, clockwise);
108} 79}