19 Commits

Author SHA1 Message Date
Knutwurst
c83dad91f3 Z2 Stepper pin definitions for CHIRON and 4MAX. 2023-05-30 22:10:31 +02:00
Knutwurst
429b8cc1fa Fix warnings in 4MAX Build 2023-05-30 22:00:27 +02:00
Knutwurst
2e030524e2 Disable debug output. 2023-05-30 21:18:41 +02:00
Knutwurst
45cbc380d9 Update build date. 2023-05-30 19:26:27 +02:00
Knutwurst
cf0611a7d9 Use const char* because it's not altered past that point. 2023-05-30 17:33:39 +02:00
Knutwurst
9c4c58235b Fix compiler warnings for Chiron build and Directory selection on Anycubic 1.0 displays. 2023-05-30 16:46:30 +02:00
Knutwurst
75ffa32980 Use SENDLINE instead of SEND to create directory name on anycubic 1.0 display. 2023-05-30 16:07:26 +02:00
Knutwurst
e0d858d812 Fix misuse of const char pointer by creating a new string which represents the filename. 2023-05-30 15:09:46 +02:00
Knutwurst
ad86d96a31 Cleanup 2023-05-30 09:22:25 +02:00
Knutwurst
6c4a0a887a Remove old PrintList() implementation + some cleanup 2023-05-29 20:48:58 +02:00
Knutwurst
e940c218cd Do not remove current selection if Special Menu is enabled, so items can be tapped multiple times. 2023-05-29 20:40:27 +02:00
Knutwurst
1df0ee59d2 Set correct filament sensor pins for chiron in correspondig header and enable new file list implementation. 2023-05-29 20:34:08 +02:00
Knutwurst
9244ea5890 New file list render implementation - WIP! 2023-05-29 20:07:06 +02:00
Knutwurst
8e34d7dc7c Fix 4MAXP2 Build. 2023-05-29 19:27:55 +02:00
Knutwurst
7fbbbba752 Fix Typo 2023-05-29 14:20:28 +02:00
Knutwurst
2b5816037a Add custom M600 configuration for DirectExtruder 4MAX Pro 2.0. 2023-05-29 12:35:07 +02:00
Knutwurst
e008a96269 Fix Chiron and 4MAX Pro 2.0 Filament rundout sensor. 2023-05-29 11:39:00 +02:00
Knutwurst
952e0db31e Fix that you could not get out of a selected directory. Refactor Touchscreen file handling. 2023-05-29 11:20:22 +02:00
Knutwurst
69efa3376a Set lowest point for BLTouch from 2 to 10 mm. 2023-05-28 22:57:50 +02:00
9 changed files with 278 additions and 204 deletions

View File

@@ -1939,7 +1939,7 @@
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
// #define Z_AFTER_PROBING 5 // Z position after probing is done
#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
#define Z_PROBE_LOW_POINT -10 // Farthest distance below the trigger-point to go before stopping
// For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -50

View File

@@ -2658,29 +2658,51 @@
*/
#define ADVANCED_PAUSE_FEATURE
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 30 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 555 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 538 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
#if DISABLED(KNUTWURST_4MAXP2)
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 30 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 555 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 538 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
#else
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 1 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle.
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 0 // (mm/s) Unload filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_UNLOAD_ACCEL 30 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_UNLOAD_LENGTH 0 // (mm) The length of filament for a complete unload.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
// Set to 0 for manual unloading.
#define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 // (mm/s) Slow move when starting load.
#define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 // (mm) Slow length, to allow time to insert material.
// 0 to disable start loading and skip to fast load only
#define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 30 // (mm/s) Load filament feedrate. This can be pretty fast.
#define FILAMENT_CHANGE_FAST_LOAD_ACCEL 10 // (mm/s^2) Lower acceleration may allow a faster feedrate.
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 5 // (mm) Load length of filament, from extruder gear to nozzle.
// For Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the nozzle.
#endif
#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted.
#define ADVANCED_PAUSE_PURGE_FEEDRATE 2 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate.
#define ADVANCED_PAUSE_PURGE_LENGTH 2 // (mm) Length to extrude after loading.
// Set to 0 for manual extrusion.
// Filament can be extruded repeatedly from the Filament Change menu
// until extrusion is consistent, and to purge old filament.
// #define ADVANCED_PAUSE_RESUME_PRIME 0 // (mm) Extra distance to prime nozzle after returning from park.
#define ADVANCED_PAUSE_FANS_PAUSE // Turn off print-cooling fans while the machine is paused.

