Skip to content

Enable USE_WATCHDOG by default#2986

Merged
thinkyhead merged 1 commit intoMarlinFirmware:RCBugFixfrom
thinkyhead:enable_watchdog
Mar 2, 2016
Merged

Enable USE_WATCHDOG by default#2986
thinkyhead merged 1 commit intoMarlinFirmware:RCBugFixfrom
thinkyhead:enable_watchdog

Conversation

@thinkyhead
Copy link
Member

As suggested by @daid and others, make thermal protection as safe as possible by default.

@thinkyhead thinkyhead force-pushed the enable_watchdog branch 2 times, most recently from 5018154 to c171873 Compare February 10, 2016 00:59
@thinkyhead thinkyhead changed the title Enable watchdog Enable USE_WATCHDOG by default Feb 10, 2016
@valdemar4eg
Copy link

Dear all,
Could somebody, please, explain in more details how does WATCHDOG works on geeetech gt2560 (mix on Andruino Mega 2560)? My printer quite often crushes in the middle of the print with all heaters on. So I would like to use all safety features available on Marlin.

These comments in the code are not clear to me.
#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.
// 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.
//#define WATCHDOG_RESET_MANUAL
#endif

Thank you in advance

@daid
Copy link
Contributor

daid commented Feb 26, 2016

@valdemar4eg Pretty simple, you only use USE_WATCHDOG do not use WATCHDOG_RESET_MANUAL. That should protect you from leaving the heaters on, IF it is the firmware that is crashing.

WATCHDOG_RESET_MANUAL is a pretty bad feature and shouldn't be used. I'm the one that added those warning comments.

@valdemar4eg
Copy link

Dear Daid,
thanks for the reply. If I will uncomment #define USE_WATCHDOG device will hang in the loop but will switch off all outputs and will work normally only if I will reset the power supply. Am I right?

@daid
Copy link
Contributor

daid commented Feb 26, 2016

@valdemar4eg yes (or it might reboot, depends on which bootloader they put into the chip)

@thinkyhead
Copy link
Member Author

Does anyone want to vote against this PR? I originally submitted this thinking it would be extra-helpful for thermal protection, but I realized later actually this is "hang" protection — still pretty helpful as a safety feature, but indirectly. So, does anyone think this definitely should not be enabled by default for any reason?

@CONSULitAS
Copy link
Contributor

👍
Safety features have to be enabled by default. Everything else would be grossly negligent (careless in sense of law)!

If somebody decides that this doesn't fit for his printer, he can disable it, but he has to think about the consequences and to care for safety on his own.

So we should add a standard warning comment to this and thermal protection like:

// SAFETY FEATURE! Think twice before deactivation and be careful to avoid damage to persons and property.

@thinkyhead
Copy link
Member Author

@CONSULitAS Your passion has swayed me to your position.

thinkyhead added a commit that referenced this pull request Mar 2, 2016
@thinkyhead thinkyhead merged commit 9eb4ace into MarlinFirmware:RCBugFix Mar 2, 2016
@thinkyhead thinkyhead deleted the enable_watchdog branch March 2, 2016 13:29
@jbrazio jbrazio modified the milestone: 1.1.0 Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants