From b0e84c72d7a533f62ca750a73445da7fcebe8d18 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 17 Nov 2021 20:42:47 +0100 Subject: wakeup cause added to init functions --- fw/fe310/eos/eve/eve.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'fw/fe310/eos/eve/eve.c') diff --git a/fw/fe310/eos/eve/eve.c b/fw/fe310/eos/eve/eve.c index f4aae01..0fb55d4 100644 --- a/fw/fe310/eos/eve/eve.c +++ b/fw/fe310/eos/eve/eve.c @@ -1,6 +1,7 @@ #include #include +#include "power.h" #include "eve.h" #define EVE_MEM_WRITE 0x800000 @@ -434,12 +435,12 @@ static int _init(int touch_calibrate, uint32_t *touch_matrix, uint8_t gpio_dir) return EVE_OK; } -int eve_init(int pwr_on, int touch_calibrate, uint32_t *touch_matrix, uint8_t gpio_dir) { - eve_spi_start(); +int eve_init(uint8_t wakeup_cause, int touch_calibrate, uint32_t *touch_matrix, uint8_t gpio_dir) { + int rst = (wakeup_cause == EOS_PWR_WAKE_RST); - pwr_on = 1; // override this for now + eve_spi_start(); - if (pwr_on) { + if (rst) { int rv = _init(touch_calibrate, touch_matrix, gpio_dir); if (rv) return rv; } else { @@ -447,7 +448,7 @@ int eve_init(int pwr_on, int touch_calibrate, uint32_t *touch_matrix, uint8_t gp eve_active(); } - eve_touch_init(pwr_on, touch_calibrate, touch_matrix); + eve_touch_init(wakeup_cause, touch_calibrate, touch_matrix); eve_platform_init(); eve_spi_stop(); -- cgit v1.2.3