diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index af3325be41..4d6b227287 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -189,6 +189,8 @@ void enquecommand_P(const char *cmd); //put an ascii command at the end of the c void prepare_arc_move(char isclockwise); void clamp_to_software_endstops(float target[3]); +void refresh_cmd_timeout(void); + #ifdef FAST_PWM_FAN void setPwmFrequency(uint8_t pin, int val); #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 920aed00c4..bf13f8e620 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1046,6 +1046,10 @@ static void homeaxis(int axis) { } } #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) ++void refresh_cmd_timeout(void) +{ + previous_millis_cmd = millis(); +} void process_commands() { diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 77be8e8e35..acbc8d6e4b 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -460,6 +460,7 @@ static void lcd_move_x() { if (encoderPosition != 0) { + refresh_cmd_timeout(); current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale; if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS) current_position[X_AXIS] = X_MIN_POS; @@ -489,6 +490,7 @@ static void lcd_move_y() { if (encoderPosition != 0) { + refresh_cmd_timeout(); current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale; if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS) current_position[Y_AXIS] = Y_MIN_POS; @@ -518,6 +520,7 @@ static void lcd_move_z() { if (encoderPosition != 0) { + refresh_cmd_timeout(); current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale; if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) current_position[Z_AXIS] = Z_MIN_POS;