浏览代码

Use configured feedrates, center for DELTA_CALIBRATION_MENU

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

+ 7
- 5
Marlin/ultralcd.cpp 查看文件

1261
   #if ENABLED(DELTA_CALIBRATION_MENU)
1261
   #if ENABLED(DELTA_CALIBRATION_MENU)
1262
 
1262
 
1263
     static void _goto_tower_pos(const float &a) {
1263
     static void _goto_tower_pos(const float &a) {
1264
-      char cmd[26];
1265
-      sprintf_P(cmd, PSTR("G1 F4000 X%i Y%i"), int(-(DELTA_PRINTABLE_RADIUS) * sin(a)), int((DELTA_PRINTABLE_RADIUS) * cos(a)));
1266
-      enqueue_and_echo_commands_P(PSTR("G1 F8000 Z4"));
1267
-      enqueue_and_echo_command(cmd);
1264
+      do_blocking_move_to(
1265
+        a < 0 ? X_HOME_POS : sin(a) * -(DELTA_PRINTABLE_RADIUS),
1266
+        a < 0 ? Y_HOME_POS : cos(a) *  (DELTA_PRINTABLE_RADIUS),
1267
+        4
1268
+      );
1268
     }
1269
     }
1269
 
1270
 
1270
     static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1271
     static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1271
     static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1272
     static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1272
     static void _goto_tower_z() { _goto_tower_pos(0); }
1273
     static void _goto_tower_z() { _goto_tower_pos(0); }
1274
+    static void _goto_center()  { _goto_tower_pos(-1); }
1273
 
1275
 
1274
     static void lcd_delta_calibrate_menu() {
1276
     static void lcd_delta_calibrate_menu() {
1275
       START_MENU();
1277
       START_MENU();
1278
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1280
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1279
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1281
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1280
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
1282
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
1281
-      MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G1 F8000 Z4\nG1 F4000 X0 Y0"));
1283
+      MENU_ITEM(function, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
1282
       END_MENU();
1284
       END_MENU();
1283
     }
1285
     }
1284
 
1286
 

正在加载...
取消
保存