Просмотр исходного кода

Apply const in Marlin_main.cpp

Scott Lahteine 8 лет назад
Родитель
Сommit
b17e2d3dcd
1 измененных файлов: 6 добавлений и 5 удалений
  1. 6
    5
      Marlin/Marlin_main.cpp

+ 6
- 5
Marlin/Marlin_main.cpp Просмотреть файл

@@ -3731,7 +3731,7 @@ inline void gcode_G28() {
3731 3731
   // Disable the leveling matrix before homing
3732 3732
   #if HAS_LEVELING
3733 3733
     #if ENABLED(AUTO_BED_LEVELING_UBL)
3734
-      const bool bed_leveling_state_at_entry = ubl.state.active;
3734
+      const bool ubl_state_at_entry = ubl.state.active;
3735 3735
     #endif
3736 3736
     set_bed_leveling_enabled(false);
3737 3737
   #endif
@@ -3874,8 +3874,9 @@ inline void gcode_G28() {
3874 3874
     // move to a height where we can use the full xy-area
3875 3875
     do_blocking_move_to_z(delta_clip_start_height);
3876 3876
   #endif
3877
+
3877 3878
   #if ENABLED(AUTO_BED_LEVELING_UBL)
3878
-    set_bed_leveling_enabled(bed_leveling_state_at_entry);
3879
+    set_bed_leveling_enabled(ubl_state_at_entry);
3879 3880
   #endif
3880 3881
 
3881 3882
   clean_up_after_endstop_or_probe_move();
@@ -11119,7 +11120,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
11119 11120
   inline bool prepare_kinematic_move_to(float ltarget[XYZE]) {
11120 11121
 
11121 11122
     // Get the top feedrate of the move in the XY plane
11122
-    float _feedrate_mm_s = MMS_SCALED(feedrate_mm_s);
11123
+    const float _feedrate_mm_s = MMS_SCALED(feedrate_mm_s);
11123 11124
 
11124 11125
     // If the move is only in Z/E don't split up the move
11125 11126
     if (ltarget[X_AXIS] == current_position[X_AXIS] && ltarget[Y_AXIS] == current_position[Y_AXIS]) {
@@ -11144,7 +11145,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
11144 11145
     if (UNEAR_ZERO(cartesian_mm)) return true;
11145 11146
 
11146 11147
     // Minimum number of seconds to move the given distance
11147
-    float seconds = cartesian_mm / _feedrate_mm_s;
11148
+    const float seconds = cartesian_mm / _feedrate_mm_s;
11148 11149
 
11149 11150
     // The number of segments-per-second times the duration
11150 11151
     // gives the number of segments
@@ -11434,7 +11435,7 @@ void prepare_move_to_destination() {
11434 11435
     if (angular_travel == 0 && current_position[X_AXIS] == logical[X_AXIS] && current_position[Y_AXIS] == logical[Y_AXIS])
11435 11436
       angular_travel += RADIANS(360);
11436 11437
 
11437
-    float mm_of_travel = HYPOT(angular_travel * radius, fabs(linear_travel));
11438
+    const float mm_of_travel = HYPOT(angular_travel * radius, fabs(linear_travel));
11438 11439
     if (mm_of_travel < 0.001) return;
11439 11440
 
11440 11441
     uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT));

Загрузка…
Отмена
Сохранить