bug fix
This commit is contained in:
parent
22a25532ba
commit
03c938c1fe
2 changed files with 8 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue