From 583c46a63fa13783eed8ed091b741ab48ebc3ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 14 Apr 2023 17:27:04 +0000 Subject: [PATCH] Simplify two fan_check_error checks There are only 3 possible values. No need to check for two of them to rule of the last value. Instead simply check for the last value only. Change in memory: Flash: -16 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 8 ++++---- Firmware/ultralcd.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 3762cc0f4..2ac9d1309 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -11135,11 +11135,11 @@ void restore_extruder_temperature_from_ram() { //! @param e_move void restore_print_from_ram_and_continue(float e_move) { - if (!saved_printing) return; - + if (!saved_printing) return; + #ifdef FANCHECK - // Do not allow resume printing if fans are still not ok - if ((fan_check_error != EFCE_OK) && (fan_check_error != EFCE_FIXED)) return; + // Do not allow resume printing if fans are still not ok + if (fan_check_error == EFCE_REPORTED) return; if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb #endif diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 825e7e778..e811235d5 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -5283,7 +5283,7 @@ static void lcd_main_menu() // only allow resuming if hardware errors (temperature or fan) are cleared if(!get_temp_error() #ifdef FANCHECK - && ((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK)) + && fan_check_error != EFCE_REPORTED #endif //FANCHECK ) { if (saved_printing) {