From e6a7abf2c1a3991b3b18815a92df3c54f6de5346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 6 Aug 2021 15:08:46 +0000 Subject: [PATCH] Change temp_runaway_timer from float to uint32_t Saves 32 bytes of flash Also change temp_runaway_error_counter from int to uint16_t to be specific --- Firmware/temperature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 7e48575a..abeaa264 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -222,8 +222,8 @@ enum TempRunawayStates : uint8_t #if (defined (TEMP_RUNAWAY_BED_HYSTERESIS) && TEMP_RUNAWAY_BED_TIMEOUT > 0) || (defined (TEMP_RUNAWAY_EXTRUDER_HYSTERESIS) && TEMP_RUNAWAY_EXTRUDER_TIMEOUT > 0) static uint8_t temp_runaway_status[4]; static float temp_runaway_target[4]; -static float temp_runaway_timer[4]; -static int temp_runaway_error_counter[4]; +static uint32_t temp_runaway_timer[4]; +static uint16_t temp_runaway_error_counter[4]; static void temp_runaway_check(int _heater_id, float _target_temperature, float _current_temperature, float _output, bool _isbed); static void temp_runaway_stop(bool isPreheat, bool isBed); @@ -1244,7 +1244,7 @@ void temp_runaway_check(int _heater_id, float _target_temperature, float _curren { float __delta; float __hysteresis = 0; - int __timeout = 0; + uint16_t __timeout = 0; bool temp_runaway_check_active = false; static float __preheat_start[2] = { 0,0}; //currently just bed and one extruder static int __preheat_counter[2] = { 0,0};