Browse Source

Coding standard patch of M290

Scott Lahteine 7 years ago
parent
commit
355dfed437
1 changed files with 2 additions and 4 deletions
  1. 2
    4
      Marlin/Marlin_main.cpp

+ 2
- 4
Marlin/Marlin_main.cpp View File

@@ -9314,8 +9314,7 @@ inline void gcode_M226() {
9314 9314
     #if ENABLED(BABYSTEP_XY)
9315 9315
       for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
9316 9316
         if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
9317
-          float offs = parser.value_axis_units(a);
9318
-          offs = constrain(offs, -2, 2);
9317
+          const float offs = constrain(parser.value_axis_units(a), -2, 2);
9319 9318
           #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9320 9319
             if (a == Z_AXIS) {
9321 9320
               zprobe_zoffset += offs;
@@ -9326,8 +9325,7 @@ inline void gcode_M226() {
9326 9325
         }
9327 9326
     #else
9328 9327
       if (parser.seenval('Z') || parser.seenval('S')) {
9329
-        float offs = parser.value_axis_units(Z_AXIS);
9330
-        offs = constrain(offs, -2, 2);
9328
+        const float offs = constrain(parser.value_axis_units(Z_AXIS), -2, 2);
9331 9329
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9332 9330
           zprobe_zoffset += offs;
9333 9331
           refresh_zprobe_zoffset(); // This will babystep the axis

Loading…
Cancel
Save