From 641cdefe583e7c3fa88cc5739cda3843c0e9354a Mon Sep 17 00:00:00 2001 From: Evgenii Meshcheriakov Date: Thu, 27 Oct 2022 20:23:34 +0300 Subject: [PATCH] state-handler: fix: reset of integral value after error state. Display wiht 3 digits --- esp-vent-main/inc/common_control_values.h | 1 - esp-vent-main/src/StateHandler/StateHandler.cpp | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/esp-vent-main/inc/common_control_values.h b/esp-vent-main/inc/common_control_values.h index c23ef7b..6f64ff0 100644 --- a/esp-vent-main/inc/common_control_values.h +++ b/esp-vent-main/inc/common_control_values.h @@ -21,7 +21,6 @@ enum _global_values TIMER_GLOBAL_TIMEOUT = 120000, TIMER_SENSORS_TIMEOUT = 5000, TIMER_PRESSURE_TIMEOUT = 150, - TIMER_ERROR_VALUE = -255, }; #endif /* COMMON_CONTROL_VALUES_H_ */ diff --git a/esp-vent-main/src/StateHandler/StateHandler.cpp b/esp-vent-main/src/StateHandler/StateHandler.cpp index f21db3f..23a214f 100644 --- a/esp-vent-main/src/StateHandler/StateHandler.cpp +++ b/esp-vent-main/src/StateHandler/StateHandler.cpp @@ -34,21 +34,21 @@ StateHandler::displaySet (size_t mode) switch (mode) { case MANUAL: - snprintf (line_up, LCD_SIZE, "SPEED: %02d (M)", + snprintf (line_up, LCD_SIZE, "SPEED: %03d (M)", saved_set_value[current_mode]); - snprintf (line_down, LCD_SIZE, "PRESSURE: %02dPa", + snprintf (line_down, LCD_SIZE, "PRESSURE: %03dPa", saved_curr_value[current_mode]); break; case AUTO: - snprintf (line_up, LCD_SIZE, "P.SET: %02dPa (A)", + snprintf (line_up, LCD_SIZE, "P.SET: %03dPa(A)", saved_set_value[current_mode]); - snprintf (line_down, LCD_SIZE, "P.CURR: %02dPa", + snprintf (line_down, LCD_SIZE, "P.CURR: %03dPa", saved_curr_value[current_mode]); break; case SENSORS: - snprintf (line_up, LCD_SIZE, "PRE:%02d TEM:%02d", + snprintf (line_up, LCD_SIZE, "PRE:%03d TEM:%02d", sensors_data[PRESSUREDAT], sensors_data[TEMPERATURE]); - snprintf (line_down, LCD_SIZE, "HUM:%02d CO2:%02d", + snprintf (line_down, LCD_SIZE, "HUM:%02d CO2:%03d", sensors_data[HUMIDITY], sensors_data[CO2]); break; case ERROR_TIMEOUT: @@ -245,8 +245,8 @@ StateHandler::handleTickValue (int value) if (error_timer > TIMER_GLOBAL_TIMEOUT && task_is_pending) { this->fan_speed.setInit (0); - this->_propeller->spin (0); this->value[(current_mode)].setInit (0); + integral = 0; saveSetAndDisplay (AUTO); displaySet (ERROR_TIMEOUT); state_timer->Sleep (2000);