Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions cores/esp32/esp32-hal-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,21 @@
#include "soc/touch_sensor_periph.h"

int8_t digitalPinToTouchChannel(uint8_t pin) {
int8_t ret = -1;
if (pin < SOC_GPIO_PIN_COUNT) {
for (uint8_t i = 0; i < SOC_TOUCH_SENSOR_NUM; i++) {
if (touch_sensor_channel_io_map[i] == pin) {
ret = i;
break;
return i;
}
}
}
return ret;

log_e("No touch pad on selected pin(%u)!", pin);
return -1;
}
#else
// No Touch Sensor available
int8_t digitalPinToTouchChannel(uint8_t pin) {
log_e("Touch sensor not available on this chip");
return -1;
}
#endif
Expand Down
3 changes: 0 additions & 3 deletions cores/esp32/esp32-hal-touch-ng.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ static void __touchChannelInit(int pad) {
static touch_value_t __touchRead(uint8_t pin) {
int8_t pad = digitalPinToTouchChannel(pin);
if (pad < 0) {
log_e(" No touch pad on selected pin!");
return 0;
}

Expand Down Expand Up @@ -360,7 +359,6 @@ static touch_value_t __touchRead(uint8_t pin) {
static void __touchConfigInterrupt(uint8_t pin, void (*userFunc)(void), void *Args, bool callWithArgs, touch_value_t threshold) {
int8_t pad = digitalPinToTouchChannel(pin);
if (pad < 0) {
log_e(" No touch pad on selected pin!");
return;
}

Expand Down Expand Up @@ -446,7 +444,6 @@ bool touchInterruptGetLastStatus(uint8_t pin) {
void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold) {
int8_t pad = digitalPinToTouchChannel(pin);
if (pad < 0) {
log_e(" No touch pad on selected pin!");
return;
}

Expand Down
3 changes: 0 additions & 3 deletions cores/esp32/esp32-hal-touch.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ static void __touchChannelInit(int pad) {
static touch_value_t __touchRead(uint8_t pin) {
int8_t pad = digitalPinToTouchChannel(pin);
if (pad < 0) {
log_e(" No touch pad on selected pin!");
return 0;
}

Expand All @@ -233,7 +232,6 @@ static touch_value_t __touchRead(uint8_t pin) {
static void __touchConfigInterrupt(uint8_t pin, void (*userFunc)(void), void *Args, touch_value_t threshold, bool callWithArgs) {
int8_t pad = digitalPinToTouchChannel(pin);
if (pad < 0) {
log_e(" No touch pad on selected pin!");
return;
}

Expand Down Expand Up @@ -295,7 +293,6 @@ bool touchInterruptGetLastStatus(uint8_t pin) {
void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold) {
int8_t pad = digitalPinToTouchChannel(pin);
if (pad < 0) {
log_e(" No touch pad on selected pin!");
return;
}

Expand Down
Loading