diff options
author | Drashna Jaelre <drashna@live.com> | 2021-05-21 23:17:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 23:17:32 -0700 |
commit | a0fed0ea176d1c986e40fc4981b900509c90d66e (patch) | |
tree | ee12f5943046015ea0dce8e2a30a68bc8eb99dbe /keyboards/splitkb/zima/zima.c | |
parent | 76c23b15abc824f867b48d8d5100dced2417d336 (diff) | |
download | qmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.tar.gz qmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.zip |
Convert Encoder callbacks to be boolean functions (#12805)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'keyboards/splitkb/zima/zima.c')
-rw-r--r-- | keyboards/splitkb/zima/zima.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/keyboards/splitkb/zima/zima.c b/keyboards/splitkb/zima/zima.c index 3989ebeb2..74f9c84a7 100644 --- a/keyboards/splitkb/zima/zima.c +++ b/keyboards/splitkb/zima/zima.c | |||
@@ -93,12 +93,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { | |||
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | #ifdef ENCODER_ENABLE | 95 | #ifdef ENCODER_ENABLE |
96 | __attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) { | 96 | bool encoder_update_kb(uint8_t index, bool clockwise) { |
97 | if (clockwise) { | ||
98 | tap_code16(KC_VOLU); | ||
99 | } else { | ||
100 | tap_code16(KC_VOLD); | ||
101 | } | ||
102 | # ifdef OLED_DRIVER_ENABLE | 97 | # ifdef OLED_DRIVER_ENABLE |
103 | oled_timer = timer_read32(); | 98 | oled_timer = timer_read32(); |
104 | # endif | 99 | # endif |
@@ -108,5 +103,12 @@ __attribute__((weak)) void encoder_update_user(uint8_t index, bool clockwise) { | |||
108 | # ifdef HAPTIC_ENABLE | 103 | # ifdef HAPTIC_ENABLE |
109 | if (haptic_config.enable) haptic_play(); | 104 | if (haptic_config.enable) haptic_play(); |
110 | # endif | 105 | # endif |
106 | if (!encoder_update_user(index, clockwise)) return false; | ||
107 | if (clockwise) { | ||
108 | tap_code16(KC_VOLU); | ||
109 | } else { | ||
110 | tap_code16(KC_VOLD); | ||
111 | } | ||
112 | return true; | ||
111 | } | 113 | } |
112 | #endif | 114 | #endif |