Merge pull request #3426 from thinkyhead/rc_no_unhomed_lcd_move_on_delta_scara
No LCD Move for unhomed Delta/SCARA
This commit is contained in:
commit
4e17187c96
@ -553,7 +553,7 @@ void lcd_set_home_offsets() {
|
|||||||
|
|
||||||
static void _lcd_babystep(const int axis, const char* msg) {
|
static void _lcd_babystep(const int axis, const char* msg) {
|
||||||
ENCODER_DIRECTION_NORMAL();
|
ENCODER_DIRECTION_NORMAL();
|
||||||
if (encoderPosition != 0) {
|
if (encoderPosition) {
|
||||||
int distance = (int)encoderPosition * BABYSTEP_MULTIPLICATOR;
|
int distance = (int)encoderPosition * BABYSTEP_MULTIPLICATOR;
|
||||||
encoderPosition = 0;
|
encoderPosition = 0;
|
||||||
lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
|
lcdDrawUpdate = LCD_DRAW_UPDATE_CALL_REDRAW;
|
||||||
@ -1124,7 +1124,7 @@ float move_menu_scale;
|
|||||||
|
|
||||||
static void _lcd_move(const char* name, AxisEnum axis, float min, float max) {
|
static void _lcd_move(const char* name, AxisEnum axis, float min, float max) {
|
||||||
ENCODER_DIRECTION_NORMAL();
|
ENCODER_DIRECTION_NORMAL();
|
||||||
if ((encoderPosition != 0) && (movesplanned() <= 3)) {
|
if (encoderPosition && movesplanned() <= 3) {
|
||||||
refresh_cmd_timeout();
|
refresh_cmd_timeout();
|
||||||
current_position[axis] += float((int)encoderPosition) * move_menu_scale;
|
current_position[axis] += float((int)encoderPosition) * move_menu_scale;
|
||||||
if (min_software_endstops) NOLESS(current_position[axis], min);
|
if (min_software_endstops) NOLESS(current_position[axis], min);
|
||||||
@ -1156,7 +1156,7 @@ static void lcd_move_e(
|
|||||||
unsigned short original_active_extruder = active_extruder;
|
unsigned short original_active_extruder = active_extruder;
|
||||||
active_extruder = e;
|
active_extruder = e;
|
||||||
#endif
|
#endif
|
||||||
if ((encoderPosition != 0) && (movesplanned() <= 3)) {
|
if (encoderPosition && movesplanned() <= 3) {
|
||||||
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
|
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
|
||||||
encoderPosition = 0;
|
encoderPosition = 0;
|
||||||
line_to_current(E_AXIS);
|
line_to_current(E_AXIS);
|
||||||
@ -1203,13 +1203,22 @@ static void lcd_move_e(
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if ENABLED(DELTA) || ENABLED(SCARA)
|
||||||
|
#define _MOVE_XYZ_ALLOWED (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && axis_homed[Z_AXIS])
|
||||||
|
#else
|
||||||
|
#define _MOVE_XYZ_ALLOWED true
|
||||||
|
#endif
|
||||||
|
|
||||||
static void _lcd_move_menu_axis() {
|
static void _lcd_move_menu_axis() {
|
||||||
START_MENU();
|
START_MENU();
|
||||||
MENU_ITEM(back, MSG_MOVE_AXIS);
|
MENU_ITEM(back, MSG_MOVE_AXIS);
|
||||||
MENU_ITEM(submenu, MSG_MOVE_X, lcd_move_x);
|
|
||||||
MENU_ITEM(submenu, MSG_MOVE_Y, lcd_move_y);
|
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_menu_scale < 10.0) {
|
||||||
MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
|
if (_MOVE_XYZ_ALLOWED) MENU_ITEM(submenu, MSG_MOVE_Z, lcd_move_z);
|
||||||
#if EXTRUDERS == 1
|
#if EXTRUDERS == 1
|
||||||
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
|
MENU_ITEM(submenu, MSG_MOVE_E, lcd_move_e);
|
||||||
#else
|
#else
|
||||||
@ -1248,7 +1257,10 @@ static void lcd_move_menu_01mm() {
|
|||||||
static void lcd_move_menu() {
|
static void lcd_move_menu() {
|
||||||
START_MENU();
|
START_MENU();
|
||||||
MENU_ITEM(back, MSG_PREPARE);
|
MENU_ITEM(back, MSG_PREPARE);
|
||||||
MENU_ITEM(submenu, MSG_MOVE_10MM, lcd_move_menu_10mm);
|
|
||||||
|
if (_MOVE_XYZ_ALLOWED)
|
||||||
|
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_1MM, lcd_move_menu_1mm);
|
||||||
MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
|
MENU_ITEM(submenu, MSG_MOVE_01MM, lcd_move_menu_01mm);
|
||||||
//TODO:X,Y,Z,E
|
//TODO:X,Y,Z,E
|
||||||
@ -1629,7 +1641,7 @@ static void lcd_control_volumetric_menu() {
|
|||||||
#if ENABLED(HAS_LCD_CONTRAST)
|
#if ENABLED(HAS_LCD_CONTRAST)
|
||||||
static void lcd_set_contrast() {
|
static void lcd_set_contrast() {
|
||||||
ENCODER_DIRECTION_NORMAL();
|
ENCODER_DIRECTION_NORMAL();
|
||||||
if (encoderPosition != 0) {
|
if (encoderPosition) {
|
||||||
#if ENABLED(U8GLIB_LM6059_AF)
|
#if ENABLED(U8GLIB_LM6059_AF)
|
||||||
lcd_contrast += encoderPosition;
|
lcd_contrast += encoderPosition;
|
||||||
lcd_contrast &= 0xFF;
|
lcd_contrast &= 0xFF;
|
||||||
|
Loading…
Reference in New Issue
Block a user