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,12 +418,20 @@ uint32_t touch_get_event(void) {
|
|||||||
// Finger was just lifted up
|
// Finger was just lifted up
|
||||||
event = TOUCH_END | xy;
|
event = TOUCH_END | xy;
|
||||||
} else {
|
} else {
|
||||||
// 1. Most likely, we have missed the PRESS_DOWN event.
|
if (!starving && ((x != driver->last_x) || (y != driver->last_y))) {
|
||||||
// Touch duration was too short (< 20ms) to be worth reporting.
|
// We have missed the PRESS_DOWN event.
|
||||||
// 2. Finger is still lifted up. Since we have already sent the
|
// Report the start event only if the coordinates
|
||||||
// TOUCH_END event => no event needed. This should not happen
|
// have changed and driver is not starving.
|
||||||
// since two consecutive LIFT_UPs are not possible due to
|
// This suggest that the previous touch was very short,
|
||||||
// testing the interrupt line before reading the registers.
|
// 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.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user