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:
parent
5cb2982e57
commit
f29c675fcc
|
|
@ -92,6 +92,11 @@ firmware build options
|
||||||
*/
|
*/
|
||||||
#define MOVEBUFFER_SIZE 8
|
#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
|
analog subsystem stuff
|
||||||
REFERENCE - which analog reference to use. see analog.h for choices
|
REFERENCE - which analog reference to use. see analog.h for choices
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
|
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
|
|
||||||
|
#ifdef USE_WATCHDOG
|
||||||
|
|
||||||
#include <avr/wdt.h>
|
#include <avr/wdt.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
|
|
@ -40,3 +43,5 @@ void wd_reset() {
|
||||||
wd_flag &= ~1;
|
wd_flag &= ~1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* USE_WATCHDOG */
|
||||||
|
|
|
||||||
10
watchdog.h
10
watchdog.h
|
|
@ -1,6 +1,10 @@
|
||||||
#ifndef _WATCHDOG_H
|
#ifndef _WATCHDOG_H
|
||||||
#define _WATCHDOG_H
|
#define _WATCHDOG_H
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifdef USE_WATCHDOG
|
||||||
|
|
||||||
// initialize
|
// initialize
|
||||||
void wd_init(void) __attribute__ ((cold));
|
void wd_init(void) __attribute__ ((cold));
|
||||||
|
|
||||||
|
|
@ -9,4 +13,10 @@ void wd_reset(void);
|
||||||
|
|
||||||
// notable lack of disable function
|
// notable lack of disable function
|
||||||
|
|
||||||
|
#else /* USE_WATCHDOG */
|
||||||
|
|
||||||
|
#define wd_init() /* empty */
|
||||||
|
#define wd_reset() /* empty */
|
||||||
|
|
||||||
|
#endif /* USE_WATCHDOG */
|
||||||
#endif /* _WATCHDOG_H */
|
#endif /* _WATCHDOG_H */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue