Quellcode durchsuchen

Add mmu_continue_loading blocking variant and use it for usb printing, so that "ok" is not returned to the controller in case MMU load failed.

Known limitation: MMU load failed is not handled properly if it happens again after user clicked printer button to continue print.
Marek Bel vor 5 Jahren
Ursprung
Commit
bf1a55ab02
3 geänderte Dateien mit 32 neuen und 9 gelöschten Zeilen
  1. 3 2
      Firmware/Marlin_main.cpp
  2. 28 6
      Firmware/mmu.cpp
  3. 1 1
      Firmware/mmu.h

+ 3 - 2
Firmware/Marlin_main.cpp

@@ -7014,7 +7014,7 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
 	  	if (mmu_enabled) 
 		{
 			st_synchronize();
-			mmu_continue_loading();
+			mmu_continue_loading(is_usb_printing);
 			mmu_extruder = tmp_extruder; //filament change is finished
 			mmu_load_to_nozzle();
 		}
@@ -7052,7 +7052,8 @@ if((eSoundMode==e_SOUND_MODE_LOUD)||(eSoundMode==e_SOUND_MODE_ONCE))
 				  mmu_command(MmuCmd::T0 + tmp_extruder);
 
 				  manage_response(true, true, MMU_TCODE_MOVE);
-				  mmu_continue_loading();
+		          mmu_continue_loading(is_usb_printing);
+
 				  mmu_extruder = tmp_extruder; //filament change is finished
 
 				  if (load_to_nozzle)// for single material usage with mmu

+ 28 - 6
Firmware/mmu.cpp

@@ -878,7 +878,7 @@ void mmu_M600_load_filament(bool automatic, float nozzle_temp)
     mmu_command(MmuCmd::T0 + tmp_extruder);
 
     manage_response(false, true, MMU_LOAD_MOVE);
-    mmu_continue_loading();
+    mmu_continue_loading(is_usb_printing);
     mmu_extruder = tmp_extruder; //filament change is finished
 
     mmu_load_to_nozzle();
@@ -1363,7 +1363,7 @@ bFilamentAction=false;                            // NOT in "mmu_load_to_nozzle_
 	lcd_print(tmp_extruder + 1);
 	mmu_command(MmuCmd::T0 + tmp_extruder);
 	manage_response(true, true, MMU_TCODE_MOVE);
-	mmu_continue_loading();
+	mmu_continue_loading(false);
 	mmu_extruder = tmp_extruder; //filament change is finished
 	mmu_load_to_nozzle();
 	load_filament_final_feed();
@@ -1464,7 +1464,10 @@ static void load_more()
     st_synchronize();
 }
 
-void mmu_continue_loading() 
+//! @par blocking
+//!  * true blocking
+//!  * false non-blocking
+void mmu_continue_loading(bool blocking)
 {
 	if (ir_sensor_detected)
 	{
@@ -1510,9 +1513,28 @@ void mmu_continue_loading()
 
                 setAllTargetHotends(0);
                 lcd_setstatuspgm(_i("MMU load failed     "));////MSG_RECOVERING_PRINT c=20 r=1
-                mmu_fil_loaded = false; //so we can retry same T-code again
-                isPrintPaused = true;
-                mmu_command(MmuCmd::W0);
+
+                if (blocking)
+                {
+                    KEEPALIVE_STATE(PAUSED_FOR_USER);
+                    lcd_consume_click();
+                    while(!lcd_clicked()){
+                        manage_heater();
+                        manage_inactivity(true);
+                        lcd_update(0);
+                    }
+                    KEEPALIVE_STATE(IN_HANDLER);
+                    restore_print_from_ram_and_continue(0);
+                    mmu_command(MmuCmd::T0 + tmp_extruder);
+                    manage_response(true, true, MMU_TCODE_MOVE);
+                    load_more();
+                }
+                else
+                {
+                    mmu_fil_loaded = false; //so we can retry same T-code again
+                    isPrintPaused = true;
+                    mmu_command(MmuCmd::W0);
+                }
             }
 		}
 	}

+ 1 - 1
Firmware/mmu.h

@@ -134,7 +134,7 @@ extern void mmu_eject_filament(uint8_t filament, bool recover);
 #ifdef MMU_HAS_CUTTER
 extern void mmu_cut_filament(uint8_t filament_nr);
 #endif //MMU_HAS_CUTTER
-extern void mmu_continue_loading();
+extern void mmu_continue_loading(bool blocking);
 extern void mmu_filament_ramming();
 extern void mmu_wait_for_heater_blocking();
 extern void mmu_load_step(bool synchronize = true);