Explorar el Código

Fix LPC build with USE_WATCHDOG off

Scott Lahteine hace 4 años
padre
commit
4937519d51
Se han modificado 1 ficheros con 12 adiciones y 3 borrados
  1. 12
    3
      Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp

+ 12
- 3
Marlin/src/HAL/HAL_LPC1768/DebugMonitor.cpp Ver fichero

@@ -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" {

Loading…
Cancelar
Guardar