浏览代码

Use min_pos/max_pos for _lcd_move

Scott Lahteine 9 年前
父节点
当前提交
aa97328cd3
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6
    6
      Marlin/ultralcd.cpp

+ 6
- 6
Marlin/ultralcd.cpp 查看文件

@@ -1123,7 +1123,7 @@ static void lcd_prepare_menu() {
1123 1123
 float move_menu_scale;
1124 1124
 static void lcd_move_menu_axis();
1125 1125
 
1126
-static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
1126
+static void _lcd_move(const char* name, AxisEnum axis, float min, float max) {
1127 1127
   ENCODER_DIRECTION_NORMAL();
1128 1128
   if ((encoderPosition != 0) && (movesplanned() <= 3)) {
1129 1129
     refresh_cmd_timeout();
@@ -1140,13 +1140,13 @@ static void _lcd_move(const char* name, AxisEnum axis, int min, int max) {
1140 1140
 #if ENABLED(DELTA)
1141 1141
   static float delta_clip_radius_2 =  (DELTA_PRINTABLE_RADIUS) * (DELTA_PRINTABLE_RADIUS);
1142 1142
   static int delta_clip( float a ) { return sqrt(delta_clip_radius_2 - a*a); }
1143
-  static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(X_MIN_POS, -clip), min(X_MAX_POS, clip)); }
1144
-  static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(Y_MIN_POS, -clip), min(Y_MAX_POS, clip)); }
1143
+  static void lcd_move_x() { int clip = delta_clip(current_position[Y_AXIS]); _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, max(min_pos[X_AXIS], -clip), min(max_pos[X_AXIS], clip)); }
1144
+  static void lcd_move_y() { int clip = delta_clip(current_position[X_AXIS]); _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, max(min_pos[Y_AXIS], -clip), min(max_pos[Y_AXIS], clip)); }
1145 1145
 #else
1146
-  static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, X_MIN_POS, X_MAX_POS); }
1147
-  static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, Y_MIN_POS, Y_MAX_POS); }
1146
+  static void lcd_move_x() { _lcd_move(PSTR(MSG_MOVE_X), X_AXIS, min_pos[X_AXIS], max_pos[X_AXIS]); }
1147
+  static void lcd_move_y() { _lcd_move(PSTR(MSG_MOVE_Y), Y_AXIS, min_pos[Y_AXIS], max_pos[Y_AXIS]); }
1148 1148
 #endif
1149
-static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, Z_MIN_POS, Z_MAX_POS); }
1149
+static void lcd_move_z() { _lcd_move(PSTR(MSG_MOVE_Z), Z_AXIS, min_pos[Z_AXIS], max_pos[Z_AXIS]); }
1150 1150
 static void lcd_move_e(
1151 1151
   #if EXTRUDERS > 1
1152 1152
     uint8_t e

正在加载...
取消
保存