View File

@@ -41,10 +41,10 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
#define CUSTOM_BUILD_VERSION "1.5.0-b5"
#define CUSTOM_BUILD_VERSION "1.5.0-b6"
#ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2023-05-28"
#define STRING_DISTRIBUTION_DATE "2023-05-30"
#endif
/**

View File

@@ -84,6 +84,8 @@
*value = c;
pos++;
value++;
if(pos > 32766)
break;
} while (--size);
}
@@ -193,7 +195,6 @@
BLTouchMenu = false;
LevelMenu = false;
CaseLight = false;
MyFileNrCnt = 0;
currentFlowRate = 100;
flowRateBuffer = SM_FLOW_DISP_L;
@@ -705,10 +706,42 @@
}
void AnycubicTouchscreenClass::PrintList() {
#if ENABLED(KNUTWURST_SPECIAL_MENU)
void AnycubicTouchscreenClass::RenderCurrentFileList() {
uint16_t selectedNumber = 0;
FileList currentFileList;
currentFileOrDirectory[0] = 0;
if (SpecialMenu == false) {
currentTouchscreenSelection[0] = 0;
}
SENDLINE_PGM("FN "); // Filelist start
if (!isMediaInserted() && !SpecialMenu) {
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to render Current File List... J02");
SENDLINE_PGM(SM_SPECIAL_MENU_S);
SENDLINE_PGM(SM_SPECIAL_MENU_L);
}
else {
if (CodeSeen('S')) {
selectedNumber = CodeValue();
}
if (SpecialMenu) {
RenderSpecialMenu(selectedNumber);
} else if (selectedNumber <= currentFileList.count()) {
RenderCurrentFolder(selectedNumber);
}
}
SENDLINE_PGM("END"); // Filelist stop
}
void AnycubicTouchscreenClass::RenderSpecialMenu(uint16_t selectedNumber) {
#if ENABLED(KNUTWURST_SPECIAL_MENU)
if (MMLMenu) {
switch (filenumber) {
switch (selectedNumber) {
case 0: // Page 1
SENDLINE_PGM(SM_MESH_START_S);
SENDLINE_PGM(SM_MESH_START_L);
@@ -746,7 +779,7 @@
flowRateBuffer = SM_FLOW_DISP_L;
flowRateBuffer.replace("XXX", String(currentFlowRate));
switch (filenumber) {
switch (selectedNumber) {
case 0: // Page 1
SENDLINE_PGM(SM_FLOW_DISP_S);
SENDLINE(flowRateBuffer.c_str());
@@ -772,7 +805,7 @@
zOffsetBuffer.replace("XXXXX", String(float(probe.offset.z)));
switch (filenumber) {
switch (selectedNumber) {
case 0: // Page 1
SENDLINE_PGM(SM_BLTZ_DISP_S);
SENDLINE(zOffsetBuffer.c_str());
@@ -794,7 +827,7 @@
}
}
else if (LevelMenu) {
switch (filenumber) {
switch (selectedNumber) {
case 0: // Page 1
SENDLINE_PGM(SM_EZLVL_P1_S);
SENDLINE_PGM(SM_EZLVL_P1_L);
@@ -816,7 +849,7 @@
}
}
else if (SpecialMenu) {
switch (filenumber) {
switch (selectedNumber) {
case 0: // Page 1
SENDLINE_PGM(SM_FLOWMENU_S);
SENDLINE_PGM(SM_FLOWMENU_L);
@@ -888,141 +921,136 @@
}
}
#endif // if ENABLED(KNUTWURST_SPECIAL_MENU)
}
#ifdef SDSUPPORT
#if ENABLED(KNUTWURST_SPECIAL_MENU)
else if (card.isMounted())
#else
if (card.isMounted())
#endif
{
int count = filenumber;
int max_files;
int filesOnSDCard = card.countFilesInWorkDir();
void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
FileList currentFileList;
uint16_t count = selectedNumber;
uint16_t max_files;
uint16_t filesOnSDCard = currentFileList.count();
if ((filesOnSDCard - filenumber) < 4) {
max_files = filesOnSDCard;
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLN("max_files = filesOnSDCard;");
#endif
}
else {
max_files = filenumber + 3;
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLN("max_files = filenumber + 3;");
#endif
}
if ((filesOnSDCard - selectedNumber) < 4) {
max_files = filesOnSDCard;
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLN("max_files = filesOnSDCard;");
#endif
} else {
max_files = selectedNumber + 3;
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLN("max_files = filenumber + 3;");
#endif
}
if (filesOnSDCard == 3) filenumber = 0;
if (filesOnSDCard == 3) filenumber = 0;
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("filesOnSDCard: ");
SERIAL_ECHOLN(filesOnSDCard);
SERIAL_ECHOPGM("filenumber: ");
SERIAL_ECHOLN(filenumber);
SERIAL_ECHOPGM("max_files: ");
SERIAL_ECHOLN(max_files);
SERIAL_ECHOPGM("count: ");
SERIAL_ECHOLN(count);
#endif
for (count = filenumber; count <= max_files; count++) {
if (count == 0) { // Special Entry
if (strcmp(card.getWorkDirName(), "/") == 0) {
SENDLINE_PGM(SM_SPECIAL_MENU_S);
SENDLINE_PGM(SM_SPECIAL_MENU_L);
SERIAL_ECHO(count);
SERIAL_ECHO(": ");
SERIAL_ECHOLNPGM(SM_SPECIAL_MENU_L);
}
else {
SENDLINE_PGM(SM_DIR_UP_S);
SENDLINE_PGM(SM_DIR_UP_L);
SERIAL_ECHO(count);
SERIAL_ECHO(": ");
SERIAL_ECHOLNPGM(SM_DIR_UP_L);
}
}
else {
card.selectFileByIndex(count - 1);
// The longname may not be filed, so we use the built-in fallback here.
char* fileName = card.longest_filename();
int fileNameLen = strlen(fileName);
bool fileNameWasCut = false;
// Cut off too long filenames.
// They don't fit on the screen anyway.
#if ENABLED(KNUTWURST_DGUS2_TFT)
if (fileNameLen >= MAX_PRINTABLE_FILENAME_LEN) {
fileNameWasCut = true;
fileNameLen = MAX_PRINTABLE_FILENAME_LEN;
}
#endif
char outputString[fileNameLen];
// Bugfix for non-printable special characters
// which are now replaced by underscores.
for (unsigned char i = 0; i <= fileNameLen; i++) {
if (i >= fileNameLen) {
outputString[i] = ' ';
}
else {
outputString[i] = fileName[i];
if (!isPrintable(outputString[i]))
outputString[i] = '_';
}
}
// I know, it's ugly, but it's faster than a string lib
if (fileNameWasCut) {
outputString[fileNameLen - 7] = '~';
outputString[fileNameLen - 6] = '.';
outputString[fileNameLen - 5] = 'g';
outputString[fileNameLen - 4] = 'c';
outputString[fileNameLen - 3] = 'o';
outputString[fileNameLen - 2] = 'd';
outputString[fileNameLen - 1] = 'e';
}
outputString[fileNameLen] = '\0';
if (card.flag.filenameIsDir) {
#if ENABLED(KNUTWURST_DGUS2_TFT)
SEND_PGM("/");
SEND(card.filename);
SENDLINE_PGM(".GCO");
SEND_PGM("/");
SEND(outputString);
SENDLINE_PGM(".gcode");
#else
SEND_PGM("/");
SEND(card.filename);
SEND_PGM("/");
SENDLINE(outputString);
#endif
SERIAL_ECHO(count);
SERIAL_ECHOPGM(": /");
SERIAL_ECHOLN(outputString);
} else {
SENDLINE(card.filename);
SENDLINE(outputString);
SERIAL_ECHO(count);
SERIAL_ECHOPGM(": ");
SERIAL_ECHOLN(outputString);
}
}
}
}
#endif // ifdef SDSUPPORT
else {
#if ENABLED(KNUTWURST_SPECIAL_MENU_WO_SD)
for (count = selectedNumber; count <= max_files; count++) {
if (count == 0) { // Special Entry
if (currentFileList.isAtRootDir()) {
SENDLINE_PGM(SM_SPECIAL_MENU_S);
SENDLINE_PGM(SM_SPECIAL_MENU_L);
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHO(count);
SERIAL_ECHO(": ");
SERIAL_ECHOLNPGM(SM_SPECIAL_MENU_L);
#endif
}
else {
SENDLINE_PGM(SM_DIR_UP_S);
SENDLINE_PGM(SM_DIR_UP_L);
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHO(count);
SERIAL_ECHO(": ");
SERIAL_ECHOLNPGM(SM_DIR_UP_L);
#endif
}
} else {
currentFileList.seek(count - 1, false);
#if ENABLED(ANYCUBIC_LCD_DEBUG)
SERIAL_ECHOLN(currentFileList.filename());
#endif
/*
if (currentFileList.isDir()) {
SEND_PGM("/");
SENDLINE(currentFileList.shortFilename());
SEND_PGM("/");
SENDLINE(currentFileList.filename());
} else {
SENDLINE(currentFileList.shortFilename());
SENDLINE(currentFileList.filename());
}
*/
// The longname may not be filed, so we use the built-in fallback here.
const char* fileName = currentFileList.filename();
int fileNameLen = strlen(fileName);
bool fileNameWasCut = false;
// Cut off too long filenames.
// They don't fit on the screen anyway.
#if ENABLED(KNUTWURST_DGUS2_TFT)
if (fileNameLen >= MAX_PRINTABLE_FILENAME_LEN) {
fileNameWasCut = true;
fileNameLen = MAX_PRINTABLE_FILENAME_LEN;
}
#endif
char outputString[fileNameLen];
// Bugfix for non-printable special characters
// which are now replaced by underscores.
for (unsigned char i = 0; i <= fileNameLen; i++) {
if (i >= fileNameLen) {
outputString[i] = ' ';
}
else {
outputString[i] = fileName[i];
if (!isPrintable(outputString[i]))
outputString[i] = '_';
}
}
// I know, it's ugly, but it's faster than a string lib
if (fileNameWasCut) {
outputString[fileNameLen - 7] = '~';
outputString[fileNameLen - 6] = '.';
outputString[fileNameLen - 5] = 'g';
outputString[fileNameLen - 4] = 'c';
outputString[fileNameLen - 3] = 'o';
outputString[fileNameLen - 2] = 'd';
outputString[fileNameLen - 1] = 'e';
}
outputString[fileNameLen] = '\0';
if (currentFileList.isDir()) {
#if ENABLED(KNUTWURST_DGUS2_TFT)
SEND_PGM("/");
SEND(currentFileList.shortFilename());
SENDLINE_PGM(".GCO");
SEND_PGM("/");
SEND(outputString);
SENDLINE_PGM(".gcode");
#else
SEND_PGM("/");
SENDLINE(currentFileList.shortFilename());
SEND_PGM("/");
SENDLINE(currentFileList.filename());
#endif
SERIAL_ECHO(count);
SERIAL_ECHOPGM(": /");
SERIAL_ECHOLN(outputString);
} else { // The current selection is a file and not a directory
SENDLINE(currentFileList.shortFilename());
SENDLINE(outputString);
SERIAL_ECHO(count);
SERIAL_ECHOPGM(": ");
SERIAL_ECHOLN(outputString);
}
}
}
}
void AnycubicTouchscreenClass::CheckSDCardChange() {
#if BOTH(SDSUPPORT, HAS_SD_DETECT)
@@ -1270,9 +1298,8 @@
#endif
{
if (CodeSeen('S')) filenumber = CodeValue();
SENDLINE_PGM("FN "); // Filelist start
PrintList();
SENDLINE_PGM("END"); // Filelist stop
//PrintList();
RenderCurrentFileList();
}
#endif
break;
@@ -1305,25 +1332,23 @@
starpos = (strchr(TFTstrchr_pointer + 4, '*'));
if (TFTstrchr_pointer[4] == '/') {
strcpy(currentTouchscreenSelection, TFTstrchr_pointer + 5);
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("TFT Serial Debug: currentTouchscreenSelection: ", currentTouchscreenSelection);
SERIAL_EOL();
#endif
currentFileOrDirectory[0] = 0;
SENDLINE_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected
SENDLINE_PGM("");
}
else if (TFTstrchr_pointer[4] == '<') {
strcpy(currentTouchscreenSelection, TFTstrchr_pointer + 4);
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("J21", "TFT Serial Debug: Clear file selection... J21 ");
SERIAL_EOL();
#endif
SpecialMenu = true;
currentFileOrDirectory[0] = 0;
SENDLINE_DBG_PGM("J21", "TFT Serial Debug: Clear file selection... J21 "); // J21 Not File Selected
SENDLINE_PGM("");
}
else {
if (SpecialMenu == false)
currentTouchscreenSelection[0] = 0;
currentTouchscreenSelection[0] = 0;
if (starpos != NULL) *(starpos - 1) = '\0';
strcpy(currentFileOrDirectory, TFTstrchr_pointer + 4);
if (starpos) *(starpos - 1) = '\0';
strcpy(currentFileOrDirectory, TFTstrchr_pointer + 4);
SENDLINE_DBG_PGM_VAL("J20", "TFT Serial Debug: File Selected... J20 ", currentFileOrDirectory); // J20 File Selected
}
}
@@ -1514,15 +1539,16 @@
case 26: // A26 refresh SD
{
#ifdef SDSUPPORT
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("TFT Serial Debug: currentTouchscreenSelection: ", currentTouchscreenSelection);
SERIAL_EOL();
#endif
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("TFT Serial Debug: RefreshSD(): currentTouchscreenSelection: ", currentTouchscreenSelection);
SERIAL_EOL();
SERIAL_ECHOPGM("TFT Serial Debug: RefreshSD(): currentFileOrDirectory: ", currentFileOrDirectory);
SERIAL_EOL();
#endif
if (strlen(currentTouchscreenSelection) > 0) {
FileList currentFileList;
if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_DIR_UP_S)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_DIR_UP_L)) != NULL)
if ((strcasestr_P(currentFileOrDirectory, PSTR(SM_DIR_UP_S)) != NULL)
|| (strcasestr_P(currentFileOrDirectory, PSTR(SM_DIR_UP_L)) != NULL)
) {
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("TFT Serial Debug: Directory UP (cd ..)");
@@ -1545,16 +1571,17 @@
strcpy(currentFileOrDirectory, currentTouchscreenSelection);
int currentFileLen = strlen(currentFileOrDirectory);
currentFileOrDirectory[currentFileLen - 4] = '\0';
card.cd(currentFileOrDirectory);
currentFileList.changeDir(currentFileOrDirectory);
#else
currentFileList.changeDir(currentTouchscreenSelection);
#endif
}
}
}
if (SpecialMenu == false)
if (SpecialMenu == false) {
currentTouchscreenSelection[0] = 0;
}
}
#endif // ifdef SDSUPPORT
break;

