@@ -102,12 +102,8 @@ 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)];
107105 for (int i = 0 ; i < sizeof (TOUCH_GPIOS); i++) {
108106 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]);
111107 }
112108
113109 // TEST PRESS STATE
@@ -117,20 +113,14 @@ void test_touch_read(void) {
117113 delay (100 );
118114
119115 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)];
122116 for (int k = 0 ; k < sizeof (TOUCH_GPIOS); k++) {
123117 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]);
126118 }
127119
128120 // COMPARE PRESSED <-> UNPRESSED
129121 for (int l = 0 ; l < sizeof (TOUCH_GPIOS); l++) {
130122 // log_i("Touch %d: %d -> %d", 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]);
123+ Serial.printf (" Touch %d: %lu -> %lu\n " , TOUCH_GPIOS[l], touch_unpressed[l], touch_pressed[l]);
134124 }
135125 for (int l = 0 ; l < sizeof (TOUCH_GPIOS); l++) {
136126#if CONFIG_IDF_TARGET_ESP32
@@ -169,12 +159,13 @@ void setup() {
169159 ;
170160 }
171161
162+ UNITY_BEGIN ();
163+ RUN_TEST (test_touch_read);
164+
172165#if SOC_TOUCH_SENSOR_VERSION == 3
173166 touch_ll_enable_internal_capacitor (true );
174167#endif
175168
176- UNITY_BEGIN ();
177- RUN_TEST (test_touch_read);
178169 RUN_TEST (test_touch_interrtupt);
179170 RUN_TEST (test_touch_errors);
180171 UNITY_END ();
0 commit comments