mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-19 14:08:11 +00:00
fix(core): fix missing touch events when PRESS_DOWN is missed
[no changelog]
This commit is contained in:
parent
cf69a3ca5d
commit
edd5351732
@ -418,14 +418,22 @@ uint32_t touch_get_event(void) {
|
||||
// Finger was just lifted up
|
||||
event = TOUCH_END | xy;
|
||||
} else {
|
||||
// 1. Most likely, we have missed the PRESS_DOWN event.
|
||||
// Touch duration was too short (< 20ms) to be worth reporting.
|
||||
// 2. Finger is still lifted up. Since we have already sent the
|
||||
// TOUCH_END event => no event needed. This should not happen
|
||||
if (!starving && ((x != driver->last_x) || (y != driver->last_y))) {
|
||||
// We have missed the PRESS_DOWN event.
|
||||
// Report the start event only if the coordinates
|
||||
// have changed and driver is not starving.
|
||||
// This suggest that the previous touch was very short,
|
||||
// or/and the driver is not called very frequently.
|
||||
event = TOUCH_START | xy;
|
||||
} else {
|
||||
// Either the driver is starving or the coordinates
|
||||
// have not changed, which would suggest that the TOUCH_END
|
||||
// is repeated, so no event is needed -this should not happen
|
||||
// since two consecutive LIFT_UPs are not possible due to
|
||||
// testing the interrupt line before reading the registers.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remember the last state
|
||||
if ((event & TOUCH_START) || (event & TOUCH_MOVE)) {
|
||||
|
Loading…
Reference in New Issue
Block a user