This commit is contained in:
CiscoTheWolf 2023-05-22 23:00:10 +02:00
parent 22a25532ba
commit 03c938c1fe
2 changed files with 8 additions and 5 deletions

View file

@ -98,19 +98,22 @@ void loop() {
debouncers[i].update();
}
bool anyPinShorted = false;
bool anyPinFell = false;
for (unsigned int i = 0; i < numPins; i++) {
if (debouncers[i].fell()) {
anyPinShorted = true;
anyPinFell = true;
break;
}
}
if (anyPinShorted) {
if (anyPinFell) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
vTaskNotifyGiveFromISR(mqttTaskHandle, &xHigherPriorityTaskWoken);
if (xHigherPriorityTaskWoken == pdTRUE) {
portYIELD_FROM_ISR();
}
}
delay(10); // Adjust the delay as per your requirements
}