Browse Source

Tweaks to endstops macros

Scott Lahteine 8 years ago
parent
commit
4f5a8c05d5
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      Marlin/endstops.cpp

+ 3
- 3
Marlin/endstops.cpp View File

233
 // Check endstops - Called from ISR!
233
 // Check endstops - Called from ISR!
234
 void Endstops::update() {
234
 void Endstops::update() {
235
 
235
 
236
+  #define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
236
   #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
237
   #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
237
   #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
238
   #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
238
   #define _ENDSTOP_HIT(AXIS) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MIN))
239
   #define _ENDSTOP_HIT(AXIS) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MIN))
239
-  #define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
240
 
240
 
241
   // UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
241
   // UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
242
   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
242
   #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
243
-  // COPY_BIT: copy the value of COPY_BIT to BIT in bits
244
-  #define COPY_BIT(bits, COPY_BIT, BIT) SET_BIT(bits, BIT, TEST(bits, COPY_BIT))
243
+  // COPY_BIT: copy the value of SRC_BIT to DST_BIT in DST
244
+  #define COPY_BIT(DST, SRC_BIT, DST_BIT) SET_BIT(DST, DST_BIT, TEST(DST, SRC_BIT))
245
 
245
 
246
   #define _UPDATE_ENDSTOP(AXIS,MINMAX,CODE) do { \
246
   #define _UPDATE_ENDSTOP(AXIS,MINMAX,CODE) do { \
247
       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \
247
       UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

Loading…
Cancel
Save