Introduce MMU EEPROM reset feature
This new feature requires MMU FW v 2.1.7 (which brings some more small changes)
This commit is contained in:
parent
31bfbb4ed0
commit
303a67cd6f
|
|
@ -91,6 +91,9 @@ void MMU2::Reset(ResetForm level) {
|
||||||
case CutThePower:
|
case CutThePower:
|
||||||
PowerCycle();
|
PowerCycle();
|
||||||
break;
|
break;
|
||||||
|
case EraseEEPROM:
|
||||||
|
ResetX42();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -100,6 +103,10 @@ void MMU2::ResetX0() {
|
||||||
logic.ResetMMU(); // Send soft reset
|
logic.ResetMMU(); // Send soft reset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MMU2::ResetX42(){
|
||||||
|
logic.ResetMMU(42);
|
||||||
|
}
|
||||||
|
|
||||||
void MMU2::TriggerResetPin() {
|
void MMU2::TriggerResetPin() {
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ public:
|
||||||
enum ResetForm : uint8_t {
|
enum ResetForm : uint8_t {
|
||||||
Software = 0, ///< sends a X0 command into the MMU, the MMU will watchdog-reset itself
|
Software = 0, ///< sends a X0 command into the MMU, the MMU will watchdog-reset itself
|
||||||
ResetPin = 1, ///< trigger the reset pin of the MMU
|
ResetPin = 1, ///< trigger the reset pin of the MMU
|
||||||
CutThePower = 2 ///< power off and power on (that includes +5V and +24V power lines)
|
CutThePower = 2, ///< power off and power on (that includes +5V and +24V power lines)
|
||||||
|
EraseEEPROM = 42, ///< erase MMU EEPROM and then perform a software reset
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Saved print state on error.
|
/// Saved print state on error.
|
||||||
|
|
@ -196,6 +197,9 @@ private:
|
||||||
/// Perform software self-reset of the MMU (sends an X0 command)
|
/// Perform software self-reset of the MMU (sends an X0 command)
|
||||||
void ResetX0();
|
void ResetX0();
|
||||||
|
|
||||||
|
/// Perform software self-reset of the MMU + erase its EEPROM (sends X2a command)
|
||||||
|
void ResetX42();
|
||||||
|
|
||||||
/// Trigger reset pin of the MMU
|
/// Trigger reset pin of the MMU
|
||||||
void TriggerResetPin();
|
void TriggerResetPin();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ static const char MSG_DESC_UNLOAD_MANUALLY[] PROGMEM_I1 = ISTR("Filament detecte
|
||||||
static const char MSG_DESC_FILAMENT_EJECTED[] PROGMEM_I1 = ISTR("Remove the ejected filament from the front of the MMU unit."); ////MSG_DESC_FILAMENT_EJECTED c=20 r=8
|
static const char MSG_DESC_FILAMENT_EJECTED[] PROGMEM_I1 = ISTR("Remove the ejected filament from the front of the MMU unit."); ////MSG_DESC_FILAMENT_EJECTED c=20 r=8
|
||||||
|
|
||||||
// Read explanation in mmu2_protocol_logic.cpp -> supportedMmuFWVersion
|
// Read explanation in mmu2_protocol_logic.cpp -> supportedMmuFWVersion
|
||||||
static constexpr char MSG_DESC_FW_UPDATE_NEEDED[] PROGMEM_I1 = ISTR("The MMU unit firmware version incompatible with the printer's FW. Update to version 2.1.6."); ////MSG_DESC_FW_UPDATE_NEEDED c=20 r=9
|
static constexpr char MSG_DESC_FW_UPDATE_NEEDED[] PROGMEM_I1 = ISTR("The MMU unit firmware version incompatible with the printer's FW. Update to version 2.1.7."); ////MSG_DESC_FW_UPDATE_NEEDED c=20 r=9
|
||||||
static constexpr uint8_t szFWUN = sizeof(MSG_DESC_FW_UPDATE_NEEDED);
|
static constexpr uint8_t szFWUN = sizeof(MSG_DESC_FW_UPDATE_NEEDED);
|
||||||
// at least check the individual version characters in MSG_DESC_FW_UPDATE_NEEDED
|
// at least check the individual version characters in MSG_DESC_FW_UPDATE_NEEDED
|
||||||
static_assert(MSG_DESC_FW_UPDATE_NEEDED[szFWUN - 7] == ('0' + mmuVersionMajor));
|
static_assert(MSG_DESC_FW_UPDATE_NEEDED[szFWUN - 7] == ('0' + mmuVersionMajor));
|
||||||
|
|
|
||||||
|
|
@ -579,8 +579,8 @@ void ProtocolLogic::CutFilament(uint8_t slot) {
|
||||||
PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot));
|
PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProtocolLogic::ResetMMU() {
|
void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) {
|
||||||
PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, 0));
|
PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProtocolLogic::Button(uint8_t index) {
|
void ProtocolLogic::Button(uint8_t index) {
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public:
|
||||||
void LoadFilament(uint8_t slot);
|
void LoadFilament(uint8_t slot);
|
||||||
void EjectFilament(uint8_t slot);
|
void EjectFilament(uint8_t slot);
|
||||||
void CutFilament(uint8_t slot);
|
void CutFilament(uint8_t slot);
|
||||||
void ResetMMU();
|
void ResetMMU(uint8_t mode = 0);
|
||||||
void Button(uint8_t index);
|
void Button(uint8_t index);
|
||||||
void Home(uint8_t mode);
|
void Home(uint8_t mode);
|
||||||
void ReadRegister(uint8_t address);
|
void ReadRegister(uint8_t address);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ namespace MMU2 {
|
||||||
|
|
||||||
static constexpr uint8_t mmuVersionMajor = 2;
|
static constexpr uint8_t mmuVersionMajor = 2;
|
||||||
static constexpr uint8_t mmuVersionMinor = 1;
|
static constexpr uint8_t mmuVersionMinor = 1;
|
||||||
static constexpr uint8_t mmuVersionPatch = 6;
|
static constexpr uint8_t mmuVersionPatch = 7;
|
||||||
|
|
||||||
} // namespace MMU2
|
} // namespace MMU2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue