Browse Source

Move some macros from Marlin.h to macros.h

Scott Lahteine 8 years ago
parent
commit
d9f7ed9a3c
2 changed files with 11 additions and 11 deletions
  1. 0
    11
      Marlin/Marlin.h
  2. 11
    0
      Marlin/macros.h

+ 0
- 11
Marlin/Marlin.h View File

@@ -22,12 +22,6 @@
22 22
 #ifndef MARLIN_H
23 23
 #define MARLIN_H
24 24
 
25
-#define  FORCE_INLINE __attribute__((always_inline)) inline
26
-/**
27
- * Compiler warning on unused variable.
28
- */
29
-#define UNUSED(x) (void) (x)
30
-
31 25
 #include <math.h>
32 26
 #include <stdio.h>
33 27
 #include <stdlib.h>
@@ -265,11 +259,6 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); }
265 259
   void setPwmFrequency(uint8_t pin, int val);
266 260
 #endif
267 261
 
268
-#ifndef CRITICAL_SECTION_START
269
-  #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
270
-  #define CRITICAL_SECTION_END    SREG = _sreg;
271
-#endif
272
-
273 262
 /**
274 263
  * Feedrate scaling and conversion
275 264
  */

+ 11
- 0
Marlin/macros.h View File

@@ -23,6 +23,17 @@
23 23
 #ifndef MACROS_H
24 24
 #define MACROS_H
25 25
 
26
+#define FORCE_INLINE __attribute__((always_inline)) inline
27
+
28
+// Bracket code that shouldn't be interrupted
29
+#ifndef CRITICAL_SECTION_START
30
+  #define CRITICAL_SECTION_START  unsigned char _sreg = SREG; cli();
31
+  #define CRITICAL_SECTION_END    SREG = _sreg;
32
+#endif
33
+
34
+// Remove compiler warning on an unused variable
35
+#define UNUSED(x) (void) (x)
36
+
26 37
 // Macros to make a string from a macro
27 38
 #define STRINGIFY_(M) #M
28 39
 #define STRINGIFY(M) STRINGIFY_(M)

Loading…
Cancel
Save