Skip to content

Commit

Permalink
Merge pull request #4570 from thinkyhead/rc_proper_delta_calibration
Browse files Browse the repository at this point in the history
Make DELTA_CALIBRATION_MENU more universal
  • Loading branch information
thinkyhead authored Aug 9, 2016
2 parents 46c8862 + 88540d8 commit 9afa060
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ script:
# Delta Config (generic)
- restore_configs
- use_example_configs delta/generic
- opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU
- build_marlin
#
# Delta Config (generic) + ABL + ALLEN_KEY
Expand Down
21 changes: 16 additions & 5 deletions Marlin/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,14 +1260,25 @@ void kill_screen(const char* lcd_msg) {

#if ENABLED(DELTA_CALIBRATION_MENU)

static void _goto_tower_pos(const float &a) {
char cmd[20];
sprintf_P(cmd, PSTR("G1 X%i Y%i"), int(-(DELTA_PRINTABLE_RADIUS) * sin(a)), int((DELTA_PRINTABLE_RADIUS) * cos(a)));
enqueue_and_echo_commands_P(PSTR("G1 F8000 Z4\nG1 F4000"));
enqueue_and_echo_command(cmd);
}

static void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
static void _goto_tower_y() { _goto_tower_pos(RADIANS(240)); }
static void _goto_tower_z() { _goto_tower_pos(0); }

static void lcd_delta_calibrate_menu() {
START_MENU();
MENU_ITEM(back, MSG_MAIN);
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_X, PSTR("G0 F8000 X-77.94 Y-45 Z0"));
MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Y, PSTR("G0 F8000 X77.94 Y-45 Z0"));
MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_Z, PSTR("G0 F8000 X0 Y90 Z0"));
MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G0 F8000 X0 Y0 Z0"));
MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
MENU_ITEM(gcode, MSG_DELTA_CALIBRATE_CENTER, PSTR("G1 F8000 Z4\nG1 F4000 X0 Y0"));
END_MENU();
}

Expand Down Expand Up @@ -2539,7 +2550,6 @@ void lcd_update() {

bool sd_status = IS_SD_INSERTED;
if (sd_status != lcd_sd_status && lcd_detected()) {
lcd_sd_status = sd_status;

if (sd_status) {
card.initsd();
Expand All @@ -2550,6 +2560,7 @@ void lcd_update() {
if (lcd_sd_status != 2) LCD_MESSAGEPGM(MSG_SD_REMOVED);
}

lcd_sd_status = sd_status;
lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
#if ENABLED(LCD_PROGRESS_BAR)
Expand Down

0 comments on commit 9afa060

Please sign in to comment.