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_touch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fw/fe310/eos/eve/eve_touch.c') diff --git a/fw/fe310/eos/eve/eve_touch.c b/fw/fe310/eos/eve/eve_touch.c index aaa3788..77a0bf9 100644 --- a/fw/fe310/eos/eve/eve_touch.c +++ b/fw/fe310/eos/eve/eve_touch.c @@ -2,6 +2,7 @@ #include #include +#include "power.h" #include "eve.h" static int touch_intr_mask = EVE_INT_TAG | EVE_INT_TOUCH; @@ -340,7 +341,8 @@ static void _init(int touch_calibrate, uint32_t *touch_matrix) { while(eve_read8(REG_INT_FLAGS)); } -void eve_touch_init(int pwr_on, int touch_calibrate, uint32_t *touch_matrix) { +void eve_touch_init(uint8_t wakeup_cause, int touch_calibrate, uint32_t *touch_matrix) { + int rst = (wakeup_cause == EOS_PWR_WAKE_RST); int i; eve_vtrack_init(); @@ -350,7 +352,7 @@ void eve_touch_init(int pwr_on, int touch_calibrate, uint32_t *touch_matrix) { touch->eevt |= EVE_TOUCH_EETYPE_NOTOUCH; } - if (pwr_on) _init(touch_calibrate, touch_matrix); + if (rst) _init(touch_calibrate, touch_matrix); } void eve_touch_set_handler(eve_touch_handler_t handler, void *param) { -- cgit v1.2.3