diff --git a/Marlin/src/HAL/HAL_LPC1768/HAL.h b/Marlin/src/HAL/HAL_LPC1768/HAL.h index ce3828cd51..26e273e919 100644 --- a/Marlin/src/HAL/HAL_LPC1768/HAL.h +++ b/Marlin/src/HAL/HAL_LPC1768/HAL.h @@ -146,11 +146,6 @@ using FilteredADC = LPC176x::ADC; #define HAL_READ_ADC() FilteredADC::get_result() #define HAL_ADC_READY() FilteredADC::finished_conversion() -// A grace period to allow ADC readings to stabilize, preventing false alarms -#ifndef THERMAL_PROTECTION_GRACE_PERIOD - #define THERMAL_PROTECTION_GRACE_PERIOD 1000 -#endif - // Parse a G-code word into a pin index int16_t PARSED_PIN_INDEX(const char code, const int16_t dval); // P0.6 thru P0.9 are for the onboard SD card diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 8e2aa56a8f..e526919b4d 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -1137,6 +1137,8 @@ void loop() { for (;;) { + idle(); // Do an idle first so boot is slightly faster + #if ENABLED(SDSUPPORT) card.checkautostart(); @@ -1168,6 +1170,5 @@ void loop() { if (queue.length < BUFSIZE) queue.get_available_commands(); queue.advance(); endstops.event_handler(); - idle(); } } diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 812a4739b6..518ed923a5 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -82,10 +82,6 @@ #endif #endif -#ifndef THERMAL_PROTECTION_GRACE_PERIOD - #define THERMAL_PROTECTION_GRACE_PERIOD 0 // No grace period needed on well-behaved boards -#endif - Temperature thermalManager; /** @@ -1036,18 +1032,9 @@ void Temperature::manage_heater() { millis_t ms = millis(); #endif - #if HAS_THERMAL_PROTECTION - #if THERMAL_PROTECTION_GRACE_PERIOD > 0 - static millis_t grace_period = ms + THERMAL_PROTECTION_GRACE_PERIOD; - if (ELAPSED(ms, grace_period)) grace_period = 0UL; - #else - static constexpr millis_t grace_period = 0UL; - #endif - #endif - HOTEND_LOOP() { #if ENABLED(THERMAL_PROTECTION_HOTENDS) - if (!grace_period && degHotend(e) > temp_range[e].maxtemp) + if (degHotend(e) > temp_range[e].maxtemp) _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e)); #endif @@ -1103,7 +1090,7 @@ void Temperature::manage_heater() { #if HAS_HEATED_BED #if ENABLED(THERMAL_PROTECTION_BED) - if (!grace_period && degBed() > BED_MAXTEMP) + if (degBed() > BED_MAXTEMP) _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_BED)); #endif @@ -1181,7 +1168,7 @@ void Temperature::manage_heater() { #endif #if ENABLED(THERMAL_PROTECTION_CHAMBER) - if (!grace_period && degChamber() > CHAMBER_MAXTEMP) + if (degChamber() > CHAMBER_MAXTEMP) _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_CHAMBER)); #endif @@ -2224,14 +2211,6 @@ void Temperature::set_current_temp_raw() { void Temperature::readings_ready() { - #if THERMAL_PROTECTION_GRACE_PERIOD > 0 - const millis_t ms = millis(); - static millis_t grace_period = ms + THERMAL_PROTECTION_GRACE_PERIOD; // NOTE: millis() == 0 on reset - if (ELAPSED(ms, grace_period)) grace_period = 0; - #else - static constexpr millis_t grace_period = 0; - #endif - // Update the raw values if they've been read. Else we could be updating them during reading. if (!temp_meas_ready) set_current_temp_raw(); @@ -2250,6 +2229,9 @@ void Temperature::readings_ready() { temp_chamber.acc = 0; #endif + // Give ADC temperature readings time to settle at boot-up before testing + if (grace_period) return; + static constexpr int8_t temp_dir[] = { #if ENABLED(HEATER_0_USES_MAX6675) 0 @@ -2277,9 +2259,6 @@ void Temperature::readings_ready() { #endif // HOTENDS > 1 }; - // Give ADC temperature readings time to settle at boot-up before testing - if (grace_period) return; - for (uint8_t e = 0; e < COUNT(temp_dir); e++) { const int8_t tdir = temp_dir[e]; if (tdir) {