diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 45a1d4012..f199df2ae 100644 --- a/Firmware/Marlin_main.cpp +++ b/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 diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index dad00f8ee..1c671cfa3 100644 --- a/Firmware/mmu.cpp +++ b/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); + } } } } diff --git a/Firmware/mmu.h b/Firmware/mmu.h index 41e0ba1f4..f0fc0deb0 100644 --- a/Firmware/mmu.h +++ b/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);