|
|
@ -62,29 +62,13 @@ MMU2 mmu2;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#define MMU_CMD_NONE 0
|
|
|
|
#define MMU_CMD_NONE 0
|
|
|
|
#define MMU_CMD_T0 0x10
|
|
|
|
#define MMU_CMD_T0 0x10 // up to supported filaments
|
|
|
|
#define MMU_CMD_T1 0x11
|
|
|
|
#define MMU_CMD_L0 0x20 // up to supported filaments
|
|
|
|
#define MMU_CMD_T2 0x12
|
|
|
|
|
|
|
|
#define MMU_CMD_T3 0x13
|
|
|
|
|
|
|
|
#define MMU_CMD_T4 0x14
|
|
|
|
|
|
|
|
#define MMU_CMD_L0 0x20
|
|
|
|
|
|
|
|
#define MMU_CMD_L1 0x21
|
|
|
|
|
|
|
|
#define MMU_CMD_L2 0x22
|
|
|
|
|
|
|
|
#define MMU_CMD_L3 0x23
|
|
|
|
|
|
|
|
#define MMU_CMD_L4 0x24
|
|
|
|
|
|
|
|
#define MMU_CMD_C0 0x30
|
|
|
|
#define MMU_CMD_C0 0x30
|
|
|
|
#define MMU_CMD_U0 0x40
|
|
|
|
#define MMU_CMD_U0 0x40
|
|
|
|
#define MMU_CMD_E0 0x50
|
|
|
|
#define MMU_CMD_E0 0x50 // up to supported filaments
|
|
|
|
#define MMU_CMD_E1 0x51
|
|
|
|
|
|
|
|
#define MMU_CMD_E2 0x52
|
|
|
|
|
|
|
|
#define MMU_CMD_E3 0x53
|
|
|
|
|
|
|
|
#define MMU_CMD_E4 0x54
|
|
|
|
|
|
|
|
#define MMU_CMD_R0 0x60
|
|
|
|
#define MMU_CMD_R0 0x60
|
|
|
|
#define MMU_CMD_F0 0x70
|
|
|
|
#define MMU_CMD_F0 0x70 // up to supported filaments
|
|
|
|
#define MMU_CMD_F1 0x71
|
|
|
|
|
|
|
|
#define MMU_CMD_F2 0x72
|
|
|
|
|
|
|
|
#define MMU_CMD_F3 0x73
|
|
|
|
|
|
|
|
#define MMU_CMD_F4 0x74
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define MMU_REQUIRED_FW_BUILDNR TERN(MMU2_MODE_12V, 132, 126)
|
|
|
|
#define MMU_REQUIRED_FW_BUILDNR TERN(MMU2_MODE_12V, 132, 126)
|
|
|
|
|
|
|
|
|
|
|
@ -243,7 +227,7 @@ void MMU2::mmu_loop() {
|
|
|
|
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
case 1:
|
|
|
|
if (cmd) {
|
|
|
|
if (cmd) {
|
|
|
|
if (WITHIN(cmd, MMU_CMD_T0, MMU_CMD_T4)) {
|
|
|
|
if (WITHIN(cmd, MMU_CMD_T0, MMU_CMD_T0 + EXTRUDERS - 1)) {
|
|
|
|
// tool change
|
|
|
|
// tool change
|
|
|
|
int filament = cmd - MMU_CMD_T0;
|
|
|
|
int filament = cmd - MMU_CMD_T0;
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= T", filament);
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= T", filament);
|
|
|
@ -251,7 +235,7 @@ void MMU2::mmu_loop() {
|
|
|
|
TERN_(MMU_EXTRUDER_SENSOR, mmu_idl_sens = 1); // enable idler sensor, if any
|
|
|
|
TERN_(MMU_EXTRUDER_SENSOR, mmu_idl_sens = 1); // enable idler sensor, if any
|
|
|
|
state = 3; // wait for response
|
|
|
|
state = 3; // wait for response
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L4)) {
|
|
|
|
else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L0 + EXTRUDERS - 1)) {
|
|
|
|
// load
|
|
|
|
// load
|
|
|
|
int filament = cmd - MMU_CMD_L0;
|
|
|
|
int filament = cmd - MMU_CMD_L0;
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= L", filament);
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= L", filament);
|
|
|
@ -271,7 +255,7 @@ void MMU2::mmu_loop() {
|
|
|
|
MMU2_COMMAND("U0");
|
|
|
|
MMU2_COMMAND("U0");
|
|
|
|
state = 3; // wait for response
|
|
|
|
state = 3; // wait for response
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E4)) {
|
|
|
|
else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E0 + EXTRUDERS - 1)) {
|
|
|
|
// eject filament
|
|
|
|
// eject filament
|
|
|
|
int filament = cmd - MMU_CMD_E0;
|
|
|
|
int filament = cmd - MMU_CMD_E0;
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= E", filament);
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= E", filament);
|
|
|
@ -284,7 +268,7 @@ void MMU2::mmu_loop() {
|
|
|
|
MMU2_COMMAND("R0");
|
|
|
|
MMU2_COMMAND("R0");
|
|
|
|
state = 3; // wait for response
|
|
|
|
state = 3; // wait for response
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F4)) {
|
|
|
|
else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F0 + EXTRUDERS - 1)) {
|
|
|
|
// filament type
|
|
|
|
// filament type
|
|
|
|
int filament = cmd - MMU_CMD_F0;
|
|
|
|
int filament = cmd - MMU_CMD_F0;
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= F", filament, " ", cmd_arg);
|
|
|
|
DEBUG_ECHOLNPAIR("MMU <= F", filament, " ", cmd_arg);
|
|
|
|