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/torn | |
| 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/torn')
| -rw-r--r-- | keyboards/torn/torn_encoder.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/keyboards/torn/torn_encoder.c b/keyboards/torn/torn_encoder.c index 9178388d0..64804ac3a 100644 --- a/keyboards/torn/torn_encoder.c +++ b/keyboards/torn/torn_encoder.c | |||
| @@ -38,11 +38,13 @@ const uint16_t encoder_default[2][2] = { { KC_PGDN, KC_PGUP }, { KC__VOLDOWN, K | |||
| 38 | /** | 38 | /** |
| 39 | * Tap on encoder updates using the encoder keymap | 39 | * Tap on encoder updates using the encoder keymap |
| 40 | */ | 40 | */ |
| 41 | void encoder_update_kb(uint8_t index, bool clockwise) { | 41 | bool encoder_update_kb(uint8_t index, bool clockwise) { |
| 42 | // if (!encoder_update_user(index, clockwise)) return false; | ||
| 43 | |||
| 42 | uint16_t code; | 44 | uint16_t code; |
| 43 | 45 | ||
| 44 | if (encoder_keymaps) { | 46 | if (encoder_keymaps) { |
| 45 | int layer = get_highest_layer(layer_state); | 47 | uint8_t layer = get_highest_layer(layer_state); |
| 46 | do { | 48 | do { |
| 47 | code = pgm_read_word(&encoder_keymaps[layer--][index][clockwise]); | 49 | code = pgm_read_word(&encoder_keymaps[layer--][index][clockwise]); |
| 48 | } while (code == KC_TRNS); | 50 | } while (code == KC_TRNS); |
| @@ -51,6 +53,7 @@ void encoder_update_kb(uint8_t index, bool clockwise) { | |||
| 51 | } | 53 | } |
| 52 | 54 | ||
| 53 | tap_code16(code); | 55 | tap_code16(code); |
| 56 | return true; | ||
| 54 | } | 57 | } |
| 55 | 58 | ||
| 56 | static bool encoder_read_state(uint8_t *state) { | 59 | static bool encoder_read_state(uint8_t *state) { |
