From 5506d89d97db87f78ab2ba4715c4248a3d49f98f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 30 Nov 2021 22:05:17 +0100 Subject: startup code uses init/run --- fw/fe310/eos/eve/eve_touch.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 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 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) { -- cgit v1.2.3