From 41a40ca22fbb9c7996785a690ad44d207d1ec230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Bl=C3=A1ha?= Date: Wed, 30 Jun 2021 15:55:15 +0200 Subject: [PATCH] fix: self check wait after error, heater test for CW1S (need to be fixed) --- src/states.cpp | 4 ++-- src/states_items.cpp | 18 +++++++++++++++--- src/states_items.h | 3 ++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/states.cpp b/src/states.cpp index 1466f24..9218f4c 100644 --- a/src/states.cpp +++ b/src/states.cpp @@ -5,8 +5,8 @@ namespace States { /*** states definitions ***/ Base menu; - Confirm confirm; - Confirm error; + Confirm confirm(false); + Confirm error(true); Base washing( pgmstr_washing, STATE_OPTION_CONTROLS | STATE_OPTION_WASHING, diff --git a/src/states_items.cpp b/src/states_items.cpp index 3a5f261..ff57b21 100644 --- a/src/states_items.cpp +++ b/src/states_items.cpp @@ -260,8 +260,8 @@ namespace States { // States::Confirm - Confirm::Confirm() : - Base(pgmstr_emptystr, STATE_OPTION_SHORT_CANCEL), quit(false) + Confirm::Confirm(bool force_wait) : + Base(pgmstr_emptystr, STATE_OPTION_SHORT_CANCEL), force_wait(force_wait), quit(false) {} void Confirm::start() { @@ -269,7 +269,11 @@ namespace States { quit = true; us_last = 1; // beep const char* text2 = pgmstr_emptystr; - switch(config.finish_beep_mode) { + uint8_t mode = config.finish_beep_mode; + if (force_wait) { + mode = 2; + } + switch(mode) { case 2: quit = false; text2 = pgmstr_press2continue; @@ -532,10 +536,13 @@ namespace States { return &error; } uint16_t seconds = timer.getCurrentTimeInSeconds() - 1; +#ifdef CW1S + // TODO this is not working on CW1S if (!seconds && old_chamb_temp + HEATER_TEST_GAIN > hw.chamber_temp_celsius) { error.new_text(pgmstr_heater_failure, pgmstr_nopower_error); return &error; } +#endif if (seconds != old_seconds) { old_seconds = seconds; draw = true; @@ -546,8 +553,13 @@ namespace States { bool Test_heater::get_info2(char* buffer, uint8_t size) { if (draw) { buffer_init(buffer, size); +#ifdef CW1S + print_P(pgmstr_fan1); + print(hw.fan_rpm[0]); +#else print_P(pgmstr_fan3); print(hw.fan_rpm[2]); +#endif get_position()[0] = char(0); draw = false; return true; diff --git a/src/states_items.h b/src/states_items.h index 201eff3..e752350 100644 --- a/src/states_items.h +++ b/src/states_items.h @@ -83,10 +83,11 @@ namespace States { // States::Confirm class Confirm : public Base { public: - Confirm(); + Confirm(bool force_wait); void start(); Base* loop(); private: + bool force_wait; bool quit; };