move engaged from lcd console refreshes power off timeout

master
Josef Pavlik 11 years ago
parent 831fc2a952
commit 477b6fa1df

@ -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 prepare_arc_move(char isclockwise);
void clamp_to_software_endstops(float target[3]); void clamp_to_software_endstops(float target[3]);
void refresh_cmd_timeout(void);
#ifdef FAST_PWM_FAN #ifdef FAST_PWM_FAN
void setPwmFrequency(uint8_t pin, int val); void setPwmFrequency(uint8_t pin, int val);
#endif #endif

@ -1046,6 +1046,10 @@ static void homeaxis(int axis) {
} }
} }
#define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS) #define HOMEAXIS(LETTER) homeaxis(LETTER##_AXIS)
+void refresh_cmd_timeout(void)
{
previous_millis_cmd = millis();
}
void process_commands() void process_commands()
{ {

@ -460,6 +460,7 @@ static void lcd_move_x()
{ {
if (encoderPosition != 0) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[X_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS) if (min_software_endstops && current_position[X_AXIS] < X_MIN_POS)
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) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[Y_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS) if (min_software_endstops && current_position[Y_AXIS] < Y_MIN_POS)
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) if (encoderPosition != 0)
{ {
refresh_cmd_timeout();
current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[Z_AXIS] += float((int)encoderPosition) * move_menu_scale;
if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS) if (min_software_endstops && current_position[Z_AXIS] < Z_MIN_POS)
current_position[Z_AXIS] = Z_MIN_POS; current_position[Z_AXIS] = Z_MIN_POS;

Loading…
Cancel
Save