|
|
@ -390,7 +390,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
|
|
|
bool screen_changed;
|
|
|
|
bool screen_changed;
|
|
|
|
|
|
|
|
|
|
|
|
// LCD and menu clicks
|
|
|
|
// LCD and menu clicks
|
|
|
|
bool lcd_clicked, wait_for_unclick, defer_return_to_status;
|
|
|
|
bool lcd_clicked, wait_for_unclick, defer_return_to_status, no_reentrance;
|
|
|
|
|
|
|
|
|
|
|
|
// Variables used when editing values.
|
|
|
|
// Variables used when editing values.
|
|
|
|
const char* editLabel;
|
|
|
|
const char* editLabel;
|
|
|
@ -422,6 +422,27 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Synchronize safely while holding the current screen
|
|
|
|
|
|
|
|
* This blocks all further screen or stripe updates once called
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
inline void lcd_synchronize() {
|
|
|
|
|
|
|
|
lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_MOVING));
|
|
|
|
|
|
|
|
if (no_reentrance) return;
|
|
|
|
|
|
|
|
no_reentrance = true;
|
|
|
|
|
|
|
|
screenFunc_t old_screen = currentScreen;
|
|
|
|
|
|
|
|
lcd_goto_screen(lcd_synchronize);
|
|
|
|
|
|
|
|
stepper.synchronize();
|
|
|
|
|
|
|
|
no_reentrance = false;
|
|
|
|
|
|
|
|
lcd_goto_screen(old_screen);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void lcd_wait_for_homing() {
|
|
|
|
|
|
|
|
no_reentrance = true;
|
|
|
|
|
|
|
|
while (!axis_homed[X_AXIS] || !axis_homed[Y_AXIS] || !axis_homed[Z_AXIS]) idle();
|
|
|
|
|
|
|
|
no_reentrance = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
|
|
|
|
void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
|
|
|
|
|
|
|
|
|
|
|
|
void lcd_save_previous_screen() {
|
|
|
|
void lcd_save_previous_screen() {
|
|
|
@ -1063,6 +1084,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
// Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z
|
|
|
|
// Note: During Manual Bed Leveling the homed Z position is MESH_HOME_SEARCH_Z
|
|
|
|
// Z position will be restored with the final action, a G28
|
|
|
|
// Z position will be restored with the final action, a G28
|
|
|
|
inline void _mbl_goto_xy(float x, float y) {
|
|
|
|
inline void _mbl_goto_xy(float x, float y) {
|
|
|
|
|
|
|
|
if (no_reentrance) return;
|
|
|
|
current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z + Z_HOMING_HEIGHT);
|
|
|
|
current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z + Z_HOMING_HEIGHT);
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
current_position[X_AXIS] = LOGICAL_X_POSITION(x);
|
|
|
|
current_position[X_AXIS] = LOGICAL_X_POSITION(x);
|
|
|
@ -1072,7 +1094,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z);
|
|
|
|
current_position[Z_AXIS] = LOGICAL_Z_POSITION(MESH_HOME_SEARCH_Z);
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
stepper.synchronize();
|
|
|
|
lcd_synchronize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _lcd_level_goto_next_point();
|
|
|
|
void _lcd_level_goto_next_point();
|
|
|
@ -1094,6 +1116,8 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
void _lcd_level_bed_get_z() {
|
|
|
|
void _lcd_level_bed_get_z() {
|
|
|
|
ENCODER_DIRECTION_NORMAL();
|
|
|
|
ENCODER_DIRECTION_NORMAL();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (no_reentrance) goto KeepDrawing;
|
|
|
|
|
|
|
|
|
|
|
|
// Encoder wheel adjusts the Z position
|
|
|
|
// Encoder wheel adjusts the Z position
|
|
|
|
if (encoderPosition) {
|
|
|
|
if (encoderPosition) {
|
|
|
|
refresh_cmd_timeout();
|
|
|
|
refresh_cmd_timeout();
|
|
|
@ -1121,7 +1145,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
|
|
|
|
|
|
|
|
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + Z_HOMING_HEIGHT;
|
|
|
|
current_position[Z_AXIS] = MESH_HOME_SEARCH_Z + Z_HOMING_HEIGHT;
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
stepper.synchronize();
|
|
|
|
lcd_synchronize();
|
|
|
|
|
|
|
|
|
|
|
|
mbl.set_has_mesh(true);
|
|
|
|
mbl.set_has_mesh(true);
|
|
|
|
enqueue_and_echo_commands_P(PSTR("G28"));
|
|
|
|
enqueue_and_echo_commands_P(PSTR("G28"));
|
|
|
@ -1141,6 +1165,7 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
debounce_click = false;
|
|
|
|
debounce_click = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
KeepDrawing:
|
|
|
|
// Update on first display, then only on updates to Z position
|
|
|
|
// Update on first display, then only on updates to Z position
|
|
|
|
// Show message above on clicks instead
|
|
|
|
// Show message above on clicks instead
|
|
|
|
if (lcdDrawUpdate) {
|
|
|
|
if (lcdDrawUpdate) {
|
|
|
@ -1215,8 +1240,9 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
LCDVIEW_CALL_NO_REDRAW
|
|
|
|
LCDVIEW_CALL_NO_REDRAW
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
;
|
|
|
|
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
|
|
|
if (no_reentrance) return;
|
|
|
|
lcd_goto_screen(_lcd_level_bed_homing_done);
|
|
|
|
lcd_wait_for_homing();
|
|
|
|
|
|
|
|
lcd_goto_screen(_lcd_level_bed_homing_done);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1256,6 +1282,14 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
MENU_BACK(MSG_MAIN);
|
|
|
|
MENU_BACK(MSG_MAIN);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Move Axis
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
|
|
|
|
if (axis_homed[Z_AXIS])
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Auto Home
|
|
|
|
// Auto Home
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -1283,11 +1317,6 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
|
|
|
|
MENU_ITEM(submenu, MSG_LEVEL_BED, lcd_level_bed);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Move Axis
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_AXIS, lcd_move_menu);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Disable Steppers
|
|
|
|
// Disable Steppers
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -1341,14 +1370,50 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
END_MENU();
|
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float move_menu_scale;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA_CALIBRATION_MENU)
|
|
|
|
#if ENABLED(DELTA_CALIBRATION_MENU)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void lcd_move_z();
|
|
|
|
|
|
|
|
void lcd_delta_calibrate_menu();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _lcd_calibrate_homing() {
|
|
|
|
|
|
|
|
if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, PSTR(MSG_LEVEL_BED_HOMING));
|
|
|
|
|
|
|
|
lcdDrawUpdate =
|
|
|
|
|
|
|
|
#if ENABLED(DOGLCD)
|
|
|
|
|
|
|
|
LCDVIEW_CALL_REDRAW_NEXT
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
LCDVIEW_CALL_NO_REDRAW
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
|
|
|
|
|
|
|
lcd_goto_previous_menu();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _lcd_delta_calibrate_home() {
|
|
|
|
|
|
|
|
enqueue_and_echo_commands_P(PSTR("G28"));
|
|
|
|
|
|
|
|
lcd_goto_screen(_lcd_calibrate_homing);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Move directly to the tower position with uninterpolated moves
|
|
|
|
|
|
|
|
// If we used interpolated moves it would cause this to become re-entrant
|
|
|
|
void _goto_tower_pos(const float &a) {
|
|
|
|
void _goto_tower_pos(const float &a) {
|
|
|
|
do_blocking_move_to(
|
|
|
|
if (no_reentrance) return;
|
|
|
|
a < 0 ? X_HOME_POS : sin(a) * -(DELTA_PRINTABLE_RADIUS),
|
|
|
|
|
|
|
|
a < 0 ? Y_HOME_POS : cos(a) * (DELTA_PRINTABLE_RADIUS),
|
|
|
|
current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
|
|
|
|
4
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
current_position[X_AXIS] = a < 0 ? X_HOME_POS : sin(a) * -(DELTA_PRINTABLE_RADIUS);
|
|
|
|
|
|
|
|
current_position[Y_AXIS] = a < 0 ? Y_HOME_POS : cos(a) * (DELTA_PRINTABLE_RADIUS);
|
|
|
|
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
current_position[Z_AXIS] = 4.0;
|
|
|
|
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lcd_synchronize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
move_menu_scale = 0.1;
|
|
|
|
|
|
|
|
lcd_goto_screen(lcd_move_z);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
|
|
|
|
void _goto_tower_x() { _goto_tower_pos(RADIANS(120)); }
|
|
|
@ -1359,18 +1424,18 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
void lcd_delta_calibrate_menu() {
|
|
|
|
void lcd_delta_calibrate_menu() {
|
|
|
|
START_MENU();
|
|
|
|
START_MENU();
|
|
|
|
MENU_BACK(MSG_MAIN);
|
|
|
|
MENU_BACK(MSG_MAIN);
|
|
|
|
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
|
|
|
|
MENU_ITEM(submenu, MSG_AUTO_HOME, _lcd_delta_calibrate_home);
|
|
|
|
MENU_ITEM(function, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
|
|
|
|
if (axis_homed[Z_AXIS]) {
|
|
|
|
MENU_ITEM(function, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
|
|
|
|
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_X, _goto_tower_x);
|
|
|
|
MENU_ITEM(function, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
|
|
|
|
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Y, _goto_tower_y);
|
|
|
|
MENU_ITEM(function, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
|
|
|
|
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_Z, _goto_tower_z);
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_DELTA_CALIBRATE_CENTER, _goto_center);
|
|
|
|
|
|
|
|
}
|
|
|
|
END_MENU();
|
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // DELTA_CALIBRATION_MENU
|
|
|
|
#endif // DELTA_CALIBRATION_MENU
|
|
|
|
|
|
|
|
|
|
|
|
float move_menu_scale;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* If the most recent manual move hasn't been fed to the planner yet,
|
|
|
|
* If the most recent manual move hasn't been fed to the planner yet,
|
|
|
|
* and the planner can accept one, send immediately
|
|
|
|
* and the planner can accept one, send immediately
|
|
|
@ -1495,58 +1560,48 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_KINEMATIC
|
|
|
|
screenFunc_t _manual_move_func_ptr;
|
|
|
|
#define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define _MOVE_XYZ_ALLOWED true
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void _lcd_move_menu_axis() {
|
|
|
|
void lcd_move_menu_10mm() { move_menu_scale = 10.0; lcd_goto_screen(_manual_move_func_ptr); }
|
|
|
|
START_MENU();
|
|
|
|
void lcd_move_menu_1mm() { move_menu_scale = 1.0; lcd_goto_screen(_manual_move_func_ptr); }
|
|
|
|
MENU_BACK(MSG_MOVE_AXIS);
|
|
|
|
void lcd_move_menu_01mm() { move_menu_scale = 0.1; lcd_goto_screen(_manual_move_func_ptr); }
|
|
|
|
|
|
|
|
|
|
|
|
if (_MOVE_XYZ_ALLOWED) {
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (move_menu_scale < 10.0) {
|
|
|
|
|
|
|
|
if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SWITCHING_EXTRUDER)
|
|
|
|
|
|
|
|
if (active_extruder)
|
|
|
|
|
|
|
|
MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
|
|
|
|
void _lcd_move_distance_menu(AxisEnum axis, screenFunc_t func) {
|
|
|
|
#if E_MANUAL > 1
|
|
|
|
_manual_move_func_ptr = func;
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_e0);
|
|
|
|
START_MENU();
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_e1);
|
|
|
|
if (LCD_HEIGHT >= 4) {
|
|
|
|
#if E_MANUAL > 2
|
|
|
|
switch(axis) {
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_e2);
|
|
|
|
case X_AXIS:
|
|
|
|
#if E_MANUAL > 3
|
|
|
|
STATIC_ITEM(MSG_MOVE_X, true, true); break;
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_e3);
|
|
|
|
case Y_AXIS:
|
|
|
|
#endif
|
|
|
|
STATIC_ITEM(MSG_MOVE_Y, true, true); break;
|
|
|
|
#endif
|
|
|
|
case Z_AXIS:
|
|
|
|
#endif
|
|
|
|
STATIC_ITEM(MSG_MOVE_Z, true, true); break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
STATIC_ITEM(MSG_MOVE_E, true, true); break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MENU_BACK(MSG_MOVE_AXIS);
|
|
|
|
|
|
|
|
if (axis == X_AXIS || axis == Y_AXIS)
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm);
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
|
|
|
|
END_MENU();
|
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void lcd_move_get_x_amount() { _lcd_move_distance_menu(X_AXIS, lcd_move_x); }
|
|
|
|
void lcd_move_menu_10mm() {
|
|
|
|
void lcd_move_get_y_amount() { _lcd_move_distance_menu(Y_AXIS, lcd_move_y); }
|
|
|
|
move_menu_scale = 10.0;
|
|
|
|
void lcd_move_get_z_amount() { _lcd_move_distance_menu(Z_AXIS, lcd_move_z); }
|
|
|
|
_lcd_move_menu_axis();
|
|
|
|
void lcd_move_get_e_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e); }
|
|
|
|
}
|
|
|
|
#if E_MANUAL > 1
|
|
|
|
void lcd_move_menu_1mm() {
|
|
|
|
void lcd_move_get_e0_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e0); }
|
|
|
|
move_menu_scale = 1.0;
|
|
|
|
void lcd_move_get_e1_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e1); }
|
|
|
|
_lcd_move_menu_axis();
|
|
|
|
#if E_MANUAL > 2
|
|
|
|
}
|
|
|
|
void lcd_move_get_e2_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e2); }
|
|
|
|
void lcd_move_menu_01mm() {
|
|
|
|
#if E_MANUAL > 3
|
|
|
|
move_menu_scale = 0.1;
|
|
|
|
void lcd_move_get_e3_amount() { _lcd_move_distance_menu(E_AXIS, lcd_move_e3); }
|
|
|
|
_lcd_move_menu_axis();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1554,16 +1609,63 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if IS_KINEMATIC
|
|
|
|
|
|
|
|
#define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
|
|
|
|
#define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
|
|
|
|
|
|
|
|
void lcd_lower_z_to_clip_height() {
|
|
|
|
|
|
|
|
if (!no_reentrance) {
|
|
|
|
|
|
|
|
current_position[Z_AXIS] = delta_clip_start_height;
|
|
|
|
|
|
|
|
line_to_current(Z_AXIS);
|
|
|
|
|
|
|
|
lcd_synchronize();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define _MOVE_XY_ALLOWED true
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define _MOVE_XYZ_ALLOWED true
|
|
|
|
|
|
|
|
#define _MOVE_XY_ALLOWED true
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void lcd_move_menu() {
|
|
|
|
void lcd_move_menu() {
|
|
|
|
START_MENU();
|
|
|
|
START_MENU();
|
|
|
|
MENU_BACK(MSG_PREPARE);
|
|
|
|
MENU_BACK(MSG_PREPARE);
|
|
|
|
|
|
|
|
|
|
|
|
if (_MOVE_XYZ_ALLOWED)
|
|
|
|
if (_MOVE_XYZ_ALLOWED) {
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
|
|
|
|
if (_MOVE_XY_ALLOWED) {
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_get_x_amount);
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_get_y_amount);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
MENU_ITEM(function, MSG_FREE_XY, lcd_lower_z_to_clip_height);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_get_z_amount);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SWITCHING_EXTRUDER)
|
|
|
|
|
|
|
|
if (active_extruder)
|
|
|
|
|
|
|
|
MENU_ITEM(gcode, MSG_SELECT " " MSG_E1, PSTR("T0"));
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
MENU_ITEM(gcode, MSG_SELECT " " MSG_E2, PSTR("T1"));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_get_e_amount);
|
|
|
|
|
|
|
|
#if E_MANUAL > 1
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E1, lcd_move_get_e0_amount);
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E2, lcd_move_get_e1_amount);
|
|
|
|
|
|
|
|
#if E_MANUAL > 2
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E3, lcd_move_get_e2_amount);
|
|
|
|
|
|
|
|
#if E_MANUAL > 3
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_E MSG_MOVE_E4, lcd_move_get_e3_amount);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_1MM, lcd_move_menu_1mm);
|
|
|
|
|
|
|
|
MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
|
|
|
|
|
|
|
|
//TODO:X,Y,Z,E
|
|
|
|
|
|
|
|
END_MENU();
|
|
|
|
END_MENU();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2502,6 +2604,39 @@ void kill_screen(const char* lcd_msg) {
|
|
|
|
void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); }
|
|
|
|
void reprapworld_keypad_move_y_down() { _reprapworld_keypad_move(Y_AXIS, 1); }
|
|
|
|
void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait
|
|
|
|
void reprapworld_keypad_move_home() { enqueue_and_echo_commands_P(PSTR("G28")); } // move all axes home and wait
|
|
|
|
void reprapworld_keypad_move_menu() { lcd_goto_screen(lcd_move_menu); }
|
|
|
|
void reprapworld_keypad_move_menu() { lcd_goto_screen(lcd_move_menu); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void handle_reprapworld_keypad() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint8_t keypad_debounce = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!REPRAPWORLD_KEYPAD_PRESSED) {
|
|
|
|
|
|
|
|
if (keypad_debounce > 0) keypad_debounce--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!keypad_debounce) {
|
|
|
|
|
|
|
|
keypad_debounce = 2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(DELTA) && Z_HOME_DIR == -1
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
|
|
|
|
|
|
|
|
#if ENABLED(DELTA) || Z_HOME_DIR != -1
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // REPRAPWORLD_KEYPAD
|
|
|
|
#endif // REPRAPWORLD_KEYPAD
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2773,36 +2908,8 @@ void lcd_update() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD)
|
|
|
|
#if ENABLED(REPRAPWORLD_KEYPAD)
|
|
|
|
|
|
|
|
handle_reprapworld_keypad();
|
|
|
|
static uint8_t keypad_debounce = 0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (!REPRAPWORLD_KEYPAD_PRESSED) {
|
|
|
|
|
|
|
|
if (keypad_debounce > 0) keypad_debounce--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!keypad_debounce) {
|
|
|
|
|
|
|
|
keypad_debounce = 2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_MENU) reprapworld_keypad_move_menu();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(DELTA) && Z_HOME_DIR == -1
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS]) {
|
|
|
|
|
|
|
|
#if ENABLED(DELTA) || Z_HOME_DIR != -1
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_UP) reprapworld_keypad_move_z_up();
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Z_DOWN) reprapworld_keypad_move_z_down();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_X_LEFT) reprapworld_keypad_move_x_left();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_X_RIGHT) reprapworld_keypad_move_x_right();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Y_DOWN) reprapworld_keypad_move_y_down();
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_Y_UP) reprapworld_keypad_move_y_up();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
if (REPRAPWORLD_KEYPAD_MOVE_HOME) reprapworld_keypad_move_home();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // REPRAPWORLD_KEYPAD
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
|
|
|
|
bool encoderPastThreshold = (abs(encoderDiff) >= ENCODER_PULSES_PER_STEP);
|
|
|
|
if (encoderPastThreshold || lcd_clicked) {
|
|
|
|
if (encoderPastThreshold || lcd_clicked) {
|
|
|
|