From d9f7ed9a3c438ae686d4f177156471d6ecdd9538 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Jul 2016 23:24:11 -0700 Subject: [PATCH] Move some macros from Marlin.h to macros.h --- Marlin/Marlin.h | 11 ----------- Marlin/macros.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index c780ff51b..a32007e3b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -22,12 +22,6 @@ #ifndef MARLIN_H #define MARLIN_H -#define FORCE_INLINE __attribute__((always_inline)) inline -/** - * Compiler warning on unused variable. - */ -#define UNUSED(x) (void) (x) - #include #include #include @@ -265,11 +259,6 @@ inline void refresh_cmd_timeout() { previous_cmd_ms = millis(); } void setPwmFrequency(uint8_t pin, int val); #endif -#ifndef CRITICAL_SECTION_START - #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); - #define CRITICAL_SECTION_END SREG = _sreg; -#endif - /** * Feedrate scaling and conversion */ diff --git a/Marlin/macros.h b/Marlin/macros.h index f8c4735eb..c228ac3ed 100644 --- a/Marlin/macros.h +++ b/Marlin/macros.h @@ -23,6 +23,17 @@ #ifndef MACROS_H #define MACROS_H +#define FORCE_INLINE __attribute__((always_inline)) inline + +// Bracket code that shouldn't be interrupted +#ifndef CRITICAL_SECTION_START + #define CRITICAL_SECTION_START unsigned char _sreg = SREG; cli(); + #define CRITICAL_SECTION_END SREG = _sreg; +#endif + +// Remove compiler warning on an unused variable +#define UNUSED(x) (void) (x) + // Macros to make a string from a macro #define STRINGIFY_(M) #M #define STRINGIFY(M) STRINGIFY_(M)