Browse Source

Update macros for parity with 2.0.x

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

+ 0
- 2
Marlin/Marlin.h View File

212
  */
212
  */
213
 extern int16_t feedrate_percentage;
213
 extern int16_t feedrate_percentage;
214
 
214
 
215
-#define MMM_TO_MMS(MM_M) ((MM_M)/60.0)
216
-#define MMS_TO_MMM(MM_S) ((MM_S)*60.0)
217
 #define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01)
215
 #define MMS_SCALED(MM_S) ((MM_S)*feedrate_percentage*0.01)
218
 
216
 
219
 extern bool axis_relative_modes[];
217
 extern bool axis_relative_modes[];

+ 7
- 0
Marlin/macros.h View File

117
 #define DEGREES(r) ((r)*180.0/M_PI)
117
 #define DEGREES(r) ((r)*180.0/M_PI)
118
 #define HYPOT2(x,y) (sq(x)+sq(y))
118
 #define HYPOT2(x,y) (sq(x)+sq(y))
119
 
119
 
120
+#define CIRCLE_AREA(R) (M_PI * sq(R))
121
+#define CIRCLE_CIRC(R) (2.0 * M_PI * (R))
122
+
120
 #define SIGN(a) ((a>0)-(a<0))
123
 #define SIGN(a) ((a>0)-(a<0))
124
+#define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1)))
121
 
125
 
122
 // Macros to contrain values
126
 // Macros to contrain values
123
 #define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
127
 #define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
184
 #define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0)
188
 #define PENDING(NOW,SOON) ((long)(NOW-(SOON))<0)
185
 #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
189
 #define ELAPSED(NOW,SOON) (!PENDING(NOW,SOON))
186
 
190
 
191
+#define MMM_TO_MMS(MM_M) ((MM_M)/60.0)
192
+#define MMS_TO_MMM(MM_S) ((MM_S)*60.0)
193
+
187
 #define NOOP do{} while(0)
194
 #define NOOP do{} while(0)
188
 
195
 
189
 #define CEILING(x,y) (((x) + (y) - 1) / (y))
196
 #define CEILING(x,y) (((x) + (y) - 1) / (y))

Loading…
Cancel
Save