Scott Lahteine 3 лет назад
Родитель
Сommit
5917b5cf5c
3 измененных файлов: 4 добавлений и 4 удалений
  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 Просмотреть файл

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

+ 2
- 2
Marlin/src/HAL/shared/Delay.h Просмотреть файл

@@ -155,7 +155,7 @@
155 155
 #endif
156 156
 
157 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 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 Просмотреть файл

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

Загрузка…
Отмена
Сохранить