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 #endif
break; break;
case ANYCUBIC_TFT_STATE_SDPAUSE_REQ: case ANYCUBIC_TFT_STATE_SDPAUSE_REQ:
HARDWARE_SERIAL_PROTOCOLPGM("J18");
HARDWARE_SERIAL_ENTER();
#ifdef SDSUPPORT #ifdef SDSUPPORT
if ((!card.isPrinting()) && (!planner.movesplanned())) { if ((!card.isPrinting()) && (!planner.movesplanned())) {
HARDWARE_SERIAL_PROTOCOLPGM("J18");
HARDWARE_SERIAL_ENTER();
if (ai3m_pause_state < 2) { if (ai3m_pause_state < 2) {
// no flags, this is a regular pause. // no flags, this is a regular pause.
ai3m_pause_state = 1; ai3m_pause_state = 1;
@@ -1340,6 +1340,10 @@ void AnycubicTouchscreenClass::StateHandler() {
if ((!card.isPrinting()) && (!planner.movesplanned())) { if ((!card.isPrinting()) && (!planner.movesplanned())) {
queue.clear(); queue.clear();
TFTstate = ANYCUBIC_TFT_STATE_IDLE; TFTstate = ANYCUBIC_TFT_STATE_IDLE;
#ifdef SDSUPPORT
HARDWARE_SERIAL_PROTOCOLPGM("J16"); // J16 stop print
HARDWARE_SERIAL_ENTER();
#endif
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("TFT Serial Debug: SD print stopped... J16"); SERIAL_ECHOLNPGM("TFT Serial Debug: SD print stopped... J16");
#endif #endif
@@ -2134,6 +2138,12 @@ void AnycubicTouchscreenClass::GetCommandFromTFT() {
CaseLight = true; CaseLight = true;
} }
#endif #endif
#if ENABLED(KNUTWURST_DGUS2_TFT)
case 50:
HARDWARE_SERIAL_PROTOCOLPGM("J38 ");
HARDWARE_SERIAL_ENTER();
break;
#endif
#if ENABLED(KNUTWURST_MEGA_P_LASER) #if ENABLED(KNUTWURST_MEGA_P_LASER)
case 34:// Continuous printing 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() { void PowerKill() {
#ifdef POWER_OUTAGE_TEST #ifdef POWER_OUTAGE_TEST
Temp_Buf_Extuder_Temperature = thermalManager.degTargetHotend(0); Temp_Buf_Extuder_Temperature = thermalManager.degTargetHotend(0);

View File

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