Fix the WATCHPERIOD implementation. It did not work correctly in a multi extruder setup, it did not work after 32 seconds after startup (int16 used as millies timestamp). And it did not work if you gave an M104 or M109 when the target was already around the target setpoint. So on average, it did not work at all. The new implementation should be robust in detecting a failure to heat up.
// This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
// This waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
// If the temperature has not increased at the end of that period, the target temperature is set to zero.
// If the temperature has not increased at the end of that period, the target temperature is set to zero.
// It can be reset with another M104/M109
// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
//#define WATCHPERIOD 20000 //20 seconds
// differ by at least 2x WATCH_TEMP_INCREASE
//#define WATCH_TEMP_PERIOD 20000 //20 seconds
//#define WATCH_TEMP_INCREASE 10 //Heat up at least 10 degree in 20 seconds
// Wait for Cooldown
// Wait for Cooldown
// This defines if the M109 call should not block if it is cooling down.
// This defines if the M109 call should not block if it is cooling down.
@ -199,7 +201,7 @@
//#define USE_WATCHDOG
//#define USE_WATCHDOG
#ifdef USE_WATCHDOG
#ifdef USE_WATCHDOG
// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
// However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.