13#define DEBOUNCE_DELAY 500
18#if defined(IS_MIN_DESKTOP)
61#if defined(USE_TOUCH_READ)
70 LOGI(
"touch pin: %d value %d (limit: %d) -> %s", this->pin, value,
78 return this->
readPin(this->pin);
87 if (value != this->lastState) {
90 if ((value && this->activeLogic ==
ActiveHigh) ||
91 (!value && this->activeLogic ==
ActiveLow)) {
92 this->
actionOn(
true, this->pin, this->ref);
94 this->
actionOff(
false, this->pin, this->ref);
96 this->lastState = value;
100 if (value != this->lastState &&
millis() > this->debounceTimeout) {
102 this->
actionOn(active, this->pin, this->ref);
103 this->lastState = value;
107 bool active = (this->activeLogic ==
ActiveLow) ? !value : value;
109 (active != this->lastState ||
millis() > this->debounceTimeout)) {
111 this->
actionOn(active, this->pin, this->ref);
112 this->lastState = active;
145 add(pin, actionOn,
nullptr, activeLogic, ref);
244 if (
action ==
nullptr)
continue;
261 if (
action ==
nullptr)
continue;
277 void* ref =
nullptr) {
295 LOGE(
"insertAction: refusing to add nullptr");
307#if defined(IS_ZEPHYR)
327 LOGE(
"Error %d: failed to enable interrupt", ret);
345#if defined(ARDUINO) && (!defined(IS_MIN_DESKTOP) && !defined(IS_DESKTOP))
347#elif defined(IS_ZEPHYR)
#define INPUT
Definition Arduino.h:34
#define INPUT_PULLUP
Definition Arduino.h:42
#define GPIO_TO_INT(pin)
Definition Arduino.h:249
#define DEBOUNCE_DELAY
Definition AudioActions.h:13
#define TOUCH_LIMIT
Definition AudioActions.h:9
#define LOGW(...)
Definition AudioLoggerIDF.h:29
#define LOGI(...)
Definition AudioLoggerIDF.h:28
#define LOGE(...)
Definition AudioLoggerIDF.h:30