Coding standard patch of M290

This commit is contained in:
Scott Lahteine 2017-11-11 22:16:13 -06:00
parent 802ae73b13
commit 355dfed437

View File

@ -9314,8 +9314,7 @@ inline void gcode_M226() {
#if ENABLED(BABYSTEP_XY) #if ENABLED(BABYSTEP_XY)
for (uint8_t a = X_AXIS; a <= Z_AXIS; a++) for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) { if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
float offs = parser.value_axis_units(a); const float offs = constrain(parser.value_axis_units(a), -2, 2);
offs = constrain(offs, -2, 2);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
if (a == Z_AXIS) { if (a == Z_AXIS) {
zprobe_zoffset += offs; zprobe_zoffset += offs;
@ -9326,8 +9325,7 @@ inline void gcode_M226() {
} }
#else #else
if (parser.seenval('Z') || parser.seenval('S')) { if (parser.seenval('Z') || parser.seenval('S')) {
float offs = parser.value_axis_units(Z_AXIS); const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
offs = constrain(offs, -2, 2);
#if ENABLED(BABYSTEP_ZPROBE_OFFSET) #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
zprobe_zoffset += offs; zprobe_zoffset += offs;
refresh_zprobe_zoffset(); // This will babystep the axis refresh_zprobe_zoffset(); // This will babystep the axis