From 98941cdc89d93f5387bb98a443f06408321acc8f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 16 Mar 2021 02:11:43 +0100 Subject: init code cleanup --- fw/fe310/eos/app/app_form.h | 1 + fw/fe310/eos/eos.c | 2 -- fw/fe310/eos/eve/eve.c | 5 +++++ fw/fe310/eos/spi_dev.c | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'fw/fe310') diff --git a/fw/fe310/eos/app/app_form.h b/fw/fe310/eos/app/app_form.h index ed62253..191e76d 100644 --- a/fw/fe310/eos/app/app_form.h +++ b/fw/fe310/eos/app/app_form.h @@ -5,3 +5,4 @@ EVEForm *app_form_create(EVEWindow *window, EVEViewStack *stack, EVEWidgetSpec spec[], uint16_t spec_size, eve_form_action_t action, eve_form_destructor_t destructor); void app_form_destroy(EVEForm *form); +void app_form_init(void); \ No newline at end of file diff --git a/fw/fe310/eos/eos.c b/fw/fe310/eos/eos.c index 6214203..91115f6 100644 --- a/fw/fe310/eos/eos.c +++ b/fw/fe310/eos/eos.c @@ -37,7 +37,5 @@ void eos_init(void) { eos_net_wake(wakeup_cause); eve_set_touch_calibration(eve_touch); - eos_spi_dev_select(EOS_DEV_DISP); eve_init(wakeup_cause == EOS_PWR_WAKE_RST); - eos_spi_dev_deselect(); } diff --git a/fw/fe310/eos/eve/eve.c b/fw/fe310/eos/eve/eve.c index efbd02b..6809d72 100644 --- a/fw/fe310/eos/eve/eve.c +++ b/fw/fe310/eos/eve/eve.c @@ -419,7 +419,10 @@ static int _init(void) { } int eve_init(int pwr_on) { + eve_spi_start(); + pwr_on = 1; // override this for now + if (pwr_on) { int rv = _init(); if (rv) return rv; @@ -431,5 +434,7 @@ int eve_init(int pwr_on) { eve_touch_init(); eve_platform_init(); + eve_spi_stop(); + return EVE_OK; } diff --git a/fw/fe310/eos/spi_dev.c b/fw/fe310/eos/spi_dev.c index abb616d..00b1a5b 100644 --- a/fw/fe310/eos/spi_dev.c +++ b/fw/fe310/eos/spi_dev.c @@ -37,13 +37,13 @@ int eos_spi_dev_select(unsigned char dev) { } switch (dev) { case EOS_DEV_DISP: - rv = eos_spi_start(dev, spi_dev_div[dev-1], SPI_CSID_DISP, 0); + rv = eos_spi_start(dev, spi_dev_div[dev - 1], SPI_CSID_DISP, 0); break; case EOS_DEV_CARD: - rv = eos_spi_start(dev, spi_dev_div[dev-1], SPI_CSID_CARD, 0); + rv = eos_spi_start(dev, spi_dev_div[dev - 1], SPI_CSID_CARD, 0); break; case EOS_DEV_CAM: - rv = eos_spi_start(dev, spi_dev_div[dev-1], SPI_CSID_NONE, SPI_CSPIN_CAM); + rv = eos_spi_start(dev, spi_dev_div[dev - 1], SPI_CSID_NONE, SPI_CSPIN_CAM); break; } -- cgit v1.2.3