Open AndreasStgm opened 8 months ago
This was caused because the button was being released faster than the specified debounceTime. This caused the button to be stuck in the PRESSED state when it was actually RELEASED. Since the ISR is fired on a change of the input pin, the next edge that it would detect would be the rising edge of the next press of the button. It then immediately goes to the single mode because the time between the two presses was longer than the longPressTime. On the release of the button it then gets put back into the PRESSED mode again.
This is not properly fixed yet, but changes were made so that a press of the reset switch will also reset both button states back to RELEASED.
sendButtonState = ButtonState::RELEASED;
I think this issue can be fixed in multiple ways:
Method 1 is probably an easier solution to fix it now, but method 2 should be implemented eventually to make it more user-friendly.
I think this is an issue with the button presses being handled incorrectly (their state not properly being reset). Because when it is stuck a press of the reset button does not fix it.