Fix new keyboard task
This commit is contained in:
parent
81a2e1fc22
commit
b5c06d5459
|
|
@ -167,7 +167,10 @@ static void kbd_task(void *arg)
|
|||
{
|
||||
kbd_msg_t msg;
|
||||
msg.long_press = long_press;
|
||||
msg.keys = keys;
|
||||
// OR the saved key status with the current key status
|
||||
// Do this because the new key status is got when the
|
||||
// key is lifted, and does not contain the pressed key anymore
|
||||
msg.keys = keys | prev_keys;
|
||||
// Send event_t as void * message to use with OSQPost
|
||||
event_t event;
|
||||
event.type = EVENT_KBD;
|
||||
|
|
@ -179,8 +182,8 @@ static void kbd_task(void *arg)
|
|||
// Save current keyboard state as previous
|
||||
prev_keys = keys;
|
||||
}
|
||||
// Read keyboard state at 5Hz
|
||||
OSTimeDlyHMSM(0u, 0u, 0u, 200u, OS_OPT_TIME_HMSM_STRICT, &os_err);
|
||||
// Read keyboard state at 20Hz
|
||||
OSTimeDlyHMSM(0u, 0u, 0u, 50u, OS_OPT_TIME_HMSM_STRICT, &os_err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue