Remove feedmultiplyBckp global variable. Remove redundant isPrintPaused = true assignment, as it is already done in lcd_pause_print(). Remove unused saved_feedmultiply and fanSpeedBckp prototypes. Move isPrintPaused = true assignment to safer location, as LCD_COMMAND_LONG_PAUSE is not reached if lcd_commands_type is not LCD_COMMAND_IDLE.

This commit is contained in:
Marek Bel 2018-09-06 12:23:21 +02:00
parent 05a0b9c939
commit 0fe48de4af
4 changed files with 3 additions and 10 deletions

View file

@ -334,8 +334,6 @@ extern uint8_t active_extruder;
#endif
//Long pause
extern int saved_feedmultiply;
extern int fanSpeedBckp;
extern unsigned long pause_time;
extern unsigned long start_pause_print;
extern unsigned long t_fan_rising_edge;

View file

@ -329,7 +329,6 @@ unsigned int usb_printing_counter;
int8_t lcd_change_fil_state = 0;
int feedmultiplyBckp = 100;
unsigned long pause_time = 0;
unsigned long start_pause_print = millis();
unsigned long t_fan_rising_edge = millis();
@ -3056,7 +3055,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
}
//First backup current position and settings
feedmultiplyBckp = feedmultiply;
int feedmultiplyBckp = feedmultiply;
float HotendTempBckp = degTargetHotend(active_extruder);
int fanSpeedBckp = fanSpeed;
@ -3541,7 +3540,7 @@ void process_commands()
if(READ(FR_SENS)){
feedmultiplyBckp=feedmultiply;
int feedmultiplyBckp=feedmultiply;
float target[4];
float lastpos[4];
target[X_AXIS]=current_position[X_AXIS];

View file

@ -500,9 +500,6 @@ void checkFanSpeed()
}
}
extern void stop_and_save_print_to_ram(float z_move, float e_move);
extern void restore_print_from_ram_and_continue(float e_move);
void fanSpeedError(unsigned char _fan) {
if (get_message_level() != 0 && isPrintPaused) return;
//to ensure that target temp. is not set to zero in case taht we are resuming print
@ -511,7 +508,6 @@ void fanSpeedError(unsigned char _fan) {
lcd_print_stop();
}
else {
isPrintPaused = true;
lcd_pause_print();
}
}

View file

@ -970,7 +970,6 @@ void lcd_commands()
if (!blocks_queued() && !homing_flag)
{
lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20 r=1
isPrintPaused = true;
long_pause();
lcd_commands_type = 0;
lcd_commands_step = 0;
@ -1687,6 +1686,7 @@ void lcd_return_to_status()
void lcd_pause_print() {
lcd_return_to_status();
stop_and_save_print_to_ram(0.0,0.0);
isPrintPaused = true;
if (LCD_COMMAND_IDLE == lcd_commands_type)
{
lcd_commands_type = LCD_COMMAND_LONG_PAUSE;