2 Commits

Author SHA1 Message Date
Suat Özgür
12e23161fe Merge branch 'knutwurst:master' into klicky 2023-05-25 01:34:17 +02:00
Suat Özgür
78eab4e511 klicky probe initial commit 2023-05-24 22:31:27 +02:00
12 changed files with 388 additions and 388 deletions

View File

@@ -1659,7 +1659,7 @@
* Use G29 repeatedly, adjusting the Z height at each point with movement commands * Use G29 repeatedly, adjusting the Z height at each point with movement commands
* or (with LCD_BED_LEVELING) the LCD controller. * or (with LCD_BED_LEVELING) the LCD controller.
*/ */
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING, KNUTWURST_KLICKY)
#define PROBE_MANUALLY #define PROBE_MANUALLY
#endif #endif
@@ -1736,21 +1736,24 @@
* Magnetically Mounted Probe * Magnetically Mounted Probe
* For probes such as Euclid, Klicky, Klackender, etc. * For probes such as Euclid, Klicky, Klackender, etc.
*/ */
// #define MAG_MOUNTED_PROBE #if ENABLED(KNUTWURST_KLICKY)
#if ENABLED(MAG_MOUNTED_PROBE) // @see https://www.printables.com/model/489398-anycubic-mega-klicky-probe
#define MAG_MOUNTED_PROBE
#if ENABLED(MAG_MOUNTED_PROBE)
#define PROBE_DEPLOY_FEEDRATE (133 * 60) // (mm/min) Probe deploy speed #define PROBE_DEPLOY_FEEDRATE (133 * 60) // (mm/min) Probe deploy speed
#define PROBE_STOW_FEEDRATE (133 * 60) // (mm/min) Probe stow speed #define PROBE_STOW_FEEDRATE (133 * 60) // (mm/min) Probe stow speed
#define MAG_MOUNTED_DEPLOY_1 { PROBE_DEPLOY_FEEDRATE, { 245, 114, 30 } } // Move to side Dock & Attach probe #define MAG_MOUNTED_DEPLOY_1 { PROBE_DEPLOY_FEEDRATE, { 176, 0, 0 } } // Move to front dock & attach probe
#define MAG_MOUNTED_DEPLOY_2 { PROBE_DEPLOY_FEEDRATE, { 210, 114, 30 } } // Move probe off dock #define MAG_MOUNTED_DEPLOY_2 { PROBE_DEPLOY_FEEDRATE, { 176, 0, 20 } } // Move probe off dock
#define MAG_MOUNTED_DEPLOY_3 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } // Extra move if needed #define MAG_MOUNTED_DEPLOY_3 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } // Extra move if needed
#define MAG_MOUNTED_DEPLOY_4 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } // Extra move if needed #define MAG_MOUNTED_DEPLOY_4 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } // Extra move if needed
#define MAG_MOUNTED_DEPLOY_5 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } // Extra move if needed #define MAG_MOUNTED_DEPLOY_5 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } // Extra move if needed
#define MAG_MOUNTED_STOW_1 { PROBE_STOW_FEEDRATE, { 245, 114, 20 } } // Move to dock #define MAG_MOUNTED_STOW_1 { PROBE_STOW_FEEDRATE, { 176, 0, 20 } } // Move right above the dock
#define MAG_MOUNTED_STOW_2 { PROBE_STOW_FEEDRATE, { 245, 114, 0 } } // Place probe beside remover #define MAG_MOUNTED_STOW_2 { PROBE_STOW_FEEDRATE, { 176, 0, 0 } } // Move probe into dock
#define MAG_MOUNTED_STOW_3 { PROBE_STOW_FEEDRATE, { 230, 114, 0 } } // Side move to remove probe #define MAG_MOUNTED_STOW_3 { PROBE_STOW_FEEDRATE, { 50, 0, 0 } } // Side move to remove probe
#define MAG_MOUNTED_STOW_4 { PROBE_STOW_FEEDRATE, { 210, 114, 20 } } // Side move to remove probe #define MAG_MOUNTED_STOW_4 { PROBE_STOW_FEEDRATE, { 0, 0, 0 } } // Extra move if needed
#define MAG_MOUNTED_STOW_5 { PROBE_STOW_FEEDRATE, { 0, 0, 0 } } // Extra move if needed #define MAG_MOUNTED_STOW_5 { PROBE_STOW_FEEDRATE, { 0, 0, 0 } } // Extra move if needed
#endif
#endif #endif
// Duet Smart Effector (for delta printers) - https://bit.ly/2ul5U7J // Duet Smart Effector (for delta printers) - https://bit.ly/2ul5U7J
@@ -1849,7 +1852,11 @@
#define NOZZLE_TO_PROBE_OFFSET { 0, 0, -16.8 } #define NOZZLE_TO_PROBE_OFFSET { 0, 0, -16.8 }
#endif #endif
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if ENABLED(KNUTWURST_KLICKY)
#define NOZZLE_TO_PROBE_OFFSET { 0, -25, -7 }
#endif
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING, KNUTWURST_KLICKY)
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
#endif #endif
@@ -1859,6 +1866,8 @@
#if ENABLED(KNUTWURST_CHIRON) #if ENABLED(KNUTWURST_CHIRON)
#define PROBING_MARGIN 15 #define PROBING_MARGIN 15
#elseif ENABLED(KNUTWURST_KLICKY)
#define PROBING_MARGIN 20
#else #else
#define PROBING_MARGIN 35 #define PROBING_MARGIN 35
#endif #endif
@@ -1939,7 +1948,7 @@
#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes #define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes
// #define Z_AFTER_PROBING 5 // Z position after probing is done // #define Z_AFTER_PROBING 5 // Z position after probing is done
#define Z_PROBE_LOW_POINT -10 // Farthest distance below the trigger-point to go before stopping #define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping
// For M851 give a range for adjusting the Z probe offset // For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -50 #define Z_PROBE_OFFSET_RANGE_MIN -50
@@ -2477,7 +2486,7 @@
* leveling in steps so you can manually adjust the Z height at each grid-point. * leveling in steps so you can manually adjust the Z height at each grid-point.
* With an LCD controller the process is guided step-by-step. * With an LCD controller the process is guided step-by-step.
*/ */
#if EITHER(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if ANY(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING, KNUTWURST_KLICKY)
// #define AUTO_BED_LEVELING_3POINT // #define AUTO_BED_LEVELING_3POINT
// #define AUTO_BED_LEVELING_LINEAR // #define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR #define AUTO_BED_LEVELING_BILINEAR
@@ -2485,7 +2494,7 @@
// #define MESH_BED_LEVELING // #define MESH_BED_LEVELING
#endif #endif
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING, KNUTWURST_KLICKY)
// #define AUTO_BED_LEVELING_3POINT // #define AUTO_BED_LEVELING_3POINT
// #define AUTO_BED_LEVELING_LINEAR // #define AUTO_BED_LEVELING_LINEAR
// #define AUTO_BED_LEVELING_BILINEAR // #define AUTO_BED_LEVELING_BILINEAR

View File

