mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
trezorhal: return position of last touch event from touch_click
This commit is contained in:
parent
34f363f903
commit
d2ecae71d7
@ -73,14 +73,17 @@ uint32_t touch_read(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void touch_click(void)
|
||||
uint32_t touch_click(void)
|
||||
{
|
||||
uint32_t r;
|
||||
// flush touch events if any
|
||||
while (touch_read()) { }
|
||||
// wait for TOUCH_START
|
||||
while ((touch_read() & TOUCH_START) == 0) { }
|
||||
// wait for TOUCH_END
|
||||
while ((touch_read() & TOUCH_END) == 0) { }
|
||||
while (((r = touch_read()) & TOUCH_END) == 0) { }
|
||||
// flush touch events if any
|
||||
while (touch_read()) { }
|
||||
// return last touch coordinate
|
||||
return r;
|
||||
}
|
||||
|
@ -17,6 +17,6 @@
|
||||
|
||||
void touch_init(void);
|
||||
uint32_t touch_read(void);
|
||||
void touch_click(void);
|
||||
uint32_t touch_click(void);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user