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
 #ifndef MARLIN_H
22
 #ifndef MARLIN_H
23
 #define MARLIN_H
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
 #include <math.h>
25
 #include <math.h>
32
 #include <stdio.h>
26
 #include <stdio.h>
33
 #include <stdlib.h>
27
 #include <stdlib.h>
265
   void setPwmFrequency(uint8_t pin, int val);
259
   void setPwmFrequency(uint8_t pin, int val);
266
 #endif
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
  * Feedrate scaling and conversion
263
  * Feedrate scaling and conversion
275
  */
264
  */

+ 11
- 0
Marlin/macros.h View File

23
 #ifndef MACROS_H
23
 #ifndef MACROS_H
24
 #define MACROS_H
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
 // Macros to make a string from a macro
37
 // Macros to make a string from a macro
27
 #define STRINGIFY_(M) #M
38
 #define STRINGIFY_(M) #M
28
 #define STRINGIFY(M) STRINGIFY_(M)
39
 #define STRINGIFY(M) STRINGIFY_(M)

Loading…
Cancel
Save