|
@@ -62,29 +62,13 @@ MMU2 mmu2;
|
62
|
62
|
#endif
|
63
|
63
|
|
64
|
64
|
#define MMU_CMD_NONE 0
|
65
|
|
-#define MMU_CMD_T0 0x10
|
66
|
|
-#define MMU_CMD_T1 0x11
|
67
|
|
-#define MMU_CMD_T2 0x12
|
68
|
|
-#define MMU_CMD_T3 0x13
|
69
|
|
-#define MMU_CMD_T4 0x14
|
70
|
|
-#define MMU_CMD_L0 0x20
|
71
|
|
-#define MMU_CMD_L1 0x21
|
72
|
|
-#define MMU_CMD_L2 0x22
|
73
|
|
-#define MMU_CMD_L3 0x23
|
74
|
|
-#define MMU_CMD_L4 0x24
|
|
65
|
+#define MMU_CMD_T0 0x10 // up to supported filaments
|
|
66
|
+#define MMU_CMD_L0 0x20 // up to supported filaments
|
75
|
67
|
#define MMU_CMD_C0 0x30
|
76
|
68
|
#define MMU_CMD_U0 0x40
|
77
|
|
-#define MMU_CMD_E0 0x50
|
78
|
|
-#define MMU_CMD_E1 0x51
|
79
|
|
-#define MMU_CMD_E2 0x52
|
80
|
|
-#define MMU_CMD_E3 0x53
|
81
|
|
-#define MMU_CMD_E4 0x54
|
|
69
|
+#define MMU_CMD_E0 0x50 // up to supported filaments
|
82
|
70
|
#define MMU_CMD_R0 0x60
|
83
|
|
-#define MMU_CMD_F0 0x70
|
84
|
|
-#define MMU_CMD_F1 0x71
|
85
|
|
-#define MMU_CMD_F2 0x72
|
86
|
|
-#define MMU_CMD_F3 0x73
|
87
|
|
-#define MMU_CMD_F4 0x74
|
|
71
|
+#define MMU_CMD_F0 0x70 // up to supported filaments
|
88
|
72
|
|
89
|
73
|
#define MMU_REQUIRED_FW_BUILDNR TERN(MMU2_MODE_12V, 132, 126)
|
90
|
74
|
|
|
@@ -243,7 +227,7 @@ void MMU2::mmu_loop() {
|
243
|
227
|
|
244
|
228
|
case 1:
|
245
|
229
|
if (cmd) {
|
246
|
|
- if (WITHIN(cmd, MMU_CMD_T0, MMU_CMD_T4)) {
|
|
230
|
+ if (WITHIN(cmd, MMU_CMD_T0, MMU_CMD_T0 + EXTRUDERS - 1)) {
|
247
|
231
|
// tool change
|
248
|
232
|
int filament = cmd - MMU_CMD_T0;
|
249
|
233
|
DEBUG_ECHOLNPAIR("MMU <= T", filament);
|
|
@@ -251,7 +235,7 @@ void MMU2::mmu_loop() {
|
251
|
235
|
TERN_(MMU_EXTRUDER_SENSOR, mmu_idl_sens = 1); // enable idler sensor, if any
|
252
|
236
|
state = 3; // wait for response
|
253
|
237
|
}
|
254
|
|
- else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L4)) {
|
|
238
|
+ else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L0 + EXTRUDERS - 1)) {
|
255
|
239
|
// load
|
256
|
240
|
int filament = cmd - MMU_CMD_L0;
|
257
|
241
|
DEBUG_ECHOLNPAIR("MMU <= L", filament);
|
|
@@ -271,7 +255,7 @@ void MMU2::mmu_loop() {
|
271
|
255
|
MMU2_COMMAND("U0");
|
272
|
256
|
state = 3; // wait for response
|
273
|
257
|
}
|
274
|
|
- else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E4)) {
|
|
258
|
+ else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E0 + EXTRUDERS - 1)) {
|
275
|
259
|
// eject filament
|
276
|
260
|
int filament = cmd - MMU_CMD_E0;
|
277
|
261
|
DEBUG_ECHOLNPAIR("MMU <= E", filament);
|
|
@@ -284,7 +268,7 @@ void MMU2::mmu_loop() {
|
284
|
268
|
MMU2_COMMAND("R0");
|
285
|
269
|
state = 3; // wait for response
|
286
|
270
|
}
|
287
|
|
- else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F4)) {
|
|
271
|
+ else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F0 + EXTRUDERS - 1)) {
|
288
|
272
|
// filament type
|
289
|
273
|
int filament = cmd - MMU_CMD_F0;
|
290
|
274
|
DEBUG_ECHOLNPAIR("MMU <= F", filament, " ", cmd_arg);
|