Browse Source

Fixes safe_delay() to be fully compatible with delay()

João Brázio 8 years ago
parent
commit
226e74a438
3 changed files with 10 additions and 6 deletions
  1. 2
    4
      Marlin/Marlin.h
  2. 2
    1
      Marlin/utility.cpp
  3. 6
    1
      Marlin/utility.h

+ 2
- 4
Marlin/Marlin.h View File

@@ -35,13 +35,11 @@
35 35
 
36 36
 #include "MarlinConfig.h"
37 37
 
38
-#include "fastio.h"
39
-
40 38
 #include "enum.h"
39
+#include "types.h"
40
+#include "fastio.h"
41 41
 #include "utility.h"
42 42
 
43
-typedef unsigned long millis_t;
44
-
45 43
 #ifdef USBCON
46 44
   #include "HardwareSerial.h"
47 45
   #if ENABLED(BLUETOOTH)

+ 2
- 1
Marlin/utility.cpp View File

@@ -21,9 +21,10 @@
21 21
  */
22 22
 
23 23
 #include "Marlin.h"
24
+#include "utility.h"
24 25
 #include "temperature.h"
25 26
 
26
-void safe_delay(uint16_t ms) {
27
+void safe_delay(millis_t ms) {
27 28
   while (ms > 50) {
28 29
     ms -= 50;
29 30
     delay(50);

+ 6
- 1
Marlin/utility.h View File

@@ -20,4 +20,9 @@
20 20
  *
21 21
  */
22 22
 
23
-void safe_delay(uint16_t ms);
23
+#ifndef __UTILITY_H__
24
+#define __UTILITY_H__
25
+
26
+void safe_delay(millis_t ms);
27
+
28
+#endif

Loading…
Cancel
Save