1
0
Fork 0

[Core] Refactor keyevent_t for 1ms timing resolution (#15847)

This commit is contained in:
Stefan Kerkmann 2023-04-03 10:33:45 +02:00 committed by GitHub
parent 2d9140af53
commit fcf8b804ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 360 additions and 273 deletions

View file

@ -28,7 +28,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);
@ -40,7 +41,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);