From 4a877cc1b593c7301ddfafbaf126cce877018cc4 Mon Sep 17 00:00:00 2001 From: Bernator Date: Thu, 12 Sep 2019 23:23:15 +0200 Subject: [PATCH] Debounce prog button (#34) * bugfix, print not allowed in constructor * Update tpuart_data_link_layer.cpp - start confirm timout only after last byte was sent - increase BYTE_TIMEOUT * debounce progbutton --- src/knx_facade.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/knx_facade.cpp b/src/knx_facade.cpp index 82c4473..2b6d1cb 100644 --- a/src/knx_facade.cpp +++ b/src/knx_facade.cpp @@ -14,9 +14,15 @@ KnxFacade knx; #define ICACHE_RAM_ATTR #endif +#ifndef __linux__ +uint32_t lastpressed=0; +#endif ICACHE_RAM_ATTR void buttonUp() { #ifndef __linux__ - knx._toogleProgMode = true; + if (millis() - lastpressed > 200){ + knx._toogleProgMode = true; + lastpressed = millis(); + } #endif -} \ No newline at end of file +}