Skip to content

Commit a00856a

Browse files
authored
Merge pull request #78 from ncmreynolds/main
Conditional touch features, fixes #74
2 parents 4e81841 + f118f0e commit a00856a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/EasyButtonTouch.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#if defined(ESP32)
99
#include "EasyButtonTouch.h"
10+
#if defined(SOC_TOUCH_SENSOR_SUPPORTED) || (defined(SOC_TOUCH_SENSOR_NUM) && SOC_TOUCH_SENSOR_NUM > 1)
1011

1112
void EasyButtonTouch::setThreshold(int threshold)
1213
{
@@ -33,5 +34,5 @@ bool EasyButtonTouch::_readPin()
3334
ADCFilter.Filter(touchRead(_pin));
3435
return ADCFilter.Current() < _touch_threshold;
3536
}
36-
37+
#endif
3738
#endif

src/EasyButtonTouch.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#if !defined(_EasyButtonTouch_h) and defined(ESP32)
99
#define _EasyButtonTouch_h
10+
#include <include/soc/soc_caps.h>
11+
#if defined(SOC_TOUCH_SENSOR_SUPPORTED) || (defined(SOC_TOUCH_SENSOR_NUM) && SOC_TOUCH_SENSOR_NUM > 1)
1012

1113
#include <Arduino.h>
1214
#include <Filter.h>
@@ -26,5 +28,5 @@ class EasyButtonTouch : public EasyButton
2628

2729
bool _readPin();
2830
};
29-
31+
#endif
3032
#endif

0 commit comments

Comments
 (0)