From 7200b2cc11cf95edfb759ef452658ccaf30d0391 Mon Sep 17 00:00:00 2001 From: Wangjialin Date: Mon, 30 Oct 2017 14:23:51 +0800 Subject: [PATCH] bugfix(touch): registers of touchpad 8 and 9 are mismatched MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1. All the registers of touch sensor 8 and 9 are mismatched except the ‘dac’ field in touch register of RTC IO 2. To swap the index for sensor 8 and 9 in APIs. --- components/driver/rtc_module.c | 95 ++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 44 deletions(-) diff --git a/components/driver/rtc_module.c b/components/driver/rtc_module.c index fe3aea71a3..ff9ed8bb51 100644 --- a/components/driver/rtc_module.c +++ b/components/driver/rtc_module.c @@ -398,6 +398,21 @@ void rtc_gpio_force_hold_dis_all() /*--------------------------------------------------------------- Touch Pad ---------------------------------------------------------------*/ +//Some register bits of touch sensor 8 and 9 are mismatched, we need to swap the bits. +#define BITSWAP(data, n, m) (((data >> n) & 0x1) == ((data >> m) & 0x1) ? (data) : ((data) ^ ((0x1 <filtered_val[touch_num] >> TOUCH_PAD_SHIFT_DEFAULT); return ESP_OK; } -- 2.40.0