Add feature switch for new DGUS TFT in master firmware
This commit is contained in:
@@ -38,11 +38,19 @@
|
||||
*/
|
||||
#define CONFIGURATION_H_VERSION 020005
|
||||
|
||||
#define ANYCUBIC_TOUCHSCREEN
|
||||
#define ANYCUBIC_FILAMENT_RUNOUT_SENSOR
|
||||
#define ANYCUBIC_TFT_DEBUG
|
||||
//#define POWER_OUTAGE_TEST
|
||||
|
||||
#define KNUTWURST_MEGAS
|
||||
//#define KNUTWURST_TMC
|
||||
//#define KNUTWURS_DGUS2_TFT
|
||||
//#define KNUTWURST_BLTOUCH
|
||||
|
||||
|
||||
//#define KNUTWURST_DEBUG
|
||||
//#define POWER_OUTAGE_TEST
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//============================= Getting Started =============================
|
||||
@@ -2387,9 +2395,3 @@
|
||||
|
||||
// Allow servo angle to be edited and saved to EEPROM
|
||||
//#define EDITABLE_SERVO_ANGLES
|
||||
|
||||
#define ANYCUBIC_TOUCHSCREEN
|
||||
#define ANYCUBIC_FILAMENT_RUNOUT_SENSOR
|
||||
//#define ANYCUBIC_TFT_DEBUG
|
||||
//#define KNUTWURST_MEGAS_DEBUG
|
||||
//#define KNUTWURST_TMC_DEBUG
|
||||
|
@@ -748,6 +748,17 @@ void AnycubicTouchscreenClass::PrintList()
|
||||
|
||||
if (card.flag.filenameIsDir)
|
||||
{
|
||||
#if ENABLED(KNUTWURS_DGUS2_TFT)
|
||||
HARDWARE_SERIAL_PROTOCOLPGM("/");
|
||||
HARDWARE_SERIAL_PROTOCOL(card.filename);
|
||||
HARDWARE_SERIAL_PROTOCOLLNPGM(".GCO");
|
||||
HARDWARE_SERIAL_PROTOCOLPGM("/");
|
||||
HARDWARE_SERIAL_PROTOCOL(outputString);
|
||||
HARDWARE_SERIAL_PROTOCOLLNPGM(".gcode");
|
||||
SERIAL_ECHO(count);
|
||||
SERIAL_ECHOPGM(": /");
|
||||
SERIAL_ECHOLN(outputString);
|
||||
#else
|
||||
HARDWARE_SERIAL_PROTOCOL("/");
|
||||
HARDWARE_SERIAL_PROTOCOLLN(card.filename);
|
||||
HARDWARE_SERIAL_PROTOCOL("/");
|
||||
@@ -755,6 +766,7 @@ void AnycubicTouchscreenClass::PrintList()
|
||||
SERIAL_ECHO(count);
|
||||
SERIAL_ECHOPGM(": /");
|
||||
SERIAL_ECHOLN(outputString);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1284,15 +1296,13 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
|
||||
SERIAL_EOL();
|
||||
#endif
|
||||
}
|
||||
else if ((TFTstrchr_pointer[4] == '<')
|
||||
|| (TFTstrchr_pointer[4] == '[')
|
||||
|| (TFTstrchr_pointer[4] == '_'))
|
||||
else if (TFTstrchr_pointer[4] == '<')
|
||||
{
|
||||
strcpy(currentTouchscreenSelection, TFTstrchr_pointer + 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
//currentTouchscreenSelection[0] = 0;
|
||||
currentTouchscreenSelection[0] = 0;
|
||||
|
||||
#ifdef ANYCUBIC_TFT_DEBUG
|
||||
SERIAL_ECHOLNPGM("TFT Serial Debug: Normal file open path");
|
||||
@@ -1326,6 +1336,14 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
|
||||
#ifdef SDSUPPORT
|
||||
if ((!planner.movesplanned()) && (TFTstate != ANYCUBIC_TFT_STATE_SDPAUSE) && (TFTstate != ANYCUBIC_TFT_STATE_SDOUTAGE) && (card.isFileOpen()))
|
||||
{
|
||||
if ((currentTouchscreenSelection[0] == '<') || (currentTouchscreenSelection[0] == 0))
|
||||
{
|
||||
SERIAL_ECHOLNPGM("ERROR: Special entry found! Stopping...");
|
||||
KillTFT();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ai3m_pause_state = 0;
|
||||
#ifdef ANYCUBIC_TFT_DEBUG
|
||||
SERIAL_ECHOPAIR(" DEBUG: AI3M Pause State: ", ai3m_pause_state);
|
||||
@@ -1567,11 +1585,8 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
|
||||
}
|
||||
else
|
||||
{
|
||||
//if ((SelectedDirectory[0] == '.') && (SelectedDirectory[1] == '.'))
|
||||
if ((currentTouchscreenSelection[0] == 'D')
|
||||
&& (currentTouchscreenSelection[1] == 'I')
|
||||
&& (currentTouchscreenSelection[2] == 'R')
|
||||
&& (currentTouchscreenSelection[3] == '_'))
|
||||
if ((strcasestr(currentTouchscreenSelection, SM_DIR_UP_S) != NULL)
|
||||
|| (strcasestr(currentTouchscreenSelection, SM_DIR_UP_L) != NULL))
|
||||
{
|
||||
#ifdef ANYCUBIC_TFT_DEBUG
|
||||
SERIAL_ECHOLNPGM("TFT Serial Debug: Directory UP (cd ..)");
|
||||
@@ -1580,8 +1595,7 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((currentTouchscreenSelection[0] == '[')
|
||||
|| (currentTouchscreenSelection[0] == '_'))
|
||||
if (currentTouchscreenSelection[0] == '<')
|
||||
{
|
||||
#ifdef ANYCUBIC_TFT_DEBUG
|
||||
SERIAL_ECHOLNPGM("TFT Serial Debug: Enter Special Menu");
|
||||
@@ -1593,10 +1607,15 @@ void AnycubicTouchscreenClass::GetCommandFromTFT()
|
||||
#ifdef ANYCUBIC_TFT_DEBUG
|
||||
SERIAL_ECHOLNPGM("TFT Serial Debug: Not a menu. Must be a directory!");
|
||||
#endif
|
||||
|
||||
#if ENABLED(KNUTWURS_DGUS2_TFT)
|
||||
strcpy(currentFileOrDirectory, currentTouchscreenSelection);
|
||||
int currentFileLen = strlen(currentFileOrDirectory);
|
||||
currentFileOrDirectory[currentFileLen - 4] = '\0';
|
||||
card.cd(currentFileOrDirectory);
|
||||
#else
|
||||
card.cd(currentTouchscreenSelection);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ char *ftostr32(const float &);
|
||||
#define TFTBUFSIZE 4
|
||||
#define TFT_MAX_CMD_SIZE 96
|
||||
#define MSG_MY_VERSION "Knutwurst-1.0.7"
|
||||
#define MAX_PRINTABLE_FILENAME_LEN 96
|
||||
#define MAX_PRINTABLE_FILENAME_LEN 30
|
||||
|
||||
#define ANYCUBIC_TFT_STATE_IDLE 0
|
||||
#define ANYCUBIC_TFT_STATE_SDPRINT 1
|
||||
@@ -44,49 +44,96 @@ char *ftostr32(const float &);
|
||||
#define ANYCUBIC_TFT_STATE_SDSTOP_REQ 5
|
||||
#define ANYCUBIC_TFT_STATE_SDOUTAGE 99
|
||||
|
||||
#if DISABLED(KNUTWURS_DGUS2_TFT)
|
||||
#define SM_DIR_UP_L "/.."
|
||||
#define SM_DIR_UP_S ".."
|
||||
#define SM_SPECIAL_MENU_L "<Special Menu>"
|
||||
#define SM_SPECIAL_MENU_S "<SPECI~1.GCO"
|
||||
#define SM_PID_HOTEND_L "<PID Tune Hotend>"
|
||||
#define SM_PID_HOTEND_S "<PIDTU~1.GCO"
|
||||
#define SM_PID_BED_L "<PID Tune Ultrabase>"
|
||||
#define SM_PID_BED_S "<PIDTU~2.GCO"
|
||||
#define SM_SAVE_EEPROM_L "<Save EEPROM>"
|
||||
#define SM_SAVE_EEPROM_S "<SAVEE~1.GCO"
|
||||
#define SM_LOAD_DEFAULTS_L "<Load FW Defaults>"
|
||||
#define SM_LOAD_DEFAULTS_S "<LOADF~1.GCO"
|
||||
#define SM_PREHEAT_BED_L "<Preheat Ultrabase>"
|
||||
#define SM_PREHEAT_BED_S "<PREHE~1.GCO"
|
||||
#define SM_MESH_START_L "<Start Mesh Leveling>"
|
||||
#define SM_MESH_START_S "<START~1.GCO"
|
||||
#define SM_MESH_NEXT_L "<Next Mesh Point>"
|
||||
#define SM_MESH_NEXT_S "<NEXTM~1.GCO"
|
||||
#define SM_Z_UP_01_L "<Z Up 0.1>"
|
||||
#define SM_Z_UP_01_S "<ZUP01~1.GCO"
|
||||
#define SM_Z_DN_01_L "<Z Down 0.1>"
|
||||
#define SM_Z_DN_01_S "<ZDOWN~1.GCO"
|
||||
#define SM_Z_UP_002_L "<Z Up 0.02>"
|
||||
#define SM_Z_UP_002_S "<ZUP00~1.GCO"
|
||||
#define SM_Z_DN_002_L "<Z Down 0.02>"
|
||||
#define SM_Z_DN_002_S "<ZDOWN~2.GCO"
|
||||
#define SM_Z_UP_001_L "<Z Up 0.01>"
|
||||
#define SM_Z_UP_001_S "<ZUP00~2.GCO"
|
||||
#define SM_Z_DN_001_L "<Z Down 0.01>"
|
||||
#define SM_Z_DN_001_S "<ZDOWN~3.GCO"
|
||||
#define SM_BLTOUCH_L "<BLTouch Leveling>"
|
||||
#define SM_BLTOUCH_S "<BLTOU~1.GCO"
|
||||
#define SM_PAUSE_L "<Fil. Change Pause>"
|
||||
#define SM_PAUSE_S "<FILCH~2.GCO"
|
||||
#define SM_RESUME_L "<Fil. Change Resume>"
|
||||
#define SM_RESUME_S "<FILCH~1.GCO"
|
||||
#define SM_DIS_FILSENS_L "<Disable Fil. Sensor>"
|
||||
#define SM_DIS_FILSENS_S "<DISAB~1.GCO"
|
||||
#define SM_EN_FILSENS_L "<Enable Fil. Sensor>"
|
||||
#define SM_EN_FILSENS_S "<ENABL~1.GCO"
|
||||
#define SM_EXIT_L "<Exit>"
|
||||
#define SM_EXIT_S "<EXIT_~1.GCO"
|
||||
#endif
|
||||
|
||||
#define SM_DIR_UP_L "DIR_UP.gcode"
|
||||
#if ENABLED(KNUTWURS_DGUS2_TFT)
|
||||
#define SM_DIR_UP_L "<<<<<<.gcode"
|
||||
#define SM_DIR_UP_S "DIR_UP~1.GCO"
|
||||
#define SM_SPECIAL_MENU_L "[Special Menu].gcode"
|
||||
#define SM_SPECIAL_MENU_S "_SPECI~1.GCO"
|
||||
#define SM_PID_HOTEND_L "[PID Tune Hotend].gcode"
|
||||
#define SM_PID_HOTEND_S "_PIDTU~1.GCO"
|
||||
#define SM_PID_BED_L "[PID Tune Ultrabase].gcode"
|
||||
#define SM_PID_BED_S "_PIDTU~2.GCO"
|
||||
#define SM_SAVE_EEPROM_L "[Save EEPROM].gcode"
|
||||
#define SM_SAVE_EEPROM_S "_SAVEE~1.GCO"
|
||||
#define SM_LOAD_DEFAULTS_L "[Load FW Defaults].gcode"
|
||||
#define SM_LOAD_DEFAULTS_S "_LOADF~1.GCO"
|
||||
#define SM_PREHEAT_BED_L "[Preheat Ultrabase].gcode"
|
||||
#define SM_PREHEAT_BED_S "_PREHE~1.GCO"
|
||||
#define SM_MESH_START_L "[Start Mesh Leveling].gcode"
|
||||
#define SM_MESH_START_S "_START~1.GCO"
|
||||
#define SM_MESH_NEXT_L "[Next Mesh Point].gcode"
|
||||
#define SM_MESH_NEXT_S "_NEXTM~1.GCO"
|
||||
#define SM_Z_UP_01_L "[Z Up 0.1].gcode"
|
||||
#define SM_Z_UP_01_S "_ZUP01~1.GCO"
|
||||
#define SM_Z_DN_01_L "[Z Down 0.1].gcode"
|
||||
#define SM_Z_DN_01_S "_ZDOWN~1.GCO"
|
||||
#define SM_Z_UP_002_L "[Z Up 0.02].gcode"
|
||||
#define SM_Z_UP_002_S "_ZUP00~1.GCO"
|
||||
#define SM_Z_DN_002_L "[Z Down 0.02].gcode"
|
||||
#define SM_Z_DN_002_S "_ZDOWN~2.GCO"
|
||||
#define SM_Z_UP_001_L "[Z Up 0.01].gcode"
|
||||
#define SM_Z_UP_001_S "_ZUP00~2.GCO"
|
||||
#define SM_Z_DN_001_L "[Z Down 0.01].gcode"
|
||||
#define SM_Z_DN_001_S "_ZDOWN~3.GCO"
|
||||
#define SM_BLTOUCH_L "[BLTouch Leveling].gcode"
|
||||
#define SM_BLTOUCH_S "_BLTOU~1.GCO"
|
||||
#define SM_PAUSE_L "[Fil. Change Pause].gcode"
|
||||
#define SM_PAUSE_S "_FILCH~2.GCO"
|
||||
#define SM_RESUME_L "[Fil. Change Resume].gcode"
|
||||
#define SM_RESUME_S "_FILCH~1.GCO"
|
||||
#define SM_DIS_FILSENS_L "[Disable Fil. Sensor].gcode"
|
||||
#define SM_DIS_FILSENS_S "_DISAB~1"
|
||||
#define SM_EN_FILSENS_L "[Enable Fil. Sensor].gcode"
|
||||
#define SM_EN_FILSENS_S "_ENABL~1.GCO"
|
||||
#define SM_EXIT_L "[Exit].gcode"
|
||||
#define SM_EXIT_S "_EXIT_~1.GCO"
|
||||
#define SM_SPECIAL_MENU_L "<Special Menu>.gcode"
|
||||
#define SM_SPECIAL_MENU_S "<SPECI~1.GCO"
|
||||
#define SM_PID_HOTEND_L "<PID Tune Hotend>.gcode"
|
||||
#define SM_PID_HOTEND_S "<PIDTU~1.GCO"
|
||||
#define SM_PID_BED_L "<PID Tune Ultrabase>.gcode"
|
||||
#define SM_PID_BED_S "<PIDTU~2.GCO"
|
||||
#define SM_SAVE_EEPROM_L "<Save EEPROM>.gcode"
|
||||
#define SM_SAVE_EEPROM_S "<SAVEE~1.GCO"
|
||||
#define SM_LOAD_DEFAULTS_L "<Load FW Defaults>.gcode"
|
||||
#define SM_LOAD_DEFAULTS_S "<LOADF~1.GCO"
|
||||
#define SM_PREHEAT_BED_L "<Preheat Ultrabase>.gcode"
|
||||
#define SM_PREHEAT_BED_S "<PREHE~1.GCO"
|
||||
#define SM_MESH_START_L "<Start Mesh Leveling>.gcode"
|
||||
#define SM_MESH_START_S "<START~1.GCO"
|
||||
#define SM_MESH_NEXT_L "<Next Mesh Point>.gcode"
|
||||
#define SM_MESH_NEXT_S "<NEXTM~1.GCO"
|
||||
#define SM_Z_UP_01_L "<Z Up 0.1>.gcode"
|
||||
#define SM_Z_UP_01_S "<ZUP01~1.GCO"
|
||||
#define SM_Z_DN_01_L "<Z Down 0.1>.gcode"
|
||||
#define SM_Z_DN_01_S "<ZDOWN~1.GCO"
|
||||
#define SM_Z_UP_002_L "<Z Up 0.02>.gcode"
|
||||
#define SM_Z_UP_002_S "<ZUP00~1.GCO"
|
||||
#define SM_Z_DN_002_L "<Z Down 0.02>.gcode"
|
||||
#define SM_Z_DN_002_S "<ZDOWN~2.GCO"
|
||||
#define SM_Z_UP_001_L "<Z Up 0.01>.gcode"
|
||||
#define SM_Z_UP_001_S "<ZUP00~2.GCO"
|
||||
#define SM_Z_DN_001_L "<Z Down 0.01>.gcode"
|
||||
#define SM_Z_DN_001_S "<ZDOWN~3.GCO"
|
||||
#define SM_BLTOUCH_L "<BLTouch Leveling>.gcode"
|
||||
#define SM_BLTOUCH_S "<BLTOU~1.GCO"
|
||||
#define SM_PAUSE_L "<Fil. Change Pause>.gcode"
|
||||
#define SM_PAUSE_S "<FILCH~2.GCO"
|
||||
#define SM_RESUME_L "<Fil. Change Resume>.gcode"
|
||||
#define SM_RESUME_S "<FILCH~1.GCO"
|
||||
#define SM_DIS_FILSENS_L "<Disable Fil. Sensor>.gcode"
|
||||
#define SM_DIS_FILSENS_S "<DISAB~1.GCO"
|
||||
#define SM_EN_FILSENS_L "<Enable Fil. Sensor>.gcode"
|
||||
#define SM_EN_FILSENS_S "<ENABL~1.GCO"
|
||||
#define SM_EXIT_L "<Exit>.gcode"
|
||||
#define SM_EXIT_S "<EXIT_~1.GCO"
|
||||
#endif
|
||||
|
||||
|
||||
class AnycubicTouchscreenClass
|
||||
{
|
||||
|
Reference in New Issue
Block a user