From 09fee4e64de07bcb1b785afc3e0fd4a6d8f92286 Mon Sep 17 00:00:00 2001 From: DRracer Date: Fri, 31 May 2019 11:30:30 +0200 Subject: [PATCH] remove fan error simulation automaton --- Firmware/temperature.cpp | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 1b60a0230..08ff40dbe 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -489,38 +489,6 @@ void countFanSpeed() fan_edge_counter[1] = 0; } -//#define SIMULATE_FAN_ERRORS -#ifdef SIMULATE_FAN_ERRORS -struct FanSpeedErrorSimulator { - unsigned long lastMillis = 0; - bool state = false; // zatim mam 0 - klid, 1 reportuju chybu - //! @return pocet simulovanych chyb - inline uint8_t step(){ - unsigned long ms = _millis(); - switch(state){ - case false: - if( (ms - lastMillis) > 120000UL ){ // funkcni ventilator chci 2 minuty - state = true; - lastMillis = ms; - SERIAL_ECHOLNPGM("SIM Fan error"); - } - break; - case true: - if( (ms - lastMillis) > 20000UL ){ // vypadek ventilatoru chci uz 20s, - //abych stihl udelat pokusnej resume print, kdyz jeste jsou rozbity vetraky - state = false; - lastMillis = ms; - SERIAL_ECHOLNPGM("SIM Fan ok"); - } - break; - } - return state ? 20 : 0; - } -}; - -static FanSpeedErrorSimulator fanSpeedErrorSimulator; -#endif - void checkFanSpeed() { uint8_t max_print_fan_errors = 0; @@ -544,10 +512,6 @@ void checkFanSpeed() else fan_speed_errors[1] = 0; #endif -#ifdef SIMULATE_FAN_ERRORS - fan_speed_errors[0] = fanSpeedErrorSimulator.step(); -#endif - // drop the fan_check_error flag when both fans are ok if( fan_speed_errors[0] == 0 && fan_speed_errors[1] == 0 && fan_check_error == EFCE_REPORTED){ // we may even send some info to the LCD from here