|
@@ -199,14 +199,23 @@ void HardFault_HandlerC(unsigned long *sp, unsigned long lr, unsigned long cause
|
199
|
199
|
|
200
|
200
|
// Clear cause of reset to prevent entering smoothie bootstrap
|
201
|
201
|
HAL_clear_reset_source();
|
|
202
|
+
|
202
|
203
|
// Restart watchdog
|
203
|
|
- //WDT_Restart(WDT);
|
204
|
|
- watchdog_init();
|
|
204
|
+ #if ENABLED(USE_WATCHDOG)
|
|
205
|
+ //WDT_Restart(WDT);
|
|
206
|
+ watchdog_init();
|
|
207
|
+ #endif
|
205
|
208
|
|
206
|
209
|
// Reset controller
|
207
|
210
|
NVIC_SystemReset();
|
208
|
211
|
|
209
|
|
- for (;;) watchdog_init();
|
|
212
|
+ // Nothing below here is compiled because NVIC_SystemReset loops forever
|
|
213
|
+
|
|
214
|
+ for (;;) {
|
|
215
|
+ #if ENABLED(USE_WATCHDOG)
|
|
216
|
+ watchdog_init();
|
|
217
|
+ #endif
|
|
218
|
+ }
|
210
|
219
|
}
|
211
|
220
|
|
212
|
221
|
extern "C" {
|