parent
9f9bb12eeb
commit
67d7be2b2d
|
|
@ -72,7 +72,7 @@ void MMU2::Start() {
|
||||||
PowerOn();
|
PowerOn();
|
||||||
mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication
|
mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication
|
||||||
|
|
||||||
extruder = MMU2_NO_TOOL;
|
SetCurrentTool(MMU2_NO_TOOL);
|
||||||
state = xState::Connecting;
|
state = xState::Connecting;
|
||||||
|
|
||||||
// start the communication
|
// start the communication
|
||||||
|
|
@ -357,7 +357,7 @@ void MMU2::ToolChangeCommon(uint8_t slot) {
|
||||||
static_cast<void>(manage_response(true, true)); // yes, I'd like to silence [[nodiscard]] warning at this spot by casting to void
|
static_cast<void>(manage_response(true, true)); // yes, I'd like to silence [[nodiscard]] warning at this spot by casting to void
|
||||||
}
|
}
|
||||||
|
|
||||||
extruder = slot; //filament change is finished
|
SetCurrentTool(slot); //filament change is finished
|
||||||
SpoolJoin::spooljoin.setSlot(slot);
|
SpoolJoin::spooljoin.setSlot(slot);
|
||||||
|
|
||||||
++toolchange_counter;
|
++toolchange_counter;
|
||||||
|
|
@ -428,6 +428,12 @@ uint8_t MMU2::get_tool_change_tool() const {
|
||||||
return tool_change_extruder == MMU2_NO_TOOL ? (uint8_t)FILAMENT_UNKNOWN : tool_change_extruder;
|
return tool_change_extruder == MMU2_NO_TOOL ? (uint8_t)FILAMENT_UNKNOWN : tool_change_extruder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MMU2::SetCurrentTool(uint8_t ex){
|
||||||
|
extruder = ex;
|
||||||
|
MMU2_ECHO_MSGRPGM(PSTR("MMU2tool="));
|
||||||
|
SERIAL_ECHOLN((int)ex);
|
||||||
|
}
|
||||||
|
|
||||||
bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) {
|
bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) {
|
||||||
if (!WaitForMMUReady())
|
if (!WaitForMMUReady())
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -462,7 +468,7 @@ void MMU2::UnloadInner() {
|
||||||
MakeSound(Confirm);
|
MakeSound(Confirm);
|
||||||
|
|
||||||
// no active tool
|
// no active tool
|
||||||
extruder = MMU2_NO_TOOL;
|
SetCurrentTool(MMU2_NO_TOOL);
|
||||||
tool_change_extruder = MMU2_NO_TOOL;
|
tool_change_extruder = MMU2_NO_TOOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -504,7 +510,7 @@ bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) {
|
||||||
|
|
||||||
ReportingRAII rep(CommandInProgress::CutFilament);
|
ReportingRAII rep(CommandInProgress::CutFilament);
|
||||||
CutFilamentInner(slot);
|
CutFilamentInner(slot);
|
||||||
extruder = MMU2_NO_TOOL;
|
SetCurrentTool(MMU2_NO_TOOL);
|
||||||
tool_change_extruder = MMU2_NO_TOOL;
|
tool_change_extruder = MMU2_NO_TOOL;
|
||||||
MakeSound(SoundType::Confirm);
|
MakeSound(SoundType::Confirm);
|
||||||
}
|
}
|
||||||
|
|
@ -587,7 +593,7 @@ bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) {
|
||||||
break;
|
break;
|
||||||
IncrementMMUFails();
|
IncrementMMUFails();
|
||||||
}
|
}
|
||||||
extruder = MMU2_NO_TOOL;
|
SetCurrentTool(MMU2_NO_TOOL);
|
||||||
tool_change_extruder = MMU2_NO_TOOL;
|
tool_change_extruder = MMU2_NO_TOOL;
|
||||||
MakeSound(Confirm);
|
MakeSound(Confirm);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -340,6 +340,8 @@ private:
|
||||||
void UnloadInner();
|
void UnloadInner();
|
||||||
void CutFilamentInner(uint8_t slot);
|
void CutFilamentInner(uint8_t slot);
|
||||||
|
|
||||||
|
void SetCurrentTool(uint8_t ex);
|
||||||
|
|
||||||
ProtocolLogic logic; ///< implementation of the protocol logic layer
|
ProtocolLogic logic; ///< implementation of the protocol logic layer
|
||||||
uint8_t extruder; ///< currently active slot in the MMU ... somewhat... not sure where to get it from yet
|
uint8_t extruder; ///< currently active slot in the MMU ... somewhat... not sure where to get it from yet
|
||||||
uint8_t tool_change_extruder; ///< only used for UI purposes
|
uint8_t tool_change_extruder; ///< only used for UI purposes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue