Skip to content

Commit

Permalink
Init watchdog as first action in setup, not at end of Printer::Setup,…
Browse files Browse the repository at this point in the history
… and extend delay from 4s to 8s, this should avoid to have loop restart due to watchdog
  • Loading branch information
Luc committed Dec 6, 2014
1 parent ff3fda0 commit 8e33aef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ArduinoDUE/Repetier/HAL.h
Expand Up @@ -130,7 +130,7 @@ typedef char prog_char;
#define PULLUP(IO,v) {pinMode(IO, (v!=LOW ? INPUT_PULLUP : INPUT)); }

// INTERVAL / (32Khz/128) = seconds
#define WATCHDOG_INTERVAL 512u // 4sec (~16 seconds max)
#define WATCHDOG_INTERVAL 1024u // 4sec (~16 seconds max)



Expand Down
8 changes: 4 additions & 4 deletions src/ArduinoDUE/Repetier/Printer.cpp
Expand Up @@ -614,7 +614,9 @@ uint8_t Printer::setDestinationStepsFromGCode(GCode *com)

void Printer::setup()
{
HAL::stopWatchdog();
#if FEATURE_WATCHDOG
HAL::startWatchdog();
#endif // FEATURE_WATCHDOG
#if FEATURE_CONTROLLER == CONTROLLER_VIKI
HAL::delayMilliseconds(100);
#endif // FEATURE_CONTROLLER
Expand Down Expand Up @@ -953,9 +955,7 @@ SET_INPUT(FIL_SENSOR2_PIN);
playsound(1479,150);
playsound(1174,100);
playsound(2349,150);
#if FEATURE_WATCHDOG
HAL::startWatchdog();
#endif // FEATURE_WATCHDOG

}

void Printer::defaultLoopActions()
Expand Down

0 comments on commit 8e33aef

Please sign in to comment.