state-handler: add proper way of non-blinking lcd

This commit adds a save() method for comparison of
values communicating via main and stateHandler to avoid
printing every milliseconds
This commit is contained in:
Vasily Davydov
2022-10-16 14:29:22 +03:00
parent 338bcea5ce
commit 15bf2150ca
2 changed files with 24 additions and 17 deletions

View File

@@ -103,7 +103,8 @@ private:
void SetState (state_pointer newstate);
bool current_mode;
Counter value[2] = { { 0, 100 }, { 0, 120 } };
int saved_set_value, saved_curr_value;
int saved_set_value[2] = { 0, 0 };
int saved_curr_value[2] = { 0, 0 };
LiquidCrystal *_lcd;
/** Initialization state
@@ -136,6 +137,14 @@ private:
* @param button current button
*/
void handleControlButtons (uint8_t button);
/** Save values to class' varibales
*
* @param eventValue value coming from an event
* @param counterValue value of the inner Counter
* @param mode current mode
*/
void save (int eventValue, int counterValue, size_t mode);
};
#endif /* STATE_HANDLER_H_ */