diff options
Diffstat (limited to 'fw/fe310/test')
-rw-r--r-- | fw/fe310/test/Makefile | 30 | ||||
-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, 42 insertions, 41 deletions
diff --git a/fw/fe310/test/Makefile b/fw/fe310/test/Makefile deleted file mode 100644 index dde518c..0000000 --- a/fw/fe310/test/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -include ../common.mk -DEPS = main.o mem.o cell_dev.o cell_pdp.o phone.o modem.o wifi.o cam.o fs.o test.o -LIBS_ECP = - -# LIBS_ECP += -lecp -lecpcr -lecptr -lecptm -lecpdir -lecpvconn -# DEPS += ecp.o ecp_init.o audio.o - -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.. -LDFLAGS = app/*.o $(CFLAGS) -L.. -L$(ecp_dir)/build-fe310 -Wl,--gc-sections -nostartfiles -nostdlib -Wl,--start-group -lc -lm -lgcc -leos $(LIBS_ECP) -Wl,--end-group -T../bsp/default.lds -TARGET = phone - - -all: $(TARGET) - -app_: - (cd app && $(MAKE)) || exit; - -%.o: %.c - $(CC) $(CFLAGS) -c $< - -$(TARGET): app_ $(DEPS) - $(CC) $(DEPS) $(LDFLAGS) -o $@ - -clean: - (cd app && $(MAKE) clean) || exit; - rm -f *.o *.a $(TARGET) - -upload: $(TARGET) - ../bsp/upload --elf ./$(TARGET) --openocd $(RISCV_OPENOCD_HOME)/bin/openocd --gdb $(RISCV_HOME)/bin/riscv64-unknown-elf-gdb --openocd-config ../bsp/openocd.cfg - 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 ec57b99..2fc1a04 100644 --- a/fw/fe310/test/main.c +++ b/fw/fe310/test/main.c @@ -30,6 +30,8 @@ #include "fs.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[] = { /* @@ -63,13 +65,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, @@ -78,22 +80,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(); } |