You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/embed/lib/touch.c

23 lines
414 B

#ifdef USE_TOUCH
#include "touch.h"
uint32_t touch_click(void) {
uint32_t r = 0;
// flush touch events if any
while (touch_read()) {
}
// wait for TOUCH_START
while ((touch_read() & TOUCH_START) == 0) {
}
// wait for TOUCH_END
while (((r = touch_read()) & TOUCH_END) == 0) {
}
// flush touch events if any
while (touch_read()) {
}
// return last touch coordinate
return r;
}
#endif