From 94518925f8b76d1a7b9da3f6578424c9d136c135 Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Mon, 24 Oct 2022 17:04:32 +0300 Subject: [PATCH] switch-controller: modify sw behaviour --- esp-vent-main/src/SwitchController.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/esp-vent-main/src/SwitchController.cpp b/esp-vent-main/src/SwitchController.cpp index b808e90..a74c204 100644 --- a/esp-vent-main/src/SwitchController.cpp +++ b/esp-vent-main/src/SwitchController.cpp @@ -24,17 +24,15 @@ SwitchController::~SwitchController () void SwitchController::listen () { - /** Button is pressed for the first time*/ + /** Button is pressed for the first time */ if (b->read () && !b_pressed) { + h->HandleState (Event (Event::eKey, b_mode)); b_pressed = true; } - /** Button is released before 2 seconds*/ + /** Button is released */ if (!b->read () && b_pressed) { - h->HandleState (Event (Event::eKey, b_mode)); b_pressed = false; } - } -