浏览代码

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,14 +2931,16 @@ void kill_screen(const char* lcd_msg) {
2931 2931
       const float diff = float((int32_t)encoderPosition) * move_menu_scale;
2932 2932
       #if IS_KINEMATIC
2933 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 2938
       #else
2938 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 2944
       #endif
2943 2945
 
2944 2946
       manual_move_to_current(axis);

正在加载...
取消
保存