summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/eve_touch.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-11-17 20:42:47 +0100
committerUros Majstorovic <majstor@majstor.org>2021-11-17 20:42:47 +0100
commitb0e84c72d7a533f62ca750a73445da7fcebe8d18 (patch)
treed091c2307cd667fc9dd1c22e7c80e9ab9ceed445 /fw/fe310/eos/eve/eve_touch.c
parent9d1721008fe1d35abdedbff063ef29d35996124c (diff)
wakeup cause added to init functions
Diffstat (limited to 'fw/fe310/eos/eve/eve_touch.c')
-rw-r--r--fw/fe310/eos/eve/eve_touch.c6
1 files changed, 4 insertions, 2 deletions
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 <string.h>
#include <math.h>
+#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) {