Browse Source

Apply const in Marlin_main.cpp

Scott Lahteine 8 years ago
parent
commit
b17e2d3dcd
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      Marlin/Marlin_main.cpp

+ 6
- 5
Marlin/Marlin_main.cpp View File

3731
   // Disable the leveling matrix before homing
3731
   // Disable the leveling matrix before homing
3732
   #if HAS_LEVELING
3732
   #if HAS_LEVELING
3733
     #if ENABLED(AUTO_BED_LEVELING_UBL)
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
     #endif
3735
     #endif
3736
     set_bed_leveling_enabled(false);
3736
     set_bed_leveling_enabled(false);
3737
   #endif
3737
   #endif
3874
     // move to a height where we can use the full xy-area
3874
     // move to a height where we can use the full xy-area
3875
     do_blocking_move_to_z(delta_clip_start_height);
3875
     do_blocking_move_to_z(delta_clip_start_height);
3876
   #endif
3876
   #endif
3877
+
3877
   #if ENABLED(AUTO_BED_LEVELING_UBL)
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
   #endif
3880
   #endif
3880
 
3881
 
3881
   clean_up_after_endstop_or_probe_move();
3882
   clean_up_after_endstop_or_probe_move();
11119
   inline bool prepare_kinematic_move_to(float ltarget[XYZE]) {
11120
   inline bool prepare_kinematic_move_to(float ltarget[XYZE]) {
11120
 
11121
 
11121
     // Get the top feedrate of the move in the XY plane
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
     // If the move is only in Z/E don't split up the move
11125
     // If the move is only in Z/E don't split up the move
11125
     if (ltarget[X_AXIS] == current_position[X_AXIS] && ltarget[Y_AXIS] == current_position[Y_AXIS]) {
11126
     if (ltarget[X_AXIS] == current_position[X_AXIS] && ltarget[Y_AXIS] == current_position[Y_AXIS]) {
11144
     if (UNEAR_ZERO(cartesian_mm)) return true;
11145
     if (UNEAR_ZERO(cartesian_mm)) return true;
11145
 
11146
 
11146
     // Minimum number of seconds to move the given distance
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
     // The number of segments-per-second times the duration
11150
     // The number of segments-per-second times the duration
11150
     // gives the number of segments
11151
     // gives the number of segments
11434
     if (angular_travel == 0 && current_position[X_AXIS] == logical[X_AXIS] && current_position[Y_AXIS] == logical[Y_AXIS])
11435
     if (angular_travel == 0 && current_position[X_AXIS] == logical[X_AXIS] && current_position[Y_AXIS] == logical[Y_AXIS])
11435
       angular_travel += RADIANS(360);
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
     if (mm_of_travel < 0.001) return;
11439
     if (mm_of_travel < 0.001) return;
11439
 
11440
 
11440
     uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT));
11441
     uint16_t segments = floor(mm_of_travel / (MM_PER_ARC_SEGMENT));

Loading…
Cancel
Save