Proposed feature: Set Home Offsets

Add an item to the LCD menu that applies the current axis position to
the “add_homeing” offset.
This commit is contained in:
Scott Lahteine
2014-10-05 13:35:45 -07:00
parent cb4a6dd2dc
commit 2f6c57eadc
2 changed files with 29 additions and 0 deletions

View File

@ -307,6 +307,23 @@ static void lcd_autostart_sd()
}
#endif
void lcd_set_home_offsets()
{
for(int8_t i=0; i < NUM_AXIS; i++) {
if (i != E_AXIS) {
add_homeing[i] -= current_position[i];
current_position[i] = 0.0;
}
}
plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
// Audio feedback
enquecommand_P(PSTR("M300 S659 P200"));
enquecommand_P(PSTR("M300 S698 P200"));
lcd_return_to_status();
}
#ifdef BABYSTEPPING
static void lcd_babystep_x()
{
@ -566,6 +583,7 @@ static void lcd_prepare_menu()
#endif
MENU_ITEM(gcode, MSG_DISABLE_STEPPERS, PSTR("M84"));
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
MENU_ITEM(function, MSG_SET_HOME_OFFSETS, lcd_set_home_offsets);
//MENU_ITEM(gcode, MSG_SET_ORIGIN, PSTR("G92 X0 Y0 Z0"));
#if TEMP_SENSOR_0 != 0
#if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_BED != 0