More Anycubic 0.0.2 TFT fixes, thanks to @etet100

This commit is contained in:
Knutwurst
2022-01-09 14:55:02 +01:00
parent b6b2995b5e
commit 341addb39f
2 changed files with 26 additions and 2 deletions

View File

@@ -1301,10 +1301,10 @@ void AnycubicTouchscreenClass::StateHandler() {
#endif
break;
case ANYCUBIC_TFT_STATE_SDPAUSE_REQ:
HARDWARE_SERIAL_PROTOCOLPGM("J18");
HARDWARE_SERIAL_ENTER();
#ifdef SDSUPPORT
if ((!card.isPrinting()) && (!planner.movesplanned())) {
HARDWARE_SERIAL_PROTOCOLPGM("J18");
HARDWARE_SERIAL_ENTER();
if (ai3m_pause_state < 2) {
// no flags, this is a regular pause.
ai3m_pause_state = 1;
@@ -1340,6 +1340,10 @@ void AnycubicTouchscreenClass::StateHandler() {
if ((!card.isPrinting()) && (!planner.movesplanned())) {
queue.clear();
TFTstate = ANYCUBIC_TFT_STATE_IDLE;
#ifdef SDSUPPORT
HARDWARE_SERIAL_PROTOCOLPGM("J16"); // J16 stop print
HARDWARE_SERIAL_ENTER();
#endif
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("TFT Serial Debug: SD print stopped... J16");
#endif
@@ -2134,6 +2138,12 @@ void AnycubicTouchscreenClass::GetCommandFromTFT() {
CaseLight = true;
}
#endif
#if ENABLED(KNUTWURST_DGUS2_TFT)
case 50:
HARDWARE_SERIAL_PROTOCOLPGM("J38 ");
HARDWARE_SERIAL_ENTER();
break;
#endif
#if ENABLED(KNUTWURST_MEGA_P_LASER)
case 34:// Continuous printing
@@ -2386,6 +2396,17 @@ void AnycubicTouchscreenClass::BedHeatingDone() {
}
}
#if BOTH(ANYCUBIC_TFT_DEBUG, KNUTWURST_DGUS2_TFT)
void AnycubicTouchscreenClass::Command(const char * const command) {
HARDWARE_SERIAL_PROTOCOL(command);
SERIAL_ECHOPGM("TFT Serial Debug: Sending ");
SERIAL_ECHO(strlen(command));
SERIAL_ECHOPGM(" ");
SERIAL_ECHOLN(command);
HARDWARE_SERIAL_ENTER();
}
#endif
void PowerKill() {
#ifdef POWER_OUTAGE_TEST
Temp_Buf_Extuder_Temperature = thermalManager.degTargetHotend(0);

View File

@@ -255,6 +255,9 @@ class AnycubicTouchscreenClass {
void HeatingStart();
void FilamentRunout();
void KillTFT();
#if BOTH(ANYCUBIC_TFT_DEBUG, KNUTWURST_DGUS2_TFT)
void Command(const char * const command);
#endif
char TFTstate = ANYCUBIC_TFT_STATE_IDLE;
/**