diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-05-13 12:26:19 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-05-13 12:26:19 +0200 |
commit | 9ccb4db8d59ec9dab33ee8617d462f21a8bb4fa8 (patch) | |
tree | a4f8ba9375a4ee82bae6ddc0cb3a35227f6f9469 /fw/fe310/test | |
parent | 45f0d9b890b086493f9bb06428c46cd802324223 (diff) |
touch controller/eve fixes
Diffstat (limited to 'fw/fe310/test')
-rw-r--r-- | fw/fe310/test/Makefile | 4 | ||||
-rw-r--r-- | fw/fe310/test/app/app_root.c | 4 | ||||
-rw-r--r-- | fw/fe310/test/app/app_root.h | 2 | ||||
-rw-r--r-- | fw/fe310/test/fs.c | 25 | ||||
-rw-r--r-- | fw/fe310/test/main.c | 22 |
5 files changed, 44 insertions, 13 deletions
diff --git a/fw/fe310/test/Makefile b/fw/fe310/test/Makefile index 236217f..323bce0 100644 --- a/fw/fe310/test/Makefile +++ b/fw/fe310/test/Makefile @@ -1,9 +1,9 @@ include ../common.mk -CFLAGS += -I$(bsp_dir)/include -I$(bsp_dir)/drivers -I$(ext_dir)/crypto -I$(ext_dir)/fsfat -I$(ecp_dir)/src -I$(ecp_dir)/src/platform/fe310 -I.. +CFLAGS += -DECP_WITH_VCONN=1 -DECP_WITH_DIR=1 -DECP_DEBUG=1 -I$(bsp_dir)/include -I$(bsp_dir)/drivers -I$(ext_dir)/crypto -I$(ext_dir)/fsfat -I$(ecp_dir)/src -I$(ecp_dir)/src/platform/fe310 -I.. LDFLAGS = app/*.o $(CFLAGS) -L.. -L$(ecp_dir)/build-fe310 -Wl,--gc-sections -nostartfiles -nostdlib -Wl,--start-group -lc -lm -lgcc -leos -lecp -lecpcr -lecptr -lecptm -lecpdir -lecpvconn -Wl,--end-group -T../bsp/default.lds DEPS = main.o mem.o cell_dev.o cell_pdp.o phone.o modem.o wifi.o cam.o fs.o test.o -# DEPS += ecp.o ecp_init.o audio.o +# DEPS += ecp2.o ecp_init.o audio.o TARGET = phone diff --git a/fw/fe310/test/app/app_root.c b/fw/fe310/test/app/app_root.c index 7dda3c7..e6de2d1 100644 --- a/fw/fe310/test/app/app_root.c +++ b/fw/fe310/test/app/app_root.c @@ -16,7 +16,7 @@ #include "app_root.h" #define KBD_X 0 -#define KBD_Y 575 +#define KBD_Y 629 #define KBD_W 480 #define KBD_H 225 @@ -84,5 +84,5 @@ void app_root_init(eve_view_constructor_t home_page, int b) { eve_spi_stop(); - eos_net_acquire_for_evt(EOS_EVT_UI | EVE_ETYPE_INTR, 1); + eos_net_acquire_for_evt(EOS_EVT_EVE | EVE_ETYPE_INTR, 1); } diff --git a/fw/fe310/test/app/app_root.h b/fw/fe310/test/app/app_root.h index b085344..35f889f 100644 --- a/fw/fe310/test/app/app_root.h +++ b/fw/fe310/test/app/app_root.h @@ -1,7 +1,7 @@ #include <stdint.h> #define APP_SCREEN_W 480 -#define APP_SCREEN_H 800 +#define APP_SCREEN_H 854 #define APP_STATUS_H 60 #define APP_FONT_HANDLE 31 diff --git a/fw/fe310/test/fs.c b/fw/fe310/test/fs.c index 222833b..1dce3af 100644 --- a/fw/fe310/test/fs.c +++ b/fw/fe310/test/fs.c @@ -100,5 +100,30 @@ void app_fs_init(void) { rv = f_mount(&fs, "", 1); printf("f_mount:%d\n", rv); } + + if (rv == FR_OK) { + FIL f; + UINT w; + char *msg = "PERA JE CAR!"; + + rv = f_open(&f, TEXT_FN, FA_READ); + printf("f_open:%d\n", rv); + if (!rv) { + UINT r; + char _msg[TEXT_SIZE]; + + memset(_msg, 0, sizeof(_msg)); + rv = f_read(&f, _msg, sizeof(_msg), &r); + printf("f_read:%d %u %s\n", rv, r, _msg); + f_close(&f); + } else { + rv = f_open(&f, TEXT_FN, FA_WRITE | FA_CREATE_ALWAYS); + printf("f_open:%d\n", rv); + rv = f_write(&f, msg, strlen(msg), &w); + printf("f_write:%d\n", rv); + } + f_close(&f); + + } eos_spi_deselect(); }
\ No newline at end of file diff --git a/fw/fe310/test/main.c b/fw/fe310/test/main.c index 52d281b..36ad5b8 100644 --- a/fw/fe310/test/main.c +++ b/fw/fe310/test/main.c @@ -32,6 +32,8 @@ #include "ecp.h" #include "test.h" +const uint32_t _eos_touch_matrix[6] = {0xf7ac,0x440,0x3e704,0xfffff718,0x108a3,0xfff76d42}; + void app_home_page(EVEWindow *window, EVEViewStack *stack) { EVEWidgetSpec spec[] = { /* @@ -65,13 +67,13 @@ void app_home_page(EVEWindow *window, EVEViewStack *stack) { .widget.spec.page.title = "Camera", .widget.spec.page.constructor = app_cam }, + */ { .widget.type = EVE_WIDGET_TYPE_PAGE, .widget.g.w = APP_SCREEN_W, .widget.spec.page.title = "File system", .widget.spec.page.constructor = app_fs }, - */ { .widget.type = EVE_WIDGET_TYPE_PAGE, .widget.g.w = APP_SCREEN_W, @@ -80,22 +82,26 @@ void app_home_page(EVEWindow *window, EVEViewStack *stack) { }, }; - EVEForm *form = eve_form_create(window, stack, spec, 1, NULL, NULL, NULL); + EVEForm *form = eve_form_create(window, stack, spec, 2, NULL, NULL, NULL); } void print_mem(void); int main() { eos_init(); + // eos_run_once(); + printf("FREQ:%lu\n", PRCI_get_cpu_freq()); printf("\nREADY.\n"); - app_root_init(app_home_page, 0x20); - // app_phone_init(); - // app_wifi_init(); - // app_cell_dev_init(); - // app_cell_pdp_init(); - // app_fs_init(); + app_root_init(app_home_page, 0x10); + app_phone_init(); + app_wifi_init(); + app_cell_dev_init(); + app_cell_pdp_init(); + app_fs_init(); + // audio_start(); + // app_ecp_init(); eos_evtq_loop(); } |