Skip to content

Commit 8cd18cc

Browse files
committed
preprocessor messages review
1 parent d1702cd commit 8cd18cc

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

cores/esp32/esp32-hal-touch.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
// limitations under the License.
1414

1515
#include "soc/soc_caps.h"
16-
17-
#if !defined(SOC_TOUCH_VERSION_1) && !defined(SOC_TOUCH_VERSION_2)
18-
#warning CONFIG_IDF_TARGET is not supported for Touch IDF driver!
19-
#endif
20-
2116
#if SOC_TOUCH_SENSOR_NUM > 0
17+
2218
#include "driver/touch_sensor.h"
2319
#include "esp32-hal-touch.h"
2420

21+
#if !defined(SOC_TOUCH_VERSION_1) && !defined(SOC_TOUCH_VERSION_2)
22+
#error Touch IDF driver Not supported!
23+
#endif
24+
2525
/*
2626
Internal Private Touch Data Structure and Functions
2727
*/

cores/esp32/esp32-hal-touch.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ extern "C" {
2525
#endif
2626

2727
#include "soc/soc_caps.h"
28+
#include "esp32-hal.h"
2829

2930
#if SOC_TOUCH_SENSOR_NUM > 0
30-
#include "esp32-hal.h"
31+
32+
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3)
33+
#warning This SoC may not support the current Touch Sensor implementation!
34+
#endif
3135

3236
#if SOC_TOUCH_VERSION_1 // ESP32
3337
typedef uint16_t touch_value_t;
@@ -84,7 +88,6 @@ void touchInterruptSetThresholdDirection(bool mustbeLower);
8488
bool touchInterruptGetLastStatus(uint8_t pin);
8589
#endif
8690

87-
8891
#endif // SOC_TOUCH_SENSOR_NUM > 0
8992

9093
#ifdef __cplusplus

0 commit comments

Comments
 (0)