From 0be8c9a3f0cb34263156a3844009536856381e2b Mon Sep 17 00:00:00 2001 From: Evgenii Meshcheriakov Date: Fri, 21 Oct 2022 20:16:53 +0300 Subject: [PATCH] StateHandler: redundant code removal --- StateHandler/src/StateHandler.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/StateHandler/src/StateHandler.cpp b/StateHandler/src/StateHandler.cpp index b26ea5e..40cd323 100644 --- a/StateHandler/src/StateHandler.cpp +++ b/StateHandler/src/StateHandler.cpp @@ -114,6 +114,7 @@ StateHandler::stateManual (const Event &event) break; case Event::eKey: handleControlButtons (event.value); + this->A01->write(value[MANUAL].getCurrent() * 10); break; case Event::eTick: save (event.value, MANUAL); @@ -194,13 +195,9 @@ StateHandler::handleControlButtons (uint8_t button) { case BUTTON_CONTROL_DOWN: this->value[(current_mode) ? AUTO : MANUAL].dec (); - if(current_mode == MANUAL) - this->A01->write(value[(current_mode) ? AUTO : MANUAL].getCurrent() * 10); break; case BUTTON_CONTROL_UP: this->value[(current_mode) ? AUTO : MANUAL].inc (); - if(current_mode == MANUAL) - this->A01->write(value[(current_mode) ? AUTO : MANUAL].getCurrent() * 10); break; case BUTTON_CONTROL_TOG_MODE: current_mode = !current_mode;