From 97709f68751be4a06714d65db9b0249b92887adc Mon Sep 17 00:00:00 2001 From: nullstalgia Date: Wed, 9 Oct 2024 05:34:37 -0700 Subject: [PATCH] More EStop de-bounce fixing --- src/EStopManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EStopManager.cpp b/src/EStopManager.cpp index 2d144704..c6c3e171 100644 --- a/src/EStopManager.cpp +++ b/src/EStopManager.cpp @@ -92,7 +92,6 @@ void _estopEdgeInterrupt(void* arg) { // Debounce the EStop bool debounce = now - s_lastStateChange < k_estopDebounceTime; - s_lastStateChange = now; if (debounce) { return; } @@ -104,6 +103,8 @@ void _estopEdgeInterrupt(void* arg) { if (pressed == s_lastState) { return; } + s_lastState = pressed; + s_lastStateChange = now; bool deactivatesAtChanged = false; int64_t deactivatesAt = 0;