Browse Source

Merge pull request #5008 from thinkyhead/test_endstop_hits

Save some PROGMEM in MBL G28
Scott Lahteine 8 years ago
parent
commit
be7d245eff
2 changed files with 9 additions and 7 deletions
  1. 6
    4
      Marlin/Marlin_main.cpp
  2. 3
    3
      Marlin/endstops.cpp

+ 6
- 4
Marlin/Marlin_main.cpp View File

3623
           }
3623
           }
3624
         }
3624
         }
3625
         else {
3625
         else {
3626
-          SERIAL_PROTOCOLLNPGM("X not entered.");
3626
+          SERIAL_CHAR('X'); SERIAL_PROTOCOLLNPGM(" not entered.");
3627
           return;
3627
           return;
3628
         }
3628
         }
3629
+
3629
         if (code_seen('Y')) {
3630
         if (code_seen('Y')) {
3630
           py = code_value_int() - 1;
3631
           py = code_value_int() - 1;
3631
           if (py < 0 || py >= MESH_NUM_Y_POINTS) {
3632
           if (py < 0 || py >= MESH_NUM_Y_POINTS) {
3634
           }
3635
           }
3635
         }
3636
         }
3636
         else {
3637
         else {
3637
-          SERIAL_PROTOCOLLNPGM("Y not entered.");
3638
+          SERIAL_CHAR('Y'); SERIAL_PROTOCOLLNPGM(" not entered.");
3638
           return;
3639
           return;
3639
         }
3640
         }
3641
+
3640
         if (code_seen('Z')) {
3642
         if (code_seen('Z')) {
3641
           mbl.z_values[py][px] = code_value_axis_units(Z_AXIS);
3643
           mbl.z_values[py][px] = code_value_axis_units(Z_AXIS);
3642
         }
3644
         }
3643
         else {
3645
         else {
3644
-          SERIAL_PROTOCOLLNPGM("Z not entered.");
3646
+          SERIAL_CHAR('Z'); SERIAL_PROTOCOLLNPGM(" not entered.");
3645
           return;
3647
           return;
3646
         }
3648
         }
3647
         break;
3649
         break;
3651
           mbl.z_offset = code_value_axis_units(Z_AXIS);
3653
           mbl.z_offset = code_value_axis_units(Z_AXIS);
3652
         }
3654
         }
3653
         else {
3655
         else {
3654
-          SERIAL_PROTOCOLLNPGM("Z not entered.");
3656
+          SERIAL_CHAR('Z'); SERIAL_PROTOCOLLNPGM(" not entered.");
3655
           return;
3657
           return;
3656
         }
3658
         }
3657
         break;
3659
         break;

+ 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