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
 
35
 
36
 #include "MarlinConfig.h"
36
 #include "MarlinConfig.h"
37
 
37
 
38
-#include "fastio.h"
39
-
40
 #include "enum.h"
38
 #include "enum.h"
39
+#include "types.h"
40
+#include "fastio.h"
41
 #include "utility.h"
41
 #include "utility.h"
42
 
42
 
43
-typedef unsigned long millis_t;
44
-
45
 #ifdef USBCON
43
 #ifdef USBCON
46
   #include "HardwareSerial.h"
44
   #include "HardwareSerial.h"
47
   #if ENABLED(BLUETOOTH)
45
   #if ENABLED(BLUETOOTH)

+ 2
- 1
Marlin/utility.cpp View File

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

+ 6
- 1
Marlin/utility.h View File

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