Wrap the watchdog in #ifdefs and disable it for now. My poor imagination

can't think of a situation where resetting the controller in the middle
of a build would be useful. Even hanging ist better :-/

The difference in program size is just 238 bytes.
This commit is contained in:
Markus Hitter 2010-10-02 15:49:50 +02:00
parent 5cb2982e57
commit f29c675fcc
3 changed files with 20 additions and 0 deletions

View File

@ -92,6 +92,11 @@ firmware build options
*/
#define MOVEBUFFER_SIZE 8
/*
FiveD on Arduino implements a watchdog, which has to be reset every 250ms or it will reboot the controller. As rebooting (and letting the GCode sending application trying to continue the build with a then different Home point) is probably even worse than just hanging, and there is no better restore code in place, this is disabled for now.
*/
// #define USE_WATCHDOG
/*
analog subsystem stuff
REFERENCE - which analog reference to use. see analog.h for choices

View File

@ -1,5 +1,8 @@
#include "watchdog.h"
#ifdef USE_WATCHDOG
#include <avr/wdt.h>
#include <avr/interrupt.h>
@ -40,3 +43,5 @@ void wd_reset() {
wd_flag &= ~1;
}
}
#endif /* USE_WATCHDOG */

View File

@ -1,6 +1,10 @@
#ifndef _WATCHDOG_H
#define _WATCHDOG_H
#include "config.h"
#ifdef USE_WATCHDOG
// initialize
void wd_init(void) __attribute__ ((cold));
@ -9,4 +13,10 @@ void wd_reset(void);
// notable lack of disable function
#else /* USE_WATCHDOG */
#define wd_init() /* empty */
#define wd_reset() /* empty */
#endif /* USE_WATCHDOG */
#endif /* _WATCHDOG_H */