|
@@ -1,5 +1,5 @@
|
1
|
1
|
/**
|
2
|
|
- * anycubic_tft.cpp --- Support for Anycubic i3 Mega TFT
|
|
2
|
+ * anycubic_i3mega_lcd.cpp --- Support for Anycubic i3 Mega TFT
|
3
|
3
|
* Created by Christian Hopp on 09.12.17.
|
4
|
4
|
* Improved by David Ramiro
|
5
|
5
|
* Converted to ext_iu by John BouAntoun 21 June 2020
|
|
@@ -21,15 +21,29 @@
|
21
|
21
|
|
22
|
22
|
#include "../../../../inc/MarlinConfigPre.h"
|
23
|
23
|
|
24
|
|
-#if ENABLED(ANYCUBIC_TFT_MODEL)
|
|
24
|
+#if ENABLED(ANYCUBIC_LCD_I3MEGA)
|
25
|
25
|
|
26
|
|
-#include "anycubic_tft.h"
|
27
|
|
-#include "anycubic_serial.h"
|
|
26
|
+#include "anycubic_i3mega_lcd.h"
|
28
|
27
|
|
29
|
28
|
#include "../../../../inc/MarlinConfig.h"
|
30
|
29
|
#include "../../ui_api.h"
|
31
|
30
|
#include "../../../../MarlinCore.h" // for quickstop_stepper and disable_steppers
|
32
|
31
|
|
|
32
|
+// command sending macro's with debugging capability
|
|
33
|
+#define SEND_PGM(x) send_P(PSTR(x))
|
|
34
|
+#define SENDLINE_PGM(x) sendLine_P(PSTR(x))
|
|
35
|
+#define SEND_PGM_VAL(x,y) (send_P(PSTR(x)), sendLine(itostr3(y)))
|
|
36
|
+#define SEND(x) send(x)
|
|
37
|
+#define SENDLINE(x) sendLine(x)
|
|
38
|
+#if ENABLED(ANYCUBIC_LCD_DEBUG)
|
|
39
|
+ #define SENDLINE_DBG_PGM(x,y) (sendLine_P(PSTR(x)), SERIAL_ECHOLNPGM(y))
|
|
40
|
+ #define SENDLINE_DBG_PGM_VAL(x,y,z) (sendLine_P(PSTR(x)), SERIAL_ECHOPGM(y), SERIAL_ECHOLN(z))
|
|
41
|
+#else
|
|
42
|
+ #define SENDLINE_DBG_PGM(x,y) sendLine_P(PSTR(x))
|
|
43
|
+ #define SENDLINE_DBG_PGM_VAL(x,y,z) sendLine_P(PSTR(x))
|
|
44
|
+#endif
|
|
45
|
+
|
|
46
|
+
|
33
|
47
|
AnycubicTFTClass AnycubicTFT;
|
34
|
48
|
|
35
|
49
|
char _conv[8];
|
|
@@ -43,6 +57,30 @@ char *itostr2(const uint8_t &x) {
|
43
|
57
|
return _conv;
|
44
|
58
|
}
|
45
|
59
|
|
|
60
|
+static void sendNewLine(void) {
|
|
61
|
+ ANYCUBIC_LCD_SERIAL.write('\r');
|
|
62
|
+ ANYCUBIC_LCD_SERIAL.write('\n');
|
|
63
|
+}
|
|
64
|
+
|
|
65
|
+static void send(const char *str) {
|
|
66
|
+ ANYCUBIC_LCD_SERIAL.print(str);
|
|
67
|
+}
|
|
68
|
+
|
|
69
|
+static void sendLine(const char *str) {
|
|
70
|
+ send(str);
|
|
71
|
+ sendNewLine();
|
|
72
|
+}
|
|
73
|
+
|
|
74
|
+static void send_P(PGM_P str) {
|
|
75
|
+ while (const char c = pgm_read_byte(str++))
|
|
76
|
+ ANYCUBIC_LCD_SERIAL.write(c);
|
|
77
|
+}
|
|
78
|
+
|
|
79
|
+static void sendLine_P(PGM_P str) {
|
|
80
|
+ send_P(str);
|
|
81
|
+ sendNewLine();
|
|
82
|
+}
|
|
83
|
+
|
46
|
84
|
#ifndef ULTRA_LCD
|
47
|
85
|
#define DIGIT(n) ('0' + (n))
|
48
|
86
|
#define DIGIMOD(n, f) DIGIT((n) / (f) % 10)
|
|
@@ -74,8 +112,8 @@ char *itostr2(const uint8_t &x) {
|
74
|
112
|
AnycubicTFTClass::AnycubicTFTClass() {}
|
75
|
113
|
|
76
|
114
|
void AnycubicTFTClass::OnSetup() {
|
77
|
|
- AnycubicSerial.begin(115200);
|
78
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J17", "TFT Serial Debug: Main board reset... J17"); // J17 Main board reset
|
|
115
|
+ ANYCUBIC_LCD_SERIAL.begin(115200);
|
|
116
|
+ SENDLINE_DBG_PGM("J17", "TFT Serial Debug: Main board reset... J17"); // J17 Main board reset
|
79
|
117
|
ExtUI::delay_ms(10);
|
80
|
118
|
|
81
|
119
|
// initialise the state of the key pins running on the tft
|
|
@@ -92,7 +130,7 @@ void AnycubicTFTClass::OnSetup() {
|
92
|
130
|
mediaPauseState = AMPAUSESTATE_NOT_PAUSED;
|
93
|
131
|
|
94
|
132
|
// DoSDCardStateCheck();
|
95
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J12", "TFT Serial Debug: Ready... J12"); // J12 Ready
|
|
133
|
+ SENDLINE_DBG_PGM("J12", "TFT Serial Debug: Ready... J12"); // J12 Ready
|
96
|
134
|
ExtUI::delay_ms(10);
|
97
|
135
|
|
98
|
136
|
DoFilamentRunoutCheck();
|
|
@@ -101,7 +139,7 @@ void AnycubicTFTClass::OnSetup() {
|
101
|
139
|
#if ENABLED(STARTUP_CHIME)
|
102
|
140
|
ExtUI::injectCommands_P(PSTR("M300 P250 S554\nM300 P250 S554\nM300 P250 S740\nM300 P250 S554\nM300 P250 S740\nM300 P250 S554\nM300 P500 S831"));
|
103
|
141
|
#endif
|
104
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
142
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
105
|
143
|
SERIAL_ECHOLNPGM("TFT Serial Debug: Finished startup");
|
106
|
144
|
#endif
|
107
|
145
|
}
|
|
@@ -112,7 +150,7 @@ void AnycubicTFTClass::OnCommandScan() {
|
112
|
150
|
if (ELAPSED(ms, nextStopCheck)) {
|
113
|
151
|
nextStopCheck = ms + 1000UL;
|
114
|
152
|
if (mediaPrintingState == AMPRINTSTATE_STOP_REQUESTED && IsNozzleHomed()) {
|
115
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
153
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
116
|
154
|
SERIAL_ECHOLNPGM("TFT Serial Debug: Finished stopping print, releasing motors ...");
|
117
|
155
|
#endif
|
118
|
156
|
mediaPrintingState = AMPRINTSTATE_NOT_PRINTING;
|
|
@@ -120,7 +158,7 @@ void AnycubicTFTClass::OnCommandScan() {
|
120
|
158
|
ExtUI::injectCommands_P(PSTR("M84\nM27")); // disable stepper motors and force report of SD status
|
121
|
159
|
ExtUI::delay_ms(200);
|
122
|
160
|
// tell printer to release resources of print to indicate it is done
|
123
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J14", "TFT Serial Debug: SD Print Stopped... J14");
|
|
161
|
+ SENDLINE_DBG_PGM("J14", "TFT Serial Debug: SD Print Stopped... J14");
|
124
|
162
|
}
|
125
|
163
|
}
|
126
|
164
|
|
|
@@ -134,11 +172,11 @@ void AnycubicTFTClass::OnCommandScan() {
|
134
|
172
|
}
|
135
|
173
|
|
136
|
174
|
void AnycubicTFTClass::OnKillTFT() {
|
137
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11");
|
|
175
|
+ SENDLINE_DBG_PGM("J11", "TFT Serial Debug: Kill command... J11");
|
138
|
176
|
}
|
139
|
177
|
|
140
|
178
|
void AnycubicTFTClass::OnSDCardStateChange(bool isInserted) {
|
141
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
179
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
142
|
180
|
SERIAL_ECHOPGM("TFT Serial Debug: OnSDCardStateChange event triggered...");
|
143
|
181
|
SERIAL_ECHO(itostr2(isInserted));
|
144
|
182
|
SERIAL_EOL();
|
|
@@ -147,21 +185,21 @@ void AnycubicTFTClass::OnSDCardStateChange(bool isInserted) {
|
147
|
185
|
}
|
148
|
186
|
|
149
|
187
|
void AnycubicTFTClass::OnSDCardError() {
|
150
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
188
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
151
|
189
|
SERIAL_ECHOLNPGM("TFT Serial Debug: OnSDCardError event triggered...");
|
152
|
190
|
#endif
|
153
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J21", "TFT Serial Debug: On SD Card Error ... J21");
|
|
191
|
+ SENDLINE_DBG_PGM("J21", "TFT Serial Debug: On SD Card Error ... J21");
|
154
|
192
|
}
|
155
|
193
|
|
156
|
194
|
void AnycubicTFTClass::OnFilamentRunout() {
|
157
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
195
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
158
|
196
|
SERIAL_ECHOLNPGM("TFT Serial Debug: FilamentRunout triggered...");
|
159
|
197
|
#endif
|
160
|
198
|
DoFilamentRunoutCheck();
|
161
|
199
|
}
|
162
|
200
|
|
163
|
201
|
void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) {
|
164
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
202
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
165
|
203
|
SERIAL_ECHOPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ");
|
166
|
204
|
SERIAL_ECHOLN(msg);
|
167
|
205
|
#endif
|
|
@@ -181,36 +219,36 @@ void AnycubicTFTClass::OnUserConfirmRequired(const char * const msg) {
|
181
|
219
|
mediaPrintingState = AMPRINTSTATE_PAUSED;
|
182
|
220
|
mediaPauseState = AMPAUSESTATE_PARKED;
|
183
|
221
|
// enable continue button
|
184
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD print paused done... J18");
|
|
222
|
+ SENDLINE_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD print paused done... J18");
|
185
|
223
|
}
|
186
|
224
|
else if (strcmp_P(msg, PSTR("Load Filament")) == 0) {
|
187
|
225
|
mediaPrintingState = AMPRINTSTATE_PAUSED;
|
188
|
226
|
mediaPauseState = AMPAUSESTATE_FILAMENT_OUT;
|
189
|
227
|
// enable continue button
|
190
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is out... J18");
|
191
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J23", "TFT Serial Debug: UserConfirm Blocking filament prompt... J23");
|
|
228
|
+ SENDLINE_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is out... J18");
|
|
229
|
+ SENDLINE_DBG_PGM("J23", "TFT Serial Debug: UserConfirm Blocking filament prompt... J23");
|
192
|
230
|
}
|
193
|
231
|
else if (strcmp_P(msg, PSTR("Filament Purging...")) == 0) {
|
194
|
232
|
mediaPrintingState = AMPRINTSTATE_PAUSED;
|
195
|
233
|
mediaPauseState = AMPAUSESTATE_PARKING;
|
196
|
234
|
// TODO: JBA I don't think J05 just disables the continue button, i think it injects a rogue M25. So taking this out
|
197
|
235
|
// disable continue button
|
198
|
|
- // ANYCUBIC_SENDCOMMAND_DBG_PGM("J05", "TFT Serial Debug: UserConfirm SD Filament Purging... J05"); // J05 printing pause
|
|
236
|
+ // SENDLINE_DBG_PGM("J05", "TFT Serial Debug: UserConfirm SD Filament Purging... J05"); // J05 printing pause
|
199
|
237
|
|
200
|
238
|
// enable continue button
|
201
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is purging... J18");
|
|
239
|
+ SENDLINE_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is purging... J18");
|
202
|
240
|
}
|
203
|
241
|
else if (strcmp_P(msg, PSTR("HeaterTimeout")) == 0) {
|
204
|
242
|
mediaPrintingState = AMPRINTSTATE_PAUSED;
|
205
|
243
|
mediaPauseState = AMPAUSESTATE_HEATER_TIMEOUT;
|
206
|
244
|
// enable continue button
|
207
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD Heater timeout... J18");
|
|
245
|
+ SENDLINE_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD Heater timeout... J18");
|
208
|
246
|
}
|
209
|
247
|
else if (strcmp_P(msg, PSTR("Reheat finished.")) == 0) {
|
210
|
248
|
mediaPrintingState = AMPRINTSTATE_PAUSED;
|
211
|
249
|
mediaPauseState = AMPAUSESTATE_REHEAT_FINISHED;
|
212
|
250
|
// enable continue button
|
213
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD Reheat done... J18");
|
|
251
|
+ SENDLINE_DBG_PGM("J18", "TFT Serial Debug: UserConfirm SD Reheat done... J18");
|
214
|
252
|
}
|
215
|
253
|
#endif
|
216
|
254
|
}
|
|
@@ -360,7 +398,7 @@ void AnycubicTFTClass::HandleSpecialMenu() {
|
360
|
398
|
default:
|
361
|
399
|
break;
|
362
|
400
|
}
|
363
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
401
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
364
|
402
|
}
|
365
|
403
|
else {
|
366
|
404
|
SERIAL_ECHOPGM("TFT Serial Debug: Attempted to HandleSpecialMenu on non-special menu... ");
|
|
@@ -375,14 +413,13 @@ void AnycubicTFTClass::RenderCurrentFileList() {
|
375
|
413
|
SelectedDirectory[0] = 0;
|
376
|
414
|
SelectedFile[0] = 0;
|
377
|
415
|
|
378
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("FN "); // Filelist start
|
379
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
416
|
+ SENDLINE_PGM("FN "); // Filelist start
|
380
|
417
|
|
381
|
418
|
if (!ExtUI::isMediaInserted() && !SpecialMenu) {
|
382
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02");
|
|
419
|
+ SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02");
|
383
|
420
|
|
384
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Special_Menu>");
|
385
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Special_Menu>");
|
|
421
|
+ SENDLINE_PGM("<Special_Menu>");
|
|
422
|
+ SENDLINE_PGM("<Special_Menu>");
|
386
|
423
|
}
|
387
|
424
|
else {
|
388
|
425
|
if (CodeSeen('S'))
|
|
@@ -393,8 +430,7 @@ void AnycubicTFTClass::RenderCurrentFileList() {
|
393
|
430
|
else
|
394
|
431
|
RenderCurrentFolder(selectedNumber);
|
395
|
432
|
}
|
396
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("END"); // Filelist stop
|
397
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
433
|
+ SENDLINE_PGM("END"); // Filelist stop
|
398
|
434
|
#endif // SDSUPPORT
|
399
|
435
|
}
|
400
|
436
|
|
|
@@ -402,58 +438,58 @@ void AnycubicTFTClass::RenderSpecialMenu(uint16_t selectedNumber) {
|
402
|
438
|
switch (selectedNumber) {
|
403
|
439
|
#if ENABLED(PROBE_MANUALLY)
|
404
|
440
|
case 0: // First Page
|
405
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<01ZUp0.1>");
|
406
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Z Up 0.1>");
|
407
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<02ZUp0.02>");
|
408
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Z Up 0.02>");
|
409
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<03ZDn0.02>");
|
410
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Z Down 0.02>");
|
411
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<04ZDn0.1>");
|
412
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Z Down 0.1>");
|
|
441
|
+ SENDLINE_PGM("<01ZUp0.1>");
|
|
442
|
+ SENDLINE_PGM("<Z Up 0.1>");
|
|
443
|
+ SENDLINE_PGM("<02ZUp0.02>");
|
|
444
|
+ SENDLINE_PGM("<Z Up 0.02>");
|
|
445
|
+ SENDLINE_PGM("<03ZDn0.02>");
|
|
446
|
+ SENDLINE_PGM("<Z Down 0.02>");
|
|
447
|
+ SENDLINE_PGM("<04ZDn0.1>");
|
|
448
|
+ SENDLINE_PGM("<Z Down 0.1>");
|
413
|
449
|
break;
|
414
|
450
|
|
415
|
451
|
case 4: // Second Page
|
416
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<05PrehtBed>");
|
417
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Preheat bed>");
|
418
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<06SMeshLvl>");
|
419
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Start Mesh Leveling>");
|
420
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<07MeshNPnt>");
|
421
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Next Mesh Point>");
|
422
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<08HtEndPID>");
|
423
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune Hotend PID>");
|
|
452
|
+ SENDLINE_PGM("<05PrehtBed>");
|
|
453
|
+ SENDLINE_PGM("<Preheat bed>");
|
|
454
|
+ SENDLINE_PGM("<06SMeshLvl>");
|
|
455
|
+ SENDLINE_PGM("<Start Mesh Leveling>");
|
|
456
|
+ SENDLINE_PGM("<07MeshNPnt>");
|
|
457
|
+ SENDLINE_PGM("<Next Mesh Point>");
|
|
458
|
+ SENDLINE_PGM("<08HtEndPID>");
|
|
459
|
+ SENDLINE_PGM("<Auto Tune Hotend PID>");
|
424
|
460
|
break;
|
425
|
461
|
|
426
|
462
|
case 8: // Third Page
|
427
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<09HtBedPID>");
|
428
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune Hotbed PID>");
|
429
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<10FWDeflts>");
|
430
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Load FW Defaults>");
|
431
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<11SvEEPROM>");
|
432
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Save EEPROM>");
|
433
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Exit>");
|
434
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Exit>");
|
|
463
|
+ SENDLINE_PGM("<09HtBedPID>");
|
|
464
|
+ SENDLINE_PGM("<Auto Tune Hotbed PID>");
|
|
465
|
+ SENDLINE_PGM("<10FWDeflts>");
|
|
466
|
+ SENDLINE_PGM("<Load FW Defaults>");
|
|
467
|
+ SENDLINE_PGM("<11SvEEPROM>");
|
|
468
|
+ SENDLINE_PGM("<Save EEPROM>");
|
|
469
|
+ SENDLINE_PGM("<Exit>");
|
|
470
|
+ SENDLINE_PGM("<Exit>");
|
435
|
471
|
break;
|
436
|
472
|
#else
|
437
|
473
|
case 0: // First Page
|
438
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<01PrehtBed>");
|
439
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Preheat bed>");
|
440
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<02ABL>");
|
441
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Bed Leveling>");
|
442
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<03HtEndPID>");
|
443
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune Hotend PID>");
|
444
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<04HtBedPID>");
|
445
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Auto Tune Hotbed PID>");
|
|
474
|
+ SENDLINE_PGM("<01PrehtBed>");
|
|
475
|
+ SENDLINE_PGM("<Preheat bed>");
|
|
476
|
+ SENDLINE_PGM("<02ABL>");
|
|
477
|
+ SENDLINE_PGM("<Auto Bed Leveling>");
|
|
478
|
+ SENDLINE_PGM("<03HtEndPID>");
|
|
479
|
+ SENDLINE_PGM("<Auto Tune Hotend PID>");
|
|
480
|
+ SENDLINE_PGM("<04HtBedPID>");
|
|
481
|
+ SENDLINE_PGM("<Auto Tune Hotbed PID>");
|
446
|
482
|
break;
|
447
|
483
|
|
448
|
484
|
case 4: // Second Page
|
449
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<05FWDeflts>");
|
450
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Load FW Defaults>");
|
451
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<06SvEEPROM>");
|
452
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Save EEPROM>");
|
453
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<07SendM108>");
|
454
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Send User Confirmation>");
|
455
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Exit>");
|
456
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Exit>");
|
|
485
|
+ SENDLINE_PGM("<05FWDeflts>");
|
|
486
|
+ SENDLINE_PGM("<Load FW Defaults>");
|
|
487
|
+ SENDLINE_PGM("<06SvEEPROM>");
|
|
488
|
+ SENDLINE_PGM("<Save EEPROM>");
|
|
489
|
+ SENDLINE_PGM("<07SendM108>");
|
|
490
|
+ SENDLINE_PGM("<Send User Confirmation>");
|
|
491
|
+ SENDLINE_PGM("<Exit>");
|
|
492
|
+ SENDLINE_PGM("<Exit>");
|
457
|
493
|
break;
|
458
|
494
|
|
459
|
495
|
#endif // PROBE_MANUALLY
|
|
@@ -477,30 +513,30 @@ void AnycubicTFTClass::RenderCurrentFolder(uint16_t selectedNumber) {
|
477
|
513
|
for (cnt = selectedNumber; cnt <= max_files; cnt++) {
|
478
|
514
|
if (cnt == 0) { // Special Entry
|
479
|
515
|
if (currentFileList.isAtRootDir()) {
|
480
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<specialmnu>");
|
481
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("<Special Menu>");
|
|
516
|
+ SENDLINE_PGM("<specialmnu>");
|
|
517
|
+ SENDLINE_PGM("<Special Menu>");
|
482
|
518
|
}
|
483
|
519
|
else {
|
484
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("/..");
|
485
|
|
- ANYCUBIC_SERIAL_PROTOCOLLNPGM("/..");
|
|
520
|
+ SENDLINE_PGM("/..");
|
|
521
|
+ SENDLINE_PGM("/..");
|
486
|
522
|
}
|
487
|
523
|
}
|
488
|
524
|
else {
|
489
|
525
|
currentFileList.seek(cnt - 1, false);
|
490
|
526
|
|
491
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
527
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
492
|
528
|
SERIAL_ECHOLN(currentFileList.filename());
|
493
|
529
|
#endif
|
494
|
530
|
if (currentFileList.isDir()) {
|
495
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("/");
|
496
|
|
- ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.shortFilename());
|
497
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("/");
|
498
|
|
- ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.longFilename());
|
|
531
|
+ SEND_PGM("/");
|
|
532
|
+ SENDLINE(currentFileList.shortFilename());
|
|
533
|
+ SEND_PGM("/");
|
|
534
|
+ SENDLINE(currentFileList.longFilename());
|
499
|
535
|
|
500
|
536
|
}
|
501
|
537
|
else {
|
502
|
|
- ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.shortFilename());
|
503
|
|
- ANYCUBIC_SERIAL_PROTOCOLLN(currentFileList.longFilename());
|
|
538
|
+ SENDLINE(currentFileList.shortFilename());
|
|
539
|
+ SENDLINE(currentFileList.longFilename());
|
504
|
540
|
}
|
505
|
541
|
}
|
506
|
542
|
}
|
|
@@ -509,7 +545,7 @@ void AnycubicTFTClass::RenderCurrentFolder(uint16_t selectedNumber) {
|
509
|
545
|
void AnycubicTFTClass::OnPrintTimerStarted() {
|
510
|
546
|
#if ENABLED(SDSUPPORT)
|
511
|
547
|
if (mediaPrintingState == AMPRINTSTATE_PRINTING)
|
512
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J04", "TFT Serial Debug: Starting SD Print... J04"); // J04 Starting Print
|
|
548
|
+ SENDLINE_DBG_PGM("J04", "TFT Serial Debug: Starting SD Print... J04"); // J04 Starting Print
|
513
|
549
|
|
514
|
550
|
#endif
|
515
|
551
|
}
|
|
@@ -528,7 +564,7 @@ void AnycubicTFTClass::OnPrintTimerStopped() {
|
528
|
564
|
if (mediaPrintingState == AMPRINTSTATE_PRINTING) {
|
529
|
565
|
mediaPrintingState = AMPRINTSTATE_NOT_PRINTING;
|
530
|
566
|
mediaPauseState = AMPAUSESTATE_NOT_PAUSED;
|
531
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J14", "TFT Serial Debug: SD Print Completed... J14");
|
|
567
|
+ SENDLINE_DBG_PGM("J14", "TFT Serial Debug: SD Print Completed... J14");
|
532
|
568
|
}
|
533
|
569
|
// otherwise it was stopped by the printer so don't send print completed signal to TFT
|
534
|
570
|
#endif
|
|
@@ -536,8 +572,8 @@ void AnycubicTFTClass::OnPrintTimerStopped() {
|
536
|
572
|
|
537
|
573
|
void AnycubicTFTClass::GetCommandFromTFT() {
|
538
|
574
|
char *starpos = NULL;
|
539
|
|
- while (AnycubicSerial.available() > 0 && TFTbuflen < TFTBUFSIZE) {
|
540
|
|
- serial3_char = AnycubicSerial.read();
|
|
575
|
+ while (ANYCUBIC_LCD_SERIAL.available() > 0 && TFTbuflen < TFTBUFSIZE) {
|
|
576
|
+ serial3_char = ANYCUBIC_LCD_SERIAL.read();
|
541
|
577
|
if (serial3_char == '\n' ||
|
542
|
578
|
serial3_char == '\r' ||
|
543
|
579
|
serial3_char == ':' ||
|
|
@@ -553,7 +589,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
553
|
589
|
TFTstrchr_pointer = strchr(TFTcmdbuffer[TFTbufindw], 'A');
|
554
|
590
|
a_command = ((int)((strtod(&TFTcmdbuffer[TFTbufindw][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindw] + 1], NULL))));
|
555
|
591
|
|
556
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
592
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
557
|
593
|
if ((a_command > 7) && (a_command != 20)) { // No debugging of status polls, please!
|
558
|
594
|
SERIAL_ECHOPGM("TFT Serial Command: ");
|
559
|
595
|
SERIAL_ECHOLN(TFTcmdbuffer[TFTbufindw]);
|
|
@@ -563,25 +599,25 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
563
|
599
|
switch (a_command) {
|
564
|
600
|
case 0: { // A0 GET HOTEND TEMP
|
565
|
601
|
float hotendActualTemp = ExtUI::getActualTemp_celsius((ExtUI::extruder_t) (ExtUI::extruder_t) ExtUI::E0);
|
566
|
|
- ANYCUBIC_SENDCOMMANDPGM_VAL("A0V ", int(hotendActualTemp + 0.5));
|
|
602
|
+ SEND_PGM_VAL("A0V ", int(hotendActualTemp + 0.5));
|
567
|
603
|
}
|
568
|
604
|
break;
|
569
|
605
|
|
570
|
606
|
case 1: { // A1 GET HOTEND TARGET TEMP
|
571
|
607
|
float hotendTargetTemp = ExtUI::getTargetTemp_celsius((ExtUI::extruder_t) (ExtUI::extruder_t) ExtUI::E0);
|
572
|
|
- ANYCUBIC_SENDCOMMANDPGM_VAL("A1V ", int(hotendTargetTemp + 0.5));
|
|
608
|
+ SEND_PGM_VAL("A1V ", int(hotendTargetTemp + 0.5));
|
573
|
609
|
}
|
574
|
610
|
break;
|
575
|
611
|
|
576
|
612
|
case 2: { // A2 GET HOTBED TEMP
|
577
|
613
|
float heatedBedActualTemp = ExtUI::getActualTemp_celsius((ExtUI::heater_t) ExtUI::BED);
|
578
|
|
- ANYCUBIC_SENDCOMMANDPGM_VAL("A2V ", int(heatedBedActualTemp + 0.5));
|
|
614
|
+ SEND_PGM_VAL("A2V ", int(heatedBedActualTemp + 0.5));
|
579
|
615
|
}
|
580
|
616
|
break;
|
581
|
617
|
|
582
|
618
|
case 3: { // A3 GET HOTBED TARGET TEMP
|
583
|
619
|
float heatedBedTargetTemp = ExtUI::getTargetTemp_celsius((ExtUI::heater_t) ExtUI::BED);
|
584
|
|
- ANYCUBIC_SENDCOMMANDPGM_VAL("A3V ", int(heatedBedTargetTemp + 0.5));
|
|
620
|
+ SEND_PGM_VAL("A3V ", int(heatedBedTargetTemp + 0.5));
|
585
|
621
|
}
|
586
|
622
|
break;
|
587
|
623
|
|
|
@@ -589,7 +625,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
589
|
625
|
{
|
590
|
626
|
float fanPercent = ExtUI::getActualFan_percent(ExtUI::FAN0);
|
591
|
627
|
fanPercent = constrain(fanPercent, 0, 100);
|
592
|
|
- ANYCUBIC_SENDCOMMANDPGM_VAL("A4V ", int(fanPercent));
|
|
628
|
+ SEND_PGM_VAL("A4V ", int(fanPercent));
|
593
|
629
|
}
|
594
|
630
|
break;
|
595
|
631
|
|
|
@@ -598,58 +634,46 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
598
|
634
|
float xPostition = ExtUI::getAxisPosition_mm(ExtUI::X);
|
599
|
635
|
float yPostition = ExtUI::getAxisPosition_mm(ExtUI::Y);
|
600
|
636
|
float zPostition = ExtUI::getAxisPosition_mm(ExtUI::Z);
|
601
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("A5V");
|
602
|
|
- ANYCUBIC_SERIAL_SPACE();
|
603
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("X: ");
|
604
|
|
- ANYCUBIC_SERIAL_PROTOCOL(xPostition);
|
605
|
|
- ANYCUBIC_SERIAL_SPACE();
|
606
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("Y: ");
|
607
|
|
- ANYCUBIC_SERIAL_PROTOCOL(yPostition);
|
608
|
|
- ANYCUBIC_SERIAL_SPACE();
|
609
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("Z: ");
|
610
|
|
- ANYCUBIC_SERIAL_PROTOCOL(zPostition);
|
611
|
|
- ANYCUBIC_SERIAL_SPACE();
|
612
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
637
|
+ SEND_PGM("A5V X: ");
|
|
638
|
+ ANYCUBIC_LCD_SERIAL.print(xPostition);
|
|
639
|
+ SEND_PGM(" Y: ");
|
|
640
|
+ ANYCUBIC_LCD_SERIAL.print(yPostition);
|
|
641
|
+ SEND_PGM(" Z: ");
|
|
642
|
+ ANYCUBIC_LCD_SERIAL.print(zPostition);
|
|
643
|
+ SENDLINE_PGM("");
|
613
|
644
|
}
|
614
|
645
|
break;
|
615
|
646
|
|
616
|
647
|
case 6: // A6 GET SD CARD PRINTING STATUS
|
617
|
648
|
#if ENABLED(SDSUPPORT)
|
618
|
649
|
if (ExtUI::isPrintingFromMedia()) {
|
619
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("A6V ");
|
|
650
|
+ SEND_PGM("A6V ");
|
620
|
651
|
if (ExtUI::isMediaInserted()) {
|
621
|
|
- ANYCUBIC_SERIAL_PROTOCOL(itostr3(int(ExtUI::getProgress_percent())));
|
622
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
652
|
+ SENDLINE(itostr3(int(ExtUI::getProgress_percent())));
|
623
|
653
|
}
|
624
|
654
|
else {
|
625
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02");
|
|
655
|
+ SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02");
|
626
|
656
|
}
|
627
|
657
|
}
|
628
|
658
|
else {
|
629
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("A6V ---");
|
630
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
659
|
+ SENDLINE_PGM("A6V ---");
|
631
|
660
|
}
|
632
|
661
|
#endif
|
633
|
662
|
break;
|
634
|
663
|
|
635
|
664
|
case 7: { // A7 GET PRINTING TIME
|
636
|
665
|
uint32_t elapsedSeconds = ExtUI::getProgress_seconds_elapsed();
|
637
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("A7V ");
|
|
666
|
+ SEND_PGM("A7V ");
|
638
|
667
|
if (elapsedSeconds != 0) { // print time
|
639
|
668
|
uint32_t elapsedMinutes = elapsedSeconds / 60;
|
640
|
|
- ANYCUBIC_SERIAL_PROTOCOL(itostr2(elapsedMinutes / 60));
|
641
|
|
- ANYCUBIC_SERIAL_SPACE();
|
642
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("H");
|
643
|
|
- ANYCUBIC_SERIAL_SPACE();
|
644
|
|
- ANYCUBIC_SERIAL_PROTOCOL(itostr2(elapsedMinutes % 60));
|
645
|
|
- ANYCUBIC_SERIAL_SPACE();
|
646
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("M");
|
|
669
|
+ SEND(itostr2(elapsedMinutes / 60));
|
|
670
|
+ SEND_PGM(" H ");
|
|
671
|
+ SEND(itostr2(elapsedMinutes % 60));
|
|
672
|
+ SENDLINE_PGM(" M");
|
647
|
673
|
}
|
648
|
674
|
else {
|
649
|
|
- ANYCUBIC_SERIAL_SPACE();
|
650
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("999:999");
|
|
675
|
+ SENDLINE_PGM(" 999:999");
|
651
|
676
|
}
|
652
|
|
- ANYCUBIC_SERIAL_ENTER();
|
653
|
677
|
}
|
654
|
678
|
break;
|
655
|
679
|
|
|
@@ -693,15 +717,15 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
693
|
717
|
if (TFTstrchr_pointer[4] == '/') {
|
694
|
718
|
strcpy(SelectedDirectory, TFTstrchr_pointer + 5);
|
695
|
719
|
SelectedFile[0] = 0;
|
696
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected
|
697
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
720
|
+ SENDLINE_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected
|
|
721
|
+ SENDLINE_PGM("");
|
698
|
722
|
}
|
699
|
723
|
else if (TFTstrchr_pointer[4] == '<') {
|
700
|
724
|
strcpy(SelectedDirectory, TFTstrchr_pointer + 4);
|
701
|
725
|
SpecialMenu = true;
|
702
|
726
|
SelectedFile[0] = 0;
|
703
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected
|
704
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
727
|
+ SENDLINE_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected
|
|
728
|
+ SENDLINE_PGM("");
|
705
|
729
|
}
|
706
|
730
|
else {
|
707
|
731
|
SelectedDirectory[0] = 0;
|
|
@@ -710,7 +734,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
710
|
734
|
*(starpos - 1) = '\0';
|
711
|
735
|
|
712
|
736
|
strcpy(SelectedFile, TFTstrchr_pointer + 4);
|
713
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM_VAL("J20", "TFT Serial Debug: File Selected... J20 ", SelectedFile); // J20 File Selected
|
|
737
|
+ SENDLINE_DBG_PGM_VAL("J20", "TFT Serial Debug: File Selected... J20 ", SelectedFile); // J20 File Selected
|
714
|
738
|
}
|
715
|
739
|
}
|
716
|
740
|
#endif
|
|
@@ -766,7 +790,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
766
|
790
|
}
|
767
|
791
|
ExtUI::setTargetFan_percent(fanPercent, ExtUI::FAN0);
|
768
|
792
|
|
769
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
793
|
+ SENDLINE_PGM("");
|
770
|
794
|
}
|
771
|
795
|
break;
|
772
|
796
|
|
|
@@ -776,7 +800,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
776
|
800
|
disable_all_steppers();
|
777
|
801
|
}
|
778
|
802
|
|
779
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
803
|
+ SENDLINE_PGM("");
|
780
|
804
|
break;
|
781
|
805
|
|
782
|
806
|
case 20: { // A20 read printing speed
|
|
@@ -785,7 +809,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
785
|
809
|
if (CodeSeen('S'))
|
786
|
810
|
feedrate_percentage = constrain(CodeValue(), 40, 999);
|
787
|
811
|
else
|
788
|
|
- ANYCUBIC_SENDCOMMANDPGM_VAL("A20V ", feedrate_percentage);
|
|
812
|
+ SEND_PGM_VAL("A20V ", feedrate_percentage);
|
789
|
813
|
}
|
790
|
814
|
break;
|
791
|
815
|
|
|
@@ -855,14 +879,14 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
855
|
879
|
|
856
|
880
|
if (strlen(commandStr) > 0) {
|
857
|
881
|
sprintf_P(fullCommandStr, PSTR("G91\n%s\nG90"), commandStr);
|
858
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
882
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
859
|
883
|
SERIAL_ECHOPGM("TFT Serial Debug: A22 Move final request with gcode... ");
|
860
|
884
|
SERIAL_ECHOLN(fullCommandStr);
|
861
|
885
|
#endif
|
862
|
886
|
ExtUI::injectCommands(fullCommandStr);
|
863
|
887
|
}
|
864
|
888
|
}
|
865
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
889
|
+ SENDLINE_PGM("");
|
866
|
890
|
break;
|
867
|
891
|
|
868
|
892
|
case 23: // A23 preheat pla
|
|
@@ -872,8 +896,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
872
|
896
|
|
873
|
897
|
ExtUI::setTargetTemp_celsius(PREHEAT_1_TEMP_BED, (ExtUI::heater_t) ExtUI::BED);
|
874
|
898
|
ExtUI::setTargetTemp_celsius(PREHEAT_1_TEMP_HOTEND, (ExtUI::extruder_t) ExtUI::E0);
|
875
|
|
- ANYCUBIC_SERIAL_SUCC_START;
|
876
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
899
|
+ SENDLINE_PGM("OK");
|
877
|
900
|
}
|
878
|
901
|
break;
|
879
|
902
|
|
|
@@ -884,8 +907,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
884
|
907
|
|
885
|
908
|
ExtUI::setTargetTemp_celsius(PREHEAT_2_TEMP_BED, (ExtUI::heater_t) ExtUI::BED);
|
886
|
909
|
ExtUI::setTargetTemp_celsius(PREHEAT_2_TEMP_HOTEND, (ExtUI::extruder_t) ExtUI::E0);
|
887
|
|
- ANYCUBIC_SERIAL_SUCC_START;
|
888
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
910
|
+ SENDLINE_PGM("OK");
|
889
|
911
|
}
|
890
|
912
|
break;
|
891
|
913
|
|
|
@@ -894,7 +916,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
894
|
916
|
ExtUI::setTargetTemp_celsius(0, (ExtUI::heater_t) ExtUI::BED);
|
895
|
917
|
ExtUI::setTargetTemp_celsius(0, (ExtUI::extruder_t) ExtUI::E0);
|
896
|
918
|
|
897
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J12", "TFT Serial Debug: Cooling down... J12"); // J12 cool down
|
|
919
|
+ SENDLINE_DBG_PGM("J12", "TFT Serial Debug: Cooling down... J12"); // J12 cool down
|
898
|
920
|
}
|
899
|
921
|
break;
|
900
|
922
|
|
|
@@ -915,7 +937,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
915
|
937
|
}
|
916
|
938
|
}
|
917
|
939
|
else {
|
918
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to refresh SD A26... J02");
|
|
940
|
+ SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to refresh SD A26... J02");
|
919
|
941
|
}
|
920
|
942
|
|
921
|
943
|
SelectedDirectory[0] = 0;
|
|
@@ -931,13 +953,12 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
931
|
953
|
NOOP;
|
932
|
954
|
else if (CodeSeen('C'))
|
933
|
955
|
NOOP;
|
934
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
956
|
+ SENDLINE_PGM("");
|
935
|
957
|
break;
|
936
|
958
|
|
937
|
959
|
case 33: // A33 get version info
|
938
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM("J33 ");
|
939
|
|
- ANYCUBIC_SERIAL_PROTOCOLPGM(DETAILED_BUILD_VERSION);
|
940
|
|
- ANYCUBIC_SERIAL_ENTER();
|
|
960
|
+ SEND_PGM("J33 ");
|
|
961
|
+ SENDLINE_PGM(DETAILED_BUILD_VERSION);
|
941
|
962
|
break;
|
942
|
963
|
|
943
|
964
|
default:
|
|
@@ -959,9 +980,9 @@ void AnycubicTFTClass::DoSDCardStateCheck() {
|
959
|
980
|
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
|
960
|
981
|
bool isInserted = ExtUI::isMediaInserted();
|
961
|
982
|
if (isInserted)
|
962
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted");
|
|
983
|
+ SENDLINE_DBG_PGM("J00", "TFT Serial Debug: SD card state changed... isInserted");
|
963
|
984
|
else
|
964
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isInserted");
|
|
985
|
+ SENDLINE_DBG_PGM("J01", "TFT Serial Debug: SD card state changed... !isInserted");
|
965
|
986
|
|
966
|
987
|
#endif
|
967
|
988
|
}
|
|
@@ -976,10 +997,10 @@ void AnycubicTFTClass::DoFilamentRunoutCheck() {
|
976
|
997
|
ExtUI::injectCommands_P(PSTR("\nM300 P200 S1567\nM300 P200 S1174\nM300 P200 S1567\nM300 P200 S1174\nM300 P2000 S1567"));
|
977
|
998
|
|
978
|
999
|
// tell the user that the filament has run out and wait
|
979
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J23", "TFT Serial Debug: Blocking filament prompt... J23");
|
|
1000
|
+ SENDLINE_DBG_PGM("J23", "TFT Serial Debug: Blocking filament prompt... J23");
|
980
|
1001
|
}
|
981
|
1002
|
else {
|
982
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J15", "TFT Serial Debug: Non blocking filament runout... J15");
|
|
1003
|
+ SENDLINE_DBG_PGM("J15", "TFT Serial Debug: Non blocking filament runout... J15");
|
983
|
1004
|
}
|
984
|
1005
|
}
|
985
|
1006
|
#endif // FILAMENT_RUNOUT_SENSOR
|
|
@@ -988,7 +1009,7 @@ void AnycubicTFTClass::DoFilamentRunoutCheck() {
|
988
|
1009
|
void AnycubicTFTClass::StartPrint() {
|
989
|
1010
|
#if ENABLED(SDSUPPORT)
|
990
|
1011
|
if (!ExtUI::isPrinting() && strlen(SelectedFile) > 0) {
|
991
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
1012
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
992
|
1013
|
SERIAL_ECHOPGM("TFT Serial Debug: About to print file ... ");
|
993
|
1014
|
SERIAL_ECHO(ExtUI::isPrinting());
|
994
|
1015
|
SERIAL_ECHOPGM(" ");
|
|
@@ -1006,7 +1027,7 @@ void AnycubicTFTClass::PausePrint() {
|
1006
|
1027
|
if (ExtUI::isPrintingFromMedia() && mediaPrintingState != AMPRINTSTATE_STOP_REQUESTED && mediaPauseState == AMPAUSESTATE_NOT_PAUSED) {
|
1007
|
1028
|
mediaPrintingState = AMPRINTSTATE_PAUSE_REQUESTED;
|
1008
|
1029
|
mediaPauseState = AMPAUSESTATE_NOT_PAUSED; // need the userconfirm method to update pause state
|
1009
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J05", "TFT Serial Debug: SD print pause started... J05"); // J05 printing pause
|
|
1030
|
+ SENDLINE_DBG_PGM("J05", "TFT Serial Debug: SD print pause started... J05"); // J05 printing pause
|
1010
|
1031
|
|
1011
|
1032
|
// for some reason pausing the print doesn't retract the extruder so force a manual one here
|
1012
|
1033
|
ExtUI::injectCommands_P(PSTR("G91\nG1 E-2 F1800\nG90"));
|
|
@@ -1019,7 +1040,7 @@ void AnycubicTFTClass::ResumePrint() {
|
1019
|
1040
|
#if ENABLED(SDSUPPORT)
|
1020
|
1041
|
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
1021
|
1042
|
if (READ(FIL_RUNOUT_PIN)) {
|
1022
|
|
- #if ENABLED(ANYCUBIC_TFT_DEBUG)
|
|
1043
|
+ #if ENABLED(ANYCUBIC_LCD_DEBUG)
|
1023
|
1044
|
SERIAL_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... ");
|
1024
|
1045
|
#endif
|
1025
|
1046
|
|
|
@@ -1027,7 +1048,7 @@ void AnycubicTFTClass::ResumePrint() {
|
1027
|
1048
|
DoFilamentRunoutCheck();
|
1028
|
1049
|
|
1029
|
1050
|
// re-enable the continue button
|
1030
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J18", "TFT Serial Debug: Resume Print with filament sensor still tripped... J18");
|
|
1051
|
+ SENDLINE_DBG_PGM("J18", "TFT Serial Debug: Resume Print with filament sensor still tripped... J18");
|
1031
|
1052
|
return;
|
1032
|
1053
|
}
|
1033
|
1054
|
#endif
|
|
@@ -1036,7 +1057,7 @@ void AnycubicTFTClass::ResumePrint() {
|
1036
|
1057
|
mediaPauseState = AMPAUSESTATE_REHEATING;
|
1037
|
1058
|
// TODO: JBA I don't think J05 just disables the continue button, i think it injects a rogue M25. So taking this out
|
1038
|
1059
|
// // disable the continue button
|
1039
|
|
- // ANYCUBIC_SENDCOMMAND_DBG_PGM("J05", "TFT Serial Debug: Resume called with heater timeout... J05"); // J05 printing pause
|
|
1060
|
+ // SENDLINE_DBG_PGM("J05", "TFT Serial Debug: Resume called with heater timeout... J05"); // J05 printing pause
|
1040
|
1061
|
|
1041
|
1062
|
// reheat the nozzle
|
1042
|
1063
|
ExtUI::setUserConfirmed();
|
|
@@ -1045,7 +1066,7 @@ void AnycubicTFTClass::ResumePrint() {
|
1045
|
1066
|
mediaPrintingState = AMPRINTSTATE_PRINTING;
|
1046
|
1067
|
mediaPauseState = AMPAUSESTATE_NOT_PAUSED;
|
1047
|
1068
|
|
1048
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J04", "TFT Serial Debug: SD print resumed... J04"); // J04 printing form sd card now
|
|
1069
|
+ SENDLINE_DBG_PGM("J04", "TFT Serial Debug: SD print resumed... J04"); // J04 printing form sd card now
|
1049
|
1070
|
ExtUI::resumePrint();
|
1050
|
1071
|
}
|
1051
|
1072
|
#endif
|
|
@@ -1055,7 +1076,7 @@ void AnycubicTFTClass::StopPrint() {
|
1055
|
1076
|
#if ENABLED(SDSUPPORT)
|
1056
|
1077
|
mediaPrintingState = AMPRINTSTATE_STOP_REQUESTED;
|
1057
|
1078
|
mediaPauseState = AMPAUSESTATE_NOT_PAUSED;
|
1058
|
|
- ANYCUBIC_SENDCOMMAND_DBG_PGM("J16", "TFT Serial Debug: SD print stop called... J16");
|
|
1079
|
+ SENDLINE_DBG_PGM("J16", "TFT Serial Debug: SD print stop called... J16");
|
1059
|
1080
|
|
1060
|
1081
|
// for some reason stopping the print doesn't retract the extruder so force a manual one here
|
1061
|
1082
|
ExtUI::injectCommands_P(PSTR("G91\nG1 E-2 F1800\nG90"));
|
|
@@ -1063,4 +1084,4 @@ void AnycubicTFTClass::StopPrint() {
|
1063
|
1084
|
#endif
|
1064
|
1085
|
}
|
1065
|
1086
|
|
1066
|
|
-#endif // ANYCUBIC_TFT_MODEL
|
|
1087
|
+#endif // ANYCUBIC_LCD_I3MEGA
|