summaryrefslogtreecommitdiff
path: root/fw/fe310/test/status.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-03-23 21:33:57 +0100
committerUros Majstorovic <majstor@majstor.org>2021-03-23 21:33:57 +0100
commit8c61343677d2ed8f929372863016524707b8ab93 (patch)
tree59f2c65f006bcf20c0b9a6a73c53a100d08775a2 /fw/fe310/test/status.c
parent98941cdc89d93f5387bb98a443f06408321acc8f (diff)
form scroll completed
Diffstat (limited to 'fw/fe310/test/status.c')
-rw-r--r--fw/fe310/test/status.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/fw/fe310/test/status.c b/fw/fe310/test/status.c
index 2500838..cbce1c7 100644
--- a/fw/fe310/test/status.c
+++ b/fw/fe310/test/status.c
@@ -32,37 +32,36 @@
static char status_msg[128];
-static int status_touch(EVEView *v, uint8_t tag0, int touch_idx) {
- if (touch_idx == 0) {
- EVETouch *t;
- uint16_t evt;
- unsigned char state = app_phone_state_get();
-
- t = eve_touch_evt(tag0, touch_idx, v->window->tag, 2, &evt);
- if (t && (evt & EVE_TOUCH_ETYPE_POINT_UP)) {
- if ((state == VOICE_STATE_RING) && (t->eevt & EVE_TOUCH_EETYPE_TRACK_LEFT)) {
- unsigned char *buf = eos_net_alloc();
-
- buf[0] = EOS_CELL_MTYPE_VOICE | EOS_CELL_MTYPE_VOICE_ANSWER;
- eos_net_send(EOS_NET_MTYPE_CELL, buf, 1, 0);
- status_msg[0] = '\0';
- }
- if ((state != VOICE_STATE_IDLE) && (t->eevt & EVE_TOUCH_EETYPE_TRACK_RIGHT)) {
- unsigned char *buf = eos_net_alloc();
-
- buf[0] = EOS_CELL_MTYPE_VOICE | EOS_CELL_MTYPE_VOICE_HANGUP;
- eos_net_send(EOS_NET_MTYPE_CELL, buf, 1, 0);
- status_msg[0] = '\0';
- }
- return 1;
+static int status_touch(EVEView *view, EVETouch *touch, uint16_t evt, uint8_t tag0) {
+ unsigned char state = app_phone_state_get();
+ int8_t touch_idx = eve_touch_get_idx(touch);
+
+ if (touch_idx != 0) return 0;
+
+ evt = eve_touch_evt(touch, evt, tag0, view->window->tag, 2);
+ if (touch && (evt & EVE_TOUCH_ETYPE_POINT_UP)) {
+ if ((state == VOICE_STATE_RING) && (touch->eevt & EVE_TOUCH_EETYPE_TRACK_LEFT)) {
+ unsigned char *buf = eos_net_alloc();
+
+ buf[0] = EOS_CELL_MTYPE_VOICE | EOS_CELL_MTYPE_VOICE_ANSWER;
+ eos_net_send(EOS_NET_MTYPE_CELL, buf, 1, 0);
+ status_msg[0] = '\0';
+ }
+ if ((state != VOICE_STATE_IDLE) && (touch->eevt & EVE_TOUCH_EETYPE_TRACK_RIGHT)) {
+ unsigned char *buf = eos_net_alloc();
+
+ buf[0] = EOS_CELL_MTYPE_VOICE | EOS_CELL_MTYPE_VOICE_HANGUP;
+ eos_net_send(EOS_NET_MTYPE_CELL, buf, 1, 0);
+ status_msg[0] = '\0';
}
+ return 1;
}
return 0;
}
-static uint8_t status_draw(EVEView *v, uint8_t tag0) {
+static uint8_t status_draw(EVEView *view, uint8_t tag0) {
uint8_t tag_opt = EVE_TOUCH_OPT_TRACK | EVE_TOUCH_OPT_TRACK_XY;
- if (v->window->tag != EVE_TAG_NOTAG) eve_touch_set_opt(v->window->tag, eve_touch_get_opt(v->window->tag) | tag_opt);
+ if (view->window->tag != EVE_TAG_NOTAG) eve_touch_set_opt(view->window->tag, eve_touch_get_opt(view->window->tag) | tag_opt);
if (tag0 != EVE_TAG_NOTAG) {
eve_touch_set_opt(tag0, eve_touch_get_opt(tag0) | tag_opt);