Browse Source

Use configured feedrates, center for DELTA_CALIBRATION_MENU

Scott Lahteine 8 years ago
parent
commit
432e9a1f50
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      Marlin/ultralcd.cpp

+ 7
- 5
Marlin/ultralcd.cpp View File

@@ -1261,15 +1261,17 @@ void kill_screen(const char* lcd_msg) {
1261 1261
   #if ENABLED(DELTA_CALIBRATION_MENU)
1262 1262
 
1263 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 1271
     static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
1271 1272
     static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
1272 1273
     static void _goto_tower_z() { _goto_tower_pos(0); }
1274
+    static void _goto_center()  { _goto_tower_pos(-1); }
1273 1275
 
1274 1276
     static void lcd_delta_calibrate_menu() {
1275 1277
       START_MENU();
@@ -1278,7 +1280,7 @@ void kill_screen(const char* lcd_msg) {
1278 1280
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
1279 1281
       MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
1280 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 1284
       END_MENU();
1283 1285
     }
1284 1286
 

Loading…
Cancel
Save