From 7d03a941be6e9226e71cb5f5b4f7949e06bbfb02 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 9 Dec 2021 23:50:58 +0100 Subject: improved init process --- fw/fe310/test/Makefile | 3 ++- fw/fe310/test/cam.c | 4 ++-- fw/fe310/test/main.c | 20 ++++++++++---------- fw/fe310/test/test.c | 6 +----- 4 files changed, 15 insertions(+), 18 deletions(-) (limited to 'fw/fe310/test') diff --git a/fw/fe310/test/Makefile b/fw/fe310/test/Makefile index 8476db8..af18dc5 100644 --- a/fw/fe310/test/Makefile +++ b/fw/fe310/test/Makefile @@ -5,7 +5,8 @@ CRYPTO_DIR = ../../../crypto CFLAGS += -I.. -I../eos -I../bsp/include -I../bsp/drivers -I$(CRYPTO_DIR) LDFLAGS = $(CFLAGS) -L.. -Wl,--gc-sections -nostartfiles -nostdlib -Wl,--start-group -lc -lm -lgcc -leos -Wl,--end-group -T../bsp/default.lds -DEPS = main.o status.o cell_dev.o cell_pdp.o phone.o modem.o wifi.o cam.o fs.o test.o +DEPS = main.o status.o cell_dev.o cell_pdp.o phone.o modem.o wifi.o cam.o audio.o test.o +# DEPS = main.o status.o cell_dev.o cell_pdp.o phone.o modem.o wifi.o cam.o fs.o test.o TARGET = phone all: $(TARGET) diff --git a/fw/fe310/test/cam.c b/fw/fe310/test/cam.c index 2cef686..9338ae9 100644 --- a/fw/fe310/test/cam.c +++ b/fw/fe310/test/cam.c @@ -141,8 +141,8 @@ void app_cam(EVEWindow *window, EVEViewStack *stack) { eos_time_sleep(100); eos_i2c_speed(100000); - rv = eos_i2c_start(); - if (!rv) rv = eos_ov2640_init(); + eos_i2c_start(); + rv = eos_ov2640_init(); if (!rv) rv = eos_ov2640_set_pixfmt(PIXFORMAT_JPEG); if (!rv) rv = eos_ov2640_set_framesize(FRAMESIZE_VGA); eos_i2c_stop(); diff --git a/fw/fe310/test/main.c b/fw/fe310/test/main.c index f7c85e5..13c113e 100644 --- a/fw/fe310/test/main.c +++ b/fw/fe310/test/main.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -28,7 +28,8 @@ #include "modem.h" #include "wifi.h" #include "cam.h" -#include "fs.h" +// #include "fs.h" +#include "audio.h" #include "test.h" void app_home_page(EVEWindow *window, EVEViewStack *stack) { @@ -63,12 +64,14 @@ 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, @@ -77,17 +80,13 @@ void app_home_page(EVEWindow *window, EVEViewStack *stack) { }, }; - EVEForm *form = eve_form_create(window, stack, spec, 7, NULL, NULL, NULL); + EVEForm *form = eve_form_create(window, stack, spec, 6, NULL, NULL, NULL); } int main() { - uint8_t wakeup_cause = eos_power_wakeup_cause(); - int rst = (wakeup_cause == EOS_PWR_WAKE_RST); - - printf("\nREADY.\n"); - printf("FREQ:%lu\n", PRCI_get_cpu_freq()); - eos_init(); + printf("FREQ:%lu\n", PRCI_get_cpu_freq()); + printf("\nREADY.\n"); app_root_init(app_home_page, 0x20); app_status_init(); @@ -95,6 +94,7 @@ int main() { app_wifi_init(); app_cell_dev_init(); app_cell_pdp_init(); - app_fs_init(); + // app_fs_init(); + audio_start(); eos_evtq_loop(); } diff --git a/fw/fe310/test/test.c b/fw/fe310/test/test.c index 87c1e2b..9cf7605 100644 --- a/fw/fe310/test/test.c +++ b/fw/fe310/test/test.c @@ -40,11 +40,7 @@ int app_test_uievt(EVEForm *form, uint16_t evt, void *param) { case EVE_UIEVT_PAGE_TOUCH: printf("PAGE TOUCH\n"); printf("BQ25895:\n"); - rv = eos_i2c_start(); - if (rv) { - printf("I2C BUSY\n"); - return 0; - } + eos_i2c_start(); for (i=0; i<0x15; i++) { rv = reg_read(i, &data); if (!rv) printf("REG%02x: %02x\n", i, data); -- cgit v1.2.3