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/main.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 fw/fe310/phone/main.c (limited to 'fw/fe310/phone/main.c') diff --git a/fw/fe310/phone/main.c b/fw/fe310/phone/main.c new file mode 100644 index 0000000..125a9d2 --- /dev/null +++ b/fw/fe310/phone/main.c @@ -0,0 +1,94 @@ +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "app/app.h" + +#include "wifi.h" +#include "cell.h" +#include "phone.h" +#include "modem.h" +#include "timer.h" +#include "test.h" + +static const uint32_t touch_matrix[6] = {0xf7ac,0x440,0x3e704,0xfffff718,0x108a3,0xfff76d42}; + +static int home_page(EVEWindow *window, EVEViewStack *stack) { + EVEFormSpec spec[] = { + { + .widget.type = EVE_WIDGET_TYPE_PAGE, + .widget.g.w = APP_SCREEN_W, + .widget.tspec.page.title = "WiFi", + .widget.tspec.page.constructor = wifi_app, + }, + { + .widget.type = EVE_WIDGET_TYPE_PAGE, + .widget.g.w = APP_SCREEN_W, + .widget.tspec.page.title = "Modem", + .widget.tspec.page.constructor = modem_app, + }, + { + .widget.type = EVE_WIDGET_TYPE_PAGE, + .widget.g.w = APP_SCREEN_W, + .widget.tspec.page.title = "Phone", + .widget.tspec.page.constructor = phone_app, + }, + { + .widget.type = EVE_WIDGET_TYPE_PAGE, + .widget.g.w = APP_SCREEN_W, + .widget.tspec.page.title = "Timer", + .widget.tspec.page.constructor = timer_app, + }, + { + .widget.type = EVE_WIDGET_TYPE_PAGE, + .widget.g.w = APP_SCREEN_W, + .widget.tspec.page.title = "Test", + .widget.tspec.page.constructor = test_app, + }, + }; + + EVEPage *page = eve_form_create(window, stack, spec, APP_SPEC_SIZE(spec), NULL, NULL); + if (page == NULL) return EVE_ERR_NOMEM; + + return EVE_OK; +} + +void mem_print(void); + +#include + +int main() { + uint8_t wakeup_cause; + + wakeup_cause = eos_init(); + // eos_run_once(); + eos_eve_set_tmatrix(touch_matrix); + + printf("FREQ:%lu\n", PRCI_get_cpu_freq()); + printf("\nREADY.\n"); + mem_print(); + eos_gt911_cfg_print(); + + wifi_init(); + cell_init(); + phone_init(); + app_init(home_page, 0x20); + + eos_run(wakeup_cause); + + eos_evtq_loop(); +} -- cgit v1.2.3