From: Wangjialin Date: Mon, 30 Oct 2017 06:23:51 +0000 (+0800) Subject: bugfix(touch): registers of touchpad 8 and 9 are mismatched X-Git-Tag: v3.1-dev~60^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7200b2cc11cf95edfb759ef452658ccaf30d0391;p=esp-idf bugfix(touch): registers of touchpad 8 and 9 are mismatched 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. --- 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; }