Merge pull request #5008 from thinkyhead/test_endstop_hits

Save some PROGMEM in MBL G28
This commit is contained in:
Scott Lahteine 2016-10-22 03:35:52 -05:00 committed by GitHub
commit be7d245eff
2 changed files with 9 additions and 7 deletions

View file

@ -3623,9 +3623,10 @@ inline void gcode_G28() {
} }
} }
else { else {
SERIAL_PROTOCOLLNPGM("X not entered."); SERIAL_CHAR('X'); SERIAL_PROTOCOLLNPGM(" not entered.");
return; return;
} }
if (code_seen('Y')) { if (code_seen('Y')) {
py = code_value_int() - 1; py = code_value_int() - 1;
if (py < 0 || py >= MESH_NUM_Y_POINTS) { if (py < 0 || py >= MESH_NUM_Y_POINTS) {
@ -3634,14 +3635,15 @@ inline void gcode_G28() {
} }
} }
else { else {
SERIAL_PROTOCOLLNPGM("Y not entered."); SERIAL_CHAR('Y'); SERIAL_PROTOCOLLNPGM(" not entered.");
return; return;
} }
if (code_seen('Z')) { if (code_seen('Z')) {
mbl.z_values[py][px] = code_value_axis_units(Z_AXIS); mbl.z_values[py][px] = code_value_axis_units(Z_AXIS);
} }
else { else {
SERIAL_PROTOCOLLNPGM("Z not entered."); SERIAL_CHAR('Z'); SERIAL_PROTOCOLLNPGM(" not entered.");
return; return;
} }
break; break;
@ -3651,7 +3653,7 @@ inline void gcode_G28() {
mbl.z_offset = code_value_axis_units(Z_AXIS); mbl.z_offset = code_value_axis_units(Z_AXIS);
} }
else { else {
SERIAL_PROTOCOLLNPGM("Z not entered."); SERIAL_CHAR('Z'); SERIAL_PROTOCOLLNPGM(" not entered.");
return; return;
} }
break; break;

View file

@ -233,15 +233,15 @@ void Endstops::M119() {
// Check endstops - Called from ISR! // Check endstops - Called from ISR!
void Endstops::update() { void Endstops::update() {
#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
#define _ENDSTOP_HIT(AXIS) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MIN)) #define _ENDSTOP_HIT(AXIS) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MIN))
#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
// UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status // UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status
#define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
// COPY_BIT: copy the value of COPY_BIT to BIT in bits // COPY_BIT: copy the value of SRC_BIT to DST_BIT in DST
#define COPY_BIT(bits, COPY_BIT, BIT) SET_BIT(bits, BIT, TEST(bits, COPY_BIT)) #define COPY_BIT(DST, SRC_BIT, DST_BIT) SET_BIT(DST, DST_BIT, TEST(DST, SRC_BIT))
#define _UPDATE_ENDSTOP(AXIS,MINMAX,CODE) do { \ #define _UPDATE_ENDSTOP(AXIS,MINMAX,CODE) do { \
UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \ UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \