From fc98d3809e0db36d634f290417b9152f87f83e3e Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 4 Sep 2022 18:37:42 +0200 Subject: new phone firmware --- fw/fe310/phone/timer.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 fw/fe310/phone/timer.c (limited to 'fw/fe310/phone/timer.c') diff --git a/fw/fe310/phone/timer.c b/fw/fe310/phone/timer.c new file mode 100644 index 0000000..03593ff --- /dev/null +++ b/fw/fe310/phone/timer.c @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "app/app.h" + +#include "timer.h" + +static void timer(unsigned char evt) { + int rv; + + printf("TIMER\n"); + eos_timer_set(EOS_TIMER_ETYPE_USR, 500); +} + +int timer_app(EVEWindow *window, EVEViewStack *stack) { + EVEFormSpec spec[] = { + APP_SPACERW(1,1), + }; + EVEPage *page = eve_form_create(window, stack, spec, APP_SPEC_SIZE(spec), NULL, timer_close); + if (page == NULL) return EVE_ERR_NOMEM; + eos_timer_set_handler(EOS_TIMER_ETYPE_USR, timer); + eos_timer_set(EOS_TIMER_ETYPE_USR, 500); + eos_net_acquire_for_evt(EOS_EVT_TIMER | EOS_TIMER_ETYPE_USR, 1); + + return EVE_OK; +} + +void timer_close(EVEPage *page) { + eos_timer_clear(EOS_TIMER_ETYPE_USR); + eos_timer_set_handler(EOS_TIMER_ETYPE_USR, NULL); + eos_net_acquire_for_evt(EOS_EVT_TIMER | EOS_TIMER_ETYPE_USR, 0); + eve_form_destroy(page); +} -- cgit v1.2.3