2016-04-29 14:02:18 +00:00
|
|
|
#include <usrsw.h>
|
|
|
|
|
2016-04-29 01:15:18 +00:00
|
|
|
void msg_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-05-23 15:53:42 +00:00
|
|
|
ssize_t msg_recv(uint8_t *iface, uint8_t *buf, size_t len)
|
2016-04-29 01:15:18 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-05-23 15:53:42 +00:00
|
|
|
ssize_t msg_send(uint8_t iface, const uint8_t *buf, size_t len)
|
2016-04-29 01:15:18 +00:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-09-19 14:56:47 +00:00
|
|
|
// this should match values used in trezorui_poll_sdl_event() in modtrezorui/display-unix.h
|
2016-04-29 01:15:18 +00:00
|
|
|
uint32_t msg_poll_ui_event(void)
|
|
|
|
{
|
2016-04-29 14:02:18 +00:00
|
|
|
static int lp = 0;
|
|
|
|
uint32_t r = 0;
|
|
|
|
int p = switch_get();
|
|
|
|
if (lp == 0 && p == 1) {
|
|
|
|
r = 0x00010000; // touch start
|
|
|
|
} else
|
|
|
|
if (lp == 1 && p == 1) {
|
|
|
|
r = 0x00020000; // touch move
|
|
|
|
}
|
|
|
|
if (lp == 1 && p == 0) {
|
2016-09-19 14:56:47 +00:00
|
|
|
r = 0x00040000; // touch end
|
2016-04-29 14:02:18 +00:00
|
|
|
}
|
|
|
|
lp = p;
|
|
|
|
return r;
|
2016-04-29 01:15:18 +00:00
|
|
|
}
|