From 7245c760941ac35dce4c23a54d4914968107a6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 21 Jan 2023 21:02:25 +0000 Subject: [PATCH] Fix an issue where Altfan Override setting in EEPROM is not respected at boot-up --- Firmware/Marlin_main.cpp | 10 +++++----- Firmware/fancheck.cpp | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 187e880e2..89e77153f 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -1257,12 +1257,12 @@ void setup() #ifdef EXTRUDER_ALTFAN_DETECT if (eeprom_read_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE) == EEPROM_EMPTY_VALUE) { eeprom_update_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE, 0); - SERIAL_ECHORPGM(_n("Hotend fan type: ")); - if (extruder_altfan_detect()) - SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); - else - SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); } + SERIAL_ECHORPGM(_n("Hotend fan type: ")); + if (extruder_altfan_detect()) + SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); + else + SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); #endif //EXTRUDER_ALTFAN_DETECT plan_init(); // Initialize planner; diff --git a/Firmware/fancheck.cpp b/Firmware/fancheck.cpp index 9cf103179..af326b748 100755 --- a/Firmware/fancheck.cpp +++ b/Firmware/fancheck.cpp @@ -164,6 +164,9 @@ bool extruder_altfan_detect() { // override isAltFan setting for detection altfanStatus.isAltfan = 0; + + // During initialisation, use the EEPROM value + altfanStatus.altfanOverride = eeprom_read_byte((uint8_t *)EEPROM_ALTFAN_OVERRIDE); setExtruderAutoFanState(3); SET_INPUT(TACH_0);