Fix an issue where Altfan Override setting in EEPROM is not respected at boot-up

This commit is contained in:
Guðni Már Gilbert 2023-01-21 21:02:25 +00:00
parent f7b807e3cc
commit 7245c76094
2 changed files with 8 additions and 5 deletions

View File

@ -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;

View File

@ -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);