@@ -989,7 +989,7 @@
* *
* Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset. * Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset.
*/ */
#define BLTOUCH_HS_MODE false #define BLTOUCH_HS_MODE true
// Safety: Enable voltage mode settings in the LCD menu. // Safety: Enable voltage mode settings in the LCD menu.
// #define BLTOUCH_LCD_VOLTAGE_MENU // #define BLTOUCH_LCD_VOLTAGE_MENU
@@ -2658,7 +2658,6 @@
*/ */
#define ADVANCED_PAUSE_FEATURE #define ADVANCED_PAUSE_FEATURE
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
#if DISABLED(KNUTWURST_4MAXP2)
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate. #define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract. #define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
// This short retract is done immediately, before parking the nozzle. // This short retract is done immediately, before parking the nozzle.
@@ -2676,33 +2675,12 @@
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 538 // (mm) Load length of filament, from extruder gear to nozzle. #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 Bowden, the full length of the tube and nozzle.
// For direct drive, the full length of the 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_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_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. #define ADVANCED_PAUSE_PURGE_LENGTH 2 // (mm) Length to extrude after loading.
// Set to 0 for manual extrusion. // Set to 0 for manual extrusion.
// Filament can be extruded repeatedly from the Filament Change menu // Filament can be extruded repeatedly from the Filament Change menu
// until extrusion is consistent, and to purge old filament. // 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_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. #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 * here we define this default string as the date where the latest release
* version was tagged. * version was tagged.
*/ */
#define CUSTOM_BUILD_VERSION "1.5.0-b6" #define CUSTOM_BUILD_VERSION "1.5.0-b5"
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2023-05-30" #define STRING_DISTRIBUTION_DATE "2023-05-24"
#endif #endif
/** /**

View File

@@ -84,8 +84,6 @@
*value = c; *value = c;
pos++; pos++;
value++; value++;
if(pos > 32766)
break;
} while (--size); } while (--size);
} }
@@ -168,6 +166,42 @@
#endif #endif
} }
char *itostr2(const uint8_t &x) {
int xx = x;
_conv[0] = (xx / 10) % 10 + '0';
_conv[1] = (xx) % 10 + '0';
_conv[2] = 0;
return _conv;
}
#ifndef ULTRA_LCD
#define DIGIT(n) ('0' + (n))
#define DIGIMOD(n, f) DIGIT((n) / (f) % 10)
#define RJDIGIT(n, f) ((n) >= (f) ? DIGIMOD(n, f) : ' ')
#define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
char *itostr3(const int x) {
int xx = x;
_conv[4] = MINUSOR(xx, RJDIGIT(xx, 100));
_conv[5] = RJDIGIT(xx, 10);
_conv[6] = DIGIMOD(xx, 1);
return &_conv[4];
}
// Convert signed float to fixed-length string with 023.45 / -23.45 format
char *ftostr32(const float &x) {
long xx = x * 100;
_conv[1] = MINUSOR(xx, DIGIMOD(xx, 10000));
_conv[2] = DIGIMOD(xx, 1000);
_conv[3] = DIGIMOD(xx, 100);
_conv[4] = '.';
_conv[5] = DIGIMOD(xx, 10);
_conv[6] = DIGIMOD(xx, 1);
return &_conv[1];
}
#endif
using namespace ExtUI; using namespace ExtUI;
AnycubicTouchscreenClass::AnycubicTouchscreenClass() { AnycubicTouchscreenClass::AnycubicTouchscreenClass() {
@@ -195,6 +229,7 @@
BLTouchMenu = false; BLTouchMenu = false;
LevelMenu = false; LevelMenu = false;
CaseLight = false; CaseLight = false;
MyFileNrCnt = 0;
currentFlowRate = 100; currentFlowRate = 100;
flowRateBuffer = SM_FLOW_DISP_L; flowRateBuffer = SM_FLOW_DISP_L;
@@ -214,12 +249,10 @@
setup_OutageTestPin(); setup_OutageTestPin();
setup_PowerOffPin(); setup_PowerOffPin();
SENDLINE_DBG_PGM("J12", "TFT Serial Debug: Ready... J12"); SENDLINE_DBG_PGM("J12", "TFT Serial Debug: Ready... J12"); // J12 Ready
CheckHeaterError();
DoFilamentRunoutCheck(); DoFilamentRunoutCheck();
#ifdef STARTUP_CHIME #ifdef STARTUP_CHIME
BUZZ(100, 554); BUZZ(100, 554);
BUZZ(100, 740); BUZZ(100, 740);
@@ -314,7 +347,7 @@
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
#if ENABLED(FILAMENT_RUNOUT_SENSOR) #if ENABLED(FILAMENT_RUNOUT_SENSOR)
if (READ(FIL_RUNOUT_PIN)) { if (READ(FIL_RUNOUT_PIN)) {
#if ENABLED(ANYCUBIC_TFT_DEBUG) #if ENABLED(ANYCUBIC_LCD_DEBUG)
SERIAL_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); SERIAL_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... ");
#endif #endif
@@ -361,7 +394,7 @@
void AnycubicTouchscreenClass::HandleSpecialMenu() { void AnycubicTouchscreenClass::HandleSpecialMenu() {
#if ENABLED(KNUTWURST_SPECIAL_MENU) #if ENABLED(KNUTWURST_SPECIAL_MENU)
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("TFT Serial Debug: Special Menu Selection: ", currentTouchscreenSelection); SERIAL_ECHOPGM("DEBUG: Special Menu Selection: ", currentTouchscreenSelection);
SERIAL_EOL(); SERIAL_EOL();
#endif #endif
if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_SPECIAL_MENU_L)) != NULL) if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_SPECIAL_MENU_L)) != NULL)
@@ -375,19 +408,19 @@
SERIAL_ECHOLNPGM("Special Menu: PID Tune Hotend"); SERIAL_ECHOLNPGM("Special Menu: PID Tune Hotend");
#if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P) #if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P)
injectCommands(F("G28\nG90\nG1 Z20\nG1 X110 Y110 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300")); queue.inject_P(PSTR("G28\nG90\nG1 Z20\nG1 X110 Y110 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300"));
#endif #endif
#if ENABLED(KNUTWURST_MEGA_X) #if ENABLED(KNUTWURST_MEGA_X)
injectCommands(F("G28\nG90\nG1 Z20\nG1 X155 Y155 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300")); queue.inject_P(PSTR("G28\nG90\nG1 Z20\nG1 X155 Y155 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300"));
#endif #endif
#if ENABLED(KNUTWURST_CHIRON) #if ENABLED(KNUTWURST_CHIRON)
injectCommands(F("G28\nG90\nG1 Z20\nG1 X205 Y205 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300")); queue.inject_P(PSTR("G28\nG90\nG1 Z20\nG1 X205 Y205 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300"));
#endif #endif
#if ENABLED(KNUTWURST_4MAXP2) #if ENABLED(KNUTWURST_4MAXP2)
injectCommands(F("G28\nG90\nG1 Z20\nG1 X105 Y135 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300")); queue.inject_P(PSTR("G28\nG90\nG1 Z20\nG1 X105 Y135 F4000\nG1 Z5\nM106 S172\nG4 P500\nM303 E0 S215 C15 U1\nG4 P500\nM107\nG28\nG1 Z10\nM84\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300"));
#endif #endif
BUZZ(200, 1108); BUZZ(200, 1108);
@@ -399,11 +432,7 @@
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PID_BED_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PID_BED_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: PID Tune Ultrabase"); SERIAL_ECHOLNPGM("Special Menu: PID Tune Ultrabase");
BUZZ(200, 1108); queue.inject_P(PSTR("M303 E-1 S60 C6 U1\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300"));
BUZZ(200, 1661);
BUZZ(200, 1108);
BUZZ(600, 1661);
injectCommands(F("M303 E-1 S60 C6 U1\nM500\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300"));
BUZZ(200, 1108); BUZZ(200, 1108);
BUZZ(200, 1661); BUZZ(200, 1661);
BUZZ(200, 1108); BUZZ(200, 1108);
@@ -432,7 +461,7 @@
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PREHEAT_BED_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PREHEAT_BED_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Preheat Ultrabase"); SERIAL_ECHOLNPGM("Special Menu: Preheat Ultrabase");
injectCommands(F("M140 S60")); queue.inject_P(PSTR("M140 S60"));
} }
#if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING)
@@ -445,49 +474,49 @@
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_MESH_START_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_MESH_START_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Start Mesh Leveling"); SERIAL_ECHOLNPGM("Special Menu: Start Mesh Leveling");
injectCommands(F("G28\nG29 S1")); queue.inject_P(PSTR("G28\nG29 S1"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_MESH_NEXT_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_MESH_NEXT_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_MESH_NEXT_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_MESH_NEXT_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Next Mesh Point"); SERIAL_ECHOLNPGM("Special Menu: Next Mesh Point");
injectCommands(F("G29 S2")); queue.inject_P(PSTR("G29 S2"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_01_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_01_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_01_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_01_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Z Up 0.1"); SERIAL_ECHOLNPGM("Special Menu: Z Up 0.1");
injectCommands(F("G91\nG1 Z+0.1\nG90")); queue.inject_P(PSTR("G91\nG1 Z+0.1\nG90"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_01_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_01_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_01_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_01_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Z Down 0.1"); SERIAL_ECHOLNPGM("Special Menu: Z Down 0.1");
injectCommands(F("G91\nG1 Z-0.1\nG90")); queue.inject_P(PSTR("G91\nG1 Z-0.1\nG90"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_002_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_002_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_002_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_002_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Z Up 0.02"); SERIAL_ECHOLNPGM("Special Menu: Z Up 0.02");
injectCommands(F("G91\nG1 Z+0.02\nG90")); queue.inject_P(PSTR("G91\nG1 Z+0.02\nG90"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_002_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_002_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_002_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_002_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Z Down 0.02"); SERIAL_ECHOLNPGM("Special Menu: Z Down 0.02");
injectCommands(F("G91\nG1 Z-0.02\nG90")); queue.inject_P(PSTR("G91\nG1 Z-0.02\nG90"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_001_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_001_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_001_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_UP_001_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Z Up 0.01"); SERIAL_ECHOLNPGM("Special Menu: Z Up 0.01");
injectCommands(F("G91\nG1 Z+0.03\nG4 P250\nG1 Z-0.02\nG90")); queue.inject_P(PSTR("G91\nG1 Z+0.03\nG4 P250\nG1 Z-0.02\nG90"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_001_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_001_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_001_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_Z_DN_001_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Z Down 0.01"); SERIAL_ECHOLNPGM("Special Menu: Z Down 0.01");
injectCommands(F("G91\nG1 Z+0.02\nG4 P250\nG1 Z-0.03\nG90")); queue.inject_P(PSTR("G91\nG1 Z+0.02\nG4 P250\nG1 Z-0.03\nG90"));
} }
#endif // if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING) #endif // if NONE(KNUTWURST_BLTOUCH, KNUTWURST_TFT_LEVELING)
@@ -496,7 +525,7 @@
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_BLTOUCH_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_BLTOUCH_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: BLTouch Leveling"); SERIAL_ECHOLNPGM("Special Menu: BLTouch Leveling");
injectCommands(F("G28\nG29\nM500\nG90\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300\nG1 Z30 F4000\nG1 X0 F4000\nG91\nM84\nM420 S1")); queue.inject_P(PSTR("G28\nG29\nM500\nG90\nM300 S440 P200\nM300 S660 P250\nM300 S880 P300\nG1 Z30 F4000\nG1 X0 F4000\nG91\nM84\nM420 S1"));
BUZZ(105, 1108); BUZZ(105, 1108);
BUZZ(210, 1661); BUZZ(210, 1661);
} }
@@ -518,7 +547,7 @@
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PAUSE_L)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_PAUSE_L)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Fil. Change Pause"); SERIAL_ECHOLNPGM("Special Menu: Fil. Change Pause");
injectCommands(F("M600")); PausePrint();
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_RESUME_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_RESUME_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_RESUME_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_RESUME_S)) != NULL)
@@ -530,7 +559,7 @@
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_DIS_FILSENS_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_DIS_FILSENS_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Disable Filament Sensor"); SERIAL_ECHOLNPGM("Special Menu: Disable Filament Sensor");
injectCommands(F("M412 H0 S0\nM500")); queue.inject_P(PSTR("M412 H0 S0\nM500"));
BUZZ(105, 1108); BUZZ(105, 1108);
BUZZ(105, 1108); BUZZ(105, 1108);
BUZZ(105, 1108); BUZZ(105, 1108);
@@ -539,7 +568,7 @@
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_EN_FILSENS_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_EN_FILSENS_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Enable Filament Sensor"); SERIAL_ECHOLNPGM("Special Menu: Enable Filament Sensor");
injectCommands(F("M412 H0 S1\nM500")); queue.inject_P(PSTR("M412 H0 S1\nM500"));
BUZZ(105, 1108); BUZZ(105, 1108);
BUZZ(105, 1108); BUZZ(105, 1108);
} }
@@ -627,32 +656,32 @@
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Enter Easy Level Menu"); SERIAL_ECHOLNPGM("Special Menu: Enter Easy Level Menu");
LevelMenu = true; LevelMenu = true;
injectCommands(F("G28\nM420 S0\nG90\nG1 Z5\nG1 X15 Y15 F4000\nG1 Z0")); queue.inject_P(PSTR("G28\nM420 S0\nG90\nG1 Z5\nG1 X15 Y15 F4000\nG1 Z0"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P1_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P1_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P1_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P1_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 1"); SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 1");
injectCommands(F("G90\nG1 Z5\nG1 X15 Y15 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X15 Y15 F4000\nG1 Z0"));
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P2_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P2_L)) != NULL)
|| (strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P2_S)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P2_S)) != NULL)
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 2"); SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 2");
#if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P) #if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P)
injectCommands(F("G90\nG1 Z5\nG1 X205 Y15 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X205 Y15 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_MEGA_X) #if ENABLED(KNUTWURST_MEGA_X)
injectCommands(F("G90\nG1 Z5\nG1 X295 Y15 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X295 Y15 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_CHIRON) #if ENABLED(KNUTWURST_CHIRON)
injectCommands(F("G90\nG1 Z5\nG1 X385 Y15 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X385 Y15 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_4MAXP2) #if ENABLED(KNUTWURST_4MAXP2)
injectCommands(F("G90\nG1 Z5\nG1 X255 Y15 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X255 Y15 F4000\nG1 Z0"));
#endif #endif
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P3_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P3_L)) != NULL)
@@ -660,19 +689,19 @@
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 3"); SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 3");
#if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P) #if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P)
injectCommands(F("G90\nG1 Z5\nG1 X205 Y200 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X205 Y200 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_MEGA_X) #if ENABLED(KNUTWURST_MEGA_X)
injectCommands(F("G90\nG1 Z5\nG1 X295 Y295 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X295 Y295 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_CHIRON) #if ENABLED(KNUTWURST_CHIRON)
injectCommands(F("G90\nG1 Z5\nG1 X395 Y395 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X395 Y395 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_4MAXP2) #if ENABLED(KNUTWURST_4MAXP2)
injectCommands(F("G90\nG1 Z5\nG1 X255 Y195 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X255 Y195 F4000\nG1 Z0"));
#endif #endif
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P4_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_P4_L)) != NULL)
@@ -680,19 +709,19 @@
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 4"); SERIAL_ECHOLNPGM("Special Menu: Easy Level POINT 4");
#if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P) #if ANY(KNUTWURST_MEGA, KNUTWURST_MEGA_S, KNUTWURST_MEGA_P)
injectCommands(F("G90\nG1 Z5\nG1 X15 Y200 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X15 Y200 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_MEGA_X) #if ENABLED(KNUTWURST_MEGA_X)
injectCommands(F("G90\nG1 Z5\nG1 X15 Y295 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X15 Y295 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_CHIRON) #if ENABLED(KNUTWURST_CHIRON)
injectCommands(F("G90\nG1 Z5\nG1 X15 Y395 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X15 Y395 F4000\nG1 Z0"));
#endif #endif
#if ENABLED(KNUTWURST_4MAXP2) #if ENABLED(KNUTWURST_4MAXP2)
injectCommands(F("G90\nG1 Z5\nG1 X15 Y195 F4000\nG1 Z0")); queue.inject_P(PSTR("G90\nG1 Z5\nG1 X15 Y195 F4000\nG1 Z0"));
#endif #endif
} }
else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_EXIT_L)) != NULL) else if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_EZLVL_EXIT_L)) != NULL)
@@ -700,48 +729,16 @@
) { ) {
SERIAL_ECHOLNPGM("Special Menu: Exit Easy Level Menu"); SERIAL_ECHOLNPGM("Special Menu: Exit Easy Level Menu");
LevelMenu = false; LevelMenu = false;
injectCommands(F("G90\nG1 Z10\nG1 X15 Y15 F4000\nM420 S1")); queue.inject_P(PSTR("G90\nG1 Z10\nG1 X15 Y15 F4000\nM420 S1"));
} }
#endif // if ENABLED(KNUTWURST_SPECIAL_MENU) #endif // if ENABLED(KNUTWURST_SPECIAL_MENU)
} }
void AnycubicTouchscreenClass::RenderCurrentFileList() { void AnycubicTouchscreenClass::PrintList() {
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 ENABLED(KNUTWURST_SPECIAL_MENU)
if (MMLMenu) { if (MMLMenu) {
switch (selectedNumber) { switch (filenumber) {
case 0: // Page 1 case 0: // Page 1
SENDLINE_PGM(SM_MESH_START_S); SENDLINE_PGM(SM_MESH_START_S);
SENDLINE_PGM(SM_MESH_START_L); SENDLINE_PGM(SM_MESH_START_L);
@@ -779,7 +776,7 @@ void AnycubicTouchscreenClass::RenderSpecialMenu(uint16_t selectedNumber) {
flowRateBuffer = SM_FLOW_DISP_L; flowRateBuffer = SM_FLOW_DISP_L;
flowRateBuffer.replace("XXX", String(currentFlowRate)); flowRateBuffer.replace("XXX", String(currentFlowRate));
switch (selectedNumber) { switch (filenumber) {
case 0: // Page 1 case 0: // Page 1
SENDLINE_PGM(SM_FLOW_DISP_S); SENDLINE_PGM(SM_FLOW_DISP_S);
SENDLINE(flowRateBuffer.c_str()); SENDLINE(flowRateBuffer.c_str());
@@ -799,13 +796,13 @@ void AnycubicTouchscreenClass::RenderSpecialMenu(uint16_t selectedNumber) {
zOffsetBuffer = SM_BLTZ_DISP_L; zOffsetBuffer = SM_BLTZ_DISP_L;
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("TFT Serial Debug: Current probe.offset.z: ", float(probe.offset.z)); SERIAL_ECHOPGM("DEBUG: Current probe.offset.z: ", float(probe.offset.z));
SERIAL_EOL(); SERIAL_EOL();
#endif #endif
zOffsetBuffer.replace("XXXXX", String(float(probe.offset.z))); zOffsetBuffer.replace("XXXXX", String(float(probe.offset.z)));
switch (selectedNumber) { switch (filenumber) {
case 0: // Page 1 case 0: // Page 1
SENDLINE_PGM(SM_BLTZ_DISP_S); SENDLINE_PGM(SM_BLTZ_DISP_S);
SENDLINE(zOffsetBuffer.c_str()); SENDLINE(zOffsetBuffer.c_str());
@@ -827,7 +824,7 @@ void AnycubicTouchscreenClass::RenderSpecialMenu(uint16_t selectedNumber) {
} }
} }
else if (LevelMenu) { else if (LevelMenu) {
switch (selectedNumber) { switch (filenumber) {
case 0: // Page 1 case 0: // Page 1
SENDLINE_PGM(SM_EZLVL_P1_S); SENDLINE_PGM(SM_EZLVL_P1_S);
SENDLINE_PGM(SM_EZLVL_P1_L); SENDLINE_PGM(SM_EZLVL_P1_L);
@@ -849,7 +846,7 @@ void AnycubicTouchscreenClass::RenderSpecialMenu(uint16_t selectedNumber) {
} }
} }
else if (SpecialMenu) { else if (SpecialMenu) {
switch (selectedNumber) { switch (filenumber) {
case 0: // Page 1 case 0: // Page 1
SENDLINE_PGM(SM_FLOWMENU_S); SENDLINE_PGM(SM_FLOWMENU_S);
SENDLINE_PGM(SM_FLOWMENU_L); SENDLINE_PGM(SM_FLOWMENU_L);
@@ -921,21 +918,26 @@ void AnycubicTouchscreenClass::RenderSpecialMenu(uint16_t selectedNumber) {
} }
} }
#endif // if ENABLED(KNUTWURST_SPECIAL_MENU) #endif // if ENABLED(KNUTWURST_SPECIAL_MENU)
}
void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) { #ifdef SDSUPPORT
FileList currentFileList; #if ENABLED(KNUTWURST_SPECIAL_MENU)
uint16_t count = selectedNumber; else if (card.isMounted())
uint16_t max_files; #else
uint16_t filesOnSDCard = currentFileList.count(); if (card.isMounted())
#endif
{
int count = filenumber;
int max_files;
int filesOnSDCard = card.countFilesInWorkDir();
if ((filesOnSDCard - selectedNumber) < 4) { if ((filesOnSDCard - filenumber) < 4) {
max_files = filesOnSDCard; max_files = filesOnSDCard;
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLN("max_files = filesOnSDCard;"); SERIAL_ECHOLN("max_files = filesOnSDCard;");
#endif #endif
} else { }
max_files = selectedNumber + 3; else {
max_files = filenumber + 3;
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLN("max_files = filenumber + 3;"); SERIAL_ECHOLN("max_files = filenumber + 3;");
#endif #endif
@@ -943,47 +945,39 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
if (filesOnSDCard == 3) filenumber = 0; if (filesOnSDCard == 3) filenumber = 0;
for (count = selectedNumber; count <= max_files; count++) { #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 (count == 0) { // Special Entry
if (currentFileList.isAtRootDir()) { if (strcmp(card.getWorkDirName(), "/") == 0) {
SENDLINE_PGM(SM_SPECIAL_MENU_S); SENDLINE_PGM(SM_SPECIAL_MENU_S);
SENDLINE_PGM(SM_SPECIAL_MENU_L); SENDLINE_PGM(SM_SPECIAL_MENU_L);
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHO(count); SERIAL_ECHO(count);
SERIAL_ECHO(": "); SERIAL_ECHO(": ");
SERIAL_ECHOLNPGM(SM_SPECIAL_MENU_L); SERIAL_ECHOLNPGM(SM_SPECIAL_MENU_L);
#endif
} }
else { else {
SENDLINE_PGM(SM_DIR_UP_S); SENDLINE_PGM(SM_DIR_UP_S);
SENDLINE_PGM(SM_DIR_UP_L); SENDLINE_PGM(SM_DIR_UP_L);
#ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHO(count); SERIAL_ECHO(count);
SERIAL_ECHO(": "); SERIAL_ECHO(": ");
SERIAL_ECHOLNPGM(SM_DIR_UP_L); 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());
} }
*/ else {
card.selectFileByIndex(count - 1);
// The longname may not be filed, so we use the built-in fallback here. // The longname may not be filed, so we use the built-in fallback here.
const char* fileName = currentFileList.filename(); char* fileName = card.longest_filename();
int fileNameLen = strlen(fileName); int fileNameLen = strlen(fileName);
bool fileNameWasCut = false; bool fileNameWasCut = false;
@@ -1024,25 +1018,25 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
outputString[fileNameLen] = '\0'; outputString[fileNameLen] = '\0';
if (currentFileList.isDir()) { if (card.flag.filenameIsDir) {
#if ENABLED(KNUTWURST_DGUS2_TFT) #if ENABLED(KNUTWURST_DGUS2_TFT)
SEND_PGM("/"); SEND_PGM("/");
SEND(currentFileList.shortFilename()); SEND(card.filename);
SENDLINE_PGM(".GCO"); SENDLINE_PGM(".GCO");
SEND_PGM("/"); SEND_PGM("/");
SEND(outputString); SEND(outputString);
SENDLINE_PGM(".gcode"); SENDLINE_PGM(".gcode");
#else #else
SEND_PGM("/"); SEND_PGM("/");
SENDLINE(currentFileList.shortFilename()); SEND(card.filename);
SEND_PGM("/"); SEND_PGM("/");
SENDLINE(currentFileList.filename()); SENDLINE(outputString);
#endif #endif
SERIAL_ECHO(count); SERIAL_ECHO(count);
SERIAL_ECHOPGM(": /"); SERIAL_ECHOPGM(": /");
SERIAL_ECHOLN(outputString); SERIAL_ECHOLN(outputString);
} else { // The current selection is a file and not a directory } else {
SENDLINE(currentFileList.shortFilename()); SENDLINE(card.filename);
SENDLINE(outputString); SENDLINE(outputString);
SERIAL_ECHO(count); SERIAL_ECHO(count);
SERIAL_ECHOPGM(": "); SERIAL_ECHOPGM(": ");
@@ -1050,7 +1044,15 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
} }
} }
} }
} }
#endif // ifdef SDSUPPORT
else {
#if ENABLED(KNUTWURST_SPECIAL_MENU_WO_SD)
SENDLINE_PGM(SM_SPECIAL_MENU_S);
SENDLINE_PGM(SM_SPECIAL_MENU_L);
#endif
}
}
void AnycubicTouchscreenClass::CheckSDCardChange() { void AnycubicTouchscreenClass::CheckSDCardChange() {
#if BOTH(SDSUPPORT, HAS_SD_DETECT) #if BOTH(SDSUPPORT, HAS_SD_DETECT)
@@ -1078,8 +1080,7 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
} }
void AnycubicTouchscreenClass::CheckHeaterError() { void AnycubicTouchscreenClass::CheckHeaterError() {
if ( (getTargetTemp_celsius((extruder_t)E0) < 5) if ((thermalManager.degHotend(0) < 5) || (thermalManager.degHotend(0) > 300)) {
|| (getTargetTemp_celsius((extruder_t)E0) > 300)) {
if (HeaterCheckCount > 600000) { if (HeaterCheckCount > 600000) {
HeaterCheckCount = 0; HeaterCheckCount = 0;
SENDLINE_DBG_PGM("J10", "TFT Serial Debug: Hotend temperature abnormal... J10"); SENDLINE_DBG_PGM("J10", "TFT Serial Debug: Hotend temperature abnormal... J10");
@@ -1121,7 +1122,7 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
} }
void AnycubicTouchscreenClass::UserConfirmRequired(const char * const msg) { void AnycubicTouchscreenClass::UserConfirmRequired(const char * const msg) {
#if ENABLED(ANYCUBIC_TFT_DEBUG) #if ENABLED(ANYCUBIC_LCD_DEBUG)
SERIAL_ECHOLNPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg); SERIAL_ECHOLNPGM("TFT Serial Debug: OnUserConfirmRequired triggered... ", msg);
#endif #endif
@@ -1153,6 +1154,10 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
mediaPrintingState = AMPRINTSTATE_PAUSED; mediaPrintingState = AMPRINTSTATE_PAUSED;
mediaPauseState = AMPAUSESTATE_FILAMENT_PURGING; mediaPauseState = AMPAUSESTATE_FILAMENT_PURGING;
// TODO: JBA I don't think J05 just disables the continue button, i think it injects a rogue M25. So taking this out
// disable continue button
// SENDLINE_DBG_PGM("J05", "TFT Serial Debug: UserConfirm SD Filament Purging... J05"); // J05 printing pause
// enable continue button // enable continue button
SENDLINE_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is purging... J18"); SENDLINE_DBG_PGM("J18", "TFT Serial Debug: UserConfirm Filament is purging... J18");
} }
@@ -1230,23 +1235,30 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
TFTstrchr_pointer = strchr(TFTcmdbuffer[TFTbufindw], 'A'); TFTstrchr_pointer = strchr(TFTcmdbuffer[TFTbufindw], 'A');
switch ((int)((strtod(&TFTcmdbuffer[TFTbufindw][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindw] + 1], NULL)))) { switch ((int)((strtod(&TFTcmdbuffer[TFTbufindw][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindw] + 1], NULL)))) {
case 0: // A0 GET HOTEND TEMP case 0: // A0 GET HOTEND TEMP
SEND_PGM_VAL("A0V ", int(getActualTemp_celsius(E0) + 0.5)); SEND_PGM_VAL("A0V ", int(thermalManager.degHotend(0) + 0.5));
break; break;
case 1: // A1 GET HOTEND TARGET TEMP case 1: // A1 GET HOTEND TARGET TEMP
SEND_PGM_VAL("A1V ", int(getTargetTemp_celsius(E0) + 0.5)); SEND_PGM_VAL("A1V ", int(thermalManager.degTargetHotend(0) + 0.5));
break; break;
case 2: // A2 GET HOTBED TEMP case 2: // A2 GET HOTBED TEMP
SEND_PGM_VAL("A2V ", int(getActualTemp_celsius(BED) + 0.5)); SEND_PGM_VAL("A2V ", int(thermalManager.degBed() + 0.5));
break; break;
case 3: // A3 GET HOTBED TARGET TEMP case 3: // A3 GET HOTBED TARGET TEMP
SEND_PGM_VAL("A3V ", int(getTargetTemp_celsius(BED) + 0.5)); SEND_PGM_VAL("A3V ", int(thermalManager.degTargetBed() + 0.5));
break; break;
case 4: // A4 GET FAN SPEED case 4: // A4 GET FAN SPEED
SEND_PGM_VAL("A4V ", int(getActualFan_percent(FAN0))); {
unsigned int temp;
temp = ((thermalManager.fan_speed[0] * 100) / 255);
temp = constrain(temp, 0, 100);
SEND_PGM_VAL("A4V ", temp);
}
break; break;
case 5: // A5 GET CURRENT COORDINATE case 5: // A5 GET CURRENT COORDINATE
SEND_PGM("A5V X: "); LCD_SERIAL.print(current_position[X_AXIS]); SEND_PGM("A5V X: "); LCD_SERIAL.print(current_position[X_AXIS]);
@@ -1257,16 +1269,16 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
case 6: // A6 GET SD CARD PRINTING STATUS case 6: // A6 GET SD CARD PRINTING STATUS
#ifdef SDSUPPORT #ifdef SDSUPPORT
if (isPrintingFromMedia()) if (card.isPrinting()) {
{
SEND_PGM("A6V "); SEND_PGM("A6V ");
if (isMediaInserted()) if (card.isMounted())
SENDLINE(ui8tostr3rj(getProgress_percent())); SENDLINE(itostr3(card.percentDone()));
else else
SENDLINE_DBG_PGM("J02", "TFT Serial Debug: No SD Card mounted to return printing status... J02"); SENDLINE_DBG_PGM("J02", "TFT Serial Debug: SD Card initialized... J02");
} }
else else {
SENDLINE_PGM("A6V ---"); SENDLINE_PGM("A6V ---");
}
#endif #endif
break; break;
case 7: // A7 GET PRINTING TIME case 7: // A7 GET PRINTING TIME
@@ -1298,8 +1310,9 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
#endif #endif
{ {
if (CodeSeen('S')) filenumber = CodeValue(); if (CodeSeen('S')) filenumber = CodeValue();
//PrintList(); SENDLINE_PGM("FN "); // Filelist start
RenderCurrentFileList(); PrintList();
SENDLINE_PGM("END"); // Filelist stop
} }
#endif #endif
break; break;
@@ -1328,7 +1341,7 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
case 13: // A13 SELECTION FILE case 13: // A13 SELECTION FILE
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
{ if (isMediaInserted()) {
starpos = (strchr(TFTstrchr_pointer + 4, '*')); starpos = (strchr(TFTstrchr_pointer + 4, '*'));
if (TFTstrchr_pointer[4] == '/') { if (TFTstrchr_pointer[4] == '/') {
strcpy(currentTouchscreenSelection, TFTstrchr_pointer + 5); strcpy(currentTouchscreenSelection, TFTstrchr_pointer + 5);
@@ -1379,14 +1392,14 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
unsigned int tempvalue; unsigned int tempvalue;
if (CodeSeen('S')) { if (CodeSeen('S')) {
tempvalue = constrain(CodeValue(), 0, 260); tempvalue = constrain(CodeValue(), 0, 260);
if (getTargetTemp_celsius((extruder_t)E0) <= 260) if (thermalManager.degTargetHotend(0) <= 260)
setTargetTemp_celsius(tempvalue, (extruder_t)E0);; // do not set Temp from TFT if it is set via gcode thermalManager.setTargetHotend(tempvalue, 0); // do not set Temp from TFT if it is set via gcode
} }
else if ((CodeSeen('C')) && (!isPrinting())) { else if ((CodeSeen('C')) && (!planner.movesplanned())) {
if ((getAxisPosition_mm(Z) < 10)) if ((current_position[Z_AXIS] < 10))
injectCommands(F("G1 Z10")); // RASE Z AXIS queue.inject_P(PSTR("G1 Z10")); // RASE Z AXIS
tempvalue = constrain(CodeValue(), 0, 260); tempvalue = constrain(CodeValue(), 0, 260);
setTargetTemp_celsius(tempvalue, (extruder_t)E0); thermalManager.setTargetHotend(tempvalue, 0);
} }
} }
break; break;
@@ -1395,33 +1408,36 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
{ {
unsigned int tempbed; unsigned int tempbed;
if (CodeSeen('S')) { if (CodeSeen('S')) {
tempbed = constrain(CodeValue(), 0, 120); tempbed = constrain(CodeValue(), 0, 115);
if (getTargetTemp_celsius((heater_t)BED) <= 100) thermalManager.setTargetBed(tempbed);
setTargetTemp_celsius(tempbed, (heater_t)BED); // do not set Temp from TFT if it is set via gcode if (thermalManager.degTargetBed() <= 100)
thermalManager.setTargetBed(tempbed); // do not set Temp from TFT if it is set via gcode
} }
} }
break; break;
case 18: // A18 set fan speed case 18: // A18 set fan speed
float fanPercent; unsigned int temp;
if (CodeSeen('S')) { if (CodeSeen('S')) {
fanPercent = CodeValue(); temp = (CodeValue() * 255 / 100);
fanPercent = constrain(fanPercent, 0, 100); temp = constrain(temp, 0, 255);
setTargetFan_percent(fanPercent, FAN0); thermalManager.set_fan_speed(0, temp);
} }
else { else {
fanPercent = 100; thermalManager.set_fan_speed(0, 255);
setTargetFan_percent(fanPercent, FAN0);
} }
SENDLINE_PGM(""); SENDLINE_PGM("");
break; break;
case 19: // A19 stop stepper drivers case 19: // A19 stop stepper drivers
if (!isPrinting()) { if ((!planner.movesplanned())
#ifdef SDSUPPORT
&& (!card.isPrinting())
#endif
) {
quickstop_stepper(); quickstop_stepper();
stepper.disable_all_steppers(); stepper.disable_all_steppers();
} }
SENDLINE_PGM(""); SENDLINE_PGM("");
break; break;
@@ -1537,18 +1553,16 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
break; break;
case 26: // A26 refresh SD case 26: // A26 refresh SD
{
#ifdef SDSUPPORT #ifdef SDSUPPORT
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOPGM("TFT Serial Debug: RefreshSD(): currentTouchscreenSelection: ", currentTouchscreenSelection); SERIAL_ECHOPGM(" TFT Serial Debug: currentTouchscreenSelection: ", currentTouchscreenSelection);
SERIAL_EOL();
SERIAL_ECHOPGM("TFT Serial Debug: RefreshSD(): currentFileOrDirectory: ", currentFileOrDirectory);
SERIAL_EOL(); SERIAL_EOL();
#endif #endif
if (isMediaInserted()) {
if (strlen(currentTouchscreenSelection) > 0) {
FileList currentFileList; FileList currentFileList;
if ((strcasestr_P(currentFileOrDirectory, PSTR(SM_DIR_UP_S)) != NULL) if ((strcasestr_P(currentTouchscreenSelection, PSTR(SM_DIR_UP_S)) != NULL)
|| (strcasestr_P(currentFileOrDirectory, PSTR(SM_DIR_UP_L)) != NULL) || (strcasestr_P(currentTouchscreenSelection, PSTR(SM_DIR_UP_L)) != NULL)
) { ) {
#ifdef ANYCUBIC_TFT_DEBUG #ifdef ANYCUBIC_TFT_DEBUG
SERIAL_ECHOLNPGM("TFT Serial Debug: Directory UP (cd ..)"); SERIAL_ECHOLNPGM("TFT Serial Debug: Directory UP (cd ..)");
@@ -1571,19 +1585,23 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
strcpy(currentFileOrDirectory, currentTouchscreenSelection); strcpy(currentFileOrDirectory, currentTouchscreenSelection);
int currentFileLen = strlen(currentFileOrDirectory); int currentFileLen = strlen(currentFileOrDirectory);
currentFileOrDirectory[currentFileLen - 4] = '\0'; currentFileOrDirectory[currentFileLen - 4] = '\0';
currentFileList.changeDir(currentFileOrDirectory); card.cd(currentFileOrDirectory);
#else #else
currentFileList.changeDir(currentTouchscreenSelection); currentFileList.changeDir(currentTouchscreenSelection);
#endif #endif
} }
} }
} }
if (SpecialMenu == false) {
currentTouchscreenSelection[0] = 0;
} }
if (SpecialMenu == false)
currentTouchscreenSelection[0] = 0;
#endif // ifdef SDSUPPORT #endif // ifdef SDSUPPORT
break; break;
#ifdef SERVO_ENDSTOPS
case 27: // A27 servos angles adjust
break;
#endif
case 28: // A28 filament test case 28: // A28 filament test
{ {
@@ -1615,7 +1633,7 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
if (!isPrinting()) { if (!isPrinting()) {
if (!all_axes_trusted()) { if (!all_axes_trusted()) {
injectCommands(F("G28\n")); queue.inject_P(PSTR("G28\n"));
/* /*
set_axis_is_at_home(X_AXIS); set_axis_is_at_home(X_AXIS);
sync_plan_position(); sync_plan_position();
@@ -1759,12 +1777,12 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
case 42: case 42:
if (CaseLight == true) { if (CaseLight == true) {
SERIAL_ECHOLNPGM("Case Light OFF"); SERIAL_ECHOLNPGM("Case Light OFF");
injectCommands(F("M355 S1 P0")); queue.inject_P(PSTR("M355 S1 P0"));
CaseLight = false; CaseLight = false;
} }
else { else {
SERIAL_ECHOLNPGM("Case Light ON"); SERIAL_ECHOLNPGM("Case Light ON");
injectCommands(F("M355 S1 P255")); queue.inject_P(PSTR("M355 S1 P255"));
CaseLight = true; CaseLight = true;
} }
// break; <-- TODO: do we need it? // break; <-- TODO: do we need it?
@@ -1975,7 +1993,7 @@ void AnycubicTouchscreenClass::RenderCurrentFolder(uint16_t selectedNumber) {
if (ELAPSED(ms, nextStopCheck)) { if (ELAPSED(ms, nextStopCheck)) {
nextStopCheck = ms + 1000UL; nextStopCheck = ms + 1000UL;
if (mediaPrintingState == AMPRINTSTATE_STOP_REQUESTED) { if (mediaPrintingState == AMPRINTSTATE_STOP_REQUESTED) {
#if ENABLED(ANYCUBIC_TFT_DEBUG) #if ENABLED(ANYCUBIC_LCD_DEBUG)
SERIAL_ECHOLNPGM("TFT Serial Debug: Finished stopping print, releasing motors ..."); SERIAL_ECHOLNPGM("TFT Serial Debug: Finished stopping print, releasing motors ...");
#endif #endif
mediaPrintingState = AMPRINTSTATE_NOT_PRINTING; mediaPrintingState = AMPRINTSTATE_NOT_PRINTING;

View File

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

View File

@@ -164,7 +164,7 @@
#elif MB(TRIGORILLA_13) #elif MB(TRIGORILLA_13)
#include "ramps/pins_TRIGORILLA_13.h" // ATmega2560 env:mega2560 #include "ramps/pins_TRIGORILLA_13.h" // ATmega2560 env:mega2560
#elif MB(TRIGORILLA_14, TRIGORILLA_14_11) #elif MB(TRIGORILLA_14, TRIGORILLA_14_11)
#include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:mega2560 env:MEGA_1G env:MEGA_1G_TMC env:MEGA_1G_BLT_10 env:MEGA_1G_BLT_11 env:MEGA_1G_TMC_BLT_10 env:MEGA_1G_TMC_BLT_11 env:MEGA env:MEGA_TMC env:MEGA_BLT_10 env:MEGA_BLT_11 env:MEGA_TMC_BLT_10 env:MEGA_TMC_BLT_11 env:MEGA_S env:MEGA_S_TMC env:MEGA_S_BLT_10 env:MEGA_S_BLT_11 env:MEGA_S_TMC_BLT_10 env:MEGA_S_TMC_BLT_11 env:MEGA_S_DGUS env:MEGA_S_DGUS_TMC env:MEGA_S_DGUS_BLT_10 env:MEGA_S_DGUS_BLT_11 env:MEGA_S_DGUS_TMC_BLT_10 env:MEGA_S_DGUS_TMC_BLT_11 env:MEGA_X env:MEGA_X_TMC env:MEGA_X_BLT_10 env:MEGA_X_BLT_11 env:MEGA_X_TMC_BLT_10 env:MEGA_X_TMC_BLT_11 env:MEGA_X_DGUS env:MEGA_X_DGUS_TMC env:MEGA_X_DGUS_BLT_10 env:MEGA_X_DGUS_BLT_11 env:MEGA_X_DGUS_TMC_BLT_10 env:MEGA_X_DGUS_TMC_BLT_11 env:MEGA_P_DGUS env:MEGA_P_DGUS_TMC env:MEGA_P_DGUS_BLT_10 env:MEGA_P_DGUS_BLT_11 env:MEGA_P_DGUS_TMC_BLT_10 env:MEGA_P_DGUS_TMC_BLT_11 env:4MAXP2 env:4MAXP2_TMC env:4MAXP2_BLT_10 env:4MAXP2_BLT_11 env:4MAXP2_TMC_BLT_10 env:4MAXP2_TMC_BLT_11 env:4MAXP2_DGUS env:4MAXP2_DGUS_TMC env:4MAXP2_DGUS_BLT_10 env:4MAXP2_DGUS_BLT_11 env:4MAXP2_DGUS_TMC_BLT_10 env:4MAXP2_DGUS_TMC_BLT_11 #include "ramps/pins_TRIGORILLA_14.h" // ATmega2560 env:mega2560 env:MEGA_1G env:MEGA_1G_TMC env:MEGA_1G_BLT_10 env:MEGA_1G_BLT_11 env:MEGA_1G_TMC_BLT_10 env:MEGA_1G_TMC_BLT_11 env:MEGA env:MEGA_TMC env:MEGA_TMC_KLICKY env:MEGA_BLT_10 env:MEGA_BLT_11 env:MEGA_TMC_BLT_10 env:MEGA_TMC_BLT_11 env:MEGA_S env:MEGA_S_TMC env:MEGA_S_TMC_KLICKY env:MEGA_S_BLT_10 env:MEGA_S_BLT_11 env:MEGA_S_TMC_BLT_10 env:MEGA_S_TMC_BLT_11 env:MEGA_S_DGUS env:MEGA_S_DGUS_TMC env:MEGA_S_DGUS_BLT_10 env:MEGA_S_DGUS_BLT_11 env:MEGA_S_DGUS_TMC_BLT_10 env:MEGA_S_DGUS_TMC_BLT_11 env:MEGA_X env:MEGA_X_TMC env:MEGA_X_BLT_10 env:MEGA_X_BLT_11 env:MEGA_X_TMC_BLT_10 env:MEGA_X_TMC_BLT_11 env:MEGA_X_DGUS env:MEGA_X_DGUS_TMC env:MEGA_X_DGUS_BLT_10 env:MEGA_X_DGUS_BLT_11 env:MEGA_X_DGUS_TMC_BLT_10 env:MEGA_X_DGUS_TMC_BLT_11 env:MEGA_P_DGUS env:MEGA_P_DGUS_TMC env:MEGA_P_DGUS_BLT_10 env:MEGA_P_DGUS_BLT_11 env:MEGA_P_DGUS_TMC_BLT_10 env:MEGA_P_DGUS_TMC_BLT_11 env:4MAXP2 env:4MAXP2_TMC env:4MAXP2_BLT_10 env:4MAXP2_BLT_11 env:4MAXP2_TMC_BLT_10 env:4MAXP2_TMC_BLT_11 env:4MAXP2_DGUS env:4MAXP2_DGUS_TMC env:4MAXP2_DGUS_BLT_10 env:4MAXP2_DGUS_BLT_11 env:4MAXP2_DGUS_TMC_BLT_10 env:4MAXP2_DGUS_TMC_BLT_11
#elif MB(RAMPS_ENDER_4) #elif MB(RAMPS_ENDER_4)
#include "ramps/pins_RAMPS_ENDER_4.h" // ATmega2560 env:mega2560 #include "ramps/pins_RAMPS_ENDER_4.h" // ATmega2560 env:mega2560
#elif MB(RAMPS_CREALITY) #elif MB(RAMPS_CREALITY)

View File

@@ -286,27 +286,11 @@
#endif #endif
#endif #endif
// RAMPS 1.4 DIO 4 on the servos connector
#if ANY(KNUTWURST_CHIRON, KNUTWURST_4MAXP2) #ifndef FIL_RUNOUT_PIN
#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 #define FIL_RUNOUT_PIN 19
#endif #endif
#ifndef PS_ON_PIN #ifndef PS_ON_PIN
#define PS_ON_PIN 12 #define PS_ON_PIN 12
#endif #endif

View File

@@ -142,19 +142,6 @@
#define Z_CS_PIN 40 #define Z_CS_PIN 40
#endif #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_STEP_PIN 26
#define E0_DIR_PIN 28 #define E0_DIR_PIN 28
#define E0_ENABLE_PIN 24 #define E0_ENABLE_PIN 24
@@ -266,7 +253,7 @@
// RAMPS 1.4 DIO 4 on the servos connector // RAMPS 1.4 DIO 4 on the servos connector
#ifndef FIL_RUNOUT_PIN #ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 33 #define FIL_RUNOUT_PIN 4
#endif #endif
#ifndef PS_ON_PIN #ifndef PS_ON_PIN

View File

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

View File

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

View File

@@ -79,6 +79,15 @@ build_src_filter = ${common.default_src_filter} +<src/HAL/AVR>
build_flags = ${common.build_flags} -DMOTHERBOARD=BOARD_TRIGORILLA_14 -DKNUTWURST_MEGA -DKNUTWURST_TMC build_flags = ${common.build_flags} -DMOTHERBOARD=BOARD_TRIGORILLA_14 -DKNUTWURST_MEGA -DKNUTWURST_TMC
build_unflags = -DKNUTWURST_MEGA_S -DKNUTWURST_MEGA_X -DKNUTWURST_MEGA_P -DKNUTWURST_DGUS2_TFT -DKNUTWURST_BLTOUCH -DKNUTWURST_ONE_Z_ENDSTOP -DKNUTWURST_CHIRON -DKNUTWURST_4MAXP2 build_unflags = -DKNUTWURST_MEGA_S -DKNUTWURST_MEGA_X -DKNUTWURST_MEGA_P -DKNUTWURST_DGUS2_TFT -DKNUTWURST_BLTOUCH -DKNUTWURST_ONE_Z_ENDSTOP -DKNUTWURST_CHIRON -DKNUTWURST_4MAXP2
[env:MEGA_TMC_KLICKY]
platform = atmelavr
board = megaatmega2560
board_build.f_cpu = 16000000L
lib_deps = ${common.lib_deps}
build_src_filter = ${common.default_src_filter} +<src/HAL/AVR>
build_flags = ${common.build_flags} -DMOTHERBOARD=BOARD_TRIGORILLA_14 -DKNUTWURST_MEGA -DKNUTWURST_TMC -DKNUTWURST_KLICKY
build_unflags = -DKNUTWURST_MEGA_S -DKNUTWURST_MEGA_X -DKNUTWURST_MEGA_P -DKNUTWURST_DGUS2_TFT -DKNUTWURST_BLTOUCH -DKNUTWURST_ONE_Z_ENDSTOP -DKNUTWURST_CHIRON -DKNUTWURST_4MAXP2
[env:MEGA_BLT_10] [env:MEGA_BLT_10]
platform = atmelavr platform = atmelavr
board = megaatmega2560 board = megaatmega2560
@@ -138,6 +147,15 @@ build_src_filter = ${common.default_src_filter} +<src/HAL/AVR>
build_flags = ${common.build_flags} -DMOTHERBOARD=BOARD_TRIGORILLA_14 -DKNUTWURST_MEGA_S -DKNUTWURST_TMC build_flags = ${common.build_flags} -DMOTHERBOARD=BOARD_TRIGORILLA_14 -DKNUTWURST_MEGA_S -DKNUTWURST_TMC
build_unflags = -DKNUTWURST_MEGA -DKNUTWURST_MEGA_X -DKNUTWURST_MEGA_P -DKNUTWURST_DGUS2_TFT -DKNUTWURST_BLTOUCH -DKNUTWURST_ONE_Z_ENDSTOP -DKNUTWURST_CHIRON -DKNUTWURST_4MAXP2 build_unflags = -DKNUTWURST_MEGA -DKNUTWURST_MEGA_X -DKNUTWURST_MEGA_P -DKNUTWURST_DGUS2_TFT -DKNUTWURST_BLTOUCH -DKNUTWURST_ONE_Z_ENDSTOP -DKNUTWURST_CHIRON -DKNUTWURST_4MAXP2
[env:MEGA_S_TMC_KLICKY]
platform = atmelavr
board = megaatmega2560
board_build.f_cpu = 16000000L
lib_deps = ${common.lib_deps}
build_src_filter = ${common.default_src_filter} +<src/HAL/AVR>
build_flags = ${common.build_flags} -DMOTHERBOARD=BOARD_TRIGORILLA_14 -DKNUTWURST_MEGA_S -DKNUTWURST_TMC -DKNUTWURST_KLICKY
build_unflags = -DKNUTWURST_MEGA -DKNUTWURST_MEGA_X -DKNUTWURST_MEGA_P -DKNUTWURST_DGUS2_TFT -DKNUTWURST_BLTOUCH -DKNUTWURST_ONE_Z_ENDSTOP -DKNUTWURST_CHIRON -DKNUTWURST_4MAXP2
[env:MEGA_S_BLT_10] [env:MEGA_S_BLT_10]
platform = atmelavr platform = atmelavr
board = megaatmega2560 board = megaatmega2560

View File

@@ -27,12 +27,14 @@ default_envs =
MEGA_1G_TMC_BLT_11 MEGA_1G_TMC_BLT_11
MEGA MEGA
MEGA_TMC MEGA_TMC
MEGA_TMC_KLICKY
MEGA_BLT_10 MEGA_BLT_10
MEGA_BLT_11 MEGA_BLT_11
MEGA_TMC_BLT_10 MEGA_TMC_BLT_10
MEGA_TMC_BLT_11 MEGA_TMC_BLT_11
MEGA_S MEGA_S
MEGA_S_TMC MEGA_S_TMC
MEGA_S_TMC_KLICKY
MEGA_S_BLT_10 MEGA_S_BLT_10
MEGA_S_BLT_11 MEGA_S_BLT_11
MEGA_S_TMC_BLT_10 MEGA_S_TMC_BLT_10