Pārlūkot izejas kodu

Apply const to some planner vars

Scott Lahteine 7 gadus atpakaļ
vecāks
revīzija
23e45fa3c4
1 mainītis faili ar 6 papildinājumiem un 6 dzēšanām
  1. 6
    6
      Marlin/src/module/planner.cpp

+ 6
- 6
Marlin/src/module/planner.cpp Parādīt failu

1316
     // then the machine is not coasting anymore and the safe entry / exit velocities shall be used.
1316
     // then the machine is not coasting anymore and the safe entry / exit velocities shall be used.
1317
 
1317
 
1318
     // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum.
1318
     // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum.
1319
-    bool prev_speed_larger = previous_nominal_speed > block->nominal_speed;
1320
-    float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed);
1319
+    const bool prev_speed_larger = previous_nominal_speed > block->nominal_speed;
1320
+    const float smaller_speed_factor = prev_speed_larger ? (block->nominal_speed / previous_nominal_speed) : (previous_nominal_speed / block->nominal_speed);
1321
     // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting.
1321
     // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting.
1322
     vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed;
1322
     vmax_junction = prev_speed_larger ? block->nominal_speed : previous_nominal_speed;
1323
     // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities.
1323
     // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities.
1449
   #else
1449
   #else
1450
     #define _EINDEX E_AXIS
1450
     #define _EINDEX E_AXIS
1451
   #endif
1451
   #endif
1452
-  long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1453
-       nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1454
-       nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1455
-       ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1452
+  const long na = position[X_AXIS] = LROUND(a * axis_steps_per_mm[X_AXIS]),
1453
+             nb = position[Y_AXIS] = LROUND(b * axis_steps_per_mm[Y_AXIS]),
1454
+             nc = position[Z_AXIS] = LROUND(c * axis_steps_per_mm[Z_AXIS]),
1455
+             ne = position[E_AXIS] = LROUND(e * axis_steps_per_mm[_EINDEX]);
1456
   #if ENABLED(LIN_ADVANCE)
1456
   #if ENABLED(LIN_ADVANCE)
1457
     position_float[X_AXIS] = a;
1457
     position_float[X_AXIS] = a;
1458
     position_float[Y_AXIS] = b;
1458
     position_float[Y_AXIS] = b;

Notiek ielāde…
Atcelt
Saglabāt