Browse Source

Fix warning in gcode_D

Scott Lahteine 4 years ago
parent
commit
5917b5cf5c
3 changed files with 4 additions and 4 deletions
  1. 1
    1
      Marlin/src/HAL/LINUX/HAL.h
  2. 2
    2
      Marlin/src/HAL/shared/Delay.h
  3. 1
    1
      Marlin/src/gcode/gcode_d.cpp

+ 1
- 1
Marlin/src/HAL/LINUX/HAL.h View File

23
 
23
 
24
 #define CPU_32_BIT
24
 #define CPU_32_BIT
25
 
25
 
26
-#define F_CPU 100000000
26
+#define F_CPU 100000000UL
27
 #define SystemCoreClock F_CPU
27
 #define SystemCoreClock F_CPU
28
 #include <iostream>
28
 #include <iostream>
29
 #include <stdint.h>
29
 #include <stdint.h>

+ 2
- 2
Marlin/src/HAL/shared/Delay.h View File

155
 #endif
155
 #endif
156
 
156
 
157
 // Delay in nanoseconds
157
 // Delay in nanoseconds
158
-#define DELAY_NS(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) / 1000UL )
158
+#define DELAY_NS(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL) / 1000UL)
159
 
159
 
160
 // Delay in microseconds
160
 // Delay in microseconds
161
-#define DELAY_US(x) DELAY_CYCLES( (x) * (F_CPU / 1000000UL) )
161
+#define DELAY_US(x) DELAY_CYCLES((x) * ((F_CPU) / 1000000UL))

+ 1
- 1
Marlin/src/gcode/gcode_d.cpp View File

181
         // Use a low-level delay that does not rely on interrupts to function
181
         // Use a low-level delay that does not rely on interrupts to function
182
         // Do not spin forever, to avoid thermal risks if heaters are enabled and
182
         // Do not spin forever, to avoid thermal risks if heaters are enabled and
183
         // watchdog does not work.
183
         // watchdog does not work.
184
-        DELAY_US(10000000);
184
+        for (int i = 10000; i--;) DELAY_US(1000UL);
185
         ENABLE_ISRS();
185
         ENABLE_ISRS();
186
         SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset.");
186
         SERIAL_ECHOLNPGM("FAILURE: Watchdog did not trigger board reset.");
187
       }
187
       }

Loading…
Cancel
Save