summaryrefslogtreecommitdiff
path: root/fw/fe310/test
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
parent98941cdc89d93f5387bb98a443f06408321acc8f (diff)
form scroll completed
Diffstat (limited to 'fw/fe310/test')
-rw-r--r--fw/fe310/test/main.c2
-rw-r--r--fw/fe310/test/modem.c4
-rw-r--r--fw/fe310/test/status.c49
3 files changed, 28 insertions, 27 deletions
diff --git a/fw/fe310/test/main.c b/fw/fe310/test/main.c
index dc43473..8ec7790 100644
--- a/fw/fe310/test/main.c
+++ b/fw/fe310/test/main.c
@@ -70,10 +70,12 @@ int main() {
eos_init();
+ app_form_init();
app_screen_init(app_home_page);
app_status_init();
app_phone_init();
app_wifi_init();
+ app_cell_dev_init();
app_cell_pdp_init();
eos_evtq_loop();
diff --git a/fw/fe310/test/modem.c b/fw/fe310/test/modem.c
index 9fab383..eb0368d 100644
--- a/fw/fe310/test/modem.c
+++ b/fw/fe310/test/modem.c
@@ -106,11 +106,11 @@ static void handle_cell_msg(unsigned char type, unsigned char *buffer, uint16_t
}
}
-static int modem_touch(EVEView *view, uint8_t tag0, int touch_idx) {
+static int modem_touch(EVEView *view, EVETouch *touch, uint16_t evt, uint8_t tag0) {
VParam *param = view->param;
EVEText *text = &param->text;
- return eve_text_touch(text, tag0, touch_idx);
+ return eve_text_touch(text, touch, evt, tag0);
}
static uint8_t modem_draw(EVEView *view, uint8_t tag) {
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);