summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/eve_touch.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-11-30 22:05:17 +0100
committerUros Majstorovic <majstor@majstor.org>2021-11-30 22:05:17 +0100
commit5506d89d97db87f78ab2ba4715c4248a3d49f98f (patch)
treee4ef547d541968e552a6f521ab637084b253fa68 /fw/fe310/eos/eve/eve_touch.c
parentacce7d8e05ac38776d6340342f6a7868df4f7f28 (diff)
startup code uses init/run
Diffstat (limited to 'fw/fe310/eos/eve/eve_touch.c')
-rw-r--r--fw/fe310/eos/eve/eve_touch.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/fw/fe310/eos/eve/eve_touch.c b/fw/fe310/eos/eve/eve_touch.c
index fc9d040..ff155d5 100644
--- a/fw/fe310/eos/eve/eve_touch.c
+++ b/fw/fe310/eos/eve/eve_touch.c
@@ -336,8 +336,16 @@ static void _init(int touch_calibrate, uint32_t *touch_matrix) {
while(eve_read8(REG_INT_FLAGS));
}
-void eve_touch_init(uint8_t wakeup_cause, int touch_calibrate, uint32_t *touch_matrix) {
- int rst = (wakeup_cause == EVE_INIT_RST);
+static void _start(void) {
+ eve_write8(REG_TOUCH_MODE, EVE_TMODE_CONTINUOUS);
+}
+
+static void _stop(void) {
+ eve_write8(REG_TOUCH_MODE, EVE_TMODE_OFF);
+}
+
+int eve_touch_init(uint8_t wakeup_cause, int touch_calibrate, uint32_t *touch_matrix) {
+ int rst = (wakeup_cause == EVE_WAKE_RST);
int i;
eve_vtrack_init();
@@ -348,14 +356,22 @@ void eve_touch_init(uint8_t wakeup_cause, int touch_calibrate, uint32_t *touch_m
}
if (rst) _init(touch_calibrate, touch_matrix);
+
+ return EVE_OK;
}
-void eve_touch_start(uint8_t wakeup_cause) {
- eve_write8(REG_TOUCH_MODE, EVE_TMODE_CONTINUOUS);
+int eve_touch_run(uint8_t wakeup_cause) {
+ _start();
+
+ return EVE_OK;
+}
+
+void eve_touch_start(void) {
+ _start();
}
void eve_touch_stop(void) {
- eve_write8(REG_TOUCH_MODE, EVE_TMODE_OFF);
+ _stop();
}
void eve_touch_set_handler(eve_touch_handler_t handler, void *param) {