Переглянути джерело

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.

Marek Bel 6 роки тому
батько
коміт
0fe48de4af
4 змінених файлів з 3 додано та 10 видалено
  1. 0 2
      Firmware/Marlin.h
  2. 2 3
      Firmware/Marlin_main.cpp
  3. 0 4
      Firmware/temperature.cpp
  4. 1 1
      Firmware/ultralcd.cpp

+ 0 - 2
Firmware/Marlin.h

@@ -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;

+ 2 - 3
Firmware/Marlin_main.cpp

@@ -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];

+ 0 - 4
Firmware/temperature.cpp

@@ -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();
 		}
 	}

+ 1 - 1
Firmware/ultralcd.cpp

@@ -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;