From fa0e66bf391307bd1ac159cc07c9c69c8aab8bac Mon Sep 17 00:00:00 2001 From: Takeshi Nishio Date: Fri, 3 Nov 2023 09:27:18 +0900 Subject: [PATCH] [Core] Refactor keyevent_t for 1ms timing resolution (qmk#15847) --- keyboards/sandy/dn0020/dn0020.c | 6 ++++-- keyboards/sandy/dn0030/dn0030.c | 6 ++++-- keyboards/sandy/v01/v01.c | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/keyboards/sandy/dn0020/dn0020.c b/keyboards/sandy/dn0020/dn0020.c index 82420a7cf535..e589859ba7a5 100644 --- a/keyboards/sandy/dn0020/dn0020.c +++ b/keyboards/sandy/dn0020/dn0020.c @@ -32,7 +32,8 @@ void encoder_action_unregister(void) { keyevent_t encoder_event = (keyevent_t) { .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state[index] = 0; action_exec(encoder_event); @@ -44,7 +45,8 @@ void encoder_action_register(uint8_t index, bool clockwise) { keyevent_t encoder_event = (keyevent_t) { .key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); action_exec(encoder_event); diff --git a/keyboards/sandy/dn0030/dn0030.c b/keyboards/sandy/dn0030/dn0030.c index 7fd0e2693abe..fba2ae4638b8 100644 --- a/keyboards/sandy/dn0030/dn0030.c +++ b/keyboards/sandy/dn0030/dn0030.c @@ -31,7 +31,8 @@ void encoder_action_unregister(void) { keyevent_t encoder_event = (keyevent_t) { .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state[index] = 0; action_exec(encoder_event); @@ -43,7 +44,8 @@ void encoder_action_register(uint8_t index, bool clockwise) { keyevent_t encoder_event = (keyevent_t) { .key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); action_exec(encoder_event); diff --git a/keyboards/sandy/v01/v01.c b/keyboards/sandy/v01/v01.c index b8f24130b269..31c5263347e8 100644 --- a/keyboards/sandy/v01/v01.c +++ b/keyboards/sandy/v01/v01.c @@ -32,7 +32,8 @@ void encoder_action_unregister(void) { keyevent_t encoder_event = (keyevent_t) { .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index], .pressed = false, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state[index] = 0; action_exec(encoder_event); @@ -44,7 +45,8 @@ void encoder_action_register(uint8_t index, bool clockwise) { keyevent_t encoder_event = (keyevent_t) { .key = clockwise ? encoder_cw[index] : encoder_ccw[index], .pressed = true, - .time = (timer_read() | 1) + .time = timer_read(), + .type = KEY_EVENT }; encoder_state[index] = (clockwise ^ 1) | (clockwise << 1); action_exec(encoder_event);