View File

@@ -42,20 +42,6 @@ char *itostr2(const uint8_t &x);
#define MSG_MY_VERSION CUSTOM_BUILD_VERSION
#define MAX_PRINTABLE_FILENAME_LEN 26
#if ENABLED(KNUTWURST_CHIRON)
#define FIL_RUNOUT_PIN 33
#else
#define FIL_RUNOUT_PIN 19
#endif
#define ANYCUBIC_TFT_STATE_IDLE 0
#define ANYCUBIC_TFT_STATE_SDPRINT 1
#define ANYCUBIC_TFT_STATE_SDPAUSE 2
#define ANYCUBIC_TFT_STATE_SDPAUSE_REQ 3
#define ANYCUBIC_TFT_STATE_SDPAUSE_OOF 4
#define ANYCUBIC_TFT_STATE_SDSTOP_REQ 5
#define ANYCUBIC_TFT_STATE_SDOUTAGE 99
enum AnycubicMediaPrintState {
AMPRINTSTATE_NOT_PRINTING,
AMPRINTSTATE_PRINTING,
@@ -259,6 +245,7 @@ enum AnycubicMediaPauseState {
#endif
class AnycubicTouchscreenClass {
public:
AnycubicTouchscreenClass();
@@ -273,9 +260,11 @@ void KillTFT();
static void OnPrintTimerStarted();
static void OnPrintTimerPaused();
static void OnPrintTimerStopped();
#if BOTH(ANYCUBIC_TFT_DEBUG, KNUTWURST_DGUS2_TFT)
void Command(const char * const command);
#endif
#if ENABLED(KNUTWURST_TFT_LEVELING)
void LevelingDone();
#endif
@@ -318,7 +307,6 @@ static AnycubicMediaPauseState mediaPauseState;
int CodeValueInt();
float CodeValue();
bool CodeSeen(char);
void PrintList();
void StartPrint();
void PausePrint();
void StopPrint();
@@ -331,12 +319,14 @@ void FilamentChangePause();
void ResumePrint();
void ReheatNozzle();
void ParkAfterStop();
void RenderCurrentFileList();
void RenderSpecialMenu(uint16_t);
void RenderCurrentFolder(uint16_t);
char currentTouchscreenSelection[30];
char currentFileOrDirectory[30];
char currentTouchscreenSelection[64];
char currentFileOrDirectory[64];
String flowRateBuffer;
String zOffsetBuffer;
uint16_t MyFileNrCnt = 0;
uint8_t FilamentSensorEnabled = true;
uint8_t SpecialMenu = false;

View File

@@ -286,11 +286,27 @@
#endif
#endif
// RAMPS 1.4 DIO 4 on the servos connector
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 19
#if ANY(KNUTWURST_CHIRON, KNUTWURST_4MAXP2)
#define FIL_RUNOUT_PIN 33
#ifndef Z2_STEP_PIN
#define Z2_STEP_PIN 46
#endif
#ifndef Z2_DIR_PIN
#define Z2_DIR_PIN 48
#endif
#ifndef Z2_ENABLE_PIN
#define Z2_ENABLE_PIN 62
#endif
#ifndef Z2_CS_PIN
#define Z2_CS_PIN 40
#endif
#else
#define FIL_RUNOUT_PIN 19
#endif
#ifndef PS_ON_PIN
#define PS_ON_PIN 12
#endif

View File

@@ -142,6 +142,19 @@
#define Z_CS_PIN 40
#endif
#ifndef Z2_STEP_PIN
#define Z2_STEP_PIN 46
#endif
#ifndef Z2_DIR_PIN
#define Z2_DIR_PIN 48
#endif
#ifndef Z2_ENABLE_PIN
#define Z2_ENABLE_PIN 62
#endif
#ifndef Z2_CS_PIN
#define Z2_CS_PIN 40
#endif
#define E0_STEP_PIN 26
#define E0_DIR_PIN 28
#define E0_ENABLE_PIN 24
@@ -253,7 +266,7 @@
// RAMPS 1.4 DIO 4 on the servos connector
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 4
#define FIL_RUNOUT_PIN 33
#endif
#ifndef PS_ON_PIN

View File

@@ -86,6 +86,12 @@
#define OUTAGECON_PIN 58
#endif
#if ANY(KNUTWURST_CHIRON, KNUTWURST_4MAXP2)
#define FIL_RUNOUT_PIN 33
#else
#define FIL_RUNOUT_PIN 19
#endif
#if ENABLED(TRIGORILLA_MAPPING_CHIRON)
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 33
@@ -97,7 +103,7 @@
#endif
#endif
#if EITHER(TRIGORILLA_MAPPING_CHIRON, SWAP_Z_MOTORS)
#if ANY(TRIGORILLA_MAPPING_CHIRON, SWAP_Z_MOTORS, KNUTWURST_CHIRON, KNUTWURST_4MAXP2) // PATCH: knutwurst
// Chiron and some Anycubic i3 MEGAs swap Z steppers
#define Z_STEP_PIN 36
#define Z_DIR_PIN 34

View File

@@ -64,7 +64,7 @@
#define TG_FAN1_PIN 7 // Anycubic Kossel: Unused
#define TG_FAN2_PIN 44 // Anycubic Kossel: Hotend fan
#define CONTROLLER_FAN_PIN TG_FAN1_PIN
#define FIL_RUNOUT_PIN 19
#define FIL_RUNOUT_PIN 33
#define BEEPER_PIN 31
#define SDSS 53
#define LED_PIN 13