diff options
author | Stefan Kerkmann <karlk90@pm.me> | 2023-04-03 10:33:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 18:33:45 +1000 |
commit | fcf8b804ed95a98561bd4c1d6c85604be0f7cc7b (patch) | |
tree | 6b6917d99ced027d614e7b461e1cd1939833a9cd /keyboards/rmi_kb | |
parent | 2d9140af53e4e5bbc5cd50a2b6f3eda20ed8f71e (diff) |
[Core] Refactor `keyevent_t` for 1ms timing resolution (#15847)
Diffstat (limited to 'keyboards/rmi_kb')
-rw-r--r-- | keyboards/rmi_kb/chevron/keymaps/via/keymap.c | 14 | ||||
-rw-r--r-- | keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c | 16 | ||||
-rw-r--r-- | keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c | 14 | ||||
-rw-r--r-- | keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c | 14 |
4 files changed, 33 insertions, 25 deletions
diff --git a/keyboards/rmi_kb/chevron/keymaps/via/keymap.c b/keyboards/rmi_kb/chevron/keymaps/via/keymap.c index 190a39e257..4dd5f34817 100644 --- a/keyboards/rmi_kb/chevron/keymaps/via/keymap.c +++ b/keyboards/rmi_kb/chevron/keymaps/via/keymap.c @@ -48,24 +48,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { keyevent_t encoder_ccw = { .key = (keypos_t){.row = 4, .col = 0}, - .pressed = false + .pressed = false, + .type = KEY_EVENT }; keyevent_t encoder_cw = { .key = (keypos_t){.row = 4, .col = 1}, - .pressed = false + .pressed = false, + .type = KEY_EVENT }; void matrix_scan_user(void) { if (IS_PRESSED(encoder_ccw)) { encoder_ccw.pressed = false; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); } if (IS_PRESSED(encoder_cw)) { encoder_cw.pressed = false; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); } } @@ -73,12 +75,12 @@ void matrix_scan_user(void) { bool encoder_update_user(uint8_t index, bool clockwise) { if (clockwise) { encoder_cw.pressed = true; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); wait_ms(20); } else { encoder_ccw.pressed = true; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); wait_ms(20); } diff --git a/keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c b/keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c index 71622cddcf..fa85436e48 100644 --- a/keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c +++ b/keyboards/rmi_kb/herringbone/pro/keymaps/via/keymap.c @@ -54,24 +54,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { keyevent_t encoder_ccw = { .key = (keypos_t){.row = 6, .col = 0}, - .pressed = false -}; + .pressed = false, + .type = KEY_EVENT + }; keyevent_t encoder_cw = { .key = (keypos_t){.row = 6, .col = 1}, - .pressed = false + .pressed = false, + .type = KEY_EVENT }; void matrix_scan_user(void) { if (IS_PRESSED(encoder_ccw)) { encoder_ccw.pressed = false; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); } if (IS_PRESSED(encoder_cw)) { encoder_cw.pressed = false; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); } } @@ -86,14 +88,14 @@ uint8_t current_frame = 0; bool encoder_update_user(uint8_t index, bool clockwise) { if (clockwise) { encoder_cw.pressed = true; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); wait_ms(20); anim_sleep = timer_read32(); oled_on(); } else { encoder_ccw.pressed = true; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); wait_ms(20); anim_sleep = timer_read32(); diff --git a/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c b/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c index 7bd524f9d9..825b11c95d 100644 --- a/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c +++ b/keyboards/rmi_kb/squishytkl/keymaps/via/keymap.c @@ -29,24 +29,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { keyevent_t encoder_ccw = { .key = (keypos_t){.row = 13, .col = 0}, - .pressed = false + .pressed = false, + .type = KEY_EVENT }; keyevent_t encoder_cw = { .key = (keypos_t){.row = 13, .col = 1}, - .pressed = false + .pressed = false, + .type = KEY_EVENT }; void matrix_scan_user(void) { if (IS_PRESSED(encoder_ccw)) { encoder_ccw.pressed = false; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); } if (IS_PRESSED(encoder_cw)) { encoder_cw.pressed = false; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); } } @@ -54,11 +56,11 @@ void matrix_scan_user(void) { bool encoder_update_user(uint8_t index, bool clockwise) { if (clockwise) { encoder_cw.pressed = true; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); } else { encoder_ccw.pressed = true; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); } return true; diff --git a/keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c b/keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c index 8afc6f9c25..1feb3d4686 100644 --- a/keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c +++ b/keyboards/rmi_kb/wete/v2/keymaps/via/keymap.c @@ -37,24 +37,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { keyevent_t encoder_ccw = { .key = (keypos_t){.row = 12, .col = 0}, - .pressed = false + .pressed = false, + .type = KEY_EVENT }; keyevent_t encoder_cw = { .key = (keypos_t){.row = 12, .col = 1}, - .pressed = false + .pressed = false, + .type = KEY_EVENT }; void matrix_scan_user(void) { if (IS_PRESSED(encoder_ccw)) { encoder_ccw.pressed = false; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); } if (IS_PRESSED(encoder_cw)) { encoder_cw.pressed = false; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); } } @@ -62,11 +64,11 @@ void matrix_scan_user(void) { bool encoder_update_user(uint8_t index, bool clockwise) { if (clockwise) { encoder_cw.pressed = true; - encoder_cw.time = (timer_read() | 1); + encoder_cw.time = timer_read(); action_exec(encoder_cw); } else { encoder_ccw.pressed = true; - encoder_ccw.time = (timer_read() | 1); + encoder_ccw.time = timer_read(); action_exec(encoder_ccw); } return true; |