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
     #if ENABLED(BABYSTEP_XY)
9314
     #if ENABLED(BABYSTEP_XY)
9315
       for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
9315
       for (uint8_t a = X_AXIS; a <= Z_AXIS; a++)
9316
         if (parser.seenval(axis_codes[a]) || (a == Z_AXIS && parser.seenval('S'))) {
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
           #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9318
           #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9320
             if (a == Z_AXIS) {
9319
             if (a == Z_AXIS) {
9321
               zprobe_zoffset += offs;
9320
               zprobe_zoffset += offs;
9326
         }
9325
         }
9327
     #else
9326
     #else
9328
       if (parser.seenval('Z') || parser.seenval('S')) {
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
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9329
         #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
9332
           zprobe_zoffset += offs;
9330
           zprobe_zoffset += offs;
9333
           refresh_zprobe_zoffset(); // This will babystep the axis
9331
           refresh_zprobe_zoffset(); // This will babystep the axis

Loading…
Cancel
Save