From c44897fda572cf8837b4535a6d1aaad4605c14af Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 18 Nov 2021 03:18:18 +0100 Subject: eve sleep improved --- fw/fe310/eos/eve/eve_touch.c | 11 +++++++++-- 1 file changed, 9 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 77a0bf9..035e122 100644 --- a/fw/fe310/eos/eve/eve_touch.c +++ b/fw/fe310/eos/eve/eve_touch.c @@ -300,11 +300,18 @@ void eve_handle_time(void) { } } +void eve_touch_active(void) { + eve_write8(REG_TOUCH_MODE, EVE_TMODE_CONTINUOUS); +} + +void eve_touch_sleep(void) { + eve_write8(REG_TOUCH_MODE, EVE_TMODE_OFF); +} + static void _init(int touch_calibrate, uint32_t *touch_matrix) { /* configure touch */ - eve_write16(REG_TOUCH_CONFIG, 0xb81); /* enable touch low power mode: 0xb81 - default: 0x381 */ + eve_write16(REG_TOUCH_CONFIG, 0x381); /* default */ eve_write8(REG_TOUCH_MODE, EVE_TMODE_CONTINUOUS); /* enable touch */ - eve_write16(REG_TOUCH_RZTHRESH, EVE_TOUCH_RZTHRESH); /* eliminate any false touches */ if (touch_calibrate) { eve_write8(REG_PWM_DUTY, 0x40); -- cgit v1.2.3