Merge pull request #5008 from thinkyhead/test_endstop_hits

Save some PROGMEM in MBL G28
master
Scott Lahteine 8 years ago committed by GitHub
commit be7d245eff

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

@ -233,15 +233,15 @@ void Endstops::M119() {
// Check endstops - Called from ISR!
void Endstops::update() {
#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
#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
#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
#define COPY_BIT(bits, COPY_BIT, BIT) SET_BIT(bits, BIT, TEST(bits, COPY_BIT))
// COPY_BIT: copy the value of SRC_BIT to DST_BIT in DST
#define COPY_BIT(DST, SRC_BIT, DST_BIT) SET_BIT(DST, DST_BIT, TEST(DST, SRC_BIT))
#define _UPDATE_ENDSTOP(AXIS,MINMAX,CODE) do { \
UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \

Loading…
Cancel
Save