Преглед изворни кода

One fewer compare in _lcd_move_xyz

Scott Lahteine пре 7 година
родитељ
комит
e4acd2c40e
1 измењених фајлова са 8 додато и 6 уклоњено
  1. 8
    6
      Marlin/src/lcd/ultralcd.cpp

+ 8
- 6
Marlin/src/lcd/ultralcd.cpp Прегледај датотеку

2931
       const float diff = float((int32_t)encoderPosition) * move_menu_scale;
2931
       const float diff = float((int32_t)encoderPosition) * move_menu_scale;
2932
       #if IS_KINEMATIC
2932
       #if IS_KINEMATIC
2933
         manual_move_offset += diff;
2933
         manual_move_offset += diff;
2934
-        // Limit only when trying to move towards the limit
2935
-        if ((int32_t)encoderPosition < 0) NOLESS(manual_move_offset, min - current_position[axis]);
2936
-        if ((int32_t)encoderPosition > 0) NOMORE(manual_move_offset, max - current_position[axis]);
2934
+        if ((int32_t)encoderPosition < 0)
2935
+          NOLESS(manual_move_offset, min - current_position[axis]);
2936
+        else
2937
+          NOMORE(manual_move_offset, max - current_position[axis]);
2937
       #else
2938
       #else
2938
         current_position[axis] += diff;
2939
         current_position[axis] += diff;
2939
-        // Limit only when trying to move towards the limit
2940
-        if ((int32_t)encoderPosition < 0) NOLESS(current_position[axis], min);
2941
-        if ((int32_t)encoderPosition > 0) NOMORE(current_position[axis], max);
2940
+        if ((int32_t)encoderPosition < 0)
2941
+          NOLESS(current_position[axis], min);
2942
+        else
2943
+          NOMORE(current_position[axis], max);
2942
       #endif
2944
       #endif
2943
 
2945
 
2944
       manual_move_to_current(axis);
2946
       manual_move_to_current(axis);

Loading…
Откажи
Сачувај