Merge branch 'CrealityDwin2.0_Bleeding' into Creality_Bondtech
This commit is contained in:
+16
-6
@@ -463,7 +463,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ANY(MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427)
|
||||
#if ANY(MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427, Creality422, Creality427)
|
||||
#define POWER_LOSS_RECOVERY //Screen will not compile without PLR
|
||||
#if NONE(BedAC, BedDC)
|
||||
#define BedDC
|
||||
@@ -476,6 +476,12 @@
|
||||
#define RET6_12864_LCD
|
||||
#endif
|
||||
|
||||
#if ENABLED(MachineEnder3Pro422)
|
||||
#define Creality422
|
||||
#elif ENABLED(MachineEnder3Pro427)
|
||||
#define Creality427
|
||||
#endif
|
||||
|
||||
#if EITHER(Creality422, Creality427) && DISABLED(MachineEnder3V2)
|
||||
#define RET6_12864_LCD
|
||||
#endif
|
||||
@@ -576,11 +582,15 @@
|
||||
#define LCD_SERIAL_PORT 0
|
||||
#define LCD_BAUDRATE 115200
|
||||
#define SERIAL_CATCHALL -1
|
||||
#elif ANY(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max) && NONE(GraphicLCD, MachineEnder3V2)
|
||||
#elif ANY(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max) && NONE(GraphicLCD, MachineEnder3V2, Creality422, Creality427)
|
||||
#define LCD_SERIAL_PORT 2
|
||||
#define LCD_BAUDRATE 115200
|
||||
#define SERIAL_CATCHALL 0
|
||||
#elif ANY(MachineEnder3Pro422, MachineEnder3Pro427) && DISABLED(MachineEnder3V2)
|
||||
#elif ANY(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max) && DISABLED(GraphicLCD)
|
||||
#define LCD_SERIAL_PORT 3
|
||||
#define LCD_BAUDRATE 115200
|
||||
#define SERIAL_CATCHALL 1
|
||||
#elif ANY(Creality422, Creality427) && DISABLED(MachineEnder3V2)
|
||||
#define SERIAL_PORT_2 3
|
||||
#endif
|
||||
|
||||
@@ -1060,9 +1070,9 @@
|
||||
#else
|
||||
// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
|
||||
#if ANY(HotendMosquito, PID50W)
|
||||
#define DEFAULT_Kp 25.95
|
||||
#define DEFAULT_Ki 3.08
|
||||
#define DEFAULT_Kd 54.74
|
||||
#define DEFAULT_Kp 16.8
|
||||
#define DEFAULT_Ki 1.2
|
||||
#define DEFAULT_Kd 54.3
|
||||
#elif ENABLED(HotendStock)
|
||||
#if ANY(MachineCR10SPro, MachineCR10Max)
|
||||
#define DEFAULT_Kp 25.25
|
||||
|
||||
@@ -988,7 +988,7 @@
|
||||
// Increase the slowdown divisor for larger buffer sizes.
|
||||
#define SLOWDOWN
|
||||
#if ENABLED(SLOWDOWN)
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRMiniE3V2, MachineEnder3V2)
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRMiniE3V2, MachineEnder3V2, Creality422, Creality427)
|
||||
#define SLOWDOWN_DIVISOR 4
|
||||
#else
|
||||
#define SLOWDOWN_DIVISOR 2
|
||||
@@ -1108,7 +1108,7 @@
|
||||
* vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the
|
||||
* lowest stepping frequencies.
|
||||
*/
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, MachineEnder3V2)
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, MachineEnder3V2, Creality422, Creality427)
|
||||
#define ADAPTIVE_STEP_SMOOTHING
|
||||
#endif
|
||||
|
||||
@@ -1334,7 +1334,7 @@
|
||||
|
||||
// The standard SD detect circuit reads LOW when media is inserted and HIGH when empty.
|
||||
// Enable this option and set to HIGH if your SD cards are incorrectly detected.
|
||||
#if NONE(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max, MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427, SKR14Turbo, SKR14, , Creality422, Creality427)
|
||||
#if NONE(MachineCR10SPro, MachineCRX, MachineEnder5Plus, MachineCR10Max, MachineEnder3V2, SKR14Turbo, SKR14, , Creality422, Creality427)
|
||||
#define SD_DETECT_STATE HIGH
|
||||
#endif
|
||||
|
||||
@@ -2149,7 +2149,7 @@
|
||||
|
||||
// The number of linear moves that can be in the planner at once.
|
||||
// The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g. 8, 16, 32)
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRMiniE3V2, MachineEnder3V2) || DISABLED(EXTENSIBLE_UI)
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, SKRMiniE3V2, MachineEnder3V2, Creality422, Creality427) || DISABLED(EXTENSIBLE_UI)
|
||||
#define BLOCK_BUFFER_SIZE 16
|
||||
#else
|
||||
#define BLOCK_BUFFER_SIZE 8
|
||||
@@ -2159,7 +2159,7 @@
|
||||
|
||||
// The ASCII buffer for serial input
|
||||
#define MAX_CMD_SIZE 96
|
||||
#if ANY(MachineCR10Orig, SKRMiniE3V2, MachineEnder3V2) //melzi has more ram than a 2560
|
||||
#if ANY(MachineCR10Orig, SKRMiniE3V2, MachineEnder3V2, Creality422, Creality427) //melzi has more ram than a 2560
|
||||
#define BUFSIZE 16
|
||||
#elif ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11)
|
||||
#define BUFSIZE 8
|
||||
@@ -2218,7 +2218,7 @@
|
||||
* Currently handles M108, M112, M410, M876
|
||||
* NOTE: Not yet implemented for all platforms.
|
||||
*/
|
||||
#if NONE(SKRPRO11, SKRMiniE3V2, MachineEnder3V2, MachineEnder3V2, MachineEnder3Pro422, MachineEnder3Pro427)
|
||||
#if NONE(SKRPRO11, SKRMiniE3V2)
|
||||
#define EMERGENCY_PARSER
|
||||
#endif
|
||||
|
||||
@@ -2276,7 +2276,7 @@
|
||||
*
|
||||
* Note that M207 / M208 / M209 settings are saved to EEPROM.
|
||||
*/
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, MachineEnder3V2)
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, MachineEnder3V2, Creality422, Creality427)
|
||||
#define FWRETRACT
|
||||
#endif
|
||||
#if ENABLED(FWRETRACT)
|
||||
@@ -4103,7 +4103,9 @@
|
||||
//
|
||||
// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
|
||||
//
|
||||
//#define PINS_DEBUGGING
|
||||
#if ANY(SKR13, SKR14, SKR14Turbo, SKRPRO11, MachineEnder3V2, Creality422, Creality427)
|
||||
#define PINS_DEBUGGING
|
||||
#endif
|
||||
|
||||
// Enable Marlin dev mode which adds some special commands
|
||||
//#define MARLIN_DEV_MODE
|
||||
|
||||
@@ -86,7 +86,7 @@ void onStartup()
|
||||
#else
|
||||
rtscheck.RTS_SndData(MACHINE_NAME, MacVersion);
|
||||
#endif
|
||||
rtscheck.RTS_SndData(DETAILED_BUILD_VERSION, SoftVersion);
|
||||
rtscheck.RTS_SndData(SHORT_BUILD_VERSION, SoftVersion);
|
||||
rtscheck.RTS_SndData(sizebuf, PrinterSize);
|
||||
rtscheck.RTS_SndData(WEBSITE_URL, CorpWebsite);
|
||||
|
||||
@@ -262,22 +262,25 @@ void onIdle()
|
||||
}
|
||||
rtscheck.RTS_SndData((unsigned int)getProgress_percent(), Percentage);
|
||||
}
|
||||
else if(getTargetTemp_celsius(BED)==0 && getTargetTemp_celsius(H0)==0)
|
||||
{
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) < (getTargetTemp_celsius(BED) - THERMAL_PROTECTION_BED_HYSTERESIS ) || (getActualTemp_celsius(H0) < (getTargetTemp_celsius(H0) - THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(1 + CEIconGrap, IconPrintstatus); // Heating Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 1 : PrinterStatusKey[1]);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) > (getTargetTemp_celsius(BED) + THERMAL_PROTECTION_BED_HYSTERESIS) || (getActualTemp_celsius(H0) > (getTargetTemp_celsius(H0) + THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(8 + CEIconGrap, IconPrintstatus); // Cooling Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 2 : PrinterStatusKey[1]);
|
||||
}
|
||||
else
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
{
|
||||
if(getTargetTemp_celsius(BED)==0 && getTargetTemp_celsius(H0)==0)
|
||||
{
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) < (getTargetTemp_celsius(BED) - THERMAL_PROTECTION_BED_HYSTERESIS ) || (getActualTemp_celsius(H0) < (getTargetTemp_celsius(H0) - THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(1 + CEIconGrap, IconPrintstatus); // Heating Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 1 : PrinterStatusKey[1]);
|
||||
}
|
||||
else if (getActualTemp_celsius(BED) > (getTargetTemp_celsius(BED) + THERMAL_PROTECTION_BED_HYSTERESIS) || (getActualTemp_celsius(H0) > (getTargetTemp_celsius(H0) + THERMAL_PROTECTION_HYSTERESIS)))
|
||||
{
|
||||
rtscheck.RTS_SndData(8 + CEIconGrap, IconPrintstatus); // Cooling Status
|
||||
PrinterStatusKey[1] = (PrinterStatusKey[1] == 0 ? 2 : PrinterStatusKey[1]);
|
||||
}
|
||||
else
|
||||
rtscheck.RTS_SndData(0 + CEIconGrap, IconPrintstatus);
|
||||
}
|
||||
|
||||
|
||||
rtscheck.RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z);
|
||||
@@ -348,6 +351,20 @@ void onIdle()
|
||||
AutoHomeIconNum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(isMediaInserted())
|
||||
{
|
||||
uint16_t currPage;
|
||||
if(fileIndex == 0)
|
||||
currPage = 1;
|
||||
else
|
||||
currPage = CEIL((float)((float)fileIndex / (float)DISPLAY_FILES)) +1;
|
||||
|
||||
uint16_t maxPages = CEIL(((float)filenavigator.maxFiles() / (float)DISPLAY_FILES));
|
||||
rtscheck.RTS_SndData(currPage, FilesCurentPage);
|
||||
rtscheck.RTS_SndData(maxPages, FilesMaxPage);
|
||||
}
|
||||
|
||||
void yield();
|
||||
if (rtscheck.RTS_RecData() > 0)
|
||||
rtscheck.RTS_HandleData();
|
||||
@@ -1768,7 +1785,7 @@ void onUserConfirmRequired(const char *const msg)
|
||||
}
|
||||
void onStatusChanged(const char *const statMsg)
|
||||
{
|
||||
for (int j = 0; j < 40; j++) // Clear old message
|
||||
for (int j = 0; j < 20; j++) // Clear old message
|
||||
rtscheck.RTS_SndData(' ', StatusMessageString+j);
|
||||
rtscheck.RTS_SndData(statMsg, StatusMessageString);
|
||||
}
|
||||
|
||||
@@ -97,6 +97,8 @@ namespace ExtUI {
|
||||
#define FilenameIcon 0x1200
|
||||
#define FilenameIcon1 0x1220
|
||||
#define Printfilename 0x2000
|
||||
#define FilesCurentPage 0x1310
|
||||
#define FilesMaxPage 0x1312
|
||||
#define SDFILE_ADDR 0x200A
|
||||
#define FilenamePlay 0x20D2
|
||||
#define FilenameChs 0x20D3
|
||||
@@ -104,11 +106,12 @@ namespace ExtUI {
|
||||
#define FilenameCount 0x20DE
|
||||
#define FilenameNature 0x6003
|
||||
|
||||
#if ANY(MachineCR10SPro, MachineEnder5Plus, MachineCR10Max) || ENABLED(Force10SProDisplay)
|
||||
#define StatusMessageString 0x3000
|
||||
#else
|
||||
#define StatusMessageString 0x20E8
|
||||
#endif
|
||||
//#if ANY(MachineCR10SPro, MachineEnder5Plus, MachineCR10Max) || ENABLED(Force10SProDisplay)
|
||||
// #define StatusMessageString 0x3000
|
||||
//#else
|
||||
// #define StatusMessageString 0x20E8
|
||||
//#endif
|
||||
#define StatusMessageString 0x2064
|
||||
|
||||
#if defined(TARGET_STM32F4)
|
||||
#define DWIN_SERIAL Serial1
|
||||
|
||||
@@ -21,14 +21,16 @@
|
||||
*/
|
||||
|
||||
/* ****************************************
|
||||
* lcd/extui/lib/nextion/FileNavigator.cpp
|
||||
* lcd/extui/lib/Creality/FileNavigator.cpp
|
||||
* ****************************************
|
||||
* Extensible_UI implementation for Nextion
|
||||
* https://github.com/Skorpi08
|
||||
* Extensible_UI implementation for Creality DWIN
|
||||
* 10SPro, Max, CR10V2
|
||||
* Based on implementations for Anycubic Chiron and Nextion by Nick Wells and Skorpi08
|
||||
* Written by Insanity Automation
|
||||
* ***************************************/
|
||||
|
||||
#include "../../../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(EXTENSIBLE_UI)
|
||||
|
||||
|
||||
#include "FileNavigator.h"
|
||||
@@ -112,7 +114,7 @@ void FileNavigator::getFiles(uint16_t index) {
|
||||
rtscheck.RTS_SndData(10, FilenameIcon1 + j);
|
||||
}
|
||||
|
||||
SERIAL_ECHOLNPAIR("index=", index, " currentindex=", currentindex, "folderdepth=", folderdepth);
|
||||
DEBUG_ECHOLNPAIR("index=", index, " currentindex=", currentindex, "folderdepth=", folderdepth);
|
||||
|
||||
if (currentindex == 0 && folderdepth > 0) { // Add a link to go up a folder
|
||||
files--;
|
||||
@@ -121,13 +123,10 @@ void FileNavigator::getFiles(uint16_t index) {
|
||||
}
|
||||
|
||||
for (uint16_t seek = currentindex; seek < currentindex + files; seek++) {
|
||||
SERIAL_ECHOLNPAIR("Seek", seek);
|
||||
if (filelist.seek(seek)) {
|
||||
SERIAL_ECHOLN("seek done");
|
||||
const int filelen = strlen(filelist.filename());
|
||||
if(filelen > 20)
|
||||
{
|
||||
SERIAL_ECHOLN("trunc");
|
||||
char *buf = (char *)filelist.filename();
|
||||
//char buf[filelen];
|
||||
//strcpy(&buf[filelen], filelist.filename());
|
||||
@@ -137,11 +136,16 @@ void FileNavigator::getFiles(uint16_t index) {
|
||||
else
|
||||
rtscheck.RTS_SndData(filelist.filename(), (SDFILE_ADDR + (fcnt * 20)));
|
||||
if (filelist.isDir())
|
||||
{
|
||||
rtscheck.RTS_SndData((uint8_t)4, FilenameIcon + (fcnt+1));
|
||||
rtscheck.RTS_SndData((unsigned long)0x041F, (FilenameNature + ((1+fcnt) * 16))); // Change BG of selected line to Blue
|
||||
}
|
||||
else
|
||||
{
|
||||
rtscheck.RTS_SndData((uint8_t)0, FilenameIcon + (fcnt+1));
|
||||
rtscheck.RTS_SndData((unsigned long)0xFFFF, (FilenameNature + ((1+fcnt) * 16))); // white
|
||||
rtscheck.RTS_SndData(1, FilenameIcon + (fcnt+1));
|
||||
SERIAL_ECHOLNPAIR("-", seek, " '", filelist.filename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
|
||||
}
|
||||
DEBUG_ECHOLNPAIR("-", seek, " '", filelist.filename(), "' '", currentfoldername, "", filelist.shortFilename(), "'\n");
|
||||
fcnt++;
|
||||
}
|
||||
}
|
||||
@@ -178,3 +182,4 @@ void FileNavigator::upDIR() {
|
||||
}
|
||||
|
||||
char* FileNavigator::getCurrentFolderName() { return currentfoldername; }
|
||||
#endif
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
#pragma once
|
||||
|
||||
/* ****************************************
|
||||
* lcd/extui/lib/nextion/FileNavigator.cpp
|
||||
* lcd/extui/lib/Creality/FileNavigator.cpp
|
||||
* ****************************************
|
||||
* Extensible_UI implementation for Nextion
|
||||
* https://github.com/Skorpi08
|
||||
* Extensible_UI implementation for Creality DWIN
|
||||
* 10SPro, Max, CR10V2
|
||||
* Based on implementations for Anycubic Chiron and Nextion by Nick Wells and Skorpi08
|
||||
* Written by Insanity Automation
|
||||
* ***************************************/
|
||||
|
||||
#include "../../ui_api.h"
|
||||
|
||||
@@ -1067,6 +1067,8 @@ namespace ExtUI {
|
||||
void onStatusChanged_P(PGM_P const pstr) {
|
||||
char msg[strlen_P(pstr) + 1];
|
||||
strcpy_P(msg, pstr);
|
||||
if(strlen(msg) > 20)
|
||||
msg[20]="\0";
|
||||
onStatusChanged(msg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user