Browse Source

Reorganize some core headers (#11983)

Scott Lahteine 6 years ago
parent
commit
0dedb3e139
No account linked to committer's email address

+ 2
- 2
Marlin/src/HAL/HAL_AVR/endstop_interrupts.h View File

@@ -38,9 +38,9 @@
38 38
 #ifndef _ENDSTOP_INTERRUPTS_H_
39 39
 #define _ENDSTOP_INTERRUPTS_H_
40 40
 
41
-#include "../../core/macros.h"
42
-#include <stdint.h>
43 41
 #include "../../module/endstops.h"
42
+#include "../../inc/MarlinConfig.h"
43
+#include <stdint.h>
44 44
 
45 45
 // One ISR for all EXT-Interrupts
46 46
 void endstop_ISR(void) { endstops.update(); }

+ 2
- 2
Marlin/src/HAL/HAL_DUE/DebugMonitor_Due.cpp View File

@@ -22,13 +22,13 @@
22 22
 
23 23
 #ifdef ARDUINO_ARCH_SAM
24 24
 
25
-#include "../../core/macros.h"
26 25
 #include "../../core/serial.h"
27
-#include <stdarg.h>
28 26
 
29 27
 #include "../shared/backtrace/unwinder.h"
30 28
 #include "../shared/backtrace/unwmemaccess.h"
31 29
 
30
+#include <stdarg.h>
31
+
32 32
 // Debug monitor that dumps to the Programming port all status when
33 33
 // an exception or WDT timeout happens - And then resets the board
34 34
 

+ 1
- 1
Marlin/src/HAL/HAL_DUE/usb/compiler.h View File

@@ -105,7 +105,7 @@
105 105
  * \brief Marking \a v as a unused parameter or value.
106 106
  */
107 107
 #ifndef UNUSED
108
-#define UNUSED(x) (void) (x)
108
+  #define UNUSED(x) ((void)(x))
109 109
 #endif
110 110
 
111 111
 /**

+ 2
- 4
Marlin/src/HAL/HAL_DUE/usb/conf_usb.h View File

@@ -47,12 +47,10 @@
47 47
 #ifndef _CONF_USB_H_
48 48
 #define _CONF_USB_H_
49 49
 
50
-#undef UNUSED                           /* To avoid a macro clash as macros.h already defines it */
51
-#include "../../../core/macros.h"       /* For ENABLED()/DISABLED() */
52
-#include "../../../../Configuration.h"  /* For CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */
50
+#include "../../../core/macros.h"       /* For ENABLED, DISABLED, MIN, MAX */
51
+#include "../../../../Configuration.h"  /* For SDSUPPORT and CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */
53 52
 #include "compiler.h"
54 53
 
55
-
56 54
 /**
57 55
  * USB Device Configuration
58 56
  * @{

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/spi_pins.h View File

@@ -23,7 +23,7 @@
23 23
 #ifndef SPI_PINS_LPC1768_H
24 24
 #define SPI_PINS_LPC1768_H
25 25
 
26
-#include "src/core/macros.h"
26
+#include "../../inc/MarlinConfigPre.h"
27 27
 
28 28
 #if ENABLED(SDSUPPORT) && ENABLED(DOGLCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
29 29
   #define LPC_SOFTWARE_SPI  // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently

+ 113
- 0
Marlin/src/core/config.h View File

@@ -0,0 +1,113 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+// Macros to make a string from a macro
25
+#define STRINGIFY_(M) #M
26
+#define STRINGIFY(M) STRINGIFY_(M)
27
+
28
+// Macros for bit masks
29
+#undef _BV
30
+#define _BV(n) (1<<(n))
31
+#define TEST(n,b) !!((n)&_BV(b))
32
+#define SBI(n,b) (n |= _BV(b))
33
+#define CBI(n,b) (n &= ~_BV(b))
34
+
35
+#define _BV32(b) (1UL << (b))
36
+#define TEST32(n,b) !!((n)&_BV32(b))
37
+#define SBI32(n,b) (n |= _BV32(b))
38
+#define CBI32(n,b) (n &= ~_BV32(b))
39
+
40
+// Macros for maths shortcuts
41
+#undef M_PI
42
+#define M_PI 3.14159265358979323846f
43
+
44
+// Macros to support option testing
45
+#define _CAT(a, ...) a ## __VA_ARGS__
46
+#define SWITCH_ENABLED_false 0
47
+#define SWITCH_ENABLED_true  1
48
+#define SWITCH_ENABLED_0     0
49
+#define SWITCH_ENABLED_1     1
50
+#define SWITCH_ENABLED_0x0   0
51
+#define SWITCH_ENABLED_0x1   1
52
+#define SWITCH_ENABLED_      1
53
+#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
54
+#define DISABLED(b) !ENABLED(b)
55
+
56
+#define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H))
57
+#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1)))
58
+
59
+// Macros for initializing arrays
60
+#define ARRAY_6(v1, v2, v3, v4, v5, v6, ...) { v1, v2, v3, v4, v5, v6 }
61
+#define ARRAY_5(v1, v2, v3, v4, v5, ...)     { v1, v2, v3, v4, v5 }
62
+#define ARRAY_4(v1, v2, v3, v4, ...)         { v1, v2, v3, v4 }
63
+#define ARRAY_3(v1, v2, v3, ...)             { v1, v2, v3 }
64
+#define ARRAY_2(v1, v2, ...)                 { v1, v2 }
65
+#define ARRAY_1(v1, ...)                     { v1 }
66
+#define _ARRAY_N(N, ...) ARRAY_ ##N(__VA_ARGS__)
67
+#define ARRAY_N(N, ...) _ARRAY_N(N, __VA_ARGS__)
68
+
69
+// Pins
70
+#define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0)
71
+
72
+// Increment/Decrement helper macros
73
+#define INC_0 1
74
+#define INC_1 2
75
+#define INC_2 3
76
+#define INC_3 4
77
+#define INC_4 5
78
+#define INC_5 6
79
+#define INC_6 7
80
+#define INC_7 8
81
+#define INC_8 9
82
+#define _INCREMENT(n) INC_ ##n
83
+#define INCREMENT(n) _INCREMENT(n)
84
+
85
+#define DEC_1 0
86
+#define DEC_2 1
87
+#define DEC_3 2
88
+#define DEC_4 3
89
+#define DEC_5 4
90
+#define DEC_6 5
91
+#define DEC_7 6
92
+#define DEC_8 7
93
+#define DEC_9 8
94
+#define DECREMENT_(n) DEC_ ##n
95
+#define DECREMENT(n) DECREMENT_(n)
96
+
97
+// Endstop plug identifiers
98
+#define _XMIN_ 100
99
+#define _YMIN_ 200
100
+#define _ZMIN_ 300
101
+#define _XMAX_ 101
102
+#define _YMAX_ 201
103
+#define _ZMAX_ 301
104
+
105
+// GCC properties for HAL headers
106
+#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
107
+#define  FORCE_INLINE  __attribute__((always_inline)) inline
108
+#define _UNUSED      __attribute__((unused))
109
+#define _O0          __attribute__((optimize("O0")))
110
+#define _Os          __attribute__((optimize("Os")))
111
+#define _O1          __attribute__((optimize("O1")))
112
+#define _O2          __attribute__((optimize("O2")))
113
+#define _O3          __attribute__((optimize("O3")))

+ 57
- 107
Marlin/src/core/macros.h View File

@@ -19,10 +19,9 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
-
23 22
 #pragma once
24 23
 
25
-#include "minmax.h"
24
+#include "config.h"
26 25
 
27 26
 #define NUM_AXIS 4
28 27
 #define ABCE 4
@@ -32,22 +31,6 @@
32 31
 
33 32
 #define _AXIS(A) (A##_AXIS)
34 33
 
35
-#define _XMIN_ 100
36
-#define _YMIN_ 200
37
-#define _ZMIN_ 300
38
-#define _XMAX_ 101
39
-#define _YMAX_ 201
40
-#define _ZMAX_ 301
41
-
42
-#define _FORCE_INLINE_ __attribute__((__always_inline__)) __inline__
43
-#define  FORCE_INLINE  __attribute__((always_inline)) inline
44
-#define _UNUSED      __attribute__((unused))
45
-#define _O0          __attribute__((optimize("O0")))
46
-#define _Os          __attribute__((optimize("Os")))
47
-#define _O1          __attribute__((optimize("O1")))
48
-#define _O2          __attribute__((optimize("O2")))
49
-#define _O3          __attribute__((optimize("O3")))
50
-
51 34
 // Clock speed factors
52 35
 #if !defined(CYCLES_PER_MICROSECOND) && !defined(__STM32F1__)
53 36
   #define CYCLES_PER_MICROSECOND (F_CPU / 1000000L) // 16 or 20 on AVR
@@ -57,32 +40,16 @@
57 40
 #define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU)
58 41
 
59 42
 // Remove compiler warning on an unused variable
43
+#undef UNUSED
60 44
 #define UNUSED(x) ((void)(x))
61 45
 
62
-// Macros to make a string from a macro
63
-#define STRINGIFY_(M) #M
64
-#define STRINGIFY(M) STRINGIFY_(M)
65
-
46
+// Assembly wrappers for code and labels
66 47
 #define A(CODE) " " CODE "\n\t"
67 48
 #define L(CODE) CODE ":\n\t"
68 49
 
69 50
 // Macros for bit masks
70
-#undef _BV
71
-#define _BV(n) (1<<(n))
72
-#define TEST(n,b) !!((n)&_BV(b))
73
-#define SBI(n,b) (n |= _BV(b))
74
-#define CBI(n,b) (n &= ~_BV(b))
75 51
 #define SET_BIT_TO(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0)
76 52
 
77
-#define _BV32(b) (1UL << (b))
78
-#define TEST32(n,b) !!((n)&_BV32(b))
79
-#define SBI32(n,b) (n |= _BV32(b))
80
-#define CBI32(n,b) (n &= ~_BV32(b))
81
-
82
-// Macros for maths shortcuts
83
-#undef M_PI
84
-#define M_PI 3.14159265358979323846f
85
-
86 53
 #define RADIANS(d) ((d)*float(M_PI)/180.0f)
87 54
 #define DEGREES(r) ((r)*180.0f/float(M_PI))
88 55
 #define HYPOT2(x,y) (sq(x)+sq(y))
@@ -91,25 +58,45 @@
91 58
 #define CIRCLE_CIRC(R) (2 * float(M_PI) * float(R))
92 59
 
93 60
 #define SIGN(a) ((a>0)-(a<0))
94
-#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1)))
95 61
 
96
-// Macros to constrain values
62
+// Convenience templates / macros
63
+#undef ABS
64
+#undef MIN
65
+#undef MAX
97 66
 #ifdef __cplusplus
98 67
 
99
-  // C++11 solution that is standards compliant.
100
-  template <class V, class N> static inline constexpr void NOLESS(V& v, const N n) {
101
-    if (v < n) v = n;
102
-  }
103
-  template <class V, class N> static inline constexpr void NOMORE(V& v, const N n) {
104
-    if (v > n) v = n;
105
-  }
106
-  template <class V, class N1, class N2> static inline constexpr void LIMIT(V& v, const N1 n1, const N2 n2) {
107
-    if (v < n1) v = n1;
108
-    else if (v > n2) v = n2;
68
+  // Standards-compliant C++11 solutions
69
+
70
+  extern "C++" {
71
+
72
+    template <class T> static inline constexpr const T ABS(const T v) { return v >= 0 ? v : -v; }
73
+
74
+    template <class V, class N> static inline constexpr void NOLESS(V& v, const N n) {
75
+      if (v < n) v = n;
76
+    }
77
+    template <class V, class N> static inline constexpr void NOMORE(V& v, const N n) {
78
+      if (v > n) v = n;
79
+    }
80
+    template <class V, class N1, class N2> static inline constexpr void LIMIT(V& v, const N1 n1, const N2 n2) {
81
+      if (v < n1) v = n1;
82
+      else if (v > n2) v = n2;
83
+    }
84
+
85
+    template <class L, class R> static inline constexpr auto MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) {
86
+      return lhs < rhs ? lhs : rhs;
87
+    }
88
+    template <class L, class R> static inline constexpr auto MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) {
89
+      return lhs > rhs ? lhs : rhs;
90
+    }
91
+    template<class T, class ... Ts> static inline constexpr const T MIN(T V, Ts... Vs) { return MIN(V, MIN(Vs...)); }
92
+    template<class T, class ... Ts> static inline constexpr const T MAX(T V, Ts... Vs) { return MAX(V, MAX(Vs...)); }
93
+
109 94
   }
110 95
 
111 96
 #else
112 97
 
98
+  #define ABS(a) ({__typeof__(a) _a = (a); _a >= 0 ? _a : -_a;})
99
+
113 100
   // Using GCC extensions, but Travis GCC version does not like it and gives
114 101
   //  "error: statement-expressions are not allowed outside functions nor in template-argument lists"
115 102
   #define NOLESS(v, n) \
@@ -132,21 +119,30 @@
132 119
       else if (v > _n2) v = _n2; \
133 120
     } while(0)
134 121
 
122
+  // NUM_ARGS(...) evaluates to the number of arguments
123
+  #define _NUM_ARGS(X,X6,X5,X4,X3,X2,X1,N,...) N
124
+  #define NUM_ARGS(...) _NUM_ARGS(0, __VA_ARGS__ ,6,5,4,3,2,1,0)
125
+
126
+  #define MIN_2(a,b)      ({__typeof__(a) _a = (a); __typeof__(b) _b = (b); _a > _b ? _a : _b;})
127
+  #define MIN_3(a,...)    MIN_2(a,MIN_2(__VA_ARGS__))
128
+  #define MIN_4(a,...)    MIN_2(a,MIN_3(__VA_ARGS__))
129
+  #define MIN_5(a,...)    MIN_2(a,MIN_4(__VA_ARGS__))
130
+  #define MIN_6(a,...)    MIN_2(a,MIN_5(__VA_ARGS__))
131
+  #define __MIN_N(N, ...) MIN_ ## N(__VA_ARGS__)
132
+  #define _MIN_N(N, ...)  __MIN_N(N, __VA_ARGS__)
133
+  #define MIN(...)        _MIN_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
134
+
135
+  #define MAX_2(a,b)      ({__typeof__(a) _a = (a); __typeof__(b) _b = (b); _a > _b ? _a : _b;})
136
+  #define MAX_3(a,...)    MAX_2(a,MAX_2(__VA_ARGS__))
137
+  #define MAX_4(a,...)    MAX_2(a,MAX_3(__VA_ARGS__))
138
+  #define MAX_5(a,...)    MAX_2(a,MAX_4(__VA_ARGS__))
139
+  #define MAX_6(a,...)    MAX_2(a,MAX_5(__VA_ARGS__))
140
+  #define __MAX_N(N, ...) MAX_ ## N(__VA_ARGS__)
141
+  #define _MAX_N(N, ...)  __MAX_N(N, __VA_ARGS__)
142
+  #define MAX(...)        _MAX_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
143
+
135 144
 #endif
136 145
 
137
-// Macros to support option testing
138
-#define _CAT(a, ...) a ## __VA_ARGS__
139
-#define SWITCH_ENABLED_false 0
140
-#define SWITCH_ENABLED_true  1
141
-#define SWITCH_ENABLED_0     0
142
-#define SWITCH_ENABLED_1     1
143
-#define SWITCH_ENABLED_0x0   0
144
-#define SWITCH_ENABLED_0x1   1
145
-#define SWITCH_ENABLED_      1
146
-#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
147
-#define DISABLED(b) !ENABLED(b)
148
-
149
-#define WITHIN(V,L,H) ((V) >= (L) && (V) <= (H))
150 146
 #define NUMERIC(a) WITHIN(a, '0', '9')
151 147
 #define DECIMAL(a) (NUMERIC(a) || a == '.')
152 148
 #define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+')
@@ -155,45 +151,6 @@
155 151
 #define ZERO(a) memset(a,0,sizeof(a))
156 152
 #define COPY(a,b) memcpy(a,b,MIN(sizeof(a),sizeof(b)))
157 153
 
158
-// Macros for initializing arrays
159
-#define ARRAY_6(v1, v2, v3, v4, v5, v6, ...) { v1, v2, v3, v4, v5, v6 }
160
-#define ARRAY_5(v1, v2, v3, v4, v5, ...)     { v1, v2, v3, v4, v5 }
161
-#define ARRAY_4(v1, v2, v3, v4, ...)         { v1, v2, v3, v4 }
162
-#define ARRAY_3(v1, v2, v3, ...)             { v1, v2, v3 }
163
-#define ARRAY_2(v1, v2, ...)                 { v1, v2 }
164
-#define ARRAY_1(v1, ...)                     { v1 }
165
-
166
-#define _ARRAY_N(N, ...) ARRAY_ ##N(__VA_ARGS__)
167
-#define ARRAY_N(N, ...) _ARRAY_N(N, __VA_ARGS__)
168
-
169
-// Macros for adding
170
-#define INC_0 1
171
-#define INC_1 2
172
-#define INC_2 3
173
-#define INC_3 4
174
-#define INC_4 5
175
-#define INC_5 6
176
-#define INC_6 7
177
-#define INC_7 8
178
-#define INC_8 9
179
-#define INCREMENT_(n) INC_ ##n
180
-#define INCREMENT(n) INCREMENT_(n)
181
-
182
-// Macros for subtracting
183
-#define DEC_1 0
184
-#define DEC_2 1
185
-#define DEC_3 2
186
-#define DEC_4 3
187
-#define DEC_5 4
188
-#define DEC_6 5
189
-#define DEC_7 6
190
-#define DEC_8 7
191
-#define DEC_9 8
192
-#define DECREMENT_(n) DEC_ ##n
193
-#define DECREMENT(n) DECREMENT_(n)
194
-
195
-#define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0)
196
-
197 154
 #define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0)
198 155
 #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
199 156
 
@@ -204,13 +161,6 @@
204 161
 
205 162
 #define CEILING(x,y) (((x) + (y) - 1) / (y))
206 163
 
207
-#undef ABS
208
-#ifdef __cplusplus
209
-  template <class T> static inline constexpr const T ABS(const T v) { return v >= 0 ? v : -v; }
210
-#else
211
-  #define ABS(a) ({__typeof__(a) _a = (a); _a >= 0 ? _a : -_a;})
212
-#endif
213
-
214 164
 #define UNEAR_ZERO(x) ((x) < 0.000001f)
215 165
 #define NEAR_ZERO(x) WITHIN(x, -0.000001f, 0.000001f)
216 166
 #define NEAR(x,y) NEAR_ZERO((x)-(y))

+ 0
- 71
Marlin/src/core/minmax.h View File

@@ -1,71 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
- *
5
- * Based on Sprinter and grbl.
6
- * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-#undef MIN
24
-#undef MAX
25
-
26
-#ifdef __cplusplus
27
-
28
-  #ifndef _MINMAX_H_
29
-  #define _MINMAX_H_
30
-
31
-    extern "C++" {
32
-
33
-      // C++11 solution that is standards compliant. Return type is deduced automatically
34
-      template <class L, class R> static inline constexpr auto MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) {
35
-        return lhs < rhs ? lhs : rhs;
36
-      }
37
-      template <class L, class R> static inline constexpr auto MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) {
38
-        return lhs > rhs ? lhs : rhs;
39
-      }
40
-      template<class T, class ... Ts> static inline constexpr const T MIN(T V, Ts... Vs) { return MIN(V, MIN(Vs...)); }
41
-      template<class T, class ... Ts> static inline constexpr const T MAX(T V, Ts... Vs) { return MAX(V, MAX(Vs...)); }
42
-
43
-    }
44
-
45
-  #endif
46
-
47
-#else
48
-
49
-  // NUM_ARGS(...) evaluates to the number of arguments
50
-  #define _NUM_ARGS(X,X6,X5,X4,X3,X2,X1,N,...) N
51
-  #define NUM_ARGS(...) _NUM_ARGS(0, __VA_ARGS__ ,6,5,4,3,2,1,0)
52
-
53
-  #define MIN_2(a,b)      ({__typeof__(a) _a = (a); __typeof__(b) _b = (b); _a > _b ? _a : _b;})
54
-  #define MIN_3(a,...)    MIN_2(a,MIN_2(__VA_ARGS__))
55
-  #define MIN_4(a,...)    MIN_2(a,MIN_3(__VA_ARGS__))
56
-  #define MIN_5(a,...)    MIN_2(a,MIN_4(__VA_ARGS__))
57
-  #define MIN_6(a,...)    MIN_2(a,MIN_5(__VA_ARGS__))
58
-  #define __MIN_N(N, ...) MIN_ ## N(__VA_ARGS__)
59
-  #define _MIN_N(N, ...)  __MIN_N(N, __VA_ARGS__)
60
-  #define MIN(...)        _MIN_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
61
-
62
-  #define MAX_2(a,b)      ({__typeof__(a) _a = (a); __typeof__(b) _b = (b); _a > _b ? _a : _b;})
63
-  #define MAX_3(a,...)    MAX_2(a,MAX_2(__VA_ARGS__))
64
-  #define MAX_4(a,...)    MAX_2(a,MAX_3(__VA_ARGS__))
65
-  #define MAX_5(a,...)    MAX_2(a,MAX_4(__VA_ARGS__))
66
-  #define MAX_6(a,...)    MAX_2(a,MAX_5(__VA_ARGS__))
67
-  #define __MAX_N(N, ...) MAX_ ## N(__VA_ARGS__)
68
-  #define _MAX_N(N, ...)  __MAX_N(N, __VA_ARGS__)
69
-  #define MAX(...)        _MAX_N(NUM_ARGS(__VA_ARGS__), __VA_ARGS__)
70
-
71
-#endif

+ 1
- 1
Marlin/src/feature/twibus.h View File

@@ -23,7 +23,7 @@
23 23
 #ifndef TWIBUS_H
24 24
 #define TWIBUS_H
25 25
 
26
-#include "../core/macros.h"
26
+#include "../inc/MarlinConfigPre.h"
27 27
 
28 28
 #include <Wire.h>
29 29
 

+ 4
- 5
Marlin/src/inc/MarlinConfig.h View File

@@ -19,9 +19,11 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
+#pragma once
22 23
 
23
-#ifndef _MARLIN_CONFIG_H_
24
-#define _MARLIN_CONFIG_H_
24
+//
25
+// Prefix header for all Marlin sources
26
+//
25 27
 
26 28
 #include "MarlinConfigPre.h"
27 29
 
@@ -43,6 +45,3 @@
43 45
 #include "../core/language.h"
44 46
 #include "../core/utility.h"
45 47
 #include "../core/serial.h"
46
-#include "../core/minmax.h"
47
-
48
-#endif // _MARLIN_CONFIG_H_

+ 6
- 5
Marlin/src/inc/MarlinConfigPre.h View File

@@ -19,19 +19,20 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
+#pragma once
22 23
 
23
-#ifndef _MARLIN_CONFIGPRE_H_
24
-#define _MARLIN_CONFIGPRE_H_
24
+//
25
+// Prefix header to acquire configurations
26
+//
25 27
 
26 28
 #include "../HAL/platforms.h"
27 29
 #include "../core/boards.h"
28
-#include "../core/macros.h"
29 30
 #include "../core/types.h"
31
+#include "../core/config.h"
30 32
 #include "Version.h"
31 33
 #include "../../Configuration.h"
32 34
 #include "Conditionals_LCD.h"
33 35
 #include "../core/drivers.h"
34 36
 #include "../../Configuration_adv.h"
35 37
 #include "Conditionals_adv.h"
36
-
37
-#endif // _MARLIN_CONFIGPRE_H_
38
+#include "../core/macros.h"

+ 1
- 1
Marlin/src/inc/Version.h View File

@@ -23,7 +23,7 @@
23 23
 #ifndef _VERSION_H_
24 24
 #define _VERSION_H_
25 25
 
26
-#include "../core/macros.h" // for ENABLED
26
+#include "../core/config.h" // for ENABLED
27 27
 
28 28
 /**
29 29
  * This file is the standard Marlin version identifier file.

+ 3
- 7
Marlin/src/libs/stopwatch.h View File

@@ -26,8 +26,8 @@
26 26
 // Print debug messages with M111 S2 (Uses 156 bytes of PROGMEM)
27 27
 //#define DEBUG_STOPWATCH
28 28
 
29
-#include "../core/macros.h"
30
-#include "../core/types.h"
29
+#include "../core/macros.h" // for FORCE_INLINE
30
+#include "../core/types.h"  // for millis_t
31 31
 
32 32
 /**
33 33
  * @brief Stopwatch class
@@ -36,11 +36,7 @@
36 36
  */
37 37
 class Stopwatch {
38 38
   private:
39
-    enum State : char {
40
-      STOPPED,
41
-      RUNNING,
42
-      PAUSED
43
-    };
39
+    enum State : char { STOPPED, RUNNING, PAUSED };
44 40
 
45 41
     static Stopwatch::State state;
46 42
     static millis_t accumulator;

+ 1
- 1
buildroot/share/tests/start_tests View File

@@ -6,7 +6,7 @@ export PATH="$PATH:./buildroot/bin"
6 6
 set -e
7 7
 
8 8
 exec_test () {
9
-  printf "\033[0;32m[Test $2] \033[0m$3... "
9
+  printf "\n\033[0;32m[Test $2] \033[0m$3...\n"
10 10
   if build_marlin_pio $1 "-e $2"; then
11 11
     printf "\033[0;32mPassed\033[0m\n"
12 12
     return 0

Loading…
Cancel
Save