@@ -102,8 +102,12 @@ void tearDown(void) {
102102void test_touch_read (void ) {
103103 // TEST RELEASE STATE
104104 touch_value_t touch_unpressed[sizeof (TOUCH_GPIOS)];
105+ touch_value_t touch_unpressed_2[sizeof (TOUCH_GPIOS)];
106+ touch_value_t touch_unpressed_3[sizeof (TOUCH_GPIOS)];
105107 for (int i = 0 ; i < sizeof (TOUCH_GPIOS); i++) {
106108 touch_unpressed[i] = touchRead (TOUCH_GPIOS[i]);
109+ touch_unpressed_2[i] = touchRead (TOUCH_GPIOS[i]);
110+ touch_unpressed_3[i] = touchRead (TOUCH_GPIOS[i]);
107111 }
108112
109113 // TEST PRESS STATE
@@ -113,14 +117,20 @@ void test_touch_read(void) {
113117 delay (100 );
114118
115119 touch_value_t touch_pressed[sizeof (TOUCH_GPIOS)];
120+ touch_value_t touch_pressed_2[sizeof (TOUCH_GPIOS)];
121+ touch_value_t touch_pressed_3[sizeof (TOUCH_GPIOS)];
116122 for (int k = 0 ; k < sizeof (TOUCH_GPIOS); k++) {
117123 touch_pressed[k] = touchRead (TOUCH_GPIOS[k]);
124+ touch_pressed_2[k] = touchRead (TOUCH_GPIOS[k]);
125+ touch_pressed_3[k] = touchRead (TOUCH_GPIOS[k]);
118126 }
119127
120128 // COMPARE PRESSED <-> UNPRESSED
121129 for (int l = 0 ; l < sizeof (TOUCH_GPIOS); l++) {
122130 // log_i("Touch %d: %d -> %d", TOUCH_GPIOS[l], touch_unpressed[l], touch_pressed[l]);
123- Serial.printf (" Touch %d: %lu -> %lu\n " , TOUCH_GPIOS[l], touch_unpressed[l], touch_pressed[l]);
131+ Serial.printf (" 1. Touch %d: %lu -> %lu\n " , TOUCH_GPIOS[l], touch_unpressed[l], touch_pressed[l]);
132+ Serial.printf (" 2. Touch %d: %lu -> %lu\n " , TOUCH_GPIOS[l], touch_unpressed_2[l], touch_pressed_2[l]);
133+ Serial.printf (" 3. Touch %d: %lu -> %lu\n " , TOUCH_GPIOS[l], touch_unpressed_3[l], touch_pressed_3[l]);
124134 }
125135 for (int l = 0 ; l < sizeof (TOUCH_GPIOS); l++) {
126136#if CONFIG_IDF_TARGET_ESP32
@@ -159,13 +169,12 @@ void setup() {
159169 ;
160170 }
161171
162- UNITY_BEGIN ();
163- RUN_TEST (test_touch_read);
164-
165172#if SOC_TOUCH_SENSOR_VERSION == 3
166173 touch_ll_enable_internal_capacitor (true );
167174#endif
168175
176+ UNITY_BEGIN ();
177+ RUN_TEST (test_touch_read);
169178 RUN_TEST (test_touch_interrtupt);
170179 RUN_TEST (test_touch_errors);
171180 UNITY_END ();
0 commit comments