mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-23 07:58:09 +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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void touch_click(void)
|
uint32_t touch_click(void)
|
||||||
{
|
{
|
||||||
|
uint32_t r;
|
||||||
// flush touch events if any
|
// flush touch events if any
|
||||||
while (touch_read()) { }
|
while (touch_read()) { }
|
||||||
// wait for TOUCH_START
|
// wait for TOUCH_START
|
||||||
while ((touch_read() & TOUCH_START) == 0) { }
|
while ((touch_read() & TOUCH_START) == 0) { }
|
||||||
// wait for TOUCH_END
|
// wait for TOUCH_END
|
||||||
while ((touch_read() & TOUCH_END) == 0) { }
|
while (((r = touch_read()) & TOUCH_END) == 0) { }
|
||||||
// flush touch events if any
|
// flush touch events if any
|
||||||
while (touch_read()) { }
|
while (touch_read()) { }
|
||||||
|
// return last touch coordinate
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,6 @@
|
|||||||
|
|
||||||
void touch_init(void);
|
void touch_init(void);
|
||||||
uint32_t touch_read(void);
|
uint32_t touch_read(void);
|
||||||
void touch_click(void);
|
uint32_t touch_click(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user