Browse Source

Fixed bug - unload filament restarts the printer.

Robert Pelnar 6 years ago
parent
commit
e5fee387db
2 changed files with 5 additions and 0 deletions
  1. 3 0
      Firmware/Marlin_main.cpp
  2. 2 0
      Firmware/fsensor.h

+ 3 - 0
Firmware/Marlin_main.cpp

@@ -5789,6 +5789,8 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
 			extr_unload_all(); //unload all filaments
 		}
 #else
+		bool old_fsensor_enabled = fsensor_enabled;
+		fsensor_enabled = false;
 		custom_message = true;
 		custom_message_type = 2;
 		lcd_setstatuspgm(MSG_UNLOADING_FILAMENT); 
@@ -5798,6 +5800,7 @@ case 404:  //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
 		lcd_setstatuspgm(WELCOME_MSG);
 		custom_message = false;
 		custom_message_type = 0;
+		fsensor_enabled = old_fsensor_enabled;
 #endif	
 	}
 	break;

+ 2 - 0
Firmware/fsensor.h

@@ -25,6 +25,8 @@ extern void fsensor_st_block_chunk(block_t* bl, int cnt);
 extern int16_t fsensor_chunk_len;
 //M600 in progress
 extern bool fsensor_M600;
+//enable/disable flag
+extern bool fsensor_enabled;
 
 
 #endif //FSENSOR_H