|
@@ -193,8 +193,10 @@ void MMU2::PowerOn(){
|
|
|
bool MMU2::ReadRegister(uint8_t address){
|
|
|
if( ! WaitForMMUReady())
|
|
|
return false;
|
|
|
- logic.ReadRegister(address);
|
|
|
- manage_response(false, false);
|
|
|
+ do {
|
|
|
+ logic.ReadRegister(address);
|
|
|
+ } while( ! manage_response(false, false) );
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -207,8 +209,10 @@ bool MMU2::WriteRegister(uint8_t address, uint16_t data){
|
|
|
logic.PlanExtraLoadDistance(data);
|
|
|
}
|
|
|
|
|
|
- logic.WriteRegister(address, data);
|
|
|
- manage_response(false, false);
|
|
|
+ do {
|
|
|
+ logic.WriteRegister(address, data);
|
|
|
+ } while( ! manage_response(false, false) );
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -333,8 +337,10 @@ bool MMU2::tool_change(uint8_t index) {
|
|
|
|
|
|
tool_change_extruder = index;
|
|
|
logic.ToolChange(index);
|
|
|
- manage_response(true, true);
|
|
|
-
|
|
|
+ if( ! manage_response(true, true) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
|
|
|
plan_set_e_position(current_position[E_AXIS]);
|
|
|
|
|
@@ -371,7 +377,10 @@ bool MMU2::tool_change(char code, uint8_t slot) {
|
|
|
st_synchronize();
|
|
|
tool_change_extruder = slot;
|
|
|
logic.ToolChange(slot);
|
|
|
- manage_response(false, false);
|
|
|
+ if( ! manage_response(false, false) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
extruder = slot;
|
|
|
SpoolJoin::spooljoin.setSlot(slot);
|
|
|
set_extrude_min_temp(EXTRUDE_MINTEMP);
|
|
@@ -409,7 +418,10 @@ bool MMU2::set_filament_type(uint8_t index, uint8_t type) {
|
|
|
|
|
|
|
|
|
|
|
|
- manage_response(false, false);
|
|
|
+ if( ! manage_response(false, false) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
|
|
|
return true;
|
|
|
}
|
|
@@ -426,7 +438,10 @@ bool MMU2::unload() {
|
|
|
filament_ramming();
|
|
|
|
|
|
logic.UnloadFilament();
|
|
|
- manage_response(false, true);
|
|
|
+ if( ! manage_response(false, true) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
|
|
|
|
|
|
|
|
@@ -442,7 +457,10 @@ bool MMU2::cut_filament(uint8_t index){
|
|
|
|
|
|
ReportingRAII rep(CommandInProgress::CutFilament);
|
|
|
logic.CutFilament(index);
|
|
|
- manage_response(false, true);
|
|
|
+ if( ! manage_response(false, true) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
|
|
|
return true;
|
|
|
}
|
|
@@ -472,7 +490,10 @@ bool MMU2::load_filament(uint8_t index) {
|
|
|
|
|
|
ReportingRAII rep(CommandInProgress::LoadFilament);
|
|
|
logic.LoadFilament(index);
|
|
|
- manage_response(false, false);
|
|
|
+ if( ! manage_response(false, false) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
|
|
|
|
|
|
lcd_update_enable(true);
|
|
@@ -510,7 +531,10 @@ bool MMU2::load_filament_to_nozzle(uint8_t index) {
|
|
|
|
|
|
tool_change_extruder = index;
|
|
|
logic.ToolChange(index);
|
|
|
- manage_response(true, true);
|
|
|
+ if( ! manage_response(true, true) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -541,7 +565,10 @@ bool MMU2::eject_filament(uint8_t index, bool recover) {
|
|
|
plan_buffer_line_curposXYZE(2500.F / 60.F);
|
|
|
st_synchronize();
|
|
|
logic.EjectFilament(index);
|
|
|
- manage_response(false, false);
|
|
|
+ if( ! manage_response(false, false) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
|
|
|
if (recover) {
|
|
|
|
|
@@ -559,7 +586,10 @@ bool MMU2::eject_filament(uint8_t index, bool recover) {
|
|
|
|
|
|
Sound_MakeSound(e_SOUND_TYPE_StandardConfirm);
|
|
|
|
|
|
- manage_response(false, false);
|
|
|
+ if( ! manage_response(false, false) ){
|
|
|
+
|
|
|
+ ;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -702,7 +732,7 @@ void MMU2::CheckUserInput(){
|
|
|
|
|
|
|
|
|
|
|
|
-void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
|
|
|
+bool MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
|
|
|
mmu_print_saved = SavedState::None;
|
|
|
|
|
|
KEEPALIVE_STATE(IN_PROCESS);
|
|
@@ -741,10 +771,13 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
|
|
|
ResumeUnpark();
|
|
|
ResetRetryAttempts();
|
|
|
st_synchronize();
|
|
|
- return;
|
|
|
+ return true;
|
|
|
+ case Interrupted:
|
|
|
+
|
|
|
+ return false;
|
|
|
case VersionMismatch:
|
|
|
CheckUserInput();
|
|
|
- return;
|
|
|
+ return true;
|
|
|
case CommandError:
|
|
|
|
|
|
if (inAutoRetry){
|
|
@@ -784,6 +817,9 @@ StepStatus MMU2::LogicStep(bool reportErrors) {
|
|
|
LogEchoEvent_P(PSTR("MMU Button pushed"));
|
|
|
CheckUserInput();
|
|
|
break;
|
|
|
+ case Interrupted:
|
|
|
+
|
|
|
+ break;
|
|
|
default:
|
|
|
if(reportErrors) {
|
|
|
switch (ss)
|