From 5d871ee8956a918be38b6cb77eb0f337f4263036 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 14 Jul 2023 09:50:36 -0400 Subject: [PATCH 01/39] Fix JyersUI setMeshViewerStatus() --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 7139f3cdf9a4..5bf0a769d8e3 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -416,7 +416,7 @@ class TextScroller { } } - void setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead + void JyersDWIN::setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead float v1, v2, v_min = abs(getMinValue()), v_max = abs(getMaxValue()); From f2b9754b75ac087573db6ef3214db795f5dac2e8 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 14 Jul 2023 09:51:37 -0400 Subject: [PATCH 02/39] Fix ProUI functions not used --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 55 +++++++++++++++++------- Marlin/src/lcd/e3v2/proui/dwin.h | 37 ++++++++-------- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 2 - 3 files changed, 57 insertions(+), 37 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 5ea8c71be0e1..c8c7e6215faa 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -129,9 +129,6 @@ #include "lockscreen.h" #endif -#define DEBUG_OUT ENABLED(DEBUG_DWIN) -#include "../../../core/debug_out.h" - #ifndef MACHINE_SIZE #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #endif @@ -2203,10 +2200,14 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS, void setProbeOffsetX() { setPFloatOnClick(-60, 60, UNITFDIGITS); } void setProbeOffsetY() { setPFloatOnClick(-60, 60, UNITFDIGITS); } void setProbeOffsetZ() { setPFloatOnClick(-10, 10, 2); } - void probeTest() { - LCD_MESSAGE(MSG_M48_TEST); - queue.inject(F("G28O\nM48 P10")); - } + + #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) + void probeTest() { + LCD_MESSAGE(MSG_M48_TEST); + queue.inject(F("G28O\nM48 P10")); + } + #endif + void probeStow() { probe.stow(); } void probeDeploy() { probe.deploy(); } @@ -3066,7 +3067,7 @@ void drawControlMenu() { void drawAdvancedSettingsMenu() { checkkey = ID_Menu; - if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 22)) { + if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 23)) { BACK_ITEM(gotoMainMenu); #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); @@ -3077,6 +3078,9 @@ void drawAdvancedSettingsMenu() { #if HAS_BED_PROBE MENU_ITEM(ICON_ProbeSet, MSG_ZPROBE_SETTINGS, onDrawSubMenu, drawProbeSetMenu); #endif + #if HAS_HOME_OFFSET + MENU_ITEM(ICON_ProbeSet, MSG_SET_HOME_OFFSETS, onDrawSubMenu, drawHomeOffsetMenu); + #endif MENU_ITEM(ICON_FilSet, MSG_FILAMENT_SET, onDrawSubMenu, drawFilSetMenu); #if ENABLED(PIDTEMP) && ANY(PID_AUTOTUNE_MENU, PID_EDIT_MENU) MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID " Settings", onDrawSubMenu, drawHotendPIDMenu); @@ -3156,7 +3160,7 @@ void drawMoveMenu() { void drawHomeOffsetMenu() { checkkey = ID_Menu; if (SET_MENU(homeOffsetMenu, MSG_SET_HOME_OFFSETS, 4)) { - BACK_ITEM(drawPhySetMenu); + BACK_ITEM(drawAdvancedSettingsMenu); #if HAS_X_AXIS EDIT_ITEM(ICON_HomeOffsetX, MSG_HOME_OFFSET_X, onDrawPFloatMenu, setHomeOffsetX, &home_offset.x); #endif @@ -3195,7 +3199,9 @@ void drawMoveMenu() { EDIT_ITEM(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, setHSMode, &bltouch.high_speed_mode); #endif #endif - MENU_ITEM(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, probeTest); + #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST) + MENU_ITEM(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, probeTest); + #endif } updateMenu(ProbeSetMenu); } @@ -3794,9 +3800,9 @@ void drawStepsMenu() { EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles); #endif #if ENABLED(PID_EDIT_MENU) - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, SetKi, &thermalManager.temp_hotend[0].pid.Ki); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, SetKd, &thermalManager.temp_hotend[0].pid.Kd); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_hotend[0].pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_hotend[0].pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_hotend[0].pid.Kd); #endif #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); @@ -3824,9 +3830,9 @@ void drawStepsMenu() { EDIT_ITEM(ICON_PIDCycles, MSG_PID_CYCLE, onDrawPIntMenu, setPidCycles, &hmiData.pidCycles); #endif #if ENABLED(PID_EDIT_MENU) - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, SetKi, &thermalManager.temp_bed.pid.Ki); - EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, SetKd, &thermalManager.temp_bed.pid.Kd); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KP, onDrawPFloat2Menu, setKp, &thermalManager.temp_bed.pid.Kp); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KI, onDrawPIDi, setKi, &thermalManager.temp_bed.pid.Ki); + EDIT_ITEM_F(ICON_PIDValue, "Set" STR_KD, onDrawPIDd, setKd, &thermalManager.temp_bed.pid.Kd); #endif #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); @@ -4020,4 +4026,21 @@ void drawStepsMenu() { #endif // HAS_MESH +//============================================================================= +// More Host support +//============================================================================= + +//#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) + + void PopUp_HostShutDown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); } + void onClick_HostShutDown() { + if (hmiFlag.select_flag) { hostui.shutdown(); } + hmiReturnScreen(); + } + void hostShutDown() { gotoPopup(PopUp_HostShutDown, onClick_HostShutDown); } + +//#endif + +//============================================================================= + #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 41d8020b727a..af3ef4ef10ad 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -212,8 +212,12 @@ void doCoolDown(); #if HAS_LCD_BRIGHTNESS void turnOffBacklight(); #endif -void applyExtMinT(); -void parkHead(); +#if ENABLED(PREVENT_COLD_EXTRUSION) + void applyExtMinT(); +#endif +#if ENABLED(NOZZLE_PARK_FEATURE) + void parkHead(); +#endif #if HAS_ONESTEP_LEVELING void trammingwizard(); #endif @@ -238,7 +242,7 @@ void gotoMainMenu(); void gotoInfoMenu(); void gotoPowerLossRecovery(); void gotoConfirmToPrint(); -void dwinDrawDashboard(const bool with_update); // Status Area +void dwinDrawDashboard(); // Status Area void drawMainArea(); // Redraw main area void dwinDrawStatusLine(const char *text = ""); // Draw simple status text void dwinRedrawDash(); // Redraw Dash and Status line @@ -291,15 +295,9 @@ void dwinRebootScreen(); #if HAS_MESH void dwinMeshViewer(); #endif -#if HAS_GCODE_PREVIEW - void hmiConfirmToPrint(); -#endif #if HAS_ESDIAG void drawEndStopDiag(); #endif -#if ENABLED(PRINTCOUNTER) - void drawPrintStats(); -#endif // Menu drawing functions void drawPrintFileMenu(); @@ -315,10 +313,6 @@ void drawTrammingMenu(); void drawProbeSetMenu(); #endif void drawFilSetMenu(); -#if ENABLED(NOZZLE_PARK_FEATURE) - void drawParkPosMenu(); -#endif -void drawPhySetMenu(); #if ALL(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) void drawCaseLightMenu(); #endif @@ -371,6 +365,9 @@ void drawStepsMenu(); #include "../../../module/temperature.h" void dwinStartM303(const bool seenC, const int c, const bool seenS, const heater_id_t hid, const celsius_t temp); void dwinPidTuning(tempcontrol_t result); + #if PROUI_TUNING_GRAPH + void dwinDrawPIDMPCPopup(); + #endif #endif #if ENABLED(PIDTEMP) #if ENABLED(PID_AUTOTUNE_MENU) @@ -390,9 +387,11 @@ void drawStepsMenu(); #endif // MPC -#if ANY(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) - void drawHotendMPCMenu(); -#endif -#if ENABLED(MPC_AUTOTUNE) - void dwinMPCTuning(tempcontrol_t result); -#endif +#if ENABLED(MPCTEMP) + #if ANY(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU) + void drawHotendMPCMenu(); + #endif + #if ENABLED(MPC_AUTOTUNE) + void dwinMPCTuning(tempcontrol_t result); + #endif +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index c52d57031c83..8ac7c5eb6231 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -28,8 +28,6 @@ * Date: 2022/08/08 */ -//#define DEBUG_DWIN 1 - #if defined(__STM32F1__) || defined(STM32F1) #define DASH_REDRAW 1 #endif From 125451ee10a65cb7642bdc73388e1d8aea0f3375 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 14 Jul 2023 10:09:11 -0400 Subject: [PATCH 03/39] Add, rename hostShutDown --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index c8c7e6215faa..618ae6996a96 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3039,7 +3039,7 @@ void drawPrepareMenu() { void drawControlMenu() { checkkey = ID_Menu; - if (SET_MENU_R(ControlMenu, selrect({103, 1, 28, 14}), MSG_CONTROL, 10)) { + if (SET_MENU_R(ControlMenu, selrect({103, 1, 28, 14}), MSG_CONTROL, 11)) { BACK_ITEM(gotoMainMenu); MENU_ITEM(ICON_Temperature, MSG_TEMPERATURE, onDrawTempSubMenu, drawTemperatureMenu); MENU_ITEM(ICON_Motion, MSG_MOTION, onDrawMotionSubMenu, drawMotionMenu); @@ -3059,6 +3059,9 @@ void drawControlMenu() { #if ENABLED(LED_CONTROL_MENU) MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, drawLedControlMenu); #endif + #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) + MENU_ITEM(ICON_Host, MSG_HOST_SHUTDOWN, onDrawMenuItem, HostShutDown); + #endif MENU_ITEM(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, gotoInfoMenu); } ui.reset_status(true); @@ -4032,12 +4035,12 @@ void drawStepsMenu() { //#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - void PopUp_HostShutDown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); } - void onClick_HostShutDown() { + void popupHostShutDown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); } + void onClickHostShutDown() { if (hmiFlag.select_flag) { hostui.shutdown(); } hmiReturnScreen(); } - void hostShutDown() { gotoPopup(PopUp_HostShutDown, onClick_HostShutDown); } + void hostShutDown() { gotoPopup(popupHostShutDown, onClickHostShutDown); } //#endif From f65e52a21347c081c54ea79ab431f6b7c65dbfde Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Fri, 14 Jul 2023 14:34:22 -0400 Subject: [PATCH 04/39] Update dwin.cpp fix previously commented --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 618ae6996a96..f2361a959670 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -4033,7 +4033,7 @@ void drawStepsMenu() { // More Host support //============================================================================= -//#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) +#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) void popupHostShutDown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); } void onClickHostShutDown() { @@ -4042,7 +4042,7 @@ void drawStepsMenu() { } void hostShutDown() { gotoPopup(popupHostShutDown, onClickHostShutDown); } -//#endif +#endif //============================================================================= From 3e1bfd151d6037838f816ab9f25f152e227d5a82 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 14 Jul 2023 15:34:48 -0400 Subject: [PATCH 05/39] Revert dwin.cpp, Remove setMeshViewerStatus dwin.h --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.h | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 5bf0a769d8e3..7139f3cdf9a4 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -416,7 +416,7 @@ class TextScroller { } } - void JyersDWIN::setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead + void setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead float v1, v2, v_min = abs(getMinValue()), v_max = abs(getMaxValue()); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 17b6176f3d88..4f0669f8d89d 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -233,10 +233,6 @@ class JyersDWIN { static void popupSelect(); static void updateStatusBar(const bool refresh=false); - #if HAS_MESH - static void setMeshViewerStatus(); - #endif - static FSTR_P getMenuTitle(const uint8_t menu); static uint8_t getMenuSize(const uint8_t menu); static void menuItemHandler(const uint8_t menu, const uint8_t item, bool draw=true); From 9067105c2a33eedb6f5a3c02529f3bb4666fc909 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jul 2023 20:01:16 -0500 Subject: [PATCH 06/39] cleanup --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 8 ++++---- Marlin/src/lcd/e3v2/proui/dwin.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index f2361a959670..b70d16f59f86 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3060,7 +3060,7 @@ void drawControlMenu() { MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, drawLedControlMenu); #endif #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - MENU_ITEM(ICON_Host, MSG_HOST_SHUTDOWN, onDrawMenuItem, HostShutDown); + MENU_ITEM(ICON_Host, MSG_HOST_SHUTDOWN, onDrawMenuItem, hostShutdown); #endif MENU_ITEM(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, gotoInfoMenu); } @@ -4035,12 +4035,12 @@ void drawStepsMenu() { #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - void popupHostShutDown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); } - void onClickHostShutDown() { + void popupHostShutdown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); } + void onClickHostShutdown() { if (hmiFlag.select_flag) { hostui.shutdown(); } hmiReturnScreen(); } - void hostShutDown() { gotoPopup(popupHostShutDown, onClickHostShutDown); } + void hostShutdown() { gotoPopup(popupHostShutdown, onClickHostShutdown); } #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index af3ef4ef10ad..2e765a70fd1d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -230,7 +230,7 @@ void doCoolDown(); void ublMeshLoad(); #endif #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - void hostShutDown(); + void hostShutdown(); #endif #if DISABLED(HAS_BED_PROBE) void homeZAndDisable(); @@ -394,4 +394,4 @@ void drawStepsMenu(); #if ENABLED(MPC_AUTOTUNE) void dwinMPCTuning(tempcontrol_t result); #endif -#endif \ No newline at end of file +#endif From d57ff7fc07061adb7d9bbb2be58bd6a88817a7af Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jul 2023 20:03:34 -0500 Subject: [PATCH 07/39] Defer until later --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 20 -------------------- Marlin/src/lcd/e3v2/proui/dwin.h | 3 --- 2 files changed, 23 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index b70d16f59f86..7aa9b1760d10 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3059,9 +3059,6 @@ void drawControlMenu() { #if ENABLED(LED_CONTROL_MENU) MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, drawLedControlMenu); #endif - #if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - MENU_ITEM(ICON_Host, MSG_HOST_SHUTDOWN, onDrawMenuItem, hostShutdown); - #endif MENU_ITEM(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, gotoInfoMenu); } ui.reset_status(true); @@ -4029,21 +4026,4 @@ void drawStepsMenu() { #endif // HAS_MESH -//============================================================================= -// More Host support -//============================================================================= - -#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - - void popupHostShutdown() { dwinPopupConfirmCancel(ICON_Info_1, GET_TEXT_F(MSG_HOST_SHUTDOWN)); } - void onClickHostShutdown() { - if (hmiFlag.select_flag) { hostui.shutdown(); } - hmiReturnScreen(); - } - void hostShutdown() { gotoPopup(popupHostShutdown, onClickHostShutdown); } - -#endif - -//============================================================================= - #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 2e765a70fd1d..ccc90b3de608 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -229,9 +229,6 @@ void doCoolDown(); void ublMeshSave(); void ublMeshLoad(); #endif -#if ENABLED(HOST_SHUTDOWN_MENU_ITEM) && defined(SHUTDOWN_ACTION) - void hostShutdown(); -#endif #if DISABLED(HAS_BED_PROBE) void homeZAndDisable(); #endif From 9385663911752cc52e357b413ba70a5af2d4a71c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jul 2023 20:18:35 -0500 Subject: [PATCH 08/39] declare mesh_conf in place --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 7139f3cdf9a4..5e579c9649be 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -254,7 +254,7 @@ class TextScroller { #if HAS_MESH - struct Mesh_Settings { + struct { bool viewer_asymmetric_range = false; bool viewer_print_value = false; bool goto_mesh_value = false; @@ -436,8 +436,7 @@ class TextScroller { drawing_mesh = false; } - }; - Mesh_Settings mesh_conf; + } mesh_conf; #endif // HAS_MESH From feba819673a43b9c1c4000b3cf7da1285310fec3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jul 2023 20:22:47 -0500 Subject: [PATCH 09/39] toggle with xor --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 5e579c9649be..3bc106cf812e 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1337,7 +1337,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, probe_deployed); } else { - probe_deployed = !probe_deployed; + probe_deployed ^= true; probe.set_deployed(probe_deployed); drawCheckbox(row, probe_deployed); } @@ -1350,7 +1350,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, livemove); } else { - livemove = !livemove; + livemove ^= true; drawCheckbox(row, livemove); } break; @@ -1611,7 +1611,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra planner.synchronize(); redrawMenu(); } - liveadjust = !liveadjust; + liveadjust ^= true; drawCheckbox(row, liveadjust); } break; @@ -2689,7 +2689,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, eeprom_settings.time_format_textual); } else { - eeprom_settings.time_format_textual = !eeprom_settings.time_format_textual; + eeprom_settings.time_format_textual ^= true; drawCheckbox(row, eeprom_settings.time_format_textual); } break; @@ -2847,7 +2847,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, ui.sound_on); } else { - ui.sound_on = !ui.sound_on; + ui.sound_on ^= true; drawCheckbox(row, ui.sound_on); } break; @@ -2930,7 +2930,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, runout.enabled); } else { - runout.enabled = !runout.enabled; + runout.enabled ^= true; drawCheckbox(row, runout.enabled); } break; @@ -3377,7 +3377,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, mesh_conf.viewer_print_value); } else { - mesh_conf.viewer_print_value = !mesh_conf.viewer_print_value; + mesh_conf.viewer_print_value ^= true; drawCheckbox(row, mesh_conf.viewer_print_value); } break; @@ -3387,7 +3387,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, mesh_conf.viewer_asymmetric_range); } else { - mesh_conf.viewer_asymmetric_range = !mesh_conf.viewer_asymmetric_range; + mesh_conf.viewer_asymmetric_range ^= true; drawCheckbox(row, mesh_conf.viewer_asymmetric_range); } break; @@ -3570,7 +3570,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, mesh_conf.goto_mesh_value); } else { - mesh_conf.goto_mesh_value = !mesh_conf.goto_mesh_value; + mesh_conf.goto_mesh_value ^= true; current_position.z = 0; mesh_conf.manual_mesh_move(true); drawCheckbox(row, mesh_conf.goto_mesh_value); @@ -3909,7 +3909,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawCheckbox(row, runout.enabled); } else { - runout.enabled = !runout.enabled; + runout.enabled ^= true; drawCheckbox(row, runout.enabled); } break; From 7b7efda416ec6dacf50d7aba48d1063b419d4851 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jul 2023 20:27:59 -0500 Subject: [PATCH 10/39] use targetTooColdToExtrude --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 3bc106cf812e..d4439f9e192f 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1172,7 +1172,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) drawMenu(ID_ChangeFilament); #else - if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) + if (thermalManager.targetTooColdToExtrude(0)) popupHandler(Popup_ETemp); else { if (thermalManager.temp_hotend[0].is_below_target(2)) { @@ -1313,7 +1313,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawFloat(current_position.e, row); } else { - if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) { + if (thermalManager.targetTooColdToExtrude(0)) { popupHandler(Popup_ETemp); } else { @@ -1727,7 +1727,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra if (draw) drawMenuItem(row, ICON_WriteEEPROM, GET_TEXT_F(MSG_FILAMENTLOAD)); else { - if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) + if (thermalManager.targetTooColdToExtrude(0)) popupHandler(Popup_ETemp); else { if (thermalManager.temp_hotend[0].is_below_target(2)) { @@ -1745,7 +1745,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra if (draw) drawMenuItem(row, ICON_ReadEEPROM, GET_TEXT_F(MSG_FILAMENTUNLOAD)); else { - if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) { + if (thermalManager.targetTooColdToExtrude(0)) { popupHandler(Popup_ETemp); } else { @@ -1764,7 +1764,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra if (draw) drawMenuItem(row, ICON_ResumeEEPROM, GET_TEXT_F(MSG_FILAMENTCHANGE)); else { - if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) + if (thermalManager.targetTooColdToExtrude(0)) popupHandler(Popup_ETemp); else { if (thermalManager.temp_hotend[0].is_below_target(2)) { @@ -4593,7 +4593,7 @@ void JyersDWIN::popupControl() { #if ENABLED(ADVANCED_PAUSE_FEATURE) case Popup_ConfFilChange: if (selection == 0) { - if (thermalManager.temp_hotend[0].target < thermalManager.extrude_min_temp) + if (thermalManager.targetTooColdToExtrude(0)) popupHandler(Popup_ETemp); else { if (thermalManager.temp_hotend[0].is_below_target(2)) { From ef776f1c54651a73b25483e9a0dd7e622a79eb8c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jul 2023 20:28:20 -0500 Subject: [PATCH 11/39] cleanup --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index d4439f9e192f..d5427441e1eb 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4785,12 +4785,12 @@ void JyersDWIN::update() { stateUpdate(); screenUpdate(); switch (process) { - case Proc_Main: mainMenuControl(); break; + case Proc_Main: mainMenuControl(); break; case Proc_Menu: menuControl(); break; case Proc_Value: valueControl(); break; case Proc_Option: optionControl(); break; case Proc_File: fileControl(); break; - case Proc_Print: printScreenControl(); break; + case Proc_Print: printScreenControl(); break; case Proc_Popup: popupControl(); break; case Proc_Confirm: confirmControl(); break; } From cb171c33b9e180c1969894212baa6a33ab9f4e31 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jul 2023 20:37:58 -0500 Subject: [PATCH 12/39] use getters --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 76 ++++++++++++++-------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index d5427441e1eb..fea1f081f6fe 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -816,14 +816,14 @@ void JyersDWIN::drawStatusArea(const bool icons/*=false*/) { dwinIconShow(ICON, ICON_HotendTemp, 10, 383); dwinDrawString(false, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 25 + 3 * STAT_CHR_W + 5, 384, F("/")); } - if (thermalManager.temp_hotend[0].celsius != hotend) { - hotend = thermalManager.temp_hotend[0].celsius; - dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 28, 384, thermalManager.temp_hotend[0].celsius); + if (thermalManager.degHotend(0) != hotend) { + hotend = thermalManager.degHotend(0); + dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 28, 384, hotend); dwinDrawDegreeSymbol(getColor(eeprom_settings.status_area_text, COLOR_WHITE), 25 + 3 * STAT_CHR_W + 5, 386); } - if (thermalManager.temp_hotend[0].target != hotendtarget) { - hotendtarget = thermalManager.temp_hotend[0].target; - dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 25 + 4 * STAT_CHR_W + 6, 384, thermalManager.temp_hotend[0].target); + if (thermalManager.wholeDegHotend(0) != hotendtarget) { + hotendtarget = thermalManager.degTargetHotend(0); + dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 25 + 4 * STAT_CHR_W + 6, 384, hotendtarget); dwinDrawDegreeSymbol(getColor(eeprom_settings.status_area_text, COLOR_WHITE), 25 + 4 * STAT_CHR_W + 39, 386); } if (icons) { @@ -846,14 +846,14 @@ void JyersDWIN::drawStatusArea(const bool icons/*=false*/) { dwinIconShow(ICON, ICON_BedTemp, 10, 416); dwinDrawString(false, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 25 + 3 * STAT_CHR_W + 5, 417, F("/")); } - if (thermalManager.temp_bed.celsius != bed) { - bed = thermalManager.temp_bed.celsius; - dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 28, 417, thermalManager.temp_bed.celsius); + if (thermalManager.degBed() != bed) { + bed = thermalManager.degBed(); + dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 28, 417, bed); dwinDrawDegreeSymbol(getColor(eeprom_settings.status_area_text, COLOR_WHITE), 25 + 3 * STAT_CHR_W + 5, 419); } - if (thermalManager.temp_bed.target != bedtarget) { - bedtarget = thermalManager.temp_bed.target; - dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 25 + 4 * STAT_CHR_W + 6, 417, thermalManager.temp_bed.target); + if (thermalManager.degTargetBed() != bedtarget) { + bedtarget = thermalManager.degTargetBed(); + dwinDrawIntValue(true, true, 0, DWIN_FONT_STAT, getColor(eeprom_settings.status_area_text, COLOR_WHITE), COLOR_BG_BLACK, 3, 25 + 4 * STAT_CHR_W + 6, 417, bedtarget); dwinDrawDegreeSymbol(getColor(eeprom_settings.status_area_text, COLOR_WHITE), 25 + 4 * STAT_CHR_W + 39, 419); } #endif @@ -1180,7 +1180,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra thermalManager.wait_for_hotend(0); } popupHandler(Popup_FilChange); - gcode.process_subcommands_now(TS(F("M600 B1 R"), thermalManager.temp_hotend[0].target)); + gcode.process_subcommands_now(TS(F("M600 B1 R"), thermalManager.degTargetHotend(0))); } #endif } @@ -1772,7 +1772,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra thermalManager.wait_for_hotend(0); } popupHandler(Popup_FilChange); - gcode.process_subcommands_now(TS(F("M600B1R"), thermalManager.temp_hotend[0].target)); + gcode.process_subcommands_now(TS(F("M600B1R"), thermalManager.degTargetHotend(0))); } } break; @@ -2001,7 +2001,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TEMP_HOTEND: if (draw) { drawMenuItem(row, ICON_SetEndTemp, F("Hotend")); - drawFloat(thermalManager.temp_hotend[0].target, row, false, 1); + drawFloat(thermalManager.degTargetHotend(0), row, false, 1); } else modifyValue(thermalManager.temp_hotend[0].target, MIN_E_TEMP, MAX_E_TEMP, 1); @@ -2011,7 +2011,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TEMP_BED: if (draw) { drawMenuItem(row, ICON_SetBedTemp, F("Bed")); - drawFloat(thermalManager.temp_bed.target, row, false, 1); + drawFloat(thermalManager.degTargetBed(), row, false, 1); } else modifyValue(thermalManager.temp_bed.target, MIN_BED_TEMP, MAX_BED_TEMP, 1); @@ -3835,7 +3835,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TUNE_HOTEND: if (draw) { drawMenuItem(row, ICON_SetEndTemp, F("Hotend")); - drawFloat(thermalManager.temp_hotend[0].target, row, false, 1); + drawFloat(thermalManager.degTargetHotend(0), row, false, 1); } else modifyValue(thermalManager.temp_hotend[0].target, MIN_E_TEMP, MAX_E_TEMP, 1); @@ -3846,7 +3846,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TUNE_BED: if (draw) { drawMenuItem(row, ICON_SetBedTemp, F("Bed")); - drawFloat(thermalManager.temp_bed.target, row, false, 1); + drawFloat(thermalManager.degTargetBed(), row, false, 1); } else modifyValue(thermalManager.temp_bed.target, MIN_BED_TEMP, MAX_BED_TEMP, 1); @@ -3965,7 +3965,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (last_menu) { case ID_Prepare: popupHandler(Popup_FilChange); - gcode.process_subcommands_now(TS(F("M600 B1 R"), thermalManager.temp_hotend[0].target)); + gcode.process_subcommands_now(TS(F("M600 B1 R"), thermalManager.degTargetHotend(0))); break; #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case ID_ChangeFilament: @@ -3984,7 +3984,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case CHANGEFIL_CHANGE: popupHandler(Popup_FilChange); - gcode.process_subcommands_now(TS(F("M600 B1 R"), thermalManager.temp_hotend[0].target)); + gcode.process_subcommands_now(TS(F("M600 B1 R"), thermalManager.degTargetHotend(0))); break; } break; @@ -4008,7 +4008,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case PREHEATHOTEND_CUSTOM: if (draw) { drawMenuItem(row, ICON_Temperature, F("Custom")); - drawFloat(thermalManager.temp_hotend[0].target, row, false, 1); + drawFloat(thermalManager.degTargetHotend(0), row, false, 1); } else modifyValue(thermalManager.temp_hotend[0].target, EXTRUDE_MINTEMP, MAX_E_TEMP, 1); @@ -4531,8 +4531,8 @@ void JyersDWIN::popupControl() { planner.synchronize(); #else queue.inject(F("M25")); - TERN_(HAS_HOTEND, pausetemp = thermalManager.temp_hotend[0].target); - TERN_(HAS_HEATED_BED, pausebed = thermalManager.temp_bed.target); + TERN_(HAS_HOTEND, pausetemp = thermalManager.degTargetHotend(0)); + TERN_(HAS_HEATED_BED, pausebed = thermalManager.degTargetBed()); TERN_(HAS_FAN, pausefan = thermalManager.fan_speed[0]); thermalManager.cooldown(); #endif @@ -4601,7 +4601,7 @@ void JyersDWIN::popupControl() { thermalManager.wait_for_hotend(0); } popupHandler(Popup_FilChange); - gcode.process_subcommands_now(TS(F("M600B1R"), thermalManager.temp_hotend[0].target)); + gcode.process_subcommands_now(TS(F("M600B1R"), thermalManager.degTargetHotend(0))); } } else @@ -4899,20 +4899,20 @@ void JyersDWIN::screenUpdate() { switch (active_menu) { case ID_TempMenu: #if HAS_HOTEND - if (thermalManager.temp_hotend[0].target != hotendtarget) { - hotendtarget = thermalManager.temp_hotend[0].target; + if (thermalManager.degTargetHotend(0) != hotendtarget) { + hotendtarget = thermalManager.degTargetHotend(0); if (scrollpos <= TEMP_HOTEND && TEMP_HOTEND <= scrollpos + MROWS) { if (process != Proc_Value || selection != TEMP_HOTEND - scrollpos) - drawFloat(thermalManager.temp_hotend[0].target, TEMP_HOTEND - scrollpos, false, 1); + drawFloat(hotendtarget, TEMP_HOTEND - scrollpos, false, 1); } } #endif #if HAS_HEATED_BED - if (thermalManager.temp_bed.target != bedtarget) { - bedtarget = thermalManager.temp_bed.target; + if (thermalManager.degTargetBed() != bedtarget) { + bedtarget = thermalManager.degTargetBed(); if (scrollpos <= TEMP_BED && TEMP_BED <= scrollpos + MROWS) { if (process != Proc_Value || selection != TEMP_HOTEND - scrollpos) - drawFloat(thermalManager.temp_bed.target, TEMP_BED - scrollpos, false, 1); + drawFloat(bedtarget, TEMP_BED - scrollpos, false, 1); } } #endif @@ -4921,27 +4921,27 @@ void JyersDWIN::screenUpdate() { fanspeed = thermalManager.fan_speed[0]; if (scrollpos <= TEMP_FAN && TEMP_FAN <= scrollpos + MROWS) { if (process != Proc_Value || selection != TEMP_HOTEND - scrollpos) - drawFloat(thermalManager.fan_speed[0], TEMP_FAN - scrollpos, false, 1); + drawFloat(fanspeed, TEMP_FAN - scrollpos, false, 1); } } #endif break; case ID_Tune: #if HAS_HOTEND - if (thermalManager.temp_hotend[0].target != hotendtarget) { - hotendtarget = thermalManager.temp_hotend[0].target; + if (thermalManager.degTargetHotend(0) != hotendtarget) { + hotendtarget = thermalManager.degTargetHotend(0); if (scrollpos <= TUNE_HOTEND && TUNE_HOTEND <= scrollpos + MROWS) { if (process != Proc_Value || selection != TEMP_HOTEND - scrollpos) - drawFloat(thermalManager.temp_hotend[0].target, TUNE_HOTEND - scrollpos, false, 1); + drawFloat(hotendtarget, TUNE_HOTEND - scrollpos, false, 1); } } #endif #if HAS_HEATED_BED - if (thermalManager.temp_bed.target != bedtarget) { - bedtarget = thermalManager.temp_bed.target; + if (thermalManager.degTargetBed() != bedtarget) { + bedtarget = thermalManager.degTargetBed(); if (scrollpos <= TUNE_BED && TUNE_BED <= scrollpos + MROWS) { if (process != Proc_Value || selection != TEMP_HOTEND - scrollpos) - drawFloat(thermalManager.temp_bed.target, TUNE_BED - scrollpos, false, 1); + drawFloat(bedtarget, TUNE_BED - scrollpos, false, 1); } } #endif @@ -4950,7 +4950,7 @@ void JyersDWIN::screenUpdate() { fanspeed = thermalManager.fan_speed[0]; if (scrollpos <= TUNE_FAN && TUNE_FAN <= scrollpos + MROWS) { if (process != Proc_Value || selection != TEMP_HOTEND - scrollpos) - drawFloat(thermalManager.fan_speed[0], TUNE_FAN - scrollpos, false, 1); + drawFloat(fanspeed, TUNE_FAN - scrollpos, false, 1); } } #endif From dfe61d007e05c84a82b8fb53861c2f5ac59e2dde Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sun, 16 Jul 2023 01:59:00 -0400 Subject: [PATCH 13/39] Fix view mesh range --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index fea1f081f6fe..4fc8a339cbea 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -428,11 +428,13 @@ class TextScroller { } else { float range = _MAX(v_min, v_max); + float range2 = _MIN(v_min, v_max); if (range > 3e+10F) range = 0.0000001; + if (range2 > 3e+10F) range2 = 0.0000001; v1 = -range; - v2 = range; + v2 = range2; } - jyersDWIN.updateStatus(TS(F("Red "), p_float_t(v1, 3) , F("..0.."), p_float_t(v2, 3), F(" Green"))); + jyersDWIN.updateStatus(TS(F("Red "), p_float_t(v1, 3) , F("..0.."), p_float_t(v2, 3), F("+ Green"))); drawing_mesh = false; } From 0444c61cc3804b0bfa5dd7100ae2e1cb1860fe9b Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sun, 16 Jul 2023 02:18:50 -0400 Subject: [PATCH 14/39] Remove asymmetric (unused), same fix with range --- Marlin/Configuration.h | 409 ++++++++++++------- Marlin/Configuration_adv.h | 287 +++++++------ Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp | 18 +- platformio.ini | 2 +- 4 files changed, 436 insertions(+), 280 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c59bbba32a70..4fc6f801d884 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1,6 +1,6 @@ -/** +/** Aquila UBL Mriscoc ProUI * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm @@ -21,6 +21,12 @@ */ #pragma once +// Edited by classicrocker883 for ProUI +// https://github.com/classicrocker883/MriscocProUI + +// Created from Mriscoc's Professional Firmware +// https://github.com/mriscoc/Ender3V2S1 + /** * Configuration.h * @@ -61,14 +67,14 @@ // @section info // Author info of this build printed to the host during boot and M115 -#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. -//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) +#define STRING_CONFIG_H_AUTHOR "Miguel A. Risco-Castillo (MRiscoC)" // Who made the changes. +#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) // @section machine // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_14_EFB + #define MOTHERBOARD BOARD_CREALITY_V427 // BOARD_CREALITY_V427 BOARD_VOXELAB_AQUILA BOARD_CREALITY_V422 #endif /** @@ -79,7 +85,9 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 0 +#define SERIAL_PORT 1 // Ender Configs +#define NO_AUTO_ASSIGN_WARNING // Disable serial warnings +#define NO_MAPLE_WARNING // Disable warning when using Maple env /** * Serial Port Baud Rate @@ -92,9 +100,8 @@ * * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] */ -#define BAUDRATE 250000 - -//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate +#define BAUDRATE 115200 +#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate /** * Select a secondary serial port on the board to use for communication with the host. @@ -112,11 +119,20 @@ //#define SERIAL_PORT_3 1 //#define BAUDRATE_3 250000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE +/** + * Select a serial port to communicate with RS485 protocol + * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] + */ +//#define RS485_SERIAL_PORT 1 +#ifdef RS485_SERIAL_PORT + //#define RS485_BUS_BUFFER_SIZE 128 +#endif + // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH // Name displayed in the LCD "Ready" message and Info menu -//#define CUSTOM_MACHINE_NAME "3D Printer" +#define CUSTOM_MACHINE_NAME "Aquila" // Printer's unique ID, used by some programs to differentiate between machines. // Choose your own or use a service like https://www.uuidgenerator.net/version4 @@ -139,9 +155,9 @@ * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -#define X_DRIVER_TYPE A4988 -#define Y_DRIVER_TYPE A4988 -#define Z_DRIVER_TYPE A4988 +#define X_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs +#define Y_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs +#define Z_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs //#define X2_DRIVER_TYPE A4988 //#define Y2_DRIVER_TYPE A4988 //#define Z2_DRIVER_TYPE A4988 @@ -153,7 +169,7 @@ //#define U_DRIVER_TYPE A4988 //#define V_DRIVER_TYPE A4988 //#define W_DRIVER_TYPE A4988 -#define E0_DRIVER_TYPE A4988 +#define E0_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs //#define E1_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 @@ -548,7 +564,7 @@ #define TEMP_SENSOR_5 0 #define TEMP_SENSOR_6 0 #define TEMP_SENSOR_7 0 -#define TEMP_SENSOR_BED 1 +#define TEMP_SENSOR_BED 1 // Ender Configs #define TEMP_SENSOR_PROBE 0 #define TEMP_SENSOR_CHAMBER 0 #define TEMP_SENSOR_COOLER 0 @@ -610,7 +626,7 @@ // Below this temperature the heater will be switched off // because it probably indicates a broken thermistor wire. -#define HEATER_0_MINTEMP 5 +#define HEATER_0_MINTEMP 0 // Ender Configs #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 @@ -618,7 +634,7 @@ #define HEATER_5_MINTEMP 5 #define HEATER_6_MINTEMP 5 #define HEATER_7_MINTEMP 5 -#define BED_MINTEMP 5 +#define BED_MINTEMP 0 // Ender Configs #define CHAMBER_MINTEMP 5 // Above this temperature the heater will be switched off. @@ -632,7 +648,7 @@ #define HEATER_5_MAXTEMP 275 #define HEATER_6_MAXTEMP 275 #define HEATER_7_MAXTEMP 275 -#define BED_MAXTEMP 150 +#define BED_MAXTEMP 120 // Ender3V2 Configs #define CHAMBER_MAXTEMP 60 /** @@ -676,9 +692,10 @@ #define DEFAULT_Ki_LIST { 1.08, 1.08 } #define DEFAULT_Kd_LIST { 114.00, 114.00 } #else - #define DEFAULT_Kp 22.20 - #define DEFAULT_Ki 1.08 - #define DEFAULT_Kd 114.00 +//50w Aquila + #define DEFAULT_Kp 13.19 + #define DEFAULT_Ki 0.77 + #define DEFAULT_Kd 56.05 #endif #else #define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current @@ -694,8 +711,8 @@ */ #if ENABLED(MPCTEMP) #define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~6.3K bytes of flash) - //#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash) - //#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash) + #define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash) + #define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash) #define MPC_MAX 255 // (0..255) Current to nozzle while MPC is active. #define MPC_HEATER_POWER { 40.0f } // (W) Heat cartridge powers. @@ -758,7 +775,7 @@ * * With this option disabled, bang-bang will be used. BED_LIMIT_SWITCHING enables hysteresis. */ -//#define PIDTEMPBED +#define PIDTEMPBED #if ENABLED(PIDTEMPBED) //#define MIN_BED_POWER 0 @@ -766,9 +783,9 @@ // 120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) // from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) - #define DEFAULT_bedKp 10.00 - #define DEFAULT_bedKi .023 - #define DEFAULT_bedKd 305.4 + #define DEFAULT_bedKp 128.06 + #define DEFAULT_bedKi 24.95 + #define DEFAULT_bedKd 438.07 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #else @@ -826,8 +843,8 @@ #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash) - //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash) + #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash) + #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash) #endif // @section safety @@ -840,14 +857,14 @@ * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** */ #define PREVENT_COLD_EXTRUSION -#define EXTRUDE_MINTEMP 170 +#define EXTRUDE_MINTEMP 180 // MRiscoC Customizable by menu /** * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. * Note: For Bowden Extruders make this large enough to allow load/unload. */ #define PREVENT_LENGTHY_EXTRUDE -#define EXTRUDE_MAXLENGTH 200 +#define EXTRUDE_MAXLENGTH 1000 //=========================================================================== //======================== Thermal Runaway Protection ======================= @@ -868,8 +885,8 @@ #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed -#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber -#define THERMAL_PROTECTION_COOLER // Enable thermal protection for the laser cooling +//#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber +//#define THERMAL_PROTECTION_COOLER // Enable thermal protection for the laser cooling //=========================================================================== //============================= Mechanical Settings ========================= @@ -1175,7 +1192,7 @@ // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. -//#define ENDSTOP_INTERRUPTS_FEATURE +#define ENDSTOP_INTERRUPTS_FEATURE // Ender Configs /** * Endstop Noise Threshold @@ -1219,18 +1236,23 @@ * Override with M92 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 } +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } + +//#define LIMITED_MAX_STEPS_EDITING +#if ENABLED(LIMITED_MAX_STEPS_EDITING) + #define MAX_STEPS_EDIT_VALUES { 200, 200, 2000, 2000 } +#endif /** * Default Max Feed Rate (linear=mm/s, rotational=°/s) * Override with M203 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } +#define DEFAULT_MAX_FEEDRATE { 800, 800, 18, 120 } //#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 #if ENABLED(LIMITED_MAX_FR_EDITING) - #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits + #define MAX_FEEDRATE_EDIT_VALUES { 1000, 1000, 40, 200 } // ...or, set your own edit limits // MRiscoC allows higher limits #endif /** @@ -1239,11 +1261,11 @@ * Override with M201 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } +#define DEFAULT_MAX_ACCELERATION { 800, 800, 120, 1200 } //#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 #if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 300, 9000 } // ...or, set your own edit limits #endif /** @@ -1253,10 +1275,16 @@ * M204 P Acceleration * M204 R Retract Acceleration * M204 T Travel Acceleration + * M204 I Angular Acceleration + * M204 J Angular Travel Acceleration */ -#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves +#define DEFAULT_ACCELERATION 800 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 800 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves +#if ENABLED(AXIS4_ROTATES) + #define DEFAULT_ANGULAR_ACCELERATION 3000 // I, J, K acceleration for rotational-only printing moves + #define DEFAULT_ANGULAR_TRAVEL_ACCELERATION 3000 // I, J, K acceleration for rotational-only travel (non printing) moves +#endif /** * Default Jerk limits (mm/s) @@ -1266,11 +1294,11 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -//#define CLASSIC_JERK +#define CLASSIC_JERK #if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 - #define DEFAULT_ZJERK 0.3 + #define DEFAULT_ZJERK 0.4 //#define DEFAULT_IJERK 0.3 //#define DEFAULT_JJERK 0.3 //#define DEFAULT_KJERK 0.3 @@ -1282,7 +1310,7 @@ //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 #if ENABLED(LIMITED_JERK_EDITING) - #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits + #define MAX_JERK_EDIT_VALUES { 20, 20, 1, 20 } // ...or, set your own edit limits #endif #endif @@ -1309,7 +1337,7 @@ * * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained */ -//#define S_CURVE_ACCELERATION +#define S_CURVE_ACCELERATION //=========================================================================== //============================= Z Probe Options ============================= @@ -1325,10 +1353,10 @@ * The probe replaces the Z-MIN endstop and is used for Z homing. * (Automatically enables USE_PROBE_FOR_Z_HOMING.) */ -#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN +//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN // Probe connected to BLTouch port // Force the use of the probe for Z-axis homing -//#define USE_PROBE_FOR_Z_HOMING +#define USE_PROBE_FOR_Z_HOMING // Manual mesh not have a probe /** * Z_MIN_PROBE_PIN @@ -1343,7 +1371,7 @@ * - Normally-closed (NC) also connect to GND. * - Normally-open (NO) also connect to 5V. */ -//#define Z_MIN_PROBE_PIN -1 +//#define Z_MIN_PROBE_PIN PB1 // Pin 32 is the RAMPS default /** * Probe Type @@ -1357,7 +1385,7 @@ * Use G29 repeatedly, adjusting the Z height at each point with movement commands * or (with LCD_BED_LEVELING) the LCD controller. */ -//#define PROBE_MANUALLY +//#define PROBE_MANUALLY // Manual mesh version /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -1385,7 +1413,7 @@ /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ -//#define BLTOUCH +#define BLTOUCH // 3D/CR/BLTouch version /** * MagLev V4 probe by MDD @@ -1537,26 +1565,26 @@ * | [-] | * O-- FRONT --+ */ -#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } +#define NOZZLE_TO_PROBE_OFFSET { -45.0, -7.0, 0 } // Enable and set to use a specific tool for probing. Disable to allow any tool. -#define PROBING_TOOL 0 +//#define PROBING_TOOL 0 #ifdef PROBING_TOOL //#define PROBE_TOOLCHANGE_NO_MOVE // Suppress motion on probe tool-change #endif // Most probes should stay away from the edges of the bed, but // with NOZZLE_AS_PROBE this can be negative for a wider probing area. -#define PROBING_MARGIN 10 +#define PROBING_MARGIN 0 // X and Y axis travel speed (mm/min) between probes -#define XY_PROBE_FEEDRATE (133*60) +#define XY_PROBE_FEEDRATE (180*60) // Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2) -#define Z_PROBE_FEEDRATE_FAST (4*60) +#define Z_PROBE_FEEDRATE_FAST (8*60) // Feedrate (mm/min) for the "accurate" probe of each point -#define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2) +#define Z_PROBE_FEEDRATE_SLOW (150) //(Z_PROBE_FEEDRATE_FAST * 0.3125) /** * Probe Activation Switch @@ -1603,7 +1631,7 @@ * A total of 2 does fast/slow probes with a weighted average. * A total of 3 or more adds more slow probes, taking the average. */ -//#define MULTIPLE_PROBING 2 +#define MULTIPLE_PROBING 2 // Use a value of (0) with ProUIex, otherwise (2) //#define EXTRA_PROBING 1 /** @@ -1632,7 +1660,7 @@ #define Z_PROBE_OFFSET_RANGE_MAX 20 // Enable the M48 repeatability test to test probe accuracy -//#define Z_MIN_PROBE_REPEATABILITY_TEST +#define Z_MIN_PROBE_REPEATABILITY_TEST // Before deploy/stow pause for user confirmation //#define PAUSE_BEFORE_DEPLOY_STOW @@ -1701,8 +1729,8 @@ // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR false -#define INVERT_Y_DIR true -#define INVERT_Z_DIR false +#define INVERT_Y_DIR false +#define INVERT_Z_DIR true //#define INVERT_I_DIR false //#define INVERT_J_DIR false //#define INVERT_K_DIR false @@ -1725,19 +1753,19 @@ // @section homing //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed. Also enable HOME_AFTER_DEACTIVATE for extra safety. -//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety. +#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety. /** * Set Z_IDLE_HEIGHT if the Z-Axis moves on its own when steppers are disabled. * - Use a low value (i.e., Z_MIN_POS) if the nozzle falls down to the bed. * - Use a large value (i.e., Z_MAX_POS) if the bed falls down, away from the nozzle. */ -//#define Z_IDLE_HEIGHT Z_HOME_POS +#define Z_IDLE_HEIGHT Z_HOME_POS -//#define Z_CLEARANCE_FOR_HOMING 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... - // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding. +#define Z_CLEARANCE_FOR_HOMING 5 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding. -//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing (if Z was homed) +//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing Z // Direction of endstops when homing; 1=MAX, -1=MIN // :[-1,1] @@ -1754,16 +1782,16 @@ // @section geometry // The size of the printable area -#define X_BED_SIZE 200 -#define Y_BED_SIZE 200 +#define X_BED_SIZE 220 // MRiscoC Max usable bed size +#define Y_BED_SIZE 220 // MRiscoC Max usable bed size // Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions. -#define X_MIN_POS 0 -#define Y_MIN_POS 0 +#define X_MIN_POS 0 // MRiscoC Stock physical limit +#define Y_MIN_POS 0 // MRiscoC Stock physical limit #define Z_MIN_POS 0 -#define X_MAX_POS X_BED_SIZE -#define Y_MAX_POS Y_BED_SIZE -#define Z_MAX_POS 200 +#define X_MAX_POS 230 // MRiscoC Stock physical limit +#define Y_MAX_POS 220 // MRiscoC Stock physical limit +#define Z_MAX_POS 250 // Ender Configs //#define I_MIN_POS 0 //#define I_MAX_POS 50 //#define J_MIN_POS 0 @@ -1831,12 +1859,12 @@ * RAMPS-based boards use SERVO3_PIN for the first runout sensor. * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. */ -//#define FILAMENT_RUNOUT_SENSOR +#define FILAMENT_RUNOUT_SENSOR // MRiscoC Enabled runout sensor support (2528 bytes of flash) #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500. + #define FIL_RUNOUT_ENABLED_DEFAULT false// Enable the sensor on startup. Override with M412 followed by M500. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. - #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present. + #define FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. //#define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder. @@ -1883,7 +1911,7 @@ // After a runout is detected, continue printing this length of filament // before executing the runout script. Useful for a sensor at the end of // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. - //#define FILAMENT_RUNOUT_DISTANCE_MM 25 + #define FILAMENT_RUNOUT_DISTANCE_MM 25 // MRiscoC Customizable by menu #ifdef FILAMENT_RUNOUT_DISTANCE_MM // Enable this option to use an encoder disc that toggles the runout pin @@ -1974,8 +2002,8 @@ */ //#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_LINEAR -//#define AUTO_BED_LEVELING_BILINEAR -//#define AUTO_BED_LEVELING_UBL +//#define AUTO_BED_LEVELING_BILINEAR // MRiscoC BLTouch auto level +#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING /** @@ -1983,15 +2011,15 @@ * these options to restore the prior leveling state or to always enable * leveling immediately after G28. */ -//#define RESTORE_LEVELING_AFTER_G28 +#define RESTORE_LEVELING_AFTER_G28 //#define ENABLE_LEVELING_AFTER_G28 /** * Auto-leveling needs preheating */ -//#define PREHEAT_BEFORE_LEVELING +//#define PREHEAT_BEFORE_LEVELING // MRiscoC Heatting to compensate thermal expansions #if ENABLED(PREHEAT_BEFORE_LEVELING) - #define LEVELING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time + #define LEVELING_NOZZLE_TEMP 175 // (°C) Only applies to E0 at this time // Preheat nozzle without oozing #define LEVELING_BED_TEMP 50 #endif @@ -2027,6 +2055,12 @@ #define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height. #endif + /** + * Add Z offset (M424 Z) that applies to all moves at the planner level. + * This Z offset will be automatically set to the middle value with G29. + */ + //#define GLOBAL_MESH_Z_OFFSET + /** * For Cartesian machines, instead of dividing moves on mesh boundaries, * split up moves into short segments like a Delta. This follows the @@ -2054,8 +2088,10 @@ #if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define GRID_MAX_POINTS_X 3 + #define GRID_MAX_POINTS_X 5 // Don't use more than 9 points per axis, implementation limited #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X + #define MESH_EDIT_MENU // Add a menu to edit mesh points + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -2064,7 +2100,7 @@ // Beyond the probed grid, continue the implied tilt? // Default is to maintain the height of the nearest edge. - //#define EXTRAPOLATE_BEYOND_GRID + //#define EXTRAPOLATE_BEYOND_GRID // MRiscoC Disabled for better accuracy at edges // // Subdivision of the grid by Catmull-Rom method. @@ -2085,12 +2121,13 @@ //=========================================================================== //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh + #define MESH_EDIT_MENU // Add a menu to edit mesh points - #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed - #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 7 // Don't use more than 9 points per axis, implementation limited #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - //#define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points + #define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points //#define UBL_TILT_ON_MESH_POINTS // Use nearest mesh points with G29 J for better Z reference //#define UBL_TILT_ON_MESH_POINTS_3POINT // Use nearest mesh points with G29 J0 (3-point) @@ -2127,9 +2164,10 @@ //=========================================================================== //=================================== Mesh ================================== //=========================================================================== + #define MESH_EDIT_MENU // Add a menu to edit mesh points - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed - #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed // MRiscoC Center mesh + #define GRID_MAX_POINTS_X 5 // Don't use more than 7 points per axis, implementation limited. // MRiscoC Customizable by menu #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS @@ -2149,18 +2187,20 @@ #endif // Add a menu item to move between bed corners for manual bed adjustment -//#define LCD_BED_TRAMMING +#define LCD_BED_TRAMMING #if ENABLED(LCD_BED_TRAMMING) - #define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets #define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at tramming points - #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between tramming points - //#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner - //#define BED_TRAMMING_USE_PROBE + #define BED_TRAMMING_Z_HOP 5.0 // (mm) Z height of nozzle between tramming points + #define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner + #define BED_TRAMMING_USE_PROBE #if ENABLED(BED_TRAMMING_USE_PROBE) - #define BED_TRAMMING_PROBE_TOLERANCE 0.1 // (mm) + #define BED_TRAMMING_INSET_LFRB { 35, 35, 35, 35 } // (mm) Left, Front, Right, Back insets + #define BED_TRAMMING_PROBE_TOLERANCE 0.05f // (mm) #define BED_TRAMMING_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify //#define BED_TRAMMING_AUDIO_FEEDBACK + #else + #define BED_TRAMMING_INSET_LFRB { 25.4, 25.4, 25.4, 25.4 } // (mm) Left, Front, Right, Back insets #endif /** @@ -2181,6 +2221,8 @@ * LF --------- RF LF --------- RF LF --------- RF LF --------- RF */ #define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB } +#else + #define BED_SCREW_INSET 35 // Distance the knob screw is from corners. #endif /** @@ -2213,7 +2255,7 @@ * - Allows Z homing only when XY positions are known and trusted. * - If stepper drivers sleep, XY homing may be required again before Z homing. */ -//#define Z_SAFE_HOMING +#define Z_SAFE_HOMING // MRiscoC Homing Z at center of bed #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing @@ -2222,7 +2264,7 @@ #endif // Homing speeds (linear=mm/min, rotational=°/min) -#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) } +#define HOMING_FEEDRATE_MM_M { (60*60), (60*60), (8*60) } // Validate that endstops are triggered on homing moves #define VALIDATE_HOMING_ENDSTOPS @@ -2298,15 +2340,15 @@ * * M500 - Store settings to EEPROM. * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) - * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) + * M502 - Revert settings to "factory" defaults (Follow with M500 to init the EEPROM.) */ -//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 +#define EEPROM_SETTINGS // Persistent storage with M500 and M501 // Ender Configs //#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release! -#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. 1008 bytes #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #if ENABLED(EEPROM_SETTINGS) - //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. - //#define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build. + #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors // Ender Configs + #define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build // MRiscoC Reset EEPROM on first boot #endif // @section host @@ -2318,7 +2360,7 @@ // every couple of seconds when it can't accept commands. // #define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages -#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. +#define DEFAULT_KEEPALIVE_INTERVAL 5 // Number of seconds between "busy" messages. Set with M113. #define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating // @section units @@ -2339,16 +2381,31 @@ // Preheat Constants - Up to 10 are supported without changes // #define PREHEAT_1_LABEL "PLA" -#define PREHEAT_1_TEMP_HOTEND 180 -#define PREHEAT_1_TEMP_BED 70 -#define PREHEAT_1_TEMP_CHAMBER 35 +#define PREHEAT_1_TEMP_HOTEND 210 +#define PREHEAT_1_TEMP_BED 60 +//#define PREHEAT_1_TEMP_CHAMBER 35 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -#define PREHEAT_2_LABEL "ABS" -#define PREHEAT_2_TEMP_HOTEND 240 -#define PREHEAT_2_TEMP_BED 110 -#define PREHEAT_2_TEMP_CHAMBER 35 -#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 +//#define PREHEAT_2_LABEL "ABS" //PETG +//#define PREHEAT_2_TEMP_HOTEND 240 +//#define PREHEAT_2_TEMP_BED 75 +//#define PREHEAT_2_TEMP_CHAMBER 35 +//#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 + +//#define PREHEAT_3_LABEL "Warmup" +//#define PREHEAT_3_TEMP_HOTEND 200 +//#define PREHEAT_3_TEMP_BED 50 +//#define PREHEAT_3_FAN_SPEED 0 + +//#define PREHEAT_4_LABEL "TPU" +//#define PREHEAT_4_TEMP_HOTEND 230 +//#define PREHEAT_4_TEMP_BED 80 +//#define PREHEAT_4_FAN_SPEED 128 // Value from 0 to 255 + +//#define PREHEAT_5_LABEL "CUSTOM" //NYLON +//#define PREHEAT_5_TEMP_HOTEND 240 +//#define PREHEAT_5_TEMP_BED 60 +//#define PREHEAT_5_FAN_SPEED 128 // @section motion @@ -2363,15 +2420,15 @@ * P1 Raise the nozzle always to Z-park height. * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. */ -//#define NOZZLE_PARK_FEATURE +#define NOZZLE_PARK_FEATURE // MRiscoC Enabled #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } + #define NOZZLE_PARK_POINT { 0, 220, 40 } //changed MRiscoC Customizable by menu #define NOZZLE_PARK_MOVE 0 // Park motion: 0 = XY Move, 1 = X Only, 2 = Y Only, 3 = X before Y, 4 = Y before X - #define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance - #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) - #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) + #define NOZZLE_PARK_Z_RAISE_MIN 5 // (mm) Always raise Z by at least this distance // MRiscoC uses Park Z Raise from 0 to avoid backlash issues + #define NOZZLE_PARK_XY_FEEDRATE 120 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 20 // (mm/s) Z axis feedrate (not used for delta printers) #endif /** @@ -2497,7 +2554,7 @@ * * View the current statistics with M78. */ -//#define PRINTCOUNTER +#define PRINTCOUNTER // MRiscoC Enable Print Statistics #if ENABLED(PRINTCOUNTER) #define PRINTCOUNTER_SAVE_INTERVAL 60 // (minutes) EEPROM save interval during print. A value of 0 will save stats at end of print. #endif @@ -2590,7 +2647,7 @@ * SD Card support is disabled by default. If your controller has an SD slot, * you must uncomment the following option or it won't work. */ -//#define SDSUPPORT +#define SDSUPPORT // Ender Configs /** * SD CARD: ENABLE CRC @@ -2614,13 +2671,13 @@ // This option overrides the default number of encoder pulses needed to // produce one step. Should be increased for high-resolution encoders. // -//#define ENCODER_PULSES_PER_STEP 4 +#define ENCODER_PULSES_PER_STEP 4 // Ender Configs // // Use this option to override the number of step signals required to // move between next/prev menu items. // -//#define ENCODER_STEPS_PER_MENU_ITEM 1 +#define ENCODER_STEPS_PER_MENU_ITEM 1 // Ender Configs /** * Encoder Direction Options @@ -2637,7 +2694,7 @@ // // Set this option if CLOCKWISE causes values to DECREASE // -//#define REVERSE_ENCODER_DIRECTION +#define REVERSE_ENCODER_DIRECTION //Aquila enable -- Ender disable // // This option reverses the encoder direction for navigating LCD menus. @@ -2671,7 +2728,7 @@ // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. // //#define INDIVIDUAL_AXIS_HOMING_MENU -//#define INDIVIDUAL_AXIS_HOMING_SUBMENU +#define INDIVIDUAL_AXIS_HOMING_SUBMENU // // SPEAKER/BUZZER @@ -2688,8 +2745,8 @@ // Note: Test audio output with the G-Code: // M300 S P // -//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 -//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 +#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +#define LCD_FEEDBACK_FREQUENCY_HZ 5000 // // Tone queue size, used to keep beeps from blocking execution. @@ -2974,19 +3031,6 @@ // //#define BTT_MINI_12864_V1 -// -// Factory display for Creality CR-10 / CR-7 / Ender-3 -// https://www.aliexpress.com/item/32833148327.html -// -// Connect to EXP1 on RAMPS and compatible boards. -// -//#define CR10_STOCKDISPLAY - -// -// Ender-2 OEM display, a variant of the MKS_MINI_12864 -// -//#define ENDER2_STOCKDISPLAY - // // ANET and Tronxy Graphical Controller // @@ -3112,6 +3156,9 @@ * - Download https://github.com/CrealityOfficial/Ender-3S1/archive/3S1_Plus_Screen.zip * - Copy the downloaded DWIN_SET folder to the SD card. * + * CREALITY_TOUCH + * - CR-6 OEM touch screen. A DWIN display with touch. + * * Flash display with DGUS Displays for Marlin: * - Format the SD card to FAT32 with an allocation size of 4kb. * - Download files as specified for your type of display. @@ -3162,6 +3209,12 @@ // //#define NEXTION_TFT +// +// PanelDue touch controller by Escher3D +// http://escher3d.com/pages/order/products/product2.php +// +//#define PANELDUE + // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extui'. @@ -3323,15 +3376,83 @@ //============================================================================= //============================ Other Controllers ============================ //============================================================================= +//@section proui // // Ender-3 v2 OEM display. A DWIN display with Rotary Encoder. // -//#define DWIN_CREALITY_LCD // Creality UI -//#define DWIN_LCD_PROUI // Pro UI by MRiscoC -//#define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers -//#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation) -//#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation) +// DWIN / DACAI LCD 4.3" 480x272 + +#define DWIN_CREALITY_LCD_JYERSUI // Pro UI by MRiscoC +#define USE_STOCK_DWIN_SET // Enabled ? 9.ICO : 7.ICO | in DWIN_SET +//#define HAS_DACAI 1 + +#if ENABLED(DWIN_LCD_PROUI) +// Professional firmware features: + #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) + #ifdef PROUI_EX + #define HAS_GCODE_PREVIEW 1 + #define HAS_TOOLBAR 1 + #endif + #define DISABLE_TUNING_GRAPH 0// Graph Temp as grid plot - PID/MPC Tuning (1624 bytes of flash) + #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) + #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) + #define HAS_LOCKSCREEN 1 // Simple lockscreen as to not accidentally change something (568 bytes of flash) + #define HAS_SD_EXTENDER 1 // Enable to support SD card extender cables (48 bytes of flash) + #define USE_GRID_MESHVIEWER 1 // Enable two mesh graph types : one (1728 bytes of flash) + #define HAS_CUSTOM_COLORS 1 // Able to change display colors (2040 bytes of flash) + #define ALT_COLOR_MENU 0 // Color palette options >> 0 = Voxelab Default | 1 = Alternate Aquila | 2 = Ender3V2 Default + #if ENABLED(AUTO_BED_LEVELING_UBL) + #define ACTIVATE_MESH_ITEM // Active Mesh Leveling menu option (152 bytes of flash) + #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) // (2528 bytes of flash) + #define RUNOUT_TUNE_ITEM // Filament Runout option in Tune Menu + #endif + #if ENABLED(POWER_LOSS_RECOVERY) // (3400 bytes of flash) + #define PLR_TUNE_ITEM // Power-loss Recovery option in Tune Menu + #endif + #if ENABLED(BLTOUCH) + #define HS_MENU_ITEM // BLTOUCH_HS_MODE menu option (56 bytes of flash) + #endif + #if DISABLED(DISABLE_TUNING_GRAPH) + #define PLOT_TUNE_ITEM // Temperature Plot Graph item in Tune Menu (688 bytes of flash) + #endif + #if DISABLED(CLASSIC_JERK) + //#define JD_TUNE_ITEM // Enable only if Juntion Deviation is enabled + #endif + #if ENABLED(LIN_ADVANCE) + #define ADVK_TUNE_ITEM // Linear Advance item in Tune Menu + #endif + #define SHOW_REAL_POS + #define CCLOUD_PRINT_SUPPORT // Menu item: enable/disable Creality Cloud Print Support (192 bytes of flash) + #define TRAMWIZ_MENU_ITEM // Menu item: enable Tramming Wizard (2304 bytes of flash) + #define MEDIASORT_MENU_ITEM // Menu item: enable/disable file list sorting (104 bytes of flash) + //#define ENC_MENU_ITEM // Menu item: faster/slower encoder rate (272 bytes of flash) + #define SHOW_SPEED_IND // Menu item: blink speed in mm/s along with speed percentage (296 bytes of flash) + //#define NO_BLINK_IND // Disables dashboard icon blink indicator highlighted background + +#endif + +// +// Factory display for Creality CR-10 / CR-7 / Ender-3 +// https://www.aliexpress.com/item/32833148327.html +// +// This is RAMPS-compatible using a single 10-pin connector. +// +// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) +// Connect to EXP1 on RAMPS and compatible boards. +// 2.4" 128x64 LCD +// + +//#define CR10_STOCKDISPLAY //For Ender-3 / Aquila C2 blue/white monochrome LCD +#if ENABLED(CR10_STOCKDISPLAY) //BTT_SKR_MINI_E3 + #define RET6_12864_LCD +#endif + +// +// Ender-2 OEM display, a variant of the MKS_MINI_12864 +// +//#define ENDER2_STOCKDISPLAY // // Touch Screen Settings @@ -3386,7 +3507,7 @@ // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. -//#define FAN_SOFT_PWM +#define FAN_SOFT_PWM // Ender Configs // Incrementing this by 1 will double the software PWM frequency, // affecting heaters, and the fan if FAN_SOFT_PWM is enabled. @@ -3468,7 +3589,7 @@ #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc. // See https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.h - //#define NEOPIXEL_PIN 4 // LED driving pin + #define NEOPIXEL_PIN PA13 // LED driving pin //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE //#define NEOPIXEL2_PIN 5 #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b1fde0a45d5f..fe77020b1758 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1,6 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm @@ -21,6 +21,9 @@ */ #pragma once +// Created by configs generator for Professional firmware +// https://github.com/mriscoc/Ender3V2S1 + /** * Configuration_adv.h * @@ -335,7 +338,7 @@ * Thermal Protection parameters for the bed are just as above for hotends. */ #if ENABLED(THERMAL_PROTECTION_BED) - #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds + #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius /** @@ -547,9 +550,9 @@ * Hotend Idle Timeout * Prevent filament in the nozzle from charring and causing a critical jam. */ -//#define HOTEND_IDLE_TIMEOUT +#define HOTEND_IDLE_TIMEOUT // MRiscoC Disable heaters after timeout #if ENABLED(HOTEND_IDLE_TIMEOUT) - #define HOTEND_IDLE_TIMEOUT_SEC (5*60) // (seconds) Time without extruder movement to trigger protection + #define HOTEND_IDLE_TIMEOUT_SEC (6*60) // (seconds) Time without extruder movement to trigger protection #define HOTEND_IDLE_MIN_TRIGGER 180 // (°C) Minimum temperature to enable hotend protection #define HOTEND_IDLE_NOZZLE_TARGET 0 // (°C) Safe temperature for the nozzle after timeout #define HOTEND_IDLE_BED_TARGET 0 // (°C) Safe temperature for the bed after timeout @@ -618,7 +621,7 @@ * * Define one or both of these to override the default 0-255 range. */ -//#define FAN_MIN_PWM 50 +#define FAN_MIN_PWM 50 // Ender Configs //#define FAN_MAX_PWM 128 /** @@ -681,7 +684,7 @@ * Multiple extruders can be assigned to the same pin in which case * the fan will turn on when any selected extruder is above the threshold. */ -#define E0_AUTO_FAN_PIN -1 +#define E0_AUTO_FAN_PIN -1 // Ender3V2 Configs #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 @@ -924,7 +927,7 @@ //#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing //#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa -//#define QUICK_HOME // If G28 contains XY do a diagonal move first +#define QUICK_HOME // If G28 contains XY do a diagonal move first //#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X //#define HOME_Z_FIRST // Home Z first. Requires a real endstop (not a probe). //#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first @@ -949,7 +952,7 @@ // Safety: The probe needs time to recognize the command. // Minimum command delay (ms). Enable and increase if needed. - //#define BLTOUCH_DELAY 500 + #define BLTOUCH_DELAY 200 /** * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: @@ -996,7 +999,7 @@ * * Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset. */ - //#define BLTOUCH_HS_MODE true + #define BLTOUCH_HS_MODE true #ifdef BLTOUCH_HS_MODE // The probe Z offset (M851 Z) is the height at which the probe triggers. @@ -1079,7 +1082,7 @@ #if ENABLED(ASSISTED_TRAMMING) // Define from 3 to 9 points to probe. - #define TRAMMING_POINT_XY { { 20, 20 }, { 180, 20 }, { 180, 180 }, { 20, 180 } } + #define TRAMMING_POINT_XY { { 29, 29 }, { 199, 29 }, { 199, 199 }, { 29, 199 } } // Define position names for probe points. #define TRAMMING_POINT_NAME_1 "Front-Left" @@ -1100,7 +1103,7 @@ * M4: 40 = Clockwise, 41 = Counter-Clockwise * M5: 50 = Clockwise, 51 = Counter-Clockwise */ - #define TRAMMING_SCREW_THREAD 30 + #define TRAMMING_SCREW_THREAD 40 #endif @@ -1124,7 +1127,7 @@ /** * Advanced configuration */ - #define FTM_BATCH_SIZE 100 // Batch size for trajectory generation; + #define FTM_BATCH_SIZE 100 // Batch size for trajectory generation. #define FTM_WINDOW_SIZE 200 // Window size for trajectory generation. #define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (1 / FTM_TS) #define FTM_TS 0.001f // (s) Time step for trajectory generation. (1 / FTM_FS) @@ -1186,7 +1189,7 @@ #endif //#define SHAPING_MIN_FREQ 20 // By default the minimum of the shaping frequencies. Override to affect SRAM usage. //#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage. - //#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters. + #define SHAPING_MENU // Add a menu to the LCD to set shaping parameters. #endif // @section motion @@ -1213,7 +1216,7 @@ * Enable DISABLE_IDLE_* to shut down axis steppers after an idle period. * The default timeout duration can be overridden with M18 and M84. Set to 0 for No Timeout. */ -#define DEFAULT_STEPPER_TIMEOUT_SEC 120 +#define DEFAULT_STEPPER_TIMEOUT_SEC 360 #define DISABLE_IDLE_X #define DISABLE_IDLE_Y #define DISABLE_IDLE_Z // Disable if the nozzle could fall onto your printed part! @@ -1226,17 +1229,21 @@ #define DISABLE_IDLE_E // Shut down all idle extruders // Default Minimum Feedrates for printing and travel moves -#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum feedrate. Set with M205 S. -#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum travel feedrate. Set with M205 T. +#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S. +#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T. +#if HAS_ROTATIONAL_AXES + #define DEFAULT_ANGULAR_MINIMUMFEEDRATE 0.0 // (°/s) Minimum feedrate for rotational-only moves. Set with M205 P. + #define DEFAULT_ANGULAR_MINTRAVELFEEDRATE 0.0 // (°/s) Minimum travel feedrate for rotational-only moves. Set with M205 Q. +#endif // Minimum time that a segment needs to take as the buffer gets emptied -#define DEFAULT_MINSEGMENTTIME 20000 // (µs) Set with M205 B. +#define DEFAULT_MINSEGMENTTIME 50000 // (µs) Set with M205 B. // Slow down the machine if the lookahead buffer is (by default) half full. // Increase the slowdown divisor for larger buffer sizes. #define SLOWDOWN #if ENABLED(SLOWDOWN) - #define SLOWDOWN_DIVISOR 2 + #define SLOWDOWN_DIVISOR 4 #endif /** @@ -1365,6 +1372,7 @@ * This allows higher feedrates than the MCU could otherwise support. */ #define MULTISTEPPING_LIMIT 16 //: [1, 2, 4, 8, 16, 32, 64, 128] +#define OLD_ADAPTIVE_MULTISTEPPING 1 /** * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies @@ -1372,7 +1380,7 @@ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the * lowest stepping frequencies. */ -//#define ADAPTIVE_STEP_SMOOTHING +#define ADAPTIVE_STEP_SMOOTHING /** * Custom Microstepping @@ -1447,7 +1455,7 @@ // @section lcd #if HAS_MANUAL_MOVE_MENU - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel + #define MANUAL_FEEDRATE { 60*60, 60*60, 8*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel #define FINE_MANUAL_MOVE 0.025 // (mm) Smallest manual move (< 0.1mm) applying to Z on most machines #if IS_ULTIPANEL #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" @@ -1458,8 +1466,9 @@ // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) - #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed - #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed + #define ENCODER_5X_STEPS_PER_SEC 40 // (steps/s) Encoder rate for 5x speed + #define ENCODER_10X_STEPS_PER_SEC 70 // (steps/s) Encoder rate for 10x speed // Ender Configs + #define ENCODER_100X_STEPS_PER_SEC 110 // (steps/s) Encoder rate for 100x speed // Ender Configs #endif // Play a beep when the feedrate is changed from the Status Screen @@ -1543,15 +1552,15 @@ */ #define SHOW_BOOTSCREEN // Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** #if ENABLED(SHOW_BOOTSCREEN) - #define BOOTSCREEN_TIMEOUT 3000 // (ms) Total Duration to display the boot screen(s) + #define BOOTSCREEN_TIMEOUT 1100 // (ms) Total Duration to display the boot screen(s) #if ANY(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI) - #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash) + //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash) #endif #if HAS_MARLINUI_U8GLIB //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash. #endif #if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE) - //#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup. + #define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup. #endif #endif @@ -1559,17 +1568,18 @@ //#define CUSTOM_STATUS_SCREEN_IMAGE // Show the bitmap in Marlin/_Statusscreen.h on the status screen. #endif - //#define SOUND_MENU_ITEM // Add a mute option to the LCD menu + #define SOUND_MENU_ITEM // Add a mute option to the LCD menu #define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state + //#define TICK_ON_DEFAULT // Beep/Tick default enabled state // The timeout to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 // (ms) // Scroll a longer status message into view - //#define STATUS_MESSAGE_SCROLLING + #define STATUS_MESSAGE_SCROLLING // MRiscoC Allow scrolling of large status messages // Apply a timeout to low-priority status messages - //#define STATUS_MESSAGE_TIMEOUT_SEC 30 // (seconds) + #define STATUS_MESSAGE_TIMEOUT_SEC 45 // (seconds) // MRiscoC Enable Status Message Timeout // On the Info Screen, display XY with one decimal place when possible //#define LCD_DECIMAL_SMALL_XY @@ -1580,6 +1590,9 @@ // Display a negative temperature instead of "err" //#define SHOW_TEMPERATURE_BELOW_ZERO + // Change Title Menu Text to Centered + #define TITLE_CENTERED + /** * LED Control Menu * Add LED Control to the LCD menu @@ -1609,14 +1622,14 @@ #endif // HAS_DISPLAY // Add 'M73' to set print job progress, overrides Marlin's built-in estimate -//#define SET_PROGRESS_MANUALLY +#define SET_PROGRESS_MANUALLY // MRiscoC Allow display feedback of host printing through GCode M73 #if ENABLED(SET_PROGRESS_MANUALLY) - #define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done - #define SET_REMAINING_TIME // Add 'R' parameter to set remaining time + #define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done // MRiscoC Allow display feedback of host printing through GCode M73 + #define SET_REMAINING_TIME // Add 'R' parameter to set remaining time // MRiscoC Allow display feedback of host printing through GCode M73 //#define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction - //#define M73_REPORT // Report M73 values to host + #define M73_REPORT // Report M73 values to host #if ALL(M73_REPORT, HAS_MEDIA) - #define M73_REPORT_SD_ONLY // Report only when printing from SD + //#define M73_REPORT_SD_ONLY // Report only when printing from SD #endif #endif @@ -1624,7 +1637,7 @@ #if HAS_DISPLAY && ANY(HAS_MEDIA, SET_PROGRESS_MANUALLY) #define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar) #define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E') - //#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') + #define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') #if ENABLED(SET_INTERACTION_TIME) #define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change) #endif @@ -1663,7 +1676,7 @@ //#define GCODE_REPEAT_MARKERS // Enable G-code M808 to set repeat markers and do looping - #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls + #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls // MRiscoC save program memory #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished #define SD_FINISHED_RELEASECOMMAND "M84" // Use "M84XYE" to keep Z enabled so your bed stays in place @@ -1682,7 +1695,7 @@ //#define MEDIA_MENU_AT_TOP // Force the media menu to be listed on the top of the main menu - #define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27") + #define EVENT_GCODE_SD_ABORT "G27 P2" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27") #if ENABLED(PRINTER_EVENT_LEDS) #define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination @@ -1696,7 +1709,7 @@ * an option on the LCD screen to continue the print from the last-known * point in the file. */ - //#define POWER_LOSS_RECOVERY + //#define POWER_LOSS_RECOVERY // (3400 bytes of flash) #if ENABLED(POWER_LOSS_RECOVERY) #define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss @@ -1742,17 +1755,17 @@ * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) */ - //#define SDCARD_SORT_ALPHA + #define SDCARD_SORT_ALPHA // Ender Configs // SD Card Sorting options #if ENABLED(SDCARD_SORT_ALPHA) - #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define SDSORT_LIMIT 80 // Maximum number of sorted items (10-256). Costs 27 bytes each. #define FOLDER_SORTING -1 // -1=above 0=none 1=below - #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code. - #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. + #define SDSORT_GCODE true // Allow turning sorting on/off with LCD and M34 G-code. // MRiscoC Allows disable file sort by M34 g-code + #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. // Ender Configs #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) - #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. - #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! + #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. // Ender Configs + #define SDSORT_DYNAMIC_RAM true // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! // Ender Configs #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif @@ -1761,13 +1774,13 @@ // LCD's font must contain the characters. Check your selected LCD language. //#define UTF_FILENAME_SUPPORT - //#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 ' and list long filenames with 'M20 L' - //#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol - //#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands + #define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 ' and list long filenames with 'M20 L' // MRiscoC Enabled + #define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol // MRiscoC Enabled + //#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands - //#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu + #define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu // MRiscoC Enabled - //#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!) /** * Abort SD printing when any endstop is triggered. @@ -1850,11 +1863,11 @@ //#define CONFIGURATION_EMBEDDING // Add an optimized binary file transfer mode, initiated with 'M28 B1' - //#define BINARY_FILE_TRANSFER + //#define BINARY_FILE_TRANSFER // MRiscoC Enabled for easy firmware upgrade #if ENABLED(BINARY_FILE_TRANSFER) // Include extra facilities (e.g., 'M20 F') supporting firmware upload via BINARY_FILE_TRANSFER - //#define CUSTOM_FIRMWARE_UPLOAD + //#define CUSTOM_FIRMWARE_UPLOAD // MRiscoC Enabled for easy firmware upgrade #endif /** @@ -1891,6 +1904,15 @@ */ //#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). +/** + * By default the framework is responsible for the shared media I/O. + * Enable this if you need Marlin to take care of the shared media I/O. + * Useful if shared media isn't working properly on some boards. + */ +#if HAS_MEDIA && DISABLED(NO_SD_HOST_DRIVE) + //#define DISKIO_HOST_DRIVE +#endif + /** * Additional options for Graphical Displays * @@ -2204,16 +2226,16 @@ * * Warning: Does not respect endstops! */ -//#define BABYSTEPPING +#define BABYSTEPPING // Ender Configs #if ENABLED(BABYSTEPPING) //#define INTEGRATED_BABYSTEPPING // Integration of babystepping into the Stepper ISR - //#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support - //#define BABYSTEP_WITHOUT_HOMING - //#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement) + //#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support + #define BABYSTEP_WITHOUT_HOMING // MRiscoC Enabled BbS without home + #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement) // MRiscoC Active BbS always //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! //#define BABYSTEP_INVERT_Z // Enable if Z babysteps should go the other way //#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps - #define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep + #define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep // Ender Configs 40 #define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. @@ -2228,10 +2250,16 @@ //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 - //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + #ifdef BLTOUCH + #define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + //#define BABYSTEP_GLOBAL_Z // Combine M424 Z and Babystepping + + #if ANY(BABYSTEP_ZPROBE_OFFSET, BABYSTEP_GLOBAL_Z) + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets + #endif //#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor + #endif #endif #endif @@ -2252,16 +2280,16 @@ * * See https://marlinfw.org/docs/features/lin_advance.html for full instructions. */ -//#define LIN_ADVANCE +#define LIN_ADVANCE #if ENABLED(LIN_ADVANCE) #if ENABLED(DISTINCT_E_FACTORS) - #define ADVANCE_K { 0.22 } // (mm) Compression length per 1mm/s extruder speed, per extruder + #define ADVANCE_K { 0.00 } // (mm) Compression length per 1mm/s extruder speed, per extruder #else - #define ADVANCE_K 0.22 // (mm) Compression length applying to all extruders + #define ADVANCE_K 0.00 // (mm) Compression length applying to all extruders #endif //#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L. //#define LA_DEBUG // Print debug information to serial during operation. Disable for production use. - //#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends. + #define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends. //#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz. #endif @@ -2431,7 +2459,7 @@ #define MIN_CIRCLE_SEGMENTS 72 // Minimum number of segments in a complete circle //#define ARC_SEGMENTS_PER_SEC 50 // Use the feedrate to choose the segment length #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections - //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles + #define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles // MRiscoC Enabled //#define SF_ARC_FIX // Enable only if using SkeinForge with "Arc Point" fillet procedure #endif @@ -2466,7 +2494,7 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 6 +#define MIN_STEPS_PER_SEGMENT 4 // MRiscoC Increase little movements accuracy /** * Minimum delay before and after setting the stepper DIR (in ns) @@ -2525,18 +2553,18 @@ // 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 ALL(HAS_MEDIA, DIRECT_STEPPING) - #define BLOCK_BUFFER_SIZE 8 + #define BLOCK_BUFFER_SIZE 32 #elif HAS_MEDIA - #define BLOCK_BUFFER_SIZE 16 + #define BLOCK_BUFFER_SIZE 32 #else - #define BLOCK_BUFFER_SIZE 16 + #define BLOCK_BUFFER_SIZE 32 #endif // @section serial // The ASCII buffer for serial input #define MAX_CMD_SIZE 96 -#define BUFSIZE 4 +#define BUFSIZE 32 // Transmission to Host Buffer Size // To save 386 bytes of flash (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. @@ -2545,7 +2573,7 @@ // For debug-echo: 128 bytes for the optimal speed. // Other output doesn't need to be that speedy. // :[0, 2, 4, 8, 16, 32, 64, 128, 256] -#define TX_BUFFER_SIZE 0 +#define TX_BUFFER_SIZE 64 // Host Receive Buffer Size // Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. @@ -2583,7 +2611,7 @@ * Currently handles M108, M112, M410, M876 * NOTE: Not yet implemented for all platforms. */ -//#define EMERGENCY_PARSER +#define EMERGENCY_PARSER // MRiscoC Enabled instantaneous response to emergency commands /** * Realtime Reporting (requires EMERGENCY_PARSER) @@ -2600,9 +2628,9 @@ * - During Hold all Emergency Parser commands are available, as usual. * - Enable NANODLP_Z_SYNC and NANODLP_ALL_AXIS for move command end-state reports. */ -//#define REALTIME_REPORTING_COMMANDS +//#define REALTIME_REPORTING_COMMANDS // (544 bytes of flash) #if ENABLED(REALTIME_REPORTING_COMMANDS) - //#define FULL_REPORT_TO_HOST_FEATURE // Auto-report the machine status like Grbl CNC + //#define FULL_REPORT_TO_HOST_FEATURE // Auto-report the machine status like Grbl CNC (208 bytes of flash) #endif // Bad Serial-connections can miss a received command by sending an 'ok' @@ -2612,7 +2640,7 @@ //#define NO_TIMEOUTS 1000 // Milliseconds // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. -//#define ADVANCED_OK +//#define ADVANCED_OK // (128 bytes of flash) // Printrun may have trouble receiving long strings all at once. // This option inserts short delays between lines of serial output. @@ -2655,20 +2683,20 @@ * * Note that M207 / M208 / M209 settings are saved to EEPROM. */ -//#define FWRETRACT +#define FWRETRACT // MRiscoC Enabled support for firmware based retract (1592 bytes of flash) #if ENABLED(FWRETRACT) - #define FWRETRACT_AUTORETRACT // Override slicer retractions + //#define FWRETRACT_AUTORETRACT // Override slicer retractions // MRiscoC use slicer retract #if ENABLED(FWRETRACT_AUTORETRACT) #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) + #define RETRACT_LENGTH 5 // (mm) Default retract length (positive value) // MRiscoC Bowden #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) - #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting - #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise + #define RETRACT_FEEDRATE 40 // (mm/s) Default feedrate for retracting // MRiscoC Bowden + #define RETRACT_ZRAISE 0.2 // (mm) Default retract Z-raise // MRiscoC Bowden #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) - #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction + #define RETRACT_RECOVER_FEEDRATE 40 // (mm/s) Default feedrate for recovering from retraction // MRiscoC Bowden #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously @@ -2784,21 +2812,21 @@ * * Enable PARK_HEAD_ON_PAUSE to add the G-code M125 Pause and Park. */ -//#define ADVANCED_PAUSE_FEATURE +#define ADVANCED_PAUSE_FEATURE // MRiscoC Enabled #if ENABLED(ADVANCED_PAUSE_FEATURE) #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (mm/s) Unload filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 20 // (mm/s) Unload filament feedrate. This can be pretty fast. // MRiscoC Increased filament unload speed #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 // (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. + #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 50 // (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 6 // (mm/s) Load filament feedrate. This can be pretty fast. + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 12 // (mm/s) Load filament feedrate. This can be pretty fast. // MRiscoC Increased filament load speed #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 // (mm/s^2) Lower acceleration may allow a faster feedrate. #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 // (mm) Load length of filament, from extruder gear to nozzle. // For Bowden, the full length of the tube and nozzle. @@ -2818,16 +2846,16 @@ #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. #define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NOZZLE_TIMEOUT 90 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 5 // Number of alert beeps to play when a response is needed. #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. //#define FILAMENT_CHANGE_RESUME_ON_INSERT // Automatically continue / load filament when runout sensor is triggered again. //#define PAUSE_REHEAT_FAST_RESUME // Reduce number of waits by not prompting again post-timeout before continuing. - //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. + #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. // MRiscoC Enabled park head when pause command was issued //#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change - //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. + #define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. // MRiscoC Enabled load/unload Filament G-codes //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) #endif @@ -3199,7 +3227,7 @@ * Define your own with: * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V // All axes (override below) + #define CHOPPER_TIMING CHOPPER_DEFAULT_24V // All axes (override below) // MRiscoC Correct value for UART mode drivers //#define CHOPPER_TIMING_X CHOPPER_TIMING // For X Axes (override below) //#define CHOPPER_TIMING_X2 CHOPPER_TIMING_X //#define CHOPPER_TIMING_Y CHOPPER_TIMING // For Y Axes (override below) @@ -3343,7 +3371,7 @@ /** * Step on both rising and falling edge signals (as with a square wave). */ - //#define EDGE_STEPPING + #define EDGE_STEPPING /** * Enable M122 debugging command for TMC stepper drivers. @@ -3736,6 +3764,14 @@ */ //#define CNC_COORDINATE_SYSTEMS +/** + * CNC Drilling Cycle - UNDER DEVELOPMENT + * + * Enables G81 to perform a drilling cycle. + * Currently only supports a single cycle, no G-code chaining. + */ +//#define CNC_DRILLING_CYCLE + // @section reporting /** @@ -3755,17 +3791,17 @@ /** * Auto-report position with M154 S */ -//#define AUTO_REPORT_POSITION +//#define AUTO_REPORT_POSITION // (224 bytes of flash) #if ENABLED(AUTO_REPORT_POSITION) - //#define AUTO_REPORT_REAL_POSITION // Auto-report the real position + #define AUTO_REPORT_REAL_POSITION // Auto-report the real position #endif /** * Include capabilities in M115 output */ -#define EXTENDED_CAPABILITIES_REPORT +#define EXTENDED_CAPABILITIES_REPORT // (1000 bytes of flash) #if ENABLED(EXTENDED_CAPABILITIES_REPORT) - //#define M115_GEOMETRY_REPORT + #define M115_GEOMETRY_REPORT // (448 bytes of flash) MRiscoC Enabled #endif // @section security @@ -3810,8 +3846,8 @@ // @section reporting // Extra options for the M114 "Current Position" report -//#define M114_DETAIL // Use 'M114` for details to check planner calculations -//#define M114_REALTIME // Real current position based on forward kinematics +//#define M114_DETAIL // Use 'M114` for details to check planner calculations (600 bytes of flash) +//#define M114_REALTIME // Real current position based on forward kinematics (80 bytes of flash) //#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed. //#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others) @@ -3822,13 +3858,12 @@ * Spend 28 bytes of SRAM to optimize the G-code parser */ #define FASTER_GCODE_PARSER - #if ENABLED(FASTER_GCODE_PARSER) //#define GCODE_QUOTED_STRINGS // Support for quoted string parameters #endif // Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack) -//#define MEATPACK_ON_SERIAL_PORT_1 +#define MEATPACK_ON_SERIAL_PORT_1 //#define MEATPACK_ON_SERIAL_PORT_2 //#define GCODE_CASE_INSENSITIVE // Accept G-code sent to the firmware in lowercase @@ -3842,7 +3877,7 @@ * - M206 and M428 are disabled. * - G92 will revert to its behavior from Marlin 1.0. */ -//#define NO_WORKSPACE_OFFSETS +//#define NO_WORKSPACE_OFFSETS // MRiscoC Save flash space and simplify movements /** * CNC G-code options @@ -3858,6 +3893,7 @@ #ifdef G0_FEEDRATE //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif +//#define G0_ANGULAR_FEEDRATE 2700 // (°/min) // @section gcode @@ -3998,10 +4034,10 @@ * Host Prompt Support enables Marlin to use the host for user prompts so * filament runout and other processes can be managed from the host side. */ -//#define HOST_ACTION_COMMANDS +#define HOST_ACTION_COMMANDS // MRiscoC Enabled actions from host #if ENABLED(HOST_ACTION_COMMANDS) //#define HOST_PAUSE_M76 // Tell the host to pause in response to M76 - //#define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback + #define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback // MRiscoC Enabled responses from host #if ENABLED(HOST_PROMPT_SUPPORT) //#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications #endif @@ -4016,7 +4052,7 @@ * * Implement M486 to allow Marlin to skip objects */ -//#define CANCEL_OBJECTS +#define CANCEL_OBJECTS // MRiscoC Enabled M486 to skip objects (416 bytes of flash) #if ENABLED(CANCEL_OBJECTS) #define CANCEL_OBJECTS_REPORTING // Emit the current object as a status message #endif @@ -4272,29 +4308,30 @@ // Add an LCD menu for MMU2 //#define MMU2_MENUS - - // Settings for filament load / unload from the LCD menu. - // This is for Průša MK3-style extruders. Customize for your hardware. - #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 - #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ - { 7.2, 1145 }, \ - { 14.4, 871 }, \ - { 36.0, 1393 }, \ - { 14.4, 871 }, \ - { 50.0, 198 } - - #define MMU2_RAMMING_SEQUENCE \ - { 1.0, 1000 }, \ - { 1.0, 1500 }, \ - { 2.0, 2000 }, \ - { 1.5, 3000 }, \ - { 2.5, 4000 }, \ - { -15.0, 5000 }, \ - { -14.0, 1200 }, \ - { -6.0, 600 }, \ - { 10.0, 700 }, \ - { -10.0, 400 }, \ - { -50.0, 2000 } + #if ANY(MMU2_MENUS, HAS_PRUSA_MMU2S) + // Settings for filament load / unload from the LCD menu. + // This is for Průša MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 1145 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + #endif /** * Using a sensor like the MMU2S @@ -4403,4 +4440,4 @@ //#define SOFT_RESET_ON_KILL // Use a digital button to soft-reset the controller after KILL // Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR. -//#define OPTIBOOT_RESET_REASON +//#define OPTIBOOT_RESET_REASON \ No newline at end of file diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index bd2f8a88e6a6..29966b92c9d9 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -66,7 +66,6 @@ BedLevelTools bedLevelTools; #if ENABLED(USE_GRID_MESHVIEWER) - bool BedLevelTools::viewer_asymmetric_range = false; bool BedLevelTools::viewer_print_value = false; #endif bool BedLevelTools::goto_mesh_value = false; @@ -242,8 +241,8 @@ bool BedLevelTools::meshValidate() { dwinDrawRectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ isnan(bedlevel.z_values[x][y]) ? COLOR_GREY : ( // gray if undefined (bedlevel.z_values[x][y] < 0 ? - (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_max)) << 5) | // green if mesh point value is positive + (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / range) << 11 : // red if mesh point value is negative + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / range) << 5) | // green if mesh point value is positive _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); @@ -276,15 +275,14 @@ bool BedLevelTools::meshValidate() { } void BedLevelTools::setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead - float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max); - if (v_min > 3e+10f) v_min = 0.0000001; - if (v_max > 3e+10f) v_max = 0.0000001; + float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max), range2 = _MIN(v_min, v_max); if (range > 3e+10f) range = 0.0000001; + if (range2 > 3e+10f) range2 = 0.0000001; ui.set_status( - &MString<45>( - F("Red "), p_float_t(viewer_asymmetric_range ? -v_min : -range, 3), - F("..0.."), p_float_t(viewer_asymmetric_range ? v_max : range, 3), - F(" Green") + &MString<47>( + F("Red "), p_float_t(-range, 3), + F("..0.."), p_float_t(range2, 3), + F("+ Green") ) ); drawing_mesh = false; diff --git a/platformio.ini b/platformio.ini index e3bdb6f58676..bbed133e0314 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ [platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards -default_envs = mega2560 +default_envs = STM32F103RE_creality include_dir = Marlin extra_configs = Marlin/config.ini From 0d5918386fc6a36fd4a48b492c2af52d2f17e322 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 17 Jul 2023 02:12:18 -0400 Subject: [PATCH 15/39] revert unwanted changes --- Marlin/Configuration.h | 409 +++++++++++++------------------------ Marlin/Configuration_adv.h | 287 ++++++++++++-------------- platformio.ini | 2 +- 3 files changed, 270 insertions(+), 428 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4fc6f801d884..c59bbba32a70 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1,6 +1,6 @@ -/** Aquila UBL Mriscoc ProUI +/** * Marlin 3D Printer Firmware - * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm @@ -21,12 +21,6 @@ */ #pragma once -// Edited by classicrocker883 for ProUI -// https://github.com/classicrocker883/MriscocProUI - -// Created from Mriscoc's Professional Firmware -// https://github.com/mriscoc/Ender3V2S1 - /** * Configuration.h * @@ -67,14 +61,14 @@ // @section info // Author info of this build printed to the host during boot and M115 -#define STRING_CONFIG_H_AUTHOR "Miguel A. Risco-Castillo (MRiscoC)" // Who made the changes. -#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) +#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. +//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) // @section machine // Choose the name from boards.h that matches your setup #ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_CREALITY_V427 // BOARD_CREALITY_V427 BOARD_VOXELAB_AQUILA BOARD_CREALITY_V422 + #define MOTHERBOARD BOARD_RAMPS_14_EFB #endif /** @@ -85,9 +79,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 1 // Ender Configs -#define NO_AUTO_ASSIGN_WARNING // Disable serial warnings -#define NO_MAPLE_WARNING // Disable warning when using Maple env +#define SERIAL_PORT 0 /** * Serial Port Baud Rate @@ -100,8 +92,9 @@ * * :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] */ -#define BAUDRATE 115200 -#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate +#define BAUDRATE 250000 + +//#define BAUD_RATE_GCODE // Enable G-code M575 to set the baud rate /** * Select a secondary serial port on the board to use for communication with the host. @@ -119,20 +112,11 @@ //#define SERIAL_PORT_3 1 //#define BAUDRATE_3 250000 // :[2400, 9600, 19200, 38400, 57600, 115200, 250000, 500000, 1000000] Enable to override BAUDRATE -/** - * Select a serial port to communicate with RS485 protocol - * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] - */ -//#define RS485_SERIAL_PORT 1 -#ifdef RS485_SERIAL_PORT - //#define RS485_BUS_BUFFER_SIZE 128 -#endif - // Enable the Bluetooth serial interface on AT90USB devices //#define BLUETOOTH // Name displayed in the LCD "Ready" message and Info menu -#define CUSTOM_MACHINE_NAME "Aquila" +//#define CUSTOM_MACHINE_NAME "3D Printer" // Printer's unique ID, used by some programs to differentiate between machines. // Choose your own or use a service like https://www.uuidgenerator.net/version4 @@ -155,9 +139,9 @@ * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ -#define X_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs -#define Y_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs -#define Z_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs +#define X_DRIVER_TYPE A4988 +#define Y_DRIVER_TYPE A4988 +#define Z_DRIVER_TYPE A4988 //#define X2_DRIVER_TYPE A4988 //#define Y2_DRIVER_TYPE A4988 //#define Z2_DRIVER_TYPE A4988 @@ -169,7 +153,7 @@ //#define U_DRIVER_TYPE A4988 //#define V_DRIVER_TYPE A4988 //#define W_DRIVER_TYPE A4988 -#define E0_DRIVER_TYPE TMC2208_STANDALONE // Ender Configs +#define E0_DRIVER_TYPE A4988 //#define E1_DRIVER_TYPE A4988 //#define E2_DRIVER_TYPE A4988 //#define E3_DRIVER_TYPE A4988 @@ -564,7 +548,7 @@ #define TEMP_SENSOR_5 0 #define TEMP_SENSOR_6 0 #define TEMP_SENSOR_7 0 -#define TEMP_SENSOR_BED 1 // Ender Configs +#define TEMP_SENSOR_BED 1 #define TEMP_SENSOR_PROBE 0 #define TEMP_SENSOR_CHAMBER 0 #define TEMP_SENSOR_COOLER 0 @@ -626,7 +610,7 @@ // Below this temperature the heater will be switched off // because it probably indicates a broken thermistor wire. -#define HEATER_0_MINTEMP 0 // Ender Configs +#define HEATER_0_MINTEMP 5 #define HEATER_1_MINTEMP 5 #define HEATER_2_MINTEMP 5 #define HEATER_3_MINTEMP 5 @@ -634,7 +618,7 @@ #define HEATER_5_MINTEMP 5 #define HEATER_6_MINTEMP 5 #define HEATER_7_MINTEMP 5 -#define BED_MINTEMP 0 // Ender Configs +#define BED_MINTEMP 5 #define CHAMBER_MINTEMP 5 // Above this temperature the heater will be switched off. @@ -648,7 +632,7 @@ #define HEATER_5_MAXTEMP 275 #define HEATER_6_MAXTEMP 275 #define HEATER_7_MAXTEMP 275 -#define BED_MAXTEMP 120 // Ender3V2 Configs +#define BED_MAXTEMP 150 #define CHAMBER_MAXTEMP 60 /** @@ -692,10 +676,9 @@ #define DEFAULT_Ki_LIST { 1.08, 1.08 } #define DEFAULT_Kd_LIST { 114.00, 114.00 } #else -//50w Aquila - #define DEFAULT_Kp 13.19 - #define DEFAULT_Ki 0.77 - #define DEFAULT_Kd 56.05 + #define DEFAULT_Kp 22.20 + #define DEFAULT_Ki 1.08 + #define DEFAULT_Kd 114.00 #endif #else #define BANG_MAX 255 // Limit hotend current while in bang-bang mode; 255=full current @@ -711,8 +694,8 @@ */ #if ENABLED(MPCTEMP) #define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~6.3K bytes of flash) - #define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash) - #define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash) + //#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1.3K bytes of flash) + //#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash) #define MPC_MAX 255 // (0..255) Current to nozzle while MPC is active. #define MPC_HEATER_POWER { 40.0f } // (W) Heat cartridge powers. @@ -775,7 +758,7 @@ * * With this option disabled, bang-bang will be used. BED_LIMIT_SWITCHING enables hysteresis. */ -#define PIDTEMPBED +//#define PIDTEMPBED #if ENABLED(PIDTEMPBED) //#define MIN_BED_POWER 0 @@ -783,9 +766,9 @@ // 120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+) // from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10) - #define DEFAULT_bedKp 128.06 - #define DEFAULT_bedKi 24.95 - #define DEFAULT_bedKd 438.07 + #define DEFAULT_bedKp 10.00 + #define DEFAULT_bedKi .023 + #define DEFAULT_bedKd 305.4 // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles. #else @@ -843,8 +826,8 @@ #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max. - #define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash) - #define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash) + //#define PID_EDIT_MENU // Add PID editing to the "Advanced Settings" menu. (~700 bytes of flash) + //#define PID_AUTOTUNE_MENU // Add PID auto-tuning to the "Advanced Settings" menu. (~250 bytes of flash) #endif // @section safety @@ -857,14 +840,14 @@ * *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! *** */ #define PREVENT_COLD_EXTRUSION -#define EXTRUDE_MINTEMP 180 // MRiscoC Customizable by menu +#define EXTRUDE_MINTEMP 170 /** * Prevent a single extrusion longer than EXTRUDE_MAXLENGTH. * Note: For Bowden Extruders make this large enough to allow load/unload. */ #define PREVENT_LENGTHY_EXTRUDE -#define EXTRUDE_MAXLENGTH 1000 +#define EXTRUDE_MAXLENGTH 200 //=========================================================================== //======================== Thermal Runaway Protection ======================= @@ -885,8 +868,8 @@ #define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders #define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed -//#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber -//#define THERMAL_PROTECTION_COOLER // Enable thermal protection for the laser cooling +#define THERMAL_PROTECTION_CHAMBER // Enable thermal protection for the heated chamber +#define THERMAL_PROTECTION_COOLER // Enable thermal protection for the laser cooling //=========================================================================== //============================= Mechanical Settings ========================= @@ -1192,7 +1175,7 @@ // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. -#define ENDSTOP_INTERRUPTS_FEATURE // Ender Configs +//#define ENDSTOP_INTERRUPTS_FEATURE /** * Endstop Noise Threshold @@ -1236,23 +1219,18 @@ * Override with M92 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 98 } - -//#define LIMITED_MAX_STEPS_EDITING -#if ENABLED(LIMITED_MAX_STEPS_EDITING) - #define MAX_STEPS_EDIT_VALUES { 200, 200, 2000, 2000 } -#endif +#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 } /** * Default Max Feed Rate (linear=mm/s, rotational=°/s) * Override with M203 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_FEEDRATE { 800, 800, 18, 120 } +#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } //#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 #if ENABLED(LIMITED_MAX_FR_EDITING) - #define MAX_FEEDRATE_EDIT_VALUES { 1000, 1000, 40, 200 } // ...or, set your own edit limits // MRiscoC allows higher limits + #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } // ...or, set your own edit limits #endif /** @@ -1261,11 +1239,11 @@ * Override with M201 * X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]] */ -#define DEFAULT_MAX_ACCELERATION { 800, 800, 120, 1200 } +#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } //#define LIMITED_MAX_ACCEL_EDITING // Limit edit via M201 or LCD to DEFAULT_MAX_ACCELERATION * 2 #if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 300, 9000 } // ...or, set your own edit limits + #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } // ...or, set your own edit limits #endif /** @@ -1275,16 +1253,10 @@ * M204 P Acceleration * M204 R Retract Acceleration * M204 T Travel Acceleration - * M204 I Angular Acceleration - * M204 J Angular Travel Acceleration */ -#define DEFAULT_ACCELERATION 800 // X, Y, Z and E acceleration for printing moves -#define DEFAULT_RETRACT_ACCELERATION 800 // E acceleration for retracts -#define DEFAULT_TRAVEL_ACCELERATION 1000 // X, Y, Z acceleration for travel (non printing) moves -#if ENABLED(AXIS4_ROTATES) - #define DEFAULT_ANGULAR_ACCELERATION 3000 // I, J, K acceleration for rotational-only printing moves - #define DEFAULT_ANGULAR_TRAVEL_ACCELERATION 3000 // I, J, K acceleration for rotational-only travel (non printing) moves -#endif +#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E acceleration for printing moves +#define DEFAULT_RETRACT_ACCELERATION 3000 // E acceleration for retracts +#define DEFAULT_TRAVEL_ACCELERATION 3000 // X, Y, Z acceleration for travel (non printing) moves /** * Default Jerk limits (mm/s) @@ -1294,11 +1266,11 @@ * When changing speed and direction, if the difference is less than the * value set here, it may happen instantaneously. */ -#define CLASSIC_JERK +//#define CLASSIC_JERK #if ENABLED(CLASSIC_JERK) #define DEFAULT_XJERK 10.0 #define DEFAULT_YJERK 10.0 - #define DEFAULT_ZJERK 0.4 + #define DEFAULT_ZJERK 0.3 //#define DEFAULT_IJERK 0.3 //#define DEFAULT_JJERK 0.3 //#define DEFAULT_KJERK 0.3 @@ -1310,7 +1282,7 @@ //#define LIMITED_JERK_EDITING // Limit edit via M205 or LCD to DEFAULT_aJERK * 2 #if ENABLED(LIMITED_JERK_EDITING) - #define MAX_JERK_EDIT_VALUES { 20, 20, 1, 20 } // ...or, set your own edit limits + #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } // ...or, set your own edit limits #endif #endif @@ -1337,7 +1309,7 @@ * * See https://github.com/synthetos/TinyG/wiki/Jerk-Controlled-Motion-Explained */ -#define S_CURVE_ACCELERATION +//#define S_CURVE_ACCELERATION //=========================================================================== //============================= Z Probe Options ============================= @@ -1353,10 +1325,10 @@ * The probe replaces the Z-MIN endstop and is used for Z homing. * (Automatically enables USE_PROBE_FOR_Z_HOMING.) */ -//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN // Probe connected to BLTouch port +#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN // Force the use of the probe for Z-axis homing -#define USE_PROBE_FOR_Z_HOMING // Manual mesh not have a probe +//#define USE_PROBE_FOR_Z_HOMING /** * Z_MIN_PROBE_PIN @@ -1371,7 +1343,7 @@ * - Normally-closed (NC) also connect to GND. * - Normally-open (NO) also connect to 5V. */ -//#define Z_MIN_PROBE_PIN PB1 // Pin 32 is the RAMPS default +//#define Z_MIN_PROBE_PIN -1 /** * Probe Type @@ -1385,7 +1357,7 @@ * Use G29 repeatedly, adjusting the Z height at each point with movement commands * or (with LCD_BED_LEVELING) the LCD controller. */ -//#define PROBE_MANUALLY // Manual mesh version +//#define PROBE_MANUALLY /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. @@ -1413,7 +1385,7 @@ /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ -#define BLTOUCH // 3D/CR/BLTouch version +//#define BLTOUCH /** * MagLev V4 probe by MDD @@ -1565,26 +1537,26 @@ * | [-] | * O-- FRONT --+ */ -#define NOZZLE_TO_PROBE_OFFSET { -45.0, -7.0, 0 } +#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } // Enable and set to use a specific tool for probing. Disable to allow any tool. -//#define PROBING_TOOL 0 +#define PROBING_TOOL 0 #ifdef PROBING_TOOL //#define PROBE_TOOLCHANGE_NO_MOVE // Suppress motion on probe tool-change #endif // Most probes should stay away from the edges of the bed, but // with NOZZLE_AS_PROBE this can be negative for a wider probing area. -#define PROBING_MARGIN 0 +#define PROBING_MARGIN 10 // X and Y axis travel speed (mm/min) between probes -#define XY_PROBE_FEEDRATE (180*60) +#define XY_PROBE_FEEDRATE (133*60) // Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2) -#define Z_PROBE_FEEDRATE_FAST (8*60) +#define Z_PROBE_FEEDRATE_FAST (4*60) // Feedrate (mm/min) for the "accurate" probe of each point -#define Z_PROBE_FEEDRATE_SLOW (150) //(Z_PROBE_FEEDRATE_FAST * 0.3125) +#define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2) /** * Probe Activation Switch @@ -1631,7 +1603,7 @@ * A total of 2 does fast/slow probes with a weighted average. * A total of 3 or more adds more slow probes, taking the average. */ -#define MULTIPLE_PROBING 2 // Use a value of (0) with ProUIex, otherwise (2) +//#define MULTIPLE_PROBING 2 //#define EXTRA_PROBING 1 /** @@ -1660,7 +1632,7 @@ #define Z_PROBE_OFFSET_RANGE_MAX 20 // Enable the M48 repeatability test to test probe accuracy -#define Z_MIN_PROBE_REPEATABILITY_TEST +//#define Z_MIN_PROBE_REPEATABILITY_TEST // Before deploy/stow pause for user confirmation //#define PAUSE_BEFORE_DEPLOY_STOW @@ -1729,8 +1701,8 @@ // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR false -#define INVERT_Y_DIR false -#define INVERT_Z_DIR true +#define INVERT_Y_DIR true +#define INVERT_Z_DIR false //#define INVERT_I_DIR false //#define INVERT_J_DIR false //#define INVERT_K_DIR false @@ -1753,19 +1725,19 @@ // @section homing //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed. Also enable HOME_AFTER_DEACTIVATE for extra safety. -#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety. +//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated. Also enable NO_MOTION_BEFORE_HOMING for extra safety. /** * Set Z_IDLE_HEIGHT if the Z-Axis moves on its own when steppers are disabled. * - Use a low value (i.e., Z_MIN_POS) if the nozzle falls down to the bed. * - Use a large value (i.e., Z_MAX_POS) if the bed falls down, away from the nozzle. */ -#define Z_IDLE_HEIGHT Z_HOME_POS +//#define Z_IDLE_HEIGHT Z_HOME_POS -#define Z_CLEARANCE_FOR_HOMING 5 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... - // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding. +//#define Z_CLEARANCE_FOR_HOMING 4 // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ... + // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding. -//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing Z +//#define Z_AFTER_HOMING 10 // (mm) Height to move to after homing (if Z was homed) // Direction of endstops when homing; 1=MAX, -1=MIN // :[-1,1] @@ -1782,16 +1754,16 @@ // @section geometry // The size of the printable area -#define X_BED_SIZE 220 // MRiscoC Max usable bed size -#define Y_BED_SIZE 220 // MRiscoC Max usable bed size +#define X_BED_SIZE 200 +#define Y_BED_SIZE 200 // Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions. -#define X_MIN_POS 0 // MRiscoC Stock physical limit -#define Y_MIN_POS 0 // MRiscoC Stock physical limit +#define X_MIN_POS 0 +#define Y_MIN_POS 0 #define Z_MIN_POS 0 -#define X_MAX_POS 230 // MRiscoC Stock physical limit -#define Y_MAX_POS 220 // MRiscoC Stock physical limit -#define Z_MAX_POS 250 // Ender Configs +#define X_MAX_POS X_BED_SIZE +#define Y_MAX_POS Y_BED_SIZE +#define Z_MAX_POS 200 //#define I_MIN_POS 0 //#define I_MAX_POS 50 //#define J_MIN_POS 0 @@ -1859,12 +1831,12 @@ * RAMPS-based boards use SERVO3_PIN for the first runout sensor. * For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc. */ -#define FILAMENT_RUNOUT_SENSOR // MRiscoC Enabled runout sensor support (2528 bytes of flash) +//#define FILAMENT_RUNOUT_SENSOR #if ENABLED(FILAMENT_RUNOUT_SENSOR) - #define FIL_RUNOUT_ENABLED_DEFAULT false// Enable the sensor on startup. Override with M412 followed by M500. + #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500. #define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each. - #define FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present. + #define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present. #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins. //#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins. //#define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder. @@ -1911,7 +1883,7 @@ // After a runout is detected, continue printing this length of filament // before executing the runout script. Useful for a sensor at the end of // a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead. - #define FILAMENT_RUNOUT_DISTANCE_MM 25 // MRiscoC Customizable by menu + //#define FILAMENT_RUNOUT_DISTANCE_MM 25 #ifdef FILAMENT_RUNOUT_DISTANCE_MM // Enable this option to use an encoder disc that toggles the runout pin @@ -2002,8 +1974,8 @@ */ //#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_LINEAR -//#define AUTO_BED_LEVELING_BILINEAR // MRiscoC BLTouch auto level -#define AUTO_BED_LEVELING_UBL +//#define AUTO_BED_LEVELING_BILINEAR +//#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING /** @@ -2011,15 +1983,15 @@ * these options to restore the prior leveling state or to always enable * leveling immediately after G28. */ -#define RESTORE_LEVELING_AFTER_G28 +//#define RESTORE_LEVELING_AFTER_G28 //#define ENABLE_LEVELING_AFTER_G28 /** * Auto-leveling needs preheating */ -//#define PREHEAT_BEFORE_LEVELING // MRiscoC Heatting to compensate thermal expansions +//#define PREHEAT_BEFORE_LEVELING #if ENABLED(PREHEAT_BEFORE_LEVELING) - #define LEVELING_NOZZLE_TEMP 175 // (°C) Only applies to E0 at this time // Preheat nozzle without oozing + #define LEVELING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time #define LEVELING_BED_TEMP 50 #endif @@ -2055,12 +2027,6 @@ #define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height. #endif - /** - * Add Z offset (M424 Z) that applies to all moves at the planner level. - * This Z offset will be automatically set to the middle value with G29. - */ - //#define GLOBAL_MESH_Z_OFFSET - /** * For Cartesian machines, instead of dividing moves on mesh boundaries, * split up moves into short segments like a Delta. This follows the @@ -2088,10 +2054,8 @@ #if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. - #define GRID_MAX_POINTS_X 5 // Don't use more than 9 points per axis, implementation limited + #define GRID_MAX_POINTS_X 3 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - #define MESH_EDIT_MENU // Add a menu to edit mesh points - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST @@ -2100,7 +2064,7 @@ // Beyond the probed grid, continue the implied tilt? // Default is to maintain the height of the nearest edge. - //#define EXTRAPOLATE_BEYOND_GRID // MRiscoC Disabled for better accuracy at edges + //#define EXTRAPOLATE_BEYOND_GRID // // Subdivision of the grid by Catmull-Rom method. @@ -2121,13 +2085,12 @@ //=========================================================================== //#define MESH_EDIT_GFX_OVERLAY // Display a graphics overlay while editing the mesh - #define MESH_EDIT_MENU // Add a menu to edit mesh points - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed - #define GRID_MAX_POINTS_X 7 // Don't use more than 9 points per axis, implementation limited + #define MESH_INSET 1 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 10 // Don't use more than 15 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - #define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points + //#define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points //#define UBL_TILT_ON_MESH_POINTS // Use nearest mesh points with G29 J for better Z reference //#define UBL_TILT_ON_MESH_POINTS_3POINT // Use nearest mesh points with G29 J0 (3-point) @@ -2164,10 +2127,9 @@ //=========================================================================== //=================================== Mesh ================================== //=========================================================================== - #define MESH_EDIT_MENU // Add a menu to edit mesh points - #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed // MRiscoC Center mesh - #define GRID_MAX_POINTS_X 5 // Don't use more than 7 points per axis, implementation limited. // MRiscoC Customizable by menu + #define MESH_INSET 10 // Set Mesh bounds as an inset region of the bed + #define GRID_MAX_POINTS_X 3 // Don't use more than 7 points per axis, implementation limited. #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X //#define MESH_G28_REST_ORIGIN // After homing all axes ('G28' or 'G28 XYZ') rest Z at Z_MIN_POS @@ -2187,20 +2149,18 @@ #endif // Add a menu item to move between bed corners for manual bed adjustment -#define LCD_BED_TRAMMING +//#define LCD_BED_TRAMMING #if ENABLED(LCD_BED_TRAMMING) + #define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets #define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at tramming points - #define BED_TRAMMING_Z_HOP 5.0 // (mm) Z height of nozzle between tramming points - #define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner - #define BED_TRAMMING_USE_PROBE + #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between tramming points + //#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner + //#define BED_TRAMMING_USE_PROBE #if ENABLED(BED_TRAMMING_USE_PROBE) - #define BED_TRAMMING_INSET_LFRB { 35, 35, 35, 35 } // (mm) Left, Front, Right, Back insets - #define BED_TRAMMING_PROBE_TOLERANCE 0.05f // (mm) + #define BED_TRAMMING_PROBE_TOLERANCE 0.1 // (mm) #define BED_TRAMMING_VERIFY_RAISED // After adjustment triggers the probe, re-probe to verify //#define BED_TRAMMING_AUDIO_FEEDBACK - #else - #define BED_TRAMMING_INSET_LFRB { 25.4, 25.4, 25.4, 25.4 } // (mm) Left, Front, Right, Back insets #endif /** @@ -2221,8 +2181,6 @@ * LF --------- RF LF --------- RF LF --------- RF LF --------- RF */ #define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB } -#else - #define BED_SCREW_INSET 35 // Distance the knob screw is from corners. #endif /** @@ -2255,7 +2213,7 @@ * - Allows Z homing only when XY positions are known and trusted. * - If stepper drivers sleep, XY homing may be required again before Z homing. */ -#define Z_SAFE_HOMING // MRiscoC Homing Z at center of bed +//#define Z_SAFE_HOMING #if ENABLED(Z_SAFE_HOMING) #define Z_SAFE_HOMING_X_POINT X_CENTER // X point for Z homing @@ -2264,7 +2222,7 @@ #endif // Homing speeds (linear=mm/min, rotational=°/min) -#define HOMING_FEEDRATE_MM_M { (60*60), (60*60), (8*60) } +#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) } // Validate that endstops are triggered on homing moves #define VALIDATE_HOMING_ENDSTOPS @@ -2340,15 +2298,15 @@ * * M500 - Store settings to EEPROM. * M501 - Read settings from EEPROM. (i.e., Throw away unsaved changes) - * M502 - Revert settings to "factory" defaults (Follow with M500 to init the EEPROM.) + * M502 - Revert settings to "factory" defaults. (Follow with M500 to init the EEPROM.) */ -#define EEPROM_SETTINGS // Persistent storage with M500 and M501 // Ender Configs +//#define EEPROM_SETTINGS // Persistent storage with M500 and M501 //#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release! -#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. 1008 bytes +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #if ENABLED(EEPROM_SETTINGS) - #define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors // Ender Configs - #define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build // MRiscoC Reset EEPROM on first boot + //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. + //#define EEPROM_INIT_NOW // Init EEPROM on first boot after a new build. #endif // @section host @@ -2360,7 +2318,7 @@ // every couple of seconds when it can't accept commands. // #define HOST_KEEPALIVE_FEATURE // Disable this if your host doesn't like keepalive messages -#define DEFAULT_KEEPALIVE_INTERVAL 5 // Number of seconds between "busy" messages. Set with M113. +#define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. #define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating // @section units @@ -2381,31 +2339,16 @@ // Preheat Constants - Up to 10 are supported without changes // #define PREHEAT_1_LABEL "PLA" -#define PREHEAT_1_TEMP_HOTEND 210 -#define PREHEAT_1_TEMP_BED 60 -//#define PREHEAT_1_TEMP_CHAMBER 35 +#define PREHEAT_1_TEMP_HOTEND 180 +#define PREHEAT_1_TEMP_BED 70 +#define PREHEAT_1_TEMP_CHAMBER 35 #define PREHEAT_1_FAN_SPEED 0 // Value from 0 to 255 -//#define PREHEAT_2_LABEL "ABS" //PETG -//#define PREHEAT_2_TEMP_HOTEND 240 -//#define PREHEAT_2_TEMP_BED 75 -//#define PREHEAT_2_TEMP_CHAMBER 35 -//#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 - -//#define PREHEAT_3_LABEL "Warmup" -//#define PREHEAT_3_TEMP_HOTEND 200 -//#define PREHEAT_3_TEMP_BED 50 -//#define PREHEAT_3_FAN_SPEED 0 - -//#define PREHEAT_4_LABEL "TPU" -//#define PREHEAT_4_TEMP_HOTEND 230 -//#define PREHEAT_4_TEMP_BED 80 -//#define PREHEAT_4_FAN_SPEED 128 // Value from 0 to 255 - -//#define PREHEAT_5_LABEL "CUSTOM" //NYLON -//#define PREHEAT_5_TEMP_HOTEND 240 -//#define PREHEAT_5_TEMP_BED 60 -//#define PREHEAT_5_FAN_SPEED 128 +#define PREHEAT_2_LABEL "ABS" +#define PREHEAT_2_TEMP_HOTEND 240 +#define PREHEAT_2_TEMP_BED 110 +#define PREHEAT_2_TEMP_CHAMBER 35 +#define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255 // @section motion @@ -2420,15 +2363,15 @@ * P1 Raise the nozzle always to Z-park height. * P2 Raise the nozzle by Z-park amount, limited to Z_MAX_POS. */ -#define NOZZLE_PARK_FEATURE // MRiscoC Enabled +//#define NOZZLE_PARK_FEATURE #if ENABLED(NOZZLE_PARK_FEATURE) // Specify a park position as { X, Y, Z_raise } - #define NOZZLE_PARK_POINT { 0, 220, 40 } //changed MRiscoC Customizable by menu + #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } #define NOZZLE_PARK_MOVE 0 // Park motion: 0 = XY Move, 1 = X Only, 2 = Y Only, 3 = X before Y, 4 = Y before X - #define NOZZLE_PARK_Z_RAISE_MIN 5 // (mm) Always raise Z by at least this distance // MRiscoC uses Park Z Raise from 0 to avoid backlash issues - #define NOZZLE_PARK_XY_FEEDRATE 120 // (mm/s) X and Y axes feedrate (also used for delta Z axis) - #define NOZZLE_PARK_Z_FEEDRATE 20 // (mm/s) Z axis feedrate (not used for delta printers) + #define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance + #define NOZZLE_PARK_XY_FEEDRATE 100 // (mm/s) X and Y axes feedrate (also used for delta Z axis) + #define NOZZLE_PARK_Z_FEEDRATE 5 // (mm/s) Z axis feedrate (not used for delta printers) #endif /** @@ -2554,7 +2497,7 @@ * * View the current statistics with M78. */ -#define PRINTCOUNTER // MRiscoC Enable Print Statistics +//#define PRINTCOUNTER #if ENABLED(PRINTCOUNTER) #define PRINTCOUNTER_SAVE_INTERVAL 60 // (minutes) EEPROM save interval during print. A value of 0 will save stats at end of print. #endif @@ -2647,7 +2590,7 @@ * SD Card support is disabled by default. If your controller has an SD slot, * you must uncomment the following option or it won't work. */ -#define SDSUPPORT // Ender Configs +//#define SDSUPPORT /** * SD CARD: ENABLE CRC @@ -2671,13 +2614,13 @@ // This option overrides the default number of encoder pulses needed to // produce one step. Should be increased for high-resolution encoders. // -#define ENCODER_PULSES_PER_STEP 4 // Ender Configs +//#define ENCODER_PULSES_PER_STEP 4 // // Use this option to override the number of step signals required to // move between next/prev menu items. // -#define ENCODER_STEPS_PER_MENU_ITEM 1 // Ender Configs +//#define ENCODER_STEPS_PER_MENU_ITEM 1 /** * Encoder Direction Options @@ -2694,7 +2637,7 @@ // // Set this option if CLOCKWISE causes values to DECREASE // -#define REVERSE_ENCODER_DIRECTION //Aquila enable -- Ender disable +//#define REVERSE_ENCODER_DIRECTION // // This option reverses the encoder direction for navigating LCD menus. @@ -2728,7 +2671,7 @@ // Add individual axis homing items (Home X, Home Y, and Home Z) to the LCD menu. // //#define INDIVIDUAL_AXIS_HOMING_MENU -#define INDIVIDUAL_AXIS_HOMING_SUBMENU +//#define INDIVIDUAL_AXIS_HOMING_SUBMENU // // SPEAKER/BUZZER @@ -2745,8 +2688,8 @@ // Note: Test audio output with the G-Code: // M300 S P // -#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 -#define LCD_FEEDBACK_FREQUENCY_HZ 5000 +//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 +//#define LCD_FEEDBACK_FREQUENCY_HZ 5000 // // Tone queue size, used to keep beeps from blocking execution. @@ -3031,6 +2974,19 @@ // //#define BTT_MINI_12864_V1 +// +// Factory display for Creality CR-10 / CR-7 / Ender-3 +// https://www.aliexpress.com/item/32833148327.html +// +// Connect to EXP1 on RAMPS and compatible boards. +// +//#define CR10_STOCKDISPLAY + +// +// Ender-2 OEM display, a variant of the MKS_MINI_12864 +// +//#define ENDER2_STOCKDISPLAY + // // ANET and Tronxy Graphical Controller // @@ -3156,9 +3112,6 @@ * - Download https://github.com/CrealityOfficial/Ender-3S1/archive/3S1_Plus_Screen.zip * - Copy the downloaded DWIN_SET folder to the SD card. * - * CREALITY_TOUCH - * - CR-6 OEM touch screen. A DWIN display with touch. - * * Flash display with DGUS Displays for Marlin: * - Format the SD card to FAT32 with an allocation size of 4kb. * - Download files as specified for your type of display. @@ -3209,12 +3162,6 @@ // //#define NEXTION_TFT -// -// PanelDue touch controller by Escher3D -// http://escher3d.com/pages/order/products/product2.php -// -//#define PANELDUE - // // Third-party or vendor-customized controller interfaces. // Sources should be installed in 'src/lcd/extui'. @@ -3376,83 +3323,15 @@ //============================================================================= //============================ Other Controllers ============================ //============================================================================= -//@section proui // // Ender-3 v2 OEM display. A DWIN display with Rotary Encoder. // -// DWIN / DACAI LCD 4.3" 480x272 - -#define DWIN_CREALITY_LCD_JYERSUI // Pro UI by MRiscoC -#define USE_STOCK_DWIN_SET // Enabled ? 9.ICO : 7.ICO | in DWIN_SET -//#define HAS_DACAI 1 - -#if ENABLED(DWIN_LCD_PROUI) -// Professional firmware features: - #define PROUI_EX 1 // Extended UI features (15152 bytes of flash) - #ifdef PROUI_EX - #define HAS_GCODE_PREVIEW 1 - #define HAS_TOOLBAR 1 - #endif - #define DISABLE_TUNING_GRAPH 0// Graph Temp as grid plot - PID/MPC Tuning (1624 bytes of flash) - #define HAS_ESDIAG 1 // View End-stop switch continuity (560 bytes of flash) - #define HAS_CGCODE 1 // Extra Gcode options (3320 bytes of flash) - #define HAS_LOCKSCREEN 1 // Simple lockscreen as to not accidentally change something (568 bytes of flash) - #define HAS_SD_EXTENDER 1 // Enable to support SD card extender cables (48 bytes of flash) - #define USE_GRID_MESHVIEWER 1 // Enable two mesh graph types : one (1728 bytes of flash) - #define HAS_CUSTOM_COLORS 1 // Able to change display colors (2040 bytes of flash) - #define ALT_COLOR_MENU 0 // Color palette options >> 0 = Voxelab Default | 1 = Alternate Aquila | 2 = Ender3V2 Default - #if ENABLED(AUTO_BED_LEVELING_UBL) - #define ACTIVATE_MESH_ITEM // Active Mesh Leveling menu option (152 bytes of flash) - #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) // (2528 bytes of flash) - #define RUNOUT_TUNE_ITEM // Filament Runout option in Tune Menu - #endif - #if ENABLED(POWER_LOSS_RECOVERY) // (3400 bytes of flash) - #define PLR_TUNE_ITEM // Power-loss Recovery option in Tune Menu - #endif - #if ENABLED(BLTOUCH) - #define HS_MENU_ITEM // BLTOUCH_HS_MODE menu option (56 bytes of flash) - #endif - #if DISABLED(DISABLE_TUNING_GRAPH) - #define PLOT_TUNE_ITEM // Temperature Plot Graph item in Tune Menu (688 bytes of flash) - #endif - #if DISABLED(CLASSIC_JERK) - //#define JD_TUNE_ITEM // Enable only if Juntion Deviation is enabled - #endif - #if ENABLED(LIN_ADVANCE) - #define ADVK_TUNE_ITEM // Linear Advance item in Tune Menu - #endif - #define SHOW_REAL_POS - #define CCLOUD_PRINT_SUPPORT // Menu item: enable/disable Creality Cloud Print Support (192 bytes of flash) - #define TRAMWIZ_MENU_ITEM // Menu item: enable Tramming Wizard (2304 bytes of flash) - #define MEDIASORT_MENU_ITEM // Menu item: enable/disable file list sorting (104 bytes of flash) - //#define ENC_MENU_ITEM // Menu item: faster/slower encoder rate (272 bytes of flash) - #define SHOW_SPEED_IND // Menu item: blink speed in mm/s along with speed percentage (296 bytes of flash) - //#define NO_BLINK_IND // Disables dashboard icon blink indicator highlighted background - -#endif - -// -// Factory display for Creality CR-10 / CR-7 / Ender-3 -// https://www.aliexpress.com/item/32833148327.html -// -// This is RAMPS-compatible using a single 10-pin connector. -// -// (For CR-10 owners who want to replace the Melzi Creality board but retain the display) -// Connect to EXP1 on RAMPS and compatible boards. -// 2.4" 128x64 LCD -// - -//#define CR10_STOCKDISPLAY //For Ender-3 / Aquila C2 blue/white monochrome LCD -#if ENABLED(CR10_STOCKDISPLAY) //BTT_SKR_MINI_E3 - #define RET6_12864_LCD -#endif - -// -// Ender-2 OEM display, a variant of the MKS_MINI_12864 -// -//#define ENDER2_STOCKDISPLAY +//#define DWIN_CREALITY_LCD // Creality UI +//#define DWIN_LCD_PROUI // Pro UI by MRiscoC +//#define DWIN_CREALITY_LCD_JYERSUI // Jyers UI by Jacob Myers +//#define DWIN_MARLINUI_PORTRAIT // MarlinUI (portrait orientation) +//#define DWIN_MARLINUI_LANDSCAPE // MarlinUI (landscape orientation) // // Touch Screen Settings @@ -3507,7 +3386,7 @@ // Use software PWM to drive the fan, as for the heaters. This uses a very low frequency // which is not as annoying as with the hardware PWM. On the other hand, if this frequency // is too low, you should also increment SOFT_PWM_SCALE. -#define FAN_SOFT_PWM // Ender Configs +//#define FAN_SOFT_PWM // Incrementing this by 1 will double the software PWM frequency, // affecting heaters, and the fan if FAN_SOFT_PWM is enabled. @@ -3589,7 +3468,7 @@ #if ENABLED(NEOPIXEL_LED) #define NEOPIXEL_TYPE NEO_GRBW // NEO_GRBW, NEO_RGBW, NEO_GRB, NEO_RBG, etc. // See https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.h - #define NEOPIXEL_PIN PA13 // LED driving pin + //#define NEOPIXEL_PIN 4 // LED driving pin //#define NEOPIXEL2_TYPE NEOPIXEL_TYPE //#define NEOPIXEL2_PIN 5 #define NEOPIXEL_PIXELS 30 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fe77020b1758..b1fde0a45d5f 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1,6 +1,6 @@ /** * Marlin 3D Printer Firmware - * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm @@ -21,9 +21,6 @@ */ #pragma once -// Created by configs generator for Professional firmware -// https://github.com/mriscoc/Ender3V2S1 - /** * Configuration_adv.h * @@ -338,7 +335,7 @@ * Thermal Protection parameters for the bed are just as above for hotends. */ #if ENABLED(THERMAL_PROTECTION_BED) - #define THERMAL_PROTECTION_BED_PERIOD 60 // Seconds + #define THERMAL_PROTECTION_BED_PERIOD 20 // Seconds #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius /** @@ -550,9 +547,9 @@ * Hotend Idle Timeout * Prevent filament in the nozzle from charring and causing a critical jam. */ -#define HOTEND_IDLE_TIMEOUT // MRiscoC Disable heaters after timeout +//#define HOTEND_IDLE_TIMEOUT #if ENABLED(HOTEND_IDLE_TIMEOUT) - #define HOTEND_IDLE_TIMEOUT_SEC (6*60) // (seconds) Time without extruder movement to trigger protection + #define HOTEND_IDLE_TIMEOUT_SEC (5*60) // (seconds) Time without extruder movement to trigger protection #define HOTEND_IDLE_MIN_TRIGGER 180 // (°C) Minimum temperature to enable hotend protection #define HOTEND_IDLE_NOZZLE_TARGET 0 // (°C) Safe temperature for the nozzle after timeout #define HOTEND_IDLE_BED_TARGET 0 // (°C) Safe temperature for the bed after timeout @@ -621,7 +618,7 @@ * * Define one or both of these to override the default 0-255 range. */ -#define FAN_MIN_PWM 50 // Ender Configs +//#define FAN_MIN_PWM 50 //#define FAN_MAX_PWM 128 /** @@ -684,7 +681,7 @@ * Multiple extruders can be assigned to the same pin in which case * the fan will turn on when any selected extruder is above the threshold. */ -#define E0_AUTO_FAN_PIN -1 // Ender3V2 Configs +#define E0_AUTO_FAN_PIN -1 #define E1_AUTO_FAN_PIN -1 #define E2_AUTO_FAN_PIN -1 #define E3_AUTO_FAN_PIN -1 @@ -927,7 +924,7 @@ //#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (linear=mm, rotational=°) Backoff from endstops after homing //#define XY_COUNTERPART_BACKOFF_MM 0 // (mm) Backoff X after homing Y, and vice-versa -#define QUICK_HOME // If G28 contains XY do a diagonal move first +//#define QUICK_HOME // If G28 contains XY do a diagonal move first //#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X //#define HOME_Z_FIRST // Home Z first. Requires a real endstop (not a probe). //#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first @@ -952,7 +949,7 @@ // Safety: The probe needs time to recognize the command. // Minimum command delay (ms). Enable and increase if needed. - #define BLTOUCH_DELAY 200 + //#define BLTOUCH_DELAY 500 /** * Settings for BLTOUCH Classic 1.2, 1.3 or BLTouch Smart 1.0, 2.0, 2.2, 3.0, 3.1, and most clones: @@ -999,7 +996,7 @@ * * Set the default state here, change with 'M401 S' or UI, use M500 to save, M502 to reset. */ - #define BLTOUCH_HS_MODE true + //#define BLTOUCH_HS_MODE true #ifdef BLTOUCH_HS_MODE // The probe Z offset (M851 Z) is the height at which the probe triggers. @@ -1082,7 +1079,7 @@ #if ENABLED(ASSISTED_TRAMMING) // Define from 3 to 9 points to probe. - #define TRAMMING_POINT_XY { { 29, 29 }, { 199, 29 }, { 199, 199 }, { 29, 199 } } + #define TRAMMING_POINT_XY { { 20, 20 }, { 180, 20 }, { 180, 180 }, { 20, 180 } } // Define position names for probe points. #define TRAMMING_POINT_NAME_1 "Front-Left" @@ -1103,7 +1100,7 @@ * M4: 40 = Clockwise, 41 = Counter-Clockwise * M5: 50 = Clockwise, 51 = Counter-Clockwise */ - #define TRAMMING_SCREW_THREAD 40 + #define TRAMMING_SCREW_THREAD 30 #endif @@ -1127,7 +1124,7 @@ /** * Advanced configuration */ - #define FTM_BATCH_SIZE 100 // Batch size for trajectory generation. + #define FTM_BATCH_SIZE 100 // Batch size for trajectory generation; #define FTM_WINDOW_SIZE 200 // Window size for trajectory generation. #define FTM_FS 1000 // (Hz) Frequency for trajectory generation. (1 / FTM_TS) #define FTM_TS 0.001f // (s) Time step for trajectory generation. (1 / FTM_FS) @@ -1189,7 +1186,7 @@ #endif //#define SHAPING_MIN_FREQ 20 // By default the minimum of the shaping frequencies. Override to affect SRAM usage. //#define SHAPING_MAX_STEPRATE 10000 // By default the maximum total step rate of the shaped axes. Override to affect SRAM usage. - #define SHAPING_MENU // Add a menu to the LCD to set shaping parameters. + //#define SHAPING_MENU // Add a menu to the LCD to set shaping parameters. #endif // @section motion @@ -1216,7 +1213,7 @@ * Enable DISABLE_IDLE_* to shut down axis steppers after an idle period. * The default timeout duration can be overridden with M18 and M84. Set to 0 for No Timeout. */ -#define DEFAULT_STEPPER_TIMEOUT_SEC 360 +#define DEFAULT_STEPPER_TIMEOUT_SEC 120 #define DISABLE_IDLE_X #define DISABLE_IDLE_Y #define DISABLE_IDLE_Z // Disable if the nozzle could fall onto your printed part! @@ -1229,21 +1226,17 @@ #define DISABLE_IDLE_E // Shut down all idle extruders // Default Minimum Feedrates for printing and travel moves -#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S. -#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T. -#if HAS_ROTATIONAL_AXES - #define DEFAULT_ANGULAR_MINIMUMFEEDRATE 0.0 // (°/s) Minimum feedrate for rotational-only moves. Set with M205 P. - #define DEFAULT_ANGULAR_MINTRAVELFEEDRATE 0.0 // (°/s) Minimum travel feedrate for rotational-only moves. Set with M205 Q. -#endif +#define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum feedrate. Set with M205 S. +#define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s. °/s for rotational-only moves) Minimum travel feedrate. Set with M205 T. // Minimum time that a segment needs to take as the buffer gets emptied -#define DEFAULT_MINSEGMENTTIME 50000 // (µs) Set with M205 B. +#define DEFAULT_MINSEGMENTTIME 20000 // (µs) Set with M205 B. // Slow down the machine if the lookahead buffer is (by default) half full. // Increase the slowdown divisor for larger buffer sizes. #define SLOWDOWN #if ENABLED(SLOWDOWN) - #define SLOWDOWN_DIVISOR 4 + #define SLOWDOWN_DIVISOR 2 #endif /** @@ -1372,7 +1365,6 @@ * This allows higher feedrates than the MCU could otherwise support. */ #define MULTISTEPPING_LIMIT 16 //: [1, 2, 4, 8, 16, 32, 64, 128] -#define OLD_ADAPTIVE_MULTISTEPPING 1 /** * Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies @@ -1380,7 +1372,7 @@ * vibration and surface artifacts. The algorithm adapts to provide the best possible step smoothing at the * lowest stepping frequencies. */ -#define ADAPTIVE_STEP_SMOOTHING +//#define ADAPTIVE_STEP_SMOOTHING /** * Custom Microstepping @@ -1455,7 +1447,7 @@ // @section lcd #if HAS_MANUAL_MOVE_MENU - #define MANUAL_FEEDRATE { 60*60, 60*60, 8*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel + #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel #define FINE_MANUAL_MOVE 0.025 // (mm) Smallest manual move (< 0.1mm) applying to Z on most machines #if IS_ULTIPANEL #define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position" @@ -1466,9 +1458,8 @@ // Change values more rapidly when the encoder is rotated faster #define ENCODER_RATE_MULTIPLIER #if ENABLED(ENCODER_RATE_MULTIPLIER) - #define ENCODER_5X_STEPS_PER_SEC 40 // (steps/s) Encoder rate for 5x speed - #define ENCODER_10X_STEPS_PER_SEC 70 // (steps/s) Encoder rate for 10x speed // Ender Configs - #define ENCODER_100X_STEPS_PER_SEC 110 // (steps/s) Encoder rate for 100x speed // Ender Configs + #define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed + #define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed #endif // Play a beep when the feedrate is changed from the Status Screen @@ -1552,15 +1543,15 @@ */ #define SHOW_BOOTSCREEN // Show the Marlin bootscreen on startup. ** ENABLE FOR PRODUCTION ** #if ENABLED(SHOW_BOOTSCREEN) - #define BOOTSCREEN_TIMEOUT 1100 // (ms) Total Duration to display the boot screen(s) + #define BOOTSCREEN_TIMEOUT 3000 // (ms) Total Duration to display the boot screen(s) #if ANY(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI) - //#define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash) + #define BOOT_MARLIN_LOGO_SMALL // Show a smaller Marlin logo on the Boot Screen (saving lots of flash) #endif #if HAS_MARLINUI_U8GLIB //#define BOOT_MARLIN_LOGO_ANIMATED // Animated Marlin logo. Costs ~3260 (or ~940) bytes of flash. #endif #if ANY(HAS_MARLINUI_U8GLIB, TOUCH_UI_FTDI_EVE) - #define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup. + //#define SHOW_CUSTOM_BOOTSCREEN // Show the bitmap in Marlin/_Bootscreen.h on startup. #endif #endif @@ -1568,18 +1559,17 @@ //#define CUSTOM_STATUS_SCREEN_IMAGE // Show the bitmap in Marlin/_Statusscreen.h on the status screen. #endif - #define SOUND_MENU_ITEM // Add a mute option to the LCD menu + //#define SOUND_MENU_ITEM // Add a mute option to the LCD menu #define SOUND_ON_DEFAULT // Buzzer/speaker default enabled state - //#define TICK_ON_DEFAULT // Beep/Tick default enabled state // The timeout to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000 // (ms) // Scroll a longer status message into view - #define STATUS_MESSAGE_SCROLLING // MRiscoC Allow scrolling of large status messages + //#define STATUS_MESSAGE_SCROLLING // Apply a timeout to low-priority status messages - #define STATUS_MESSAGE_TIMEOUT_SEC 45 // (seconds) // MRiscoC Enable Status Message Timeout + //#define STATUS_MESSAGE_TIMEOUT_SEC 30 // (seconds) // On the Info Screen, display XY with one decimal place when possible //#define LCD_DECIMAL_SMALL_XY @@ -1590,9 +1580,6 @@ // Display a negative temperature instead of "err" //#define SHOW_TEMPERATURE_BELOW_ZERO - // Change Title Menu Text to Centered - #define TITLE_CENTERED - /** * LED Control Menu * Add LED Control to the LCD menu @@ -1622,14 +1609,14 @@ #endif // HAS_DISPLAY // Add 'M73' to set print job progress, overrides Marlin's built-in estimate -#define SET_PROGRESS_MANUALLY // MRiscoC Allow display feedback of host printing through GCode M73 +//#define SET_PROGRESS_MANUALLY #if ENABLED(SET_PROGRESS_MANUALLY) - #define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done // MRiscoC Allow display feedback of host printing through GCode M73 - #define SET_REMAINING_TIME // Add 'R' parameter to set remaining time // MRiscoC Allow display feedback of host printing through GCode M73 + #define SET_PROGRESS_PERCENT // Add 'P' parameter to set percentage done + #define SET_REMAINING_TIME // Add 'R' parameter to set remaining time //#define SET_INTERACTION_TIME // Add 'C' parameter to set time until next filament change or other user interaction - #define M73_REPORT // Report M73 values to host + //#define M73_REPORT // Report M73 values to host #if ALL(M73_REPORT, HAS_MEDIA) - //#define M73_REPORT_SD_ONLY // Report only when printing from SD + #define M73_REPORT_SD_ONLY // Report only when printing from SD #endif #endif @@ -1637,7 +1624,7 @@ #if HAS_DISPLAY && ANY(HAS_MEDIA, SET_PROGRESS_MANUALLY) #define SHOW_PROGRESS_PERCENT // Show print progress percentage (doesn't affect progress bar) #define SHOW_ELAPSED_TIME // Display elapsed printing time (prefix 'E') - #define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') + //#define SHOW_REMAINING_TIME // Display estimated time to completion (prefix 'R') #if ENABLED(SET_INTERACTION_TIME) #define SHOW_INTERACTION_TIME // Display time until next user interaction ('C' = filament change) #endif @@ -1676,7 +1663,7 @@ //#define GCODE_REPEAT_MARKERS // Enable G-code M808 to set repeat markers and do looping - #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls // MRiscoC save program memory + #define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls #define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished #define SD_FINISHED_RELEASECOMMAND "M84" // Use "M84XYE" to keep Z enabled so your bed stays in place @@ -1695,7 +1682,7 @@ //#define MEDIA_MENU_AT_TOP // Force the media menu to be listed on the top of the main menu - #define EVENT_GCODE_SD_ABORT "G27 P2" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27") + #define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27") #if ENABLED(PRINTER_EVENT_LEDS) #define PE_LEDS_COMPLETED_TIME (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination @@ -1709,7 +1696,7 @@ * an option on the LCD screen to continue the print from the last-known * point in the file. */ - //#define POWER_LOSS_RECOVERY // (3400 bytes of flash) + //#define POWER_LOSS_RECOVERY #if ENABLED(POWER_LOSS_RECOVERY) #define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500) //#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss @@ -1755,17 +1742,17 @@ * - SDSORT_CACHE_NAMES will retain the sorted file listing in RAM. (Expensive!) * - SDSORT_DYNAMIC_RAM only uses RAM when the SD menu is visible. (Use with caution!) */ - #define SDCARD_SORT_ALPHA // Ender Configs + //#define SDCARD_SORT_ALPHA // SD Card Sorting options #if ENABLED(SDCARD_SORT_ALPHA) - #define SDSORT_LIMIT 80 // Maximum number of sorted items (10-256). Costs 27 bytes each. + #define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256). Costs 27 bytes each. #define FOLDER_SORTING -1 // -1=above 0=none 1=below - #define SDSORT_GCODE true // Allow turning sorting on/off with LCD and M34 G-code. // MRiscoC Allows disable file sort by M34 g-code - #define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting. // Ender Configs + #define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 G-code. + #define SDSORT_USES_RAM false // Pre-allocate a static array for faster pre-sorting. #define SDSORT_USES_STACK false // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.) - #define SDSORT_CACHE_NAMES true // Keep sorted items in RAM longer for speedy performance. Most expensive option. // Ender Configs - #define SDSORT_DYNAMIC_RAM true // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! // Ender Configs + #define SDSORT_CACHE_NAMES false // Keep sorted items in RAM longer for speedy performance. Most expensive option. + #define SDSORT_DYNAMIC_RAM false // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use! #define SDSORT_CACHE_VFATS 2 // Maximum number of 13-byte VFAT entries to use for sorting. // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM. #endif @@ -1774,13 +1761,13 @@ // LCD's font must contain the characters. Check your selected LCD language. //#define UTF_FILENAME_SUPPORT - #define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 ' and list long filenames with 'M20 L' // MRiscoC Enabled - #define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol // MRiscoC Enabled - //#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands + //#define LONG_FILENAME_HOST_SUPPORT // Get the long filename of a file/folder with 'M33 ' and list long filenames with 'M20 L' + //#define LONG_FILENAME_WRITE_SUPPORT // Create / delete files with long filenames via M28, M30, and Binary Transfer Protocol + //#define M20_TIMESTAMP_SUPPORT // Include timestamps by adding the 'T' flag to M20 commands - #define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu // MRiscoC Enabled + //#define SCROLL_LONG_FILENAMES // Scroll long filenames in the SD card menu - //#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!) + //#define SD_ABORT_NO_COOLDOWN // Leave the heaters on after Stop Print (not recommended!) /** * Abort SD printing when any endstop is triggered. @@ -1863,11 +1850,11 @@ //#define CONFIGURATION_EMBEDDING // Add an optimized binary file transfer mode, initiated with 'M28 B1' - //#define BINARY_FILE_TRANSFER // MRiscoC Enabled for easy firmware upgrade + //#define BINARY_FILE_TRANSFER #if ENABLED(BINARY_FILE_TRANSFER) // Include extra facilities (e.g., 'M20 F') supporting firmware upload via BINARY_FILE_TRANSFER - //#define CUSTOM_FIRMWARE_UPLOAD // MRiscoC Enabled for easy firmware upgrade + //#define CUSTOM_FIRMWARE_UPLOAD #endif /** @@ -1904,15 +1891,6 @@ */ //#define NO_SD_HOST_DRIVE // Disable SD Card access over USB (for security). -/** - * By default the framework is responsible for the shared media I/O. - * Enable this if you need Marlin to take care of the shared media I/O. - * Useful if shared media isn't working properly on some boards. - */ -#if HAS_MEDIA && DISABLED(NO_SD_HOST_DRIVE) - //#define DISKIO_HOST_DRIVE -#endif - /** * Additional options for Graphical Displays * @@ -2226,16 +2204,16 @@ * * Warning: Does not respect endstops! */ -#define BABYSTEPPING // Ender Configs +//#define BABYSTEPPING #if ENABLED(BABYSTEPPING) //#define INTEGRATED_BABYSTEPPING // Integration of babystepping into the Stepper ISR - //#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support - #define BABYSTEP_WITHOUT_HOMING // MRiscoC Enabled BbS without home - #define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement) // MRiscoC Active BbS always + //#define EP_BABYSTEPPING // M293/M294 babystepping with EMERGENCY_PARSER support + //#define BABYSTEP_WITHOUT_HOMING + //#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement) //#define BABYSTEP_XY // Also enable X/Y Babystepping. Not supported on DELTA! //#define BABYSTEP_INVERT_Z // Enable if Z babysteps should go the other way //#define BABYSTEP_MILLIMETER_UNITS // Specify BABYSTEP_MULTIPLICATOR_(XY|Z) in mm instead of micro-steps - #define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep // Ender Configs 40 + #define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep #define BABYSTEP_MULTIPLICATOR_XY 1 // (steps or mm) Steps or millimeter distance for each XY babystep //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping. @@ -2250,16 +2228,10 @@ //#define BABYSTEP_DISPLAY_TOTAL // Display total babysteps since last G28 - #ifdef BLTOUCH - #define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping - //#define BABYSTEP_GLOBAL_Z // Combine M424 Z and Babystepping - - #if ANY(BABYSTEP_ZPROBE_OFFSET, BABYSTEP_GLOBAL_Z) - #if ENABLED(BABYSTEP_ZPROBE_OFFSET) - //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets - #endif + //#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) + //#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets //#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor - #endif #endif #endif @@ -2280,16 +2252,16 @@ * * See https://marlinfw.org/docs/features/lin_advance.html for full instructions. */ -#define LIN_ADVANCE +//#define LIN_ADVANCE #if ENABLED(LIN_ADVANCE) #if ENABLED(DISTINCT_E_FACTORS) - #define ADVANCE_K { 0.00 } // (mm) Compression length per 1mm/s extruder speed, per extruder + #define ADVANCE_K { 0.22 } // (mm) Compression length per 1mm/s extruder speed, per extruder #else - #define ADVANCE_K 0.00 // (mm) Compression length applying to all extruders + #define ADVANCE_K 0.22 // (mm) Compression length applying to all extruders #endif //#define ADVANCE_K_EXTRA // Add a second linear advance constant, configurable with M900 L. //#define LA_DEBUG // Print debug information to serial during operation. Disable for production use. - #define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends. + //#define ALLOW_LOW_EJERK // Allow a DEFAULT_EJERK value of <10. Recommended for direct drive hotends. //#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz. #endif @@ -2459,7 +2431,7 @@ #define MIN_CIRCLE_SEGMENTS 72 // Minimum number of segments in a complete circle //#define ARC_SEGMENTS_PER_SEC 50 // Use the feedrate to choose the segment length #define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections - #define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles // MRiscoC Enabled + //#define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles //#define SF_ARC_FIX // Enable only if using SkeinForge with "Arc Point" fillet procedure #endif @@ -2494,7 +2466,7 @@ #endif // Moves (or segments) with fewer steps than this will be joined with the next move -#define MIN_STEPS_PER_SEGMENT 4 // MRiscoC Increase little movements accuracy +#define MIN_STEPS_PER_SEGMENT 6 /** * Minimum delay before and after setting the stepper DIR (in ns) @@ -2553,18 +2525,18 @@ // 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 ALL(HAS_MEDIA, DIRECT_STEPPING) - #define BLOCK_BUFFER_SIZE 32 + #define BLOCK_BUFFER_SIZE 8 #elif HAS_MEDIA - #define BLOCK_BUFFER_SIZE 32 + #define BLOCK_BUFFER_SIZE 16 #else - #define BLOCK_BUFFER_SIZE 32 + #define BLOCK_BUFFER_SIZE 16 #endif // @section serial // The ASCII buffer for serial input #define MAX_CMD_SIZE 96 -#define BUFSIZE 32 +#define BUFSIZE 4 // Transmission to Host Buffer Size // To save 386 bytes of flash (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. @@ -2573,7 +2545,7 @@ // For debug-echo: 128 bytes for the optimal speed. // Other output doesn't need to be that speedy. // :[0, 2, 4, 8, 16, 32, 64, 128, 256] -#define TX_BUFFER_SIZE 64 +#define TX_BUFFER_SIZE 0 // Host Receive Buffer Size // Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. @@ -2611,7 +2583,7 @@ * Currently handles M108, M112, M410, M876 * NOTE: Not yet implemented for all platforms. */ -#define EMERGENCY_PARSER // MRiscoC Enabled instantaneous response to emergency commands +//#define EMERGENCY_PARSER /** * Realtime Reporting (requires EMERGENCY_PARSER) @@ -2628,9 +2600,9 @@ * - During Hold all Emergency Parser commands are available, as usual. * - Enable NANODLP_Z_SYNC and NANODLP_ALL_AXIS for move command end-state reports. */ -//#define REALTIME_REPORTING_COMMANDS // (544 bytes of flash) +//#define REALTIME_REPORTING_COMMANDS #if ENABLED(REALTIME_REPORTING_COMMANDS) - //#define FULL_REPORT_TO_HOST_FEATURE // Auto-report the machine status like Grbl CNC (208 bytes of flash) + //#define FULL_REPORT_TO_HOST_FEATURE // Auto-report the machine status like Grbl CNC #endif // Bad Serial-connections can miss a received command by sending an 'ok' @@ -2640,7 +2612,7 @@ //#define NO_TIMEOUTS 1000 // Milliseconds // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. -//#define ADVANCED_OK // (128 bytes of flash) +//#define ADVANCED_OK // Printrun may have trouble receiving long strings all at once. // This option inserts short delays between lines of serial output. @@ -2683,20 +2655,20 @@ * * Note that M207 / M208 / M209 settings are saved to EEPROM. */ -#define FWRETRACT // MRiscoC Enabled support for firmware based retract (1592 bytes of flash) +//#define FWRETRACT #if ENABLED(FWRETRACT) - //#define FWRETRACT_AUTORETRACT // Override slicer retractions // MRiscoC use slicer retract + #define FWRETRACT_AUTORETRACT // Override slicer retractions #if ENABLED(FWRETRACT_AUTORETRACT) #define MIN_AUTORETRACT 0.1 // (mm) Don't convert E moves under this length #define MAX_AUTORETRACT 10.0 // (mm) Don't convert E moves over this length #endif - #define RETRACT_LENGTH 5 // (mm) Default retract length (positive value) // MRiscoC Bowden + #define RETRACT_LENGTH 3 // (mm) Default retract length (positive value) #define RETRACT_LENGTH_SWAP 13 // (mm) Default swap retract length (positive value) - #define RETRACT_FEEDRATE 40 // (mm/s) Default feedrate for retracting // MRiscoC Bowden - #define RETRACT_ZRAISE 0.2 // (mm) Default retract Z-raise // MRiscoC Bowden + #define RETRACT_FEEDRATE 45 // (mm/s) Default feedrate for retracting + #define RETRACT_ZRAISE 0 // (mm) Default retract Z-raise #define RETRACT_RECOVER_LENGTH 0 // (mm) Default additional recover length (added to retract length on recover) #define RETRACT_RECOVER_LENGTH_SWAP 0 // (mm) Default additional swap recover length (added to retract length on recover from toolchange) - #define RETRACT_RECOVER_FEEDRATE 40 // (mm/s) Default feedrate for recovering from retraction // MRiscoC Bowden + #define RETRACT_RECOVER_FEEDRATE 8 // (mm/s) Default feedrate for recovering from retraction #define RETRACT_RECOVER_FEEDRATE_SWAP 8 // (mm/s) Default feedrate for recovering from swap retraction #if ENABLED(MIXING_EXTRUDER) //#define RETRACT_SYNC_MIXING // Retract and restore all mixing steppers simultaneously @@ -2812,21 +2784,21 @@ * * Enable PARK_HEAD_ON_PAUSE to add the G-code M125 Pause and Park. */ -#define ADVANCED_PAUSE_FEATURE // MRiscoC Enabled +//#define ADVANCED_PAUSE_FEATURE #if ENABLED(ADVANCED_PAUSE_FEATURE) #define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate. #define PAUSE_PARK_RETRACT_LENGTH 2 // (mm) Initial retract. // This short retract is done immediately, before parking the nozzle. - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 20 // (mm/s) Unload filament feedrate. This can be pretty fast. // MRiscoC Increased filament unload speed + #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 // (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 100 // (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 50 // (mm) Slow length, to allow time to insert material. + #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 12 // (mm/s) Load filament feedrate. This can be pretty fast. // MRiscoC Increased filament load speed + #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 // (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 0 // (mm) Load length of filament, from extruder gear to nozzle. // For Bowden, the full length of the tube and nozzle. @@ -2846,16 +2818,16 @@ #define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged. #define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload - #define PAUSE_PARK_NOZZLE_TIMEOUT 90 // (seconds) Time limit before the nozzle is turned off for safety. - #define FILAMENT_CHANGE_ALERT_BEEPS 5 // Number of alert beeps to play when a response is needed. + #define PAUSE_PARK_NOZZLE_TIMEOUT 45 // (seconds) Time limit before the nozzle is turned off for safety. + #define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed. #define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change. //#define FILAMENT_CHANGE_RESUME_ON_INSERT // Automatically continue / load filament when runout sensor is triggered again. //#define PAUSE_REHEAT_FAST_RESUME // Reduce number of waits by not prompting again post-timeout before continuing. - #define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. // MRiscoC Enabled park head when pause command was issued + //#define PARK_HEAD_ON_PAUSE // Park the nozzle during pause and filament change. //#define HOME_BEFORE_FILAMENT_CHANGE // If needed, home before parking for filament change - #define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. // MRiscoC Enabled load/unload Filament G-codes + //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) #endif @@ -3227,7 +3199,7 @@ * Define your own with: * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_24V // All axes (override below) // MRiscoC Correct value for UART mode drivers + #define CHOPPER_TIMING CHOPPER_DEFAULT_12V // All axes (override below) //#define CHOPPER_TIMING_X CHOPPER_TIMING // For X Axes (override below) //#define CHOPPER_TIMING_X2 CHOPPER_TIMING_X //#define CHOPPER_TIMING_Y CHOPPER_TIMING // For Y Axes (override below) @@ -3371,7 +3343,7 @@ /** * Step on both rising and falling edge signals (as with a square wave). */ - #define EDGE_STEPPING + //#define EDGE_STEPPING /** * Enable M122 debugging command for TMC stepper drivers. @@ -3764,14 +3736,6 @@ */ //#define CNC_COORDINATE_SYSTEMS -/** - * CNC Drilling Cycle - UNDER DEVELOPMENT - * - * Enables G81 to perform a drilling cycle. - * Currently only supports a single cycle, no G-code chaining. - */ -//#define CNC_DRILLING_CYCLE - // @section reporting /** @@ -3791,17 +3755,17 @@ /** * Auto-report position with M154 S */ -//#define AUTO_REPORT_POSITION // (224 bytes of flash) +//#define AUTO_REPORT_POSITION #if ENABLED(AUTO_REPORT_POSITION) - #define AUTO_REPORT_REAL_POSITION // Auto-report the real position + //#define AUTO_REPORT_REAL_POSITION // Auto-report the real position #endif /** * Include capabilities in M115 output */ -#define EXTENDED_CAPABILITIES_REPORT // (1000 bytes of flash) +#define EXTENDED_CAPABILITIES_REPORT #if ENABLED(EXTENDED_CAPABILITIES_REPORT) - #define M115_GEOMETRY_REPORT // (448 bytes of flash) MRiscoC Enabled + //#define M115_GEOMETRY_REPORT #endif // @section security @@ -3846,8 +3810,8 @@ // @section reporting // Extra options for the M114 "Current Position" report -//#define M114_DETAIL // Use 'M114` for details to check planner calculations (600 bytes of flash) -//#define M114_REALTIME // Real current position based on forward kinematics (80 bytes of flash) +//#define M114_DETAIL // Use 'M114` for details to check planner calculations +//#define M114_REALTIME // Real current position based on forward kinematics //#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed. //#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others) @@ -3858,12 +3822,13 @@ * Spend 28 bytes of SRAM to optimize the G-code parser */ #define FASTER_GCODE_PARSER + #if ENABLED(FASTER_GCODE_PARSER) //#define GCODE_QUOTED_STRINGS // Support for quoted string parameters #endif // Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack) -#define MEATPACK_ON_SERIAL_PORT_1 +//#define MEATPACK_ON_SERIAL_PORT_1 //#define MEATPACK_ON_SERIAL_PORT_2 //#define GCODE_CASE_INSENSITIVE // Accept G-code sent to the firmware in lowercase @@ -3877,7 +3842,7 @@ * - M206 and M428 are disabled. * - G92 will revert to its behavior from Marlin 1.0. */ -//#define NO_WORKSPACE_OFFSETS // MRiscoC Save flash space and simplify movements +//#define NO_WORKSPACE_OFFSETS /** * CNC G-code options @@ -3893,7 +3858,6 @@ #ifdef G0_FEEDRATE //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif -//#define G0_ANGULAR_FEEDRATE 2700 // (°/min) // @section gcode @@ -4034,10 +3998,10 @@ * Host Prompt Support enables Marlin to use the host for user prompts so * filament runout and other processes can be managed from the host side. */ -#define HOST_ACTION_COMMANDS // MRiscoC Enabled actions from host +//#define HOST_ACTION_COMMANDS #if ENABLED(HOST_ACTION_COMMANDS) //#define HOST_PAUSE_M76 // Tell the host to pause in response to M76 - #define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback // MRiscoC Enabled responses from host + //#define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback #if ENABLED(HOST_PROMPT_SUPPORT) //#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications #endif @@ -4052,7 +4016,7 @@ * * Implement M486 to allow Marlin to skip objects */ -#define CANCEL_OBJECTS // MRiscoC Enabled M486 to skip objects (416 bytes of flash) +//#define CANCEL_OBJECTS #if ENABLED(CANCEL_OBJECTS) #define CANCEL_OBJECTS_REPORTING // Emit the current object as a status message #endif @@ -4308,30 +4272,29 @@ // Add an LCD menu for MMU2 //#define MMU2_MENUS - #if ANY(MMU2_MENUS, HAS_PRUSA_MMU2S) - // Settings for filament load / unload from the LCD menu. - // This is for Průša MK3-style extruders. Customize for your hardware. - #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 - #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ - { 7.2, 1145 }, \ - { 14.4, 871 }, \ - { 36.0, 1393 }, \ - { 14.4, 871 }, \ - { 50.0, 198 } - - #define MMU2_RAMMING_SEQUENCE \ - { 1.0, 1000 }, \ - { 1.0, 1500 }, \ - { 2.0, 2000 }, \ - { 1.5, 3000 }, \ - { 2.5, 4000 }, \ - { -15.0, 5000 }, \ - { -14.0, 1200 }, \ - { -6.0, 600 }, \ - { 10.0, 700 }, \ - { -10.0, 400 }, \ - { -50.0, 2000 } - #endif + + // Settings for filament load / unload from the LCD menu. + // This is for Průša MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 1145 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } /** * Using a sensor like the MMU2S @@ -4440,4 +4403,4 @@ //#define SOFT_RESET_ON_KILL // Use a digital button to soft-reset the controller after KILL // Report uncleaned reset reason from register r2 instead of MCUSR. Supported by Optiboot on AVR. -//#define OPTIBOOT_RESET_REASON \ No newline at end of file +//#define OPTIBOOT_RESET_REASON diff --git a/platformio.ini b/platformio.ini index bbed133e0314..e3bdb6f58676 100644 --- a/platformio.ini +++ b/platformio.ini @@ -13,7 +13,7 @@ [platformio] src_dir = Marlin boards_dir = buildroot/share/PlatformIO/boards -default_envs = STM32F103RE_creality +default_envs = mega2560 include_dir = Marlin extra_configs = Marlin/config.ini From c282a4fdea241ae094db5ebb458d8a7d619129f9 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sun, 23 Jul 2023 03:10:06 -0400 Subject: [PATCH 16/39] LCD_BACKLIGHT_TIMEOUT_MINS to work w/DWIN displays --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 1 + Marlin/src/inc/SanityCheck.h | 4 ++-- Marlin/src/lcd/e3v2/common/encoder.cpp | 10 ++++++++++ Marlin/src/lcd/e3v2/proui/dwin.cpp | 21 +++++++++++++++++++-- Marlin/src/lcd/e3v2/proui/plot.cpp | 3 +++ Marlin/src/lcd/marlinui.cpp | 4 ++-- 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 6f5187cc9f39..a6a1598d5324 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -772,6 +772,7 @@ void unified_bed_leveling::shift_mesh_height() { const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1; SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); + TERN_(LCD_BACKLIGHT_TIMEOUT_MINS, ui.refresh_backlight_timeout()); // refresh timeout to keep screen on #if HAS_MARLINUI_MENU if (ui.button_pressed()) { diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8eb8662c32e3..fe3a2796e1e6 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2736,7 +2736,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - #if !HAS_ENCODER_ACTION + #if !HAS_ENCODER_ACTION && !HAS_RESUME_CONTINUE #error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad." #elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST) #if PIN_EXISTS(LCD_BACKLIGHT) @@ -2744,7 +2744,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #elif ENABLED(NEOPIXEL_BKGD_ALWAYS_ON) #error "LCD_BACKLIGHT_TIMEOUT is not compatible with NEOPIXEL_BKGD_ALWAYS_ON." #endif - #elif !PIN_EXISTS(LCD_BACKLIGHT) + #elif !PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2) #error "LCD_BACKLIGHT_TIMEOUT_MINS requires either LCD_BACKLIGHT_PIN or NEOPIXEL_BKGD_INDEX_FIRST." #endif #endif diff --git a/Marlin/src/lcd/e3v2/common/encoder.cpp b/Marlin/src/lcd/e3v2/common/encoder.cpp index 2ff67059e98d..dd360b03506c 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.cpp +++ b/Marlin/src/lcd/e3v2/common/encoder.cpp @@ -84,6 +84,9 @@ EncoderState encoderReceiveAnalyze() { if (ELAPSED(now, next_click_update_ms)) { next_click_update_ms = millis() + 300; Encoder_tick(); + #if LCD_BACKLIGHT_TIMEOUT_MINS + ui.refresh_backlight_timeout(); //reset timer on click + #endif #if PIN_EXISTS(LCD_LED) //LED_Action(); #endif @@ -120,6 +123,13 @@ EncoderState encoderReceiveAnalyze() { if (temp_diff > 0) temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CCW, ENCODER_DIFF_CW); else temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CW, ENCODER_DIFF_CCW); + #if LCD_BACKLIGHT_TIMEOUT_MINS + if (temp_diffState > 0) { + ui.refresh_backlight_timeout(); //reset timer after encoder +- (this can be changed -> added to an all in one if statement) + if (!ui.backlight) { ui.refresh_brightness(); } + } + #endif + #if ENABLED(ENCODER_RATE_MULTIPLIER) millis_t ms = millis(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 7aa9b1760d10..c46fd954a49c 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1252,6 +1252,13 @@ void hmiInit() { void eachMomentUpdate() { static millis_t next_var_update_ms = 0, next_rts_update_ms = 0, next_status_update_ms = 0; const millis_t ms = millis(); + + #if LCD_BACKLIGHT_TIMEOUT_MINS + if (ui.backlight_off_ms && ELAPSED(ms, ui.backlight_off_ms)) { + TurnOffBacklight(); // Backlight off + ui.backlight_off_ms = 0; + } + #endif if (ELAPSED(ms, next_var_update_ms)) { next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL; @@ -2217,6 +2224,10 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS, #endif +#if LCD_BACKLIGHT_TIMEOUT_MINS + void setTimer() { setPIntOnClick(ui.backlight_timeout_min, ui.backlight_timeout_max); } +#endif + #if HAS_FILAMENT_SENSOR void setRunoutEnable() { runout.reset(); @@ -3067,7 +3078,7 @@ void drawControlMenu() { void drawAdvancedSettingsMenu() { checkkey = ID_Menu; - if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 23)) { + if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 24)) { BACK_ITEM(gotoMainMenu); #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); @@ -3104,6 +3115,9 @@ void drawAdvancedSettingsMenu() { #if HAS_LOCKSCREEN MENU_ITEM(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, dwinLockScreen); #endif + #if LCD_BACKLIGHT_TIMEOUT_MINS + EDIT_ITEM(ICON_Brightness, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); + #endif #if ENABLED(SOUND_MENU_ITEM) EDIT_ITEM(ICON_Sound, MSG_SOUND_ENABLE, onDrawChkbMenu, setEnableSound, &ui.sound_on); #endif @@ -3282,7 +3296,7 @@ void drawFilSetMenu() { void drawTuneMenu() { checkkey = ID_Menu; - if (SET_MENU_R(tuneMenu, selrect({73, 2, 28, 12}), MSG_TUNE, 17)) { + if (SET_MENU_R(tuneMenu, selrect({73, 2, 28, 12}), MSG_TUNE, 18)) { BACK_ITEM(gotoPrintProcess); EDIT_ITEM(ICON_Speed, MSG_SPEED, onDrawSpeedItem, setSpeed, &feedrate_percentage); #if HAS_HOTEND @@ -3325,6 +3339,9 @@ void drawTuneMenu() { EDIT_ITEM(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, setBrightness, &ui.brightness); MENU_ITEM(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, turnOffBacklight); #endif + #if LCD_BACKLIGHT_TIMEOUT_MINS + EDIT_ITEM(ICON_Brightness, MSG_SCREEN_TIMEOUT, onDrawPIntMenu, setTimer, &ui.backlight_timeout_minutes); + #endif #if ENABLED(CASE_LIGHT_MENU) EDIT_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on); #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index 95d8ec291d1b..59e474c7ccec 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -70,6 +70,9 @@ void PlotClass::update(const_float_t value) { dwinDrawPoint(COLOR_YELLOW, 1, 1, x2 - 1, y); } grphpoints++; + #if LCD_BACKLIGHT_TIMEOUT_MINS + ui.refresh_backlight_timeout(); + #endif } #endif // DWIN_LCD_PROUI && PROUI_TUNING_GRAPH diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 69a8e2336365..e5219230cedb 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -190,11 +190,11 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; millis_t MarlinUI::backlight_off_ms = 0; void MarlinUI::refresh_backlight_timeout() { - backlight_off_ms = backlight_timeout_minutes ? millis() + backlight_timeout_minutes * 60UL * 1000UL : 0; + backlight_off_ms = backlight_timeout_minutes ? millis() + MIN_TO_MS(backlight_timeout_minutes) : 0; #ifdef NEOPIXEL_BKGD_INDEX_FIRST neo.reset_background_color(); neo.show(); - #elif PIN_EXISTS(LCD_BACKLIGHT) + #elif PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2) WRITE(LCD_BACKLIGHT_PIN, HIGH); #endif } From dfaf0b1454a6f8f3f75f1dc819c36d15d5686008 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Tue, 25 Jul 2023 16:20:57 -0400 Subject: [PATCH 17/39] proui/meshviewer.cpp draws actual value --- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 2781ccaa1df7..6952234c9316 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -92,13 +92,13 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3*fs, py(y) - fs, z); break; case -99 ... -1: - sprintf_P(str_1, PSTR("-.%02i"), -v); + sprintf_P(str_1, PSTR("%.2f"), z); break; case 0: dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, py(y) - fs, "0"); break; case 1 ... 99: - sprintf_P(str_1, PSTR(".%02i"), v); + sprintf_P(str_1, PSTR("%.2f"), z); break; case 100 ... 999: DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, py(y) - fs, z); From 05e31000ca3b174b1736fc80de1e4406b7005f14 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Tue, 25 Jul 2023 16:22:08 -0400 Subject: [PATCH 18/39] proui/meshviewer draws gradiant "rainbow-y" colors --- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 72b66fb5b3e4..3c4ab418887d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -297,12 +297,17 @@ uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) { uint8_t B, G, R; const uint8_t maxB = 28, maxR = 28, maxG = 38; const int16_t limv = _MAX(abs(minv), abs(maxv)); - float n = minv >= 0 ? float(val - minv) / (maxv - minv) : (float)val / limv; + float n = (minv >= 0) ? (float)(val - minv) / (maxv - minv) : (float)val / limv; LIMIT(n, -1, 1); - if (n < 0) { + if (n <= -0.5) { R = 0; - G = (1 + n) * maxG; - B = (-n) * maxB; + G = maxG * (1 + n); + B = maxB; + } + else if (n <= 0) { + R = 0; + G = maxG; + B = maxB * (-n) * 2; } else if (n < 0.5) { R = maxR * n * 2; From 9baf92c2f26238ed8bc48b0ed727b5e746737b82 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 28 Jul 2023 16:36:58 -0400 Subject: [PATCH 19/39] Fix missing `str_1` error --- Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index 29966b92c9d9..ba9bc92daa6c 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -74,6 +74,7 @@ uint8_t BedLevelTools::mesh_y = 0; uint8_t BedLevelTools::tilt_grid = 1; bool drawing_mesh = false; +char str_1[16]; #if ENABLED(AUTO_BED_LEVELING_UBL) From 32d57596dd4b0edc0d3b6e8562539ae6add1e6bf Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 28 Jul 2023 16:38:24 -0400 Subject: [PATCH 20/39] Rearrange ProUI dwin.cpp to fix Adv_Pause_Feat. --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 36 +++++++++++++----------------- Marlin/src/lcd/e3v2/proui/dwin.h | 4 +--- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 503f5047dbce..e5719f1372a3 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1255,7 +1255,7 @@ void eachMomentUpdate() { #if LCD_BACKLIGHT_TIMEOUT_MINS if (ui.backlight_off_ms && ELAPSED(ms, ui.backlight_off_ms)) { - TurnOffBacklight(); // Backlight off + turnOffBacklight(); // Backlight off ui.backlight_off_ms = 0; } #endif @@ -2266,6 +2266,13 @@ void setSpeed() { setPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } void setFanSpeed() { setIntOnClick(0, 255, thermalManager.fan_speed[0], applyFanSpeed); } #endif +#if ENABLED(NOZZLE_PARK_FEATURE) + void parkHead() { + LCD_MESSAGE(MSG_FILAMENT_PARK_ENABLED); + queue.inject(F("G28O\nG27")); + } +#endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) void changeFilament() { @@ -2273,13 +2280,6 @@ void setSpeed() { setPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } queue.inject(F("M600 B2")); } - #if ENABLED(NOZZLE_PARK_FEATURE) - void parkHead() { - LCD_MESSAGE(MSG_FILAMENT_PARK_ENABLED); - queue.inject(F("G28O\nG27")); - } - #endif - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) void unloadFilament() { LCD_MESSAGE(MSG_FILAMENTUNLOAD); @@ -2987,9 +2987,7 @@ void drawPrepareMenu() { checkkey = ID_Menu; if (SET_MENU_R(prepareMenu, selrect({133, 1, 28, 13}), MSG_PREPARE, 10 + PREHEAT_COUNT)) { BACK_ITEM(gotoMainMenu); - #if ENABLED(ADVANCED_PAUSE_FEATURE) - MENU_ITEM(ICON_FilMan, MSG_FILAMENT_MAN, onDrawSubMenu, drawFilamentManMenu); - #endif + MENU_ITEM(ICON_FilMan, MSG_FILAMENT_MAN, onDrawSubMenu, drawFilamentManMenu); MENU_ITEM(ICON_Axis, MSG_MOVE_AXIS, onDrawMoveSubMenu, drawMoveMenu); #if ENABLED(LCD_BED_TRAMMING) MENU_ITEM(ICON_Tram, MSG_BED_TRAMMING, onDrawSubMenu, drawTrammingMenu); @@ -3454,9 +3452,7 @@ void drawMotionMenu() { updateMenu(motionMenu); } -#if ENABLED(ADVANCED_PAUSE_FEATURE) - - #if HAS_PREHEAT +#if ENABLED(ADVANCED_PAUSE_FEATURE) && HAS_PREHEAT void drawPreheatHotendMenu() { checkkey = ID_Menu; @@ -3468,7 +3464,7 @@ void drawMotionMenu() { updateMenu(preheatHotendMenu); } - #endif +#endif void drawFilamentManMenu() { checkkey = ID_Menu; @@ -3477,10 +3473,12 @@ void drawMotionMenu() { #if ENABLED(NOZZLE_PARK_FEATURE) MENU_ITEM(ICON_Park, MSG_FILAMENT_PARK_ENABLED, onDrawMenuItem, parkHead); #endif - #if HAS_PREHEAT - MENU_ITEM(ICON_SetEndTemp, MSG_PREHEAT_HOTEND, onDrawSubMenu, drawPreheatHotendMenu); + #if ENABLED(ADVANCED_PAUSE_FEATURE) + #if HAS_PREHEAT + MENU_ITEM(ICON_SetEndTemp, MSG_PREHEAT_HOTEND, onDrawSubMenu, drawPreheatHotendMenu); + #endif + MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament); #endif - MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament); #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) MENU_ITEM(ICON_FilUnload, MSG_FILAMENTUNLOAD, onDrawMenuItem, unloadFilament); MENU_ITEM(ICON_FilLoad, MSG_FILAMENTLOAD, onDrawMenuItem, loadFilament); @@ -3489,8 +3487,6 @@ void drawMotionMenu() { updateMenu(filamentMenu); } -#endif - #if ENABLED(MESH_BED_LEVELING) void drawManualMeshMenu() { diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index ccc90b3de608..c76ee0255a73 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -318,9 +318,7 @@ void drawFilSetMenu(); #endif void drawTuneMenu(); void drawMotionMenu(); -#if ENABLED(ADVANCED_PAUSE_FEATURE) - void drawFilamentManMenu(); -#endif +void drawFilamentManMenu(); #if ENABLED(MESH_BED_LEVELING) void drawManualMeshMenu(); #endif From 4d3e81208bdcdaa91e143c7fe7f8438b7936a3a9 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 28 Jul 2023 23:58:04 -0400 Subject: [PATCH 21/39] Update CMakeLists.txt cmake_min v3.5, fix warning --- buildroot/share/cmake/CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/buildroot/share/cmake/CMakeLists.txt b/buildroot/share/cmake/CMakeLists.txt index b861f79b952b..8864a270e429 100644 --- a/buildroot/share/cmake/CMakeLists.txt +++ b/buildroot/share/cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) #====================================================================# # Usage under Linux: # # # @@ -82,7 +82,7 @@ message("-- Running CMake version: " ${CMAKE_VERSION}) # Replace the CMake Ver. in the Arduino.cmake file(READ "${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/Platform/Arduino.cmake" ORIGINAL_FILE_CONTENTS) -string(REPLACE "cmake_minimum_required(VERSION 2.8.5)" "cmake_minimum_required(VERSION 2.8.12)" NEW_FILE_CONTENTS "${ORIGINAL_FILE_CONTENTS}") +string(REPLACE "cmake_minimum_required(VERSION 2.8.5)" "cmake_minimum_required(VERSION 3.5)" NEW_FILE_CONTENTS "${ORIGINAL_FILE_CONTENTS}") file(WRITE "${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/Platform/Arduino.cmake" "${NEW_FILE_CONTENTS}") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/modules) @@ -95,6 +95,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/marlin-cma set(ARDUINO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR}/arduino-1.8.19) #set(ARDUINO_SDK_PATH /Applications/Arduino.app/Contents/Java) #set(ARDUINO_SDK_PATH $HOME/ArduinoAddons/Arduino_1.6.x) + #====================================================================# # Set included cmake files # #====================================================================# @@ -108,6 +109,18 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/toolchain/Arduin #====================================================================# # Setup Project # +# # +# If you receive this error: # +# 'Unknown CMake command "_cmake_record_install_prefix".' # +# go to the file in your CMake directory. # +# # +# For Windows: cmake\Modules\Platform\WindowsPaths.cmake # +# For Linux: cmake/Modules/Platform/UnixPaths.cmake # +# # +# Comment out "_cmake_record_install_prefix()" # +# - OR - # +# Add "include(CMakeSystemSpecificInformation)" above the line. # +# # #====================================================================# project(Marlin C CXX) From a6a1e1c5a123f361ce520dc333b4e8097a555188 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Aug 2023 03:56:45 -0500 Subject: [PATCH 22/39] misc. adjustments --- Marlin/src/inc/SanityCheck.h | 2 +- Marlin/src/lcd/e3v2/common/encoder.cpp | 14 ++++---- Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp | 15 ++++---- Marlin/src/lcd/e3v2/proui/dwin.cpp | 36 ++++++++++---------- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 3e7b60c31459..b72953fa5585 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2740,7 +2740,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - #if !HAS_ENCODER_ACTION && !HAS_RESUME_CONTINUE + #if NONE(HAS_ENCODER_ACTION, HAS_RESUME_CONTINUE) #error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad." #elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST) #if PIN_EXISTS(LCD_BACKLIGHT) diff --git a/Marlin/src/lcd/e3v2/common/encoder.cpp b/Marlin/src/lcd/e3v2/common/encoder.cpp index dd360b03506c..fabaaf25df0c 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.cpp +++ b/Marlin/src/lcd/e3v2/common/encoder.cpp @@ -84,12 +84,12 @@ EncoderState encoderReceiveAnalyze() { if (ELAPSED(now, next_click_update_ms)) { next_click_update_ms = millis() + 300; Encoder_tick(); - #if LCD_BACKLIGHT_TIMEOUT_MINS - ui.refresh_backlight_timeout(); //reset timer on click - #endif #if PIN_EXISTS(LCD_LED) //LED_Action(); #endif + #if LCD_BACKLIGHT_TIMEOUT_MINS + ui.refresh_backlight_timeout(); // Reset timer on click + #endif if (!ui.backlight) ui.refresh_brightness(); const bool was_waiting = wait_for_user; wait_for_user = false; @@ -125,8 +125,8 @@ EncoderState encoderReceiveAnalyze() { #if LCD_BACKLIGHT_TIMEOUT_MINS if (temp_diffState > 0) { - ui.refresh_backlight_timeout(); //reset timer after encoder +- (this can be changed -> added to an all in one if statement) - if (!ui.backlight) { ui.refresh_brightness(); } + ui.refresh_backlight_timeout(); // Reset timer after encoder +- (this can be changed -> added to an all in one if statement) + if (!ui.backlight) ui.refresh_brightness(); } #endif @@ -174,9 +174,9 @@ EncoderState encoderReceiveAnalyze() { // LED light operation void LED_Action() { - LED_Control(RGB_SCALE_WARM_WHITE,0x0F); + LED_Control(RGB_SCALE_WARM_WHITE, 0x0F); delay(30); - LED_Control(RGB_SCALE_WARM_WHITE,0x00); + LED_Control(RGB_SCALE_WARM_WHITE, 0x00); } // LED initialization diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index ba9bc92daa6c..e44546e3203a 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -74,7 +74,6 @@ uint8_t BedLevelTools::mesh_y = 0; uint8_t BedLevelTools::tilt_grid = 1; bool drawing_mesh = false; -char str_1[16]; #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -252,7 +251,6 @@ bool BedLevelTools::meshValidate() { LCD_SERIAL.flushTX(); // Draw value text on - char buf[8]; const uint8_t fs = DWINUI::fontWidth(meshfont); if (viewer_print_value) { int8_t offset_x, offset_y = cell_height_px / 2 - fs; @@ -260,14 +258,15 @@ bool BedLevelTools::meshValidate() { dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + cell_width_px / 2 - 5, start_y_px + offset_y, F("X")); } else { // has value - if (GRID_MAX_POINTS_X < (ENABLED(TJC_DISPLAY) ? 8 : 10)) - sprintf_P(buf, PSTR("%s"), dtostrf(abs(bedlevel.z_values[x][y]), 1, 2, str_1)); + MString<12> msg; + if ((GRID_MAX_POINTS_X) < TERN(TJC_DISPLAY, 8, 10)) + msg.set(p_float_t(abs(bedlevel.z_values[x][y]), 2)); else - sprintf_P(buf, PSTR("%02i"), (uint16_t)(abs(bedlevel.z_values[x][y] - (int16_t)bedlevel.z_values[x][y]) * 100)); - offset_x = cell_width_px / 2 - (fs/2) * (strlen(buf)) - 2; - if (!(GRID_MAX_POINTS_X < (ENABLED(TJC_DISPLAY) ? 8 : 10))) + msg.setf_P(PSTR("%02i"), uint16_t(abs(bedlevel.z_values[x][y] - int16_t(bedlevel.z_values[x][y])) * 100)); + offset_x = cell_width_px / 2 - (fs / 2) * strlen(buf) - 2; + if ((GRID_MAX_POINTS_X) >= TERN(TJC_DISPLAY, 8, 10)) dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset_x, start_y_px + offset_y, F(".")); - dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y, buf); + dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y, msg); } safe_delay(10); LCD_SERIAL.flushTX(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index e5719f1372a3..c5f2b95bbe8b 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3466,26 +3466,26 @@ void drawMotionMenu() { #endif - void drawFilamentManMenu() { - checkkey = ID_Menu; - if (SET_MENU(filamentMenu, MSG_FILAMENT_MAN, 6)) { - BACK_ITEM(drawPrepareMenu); - #if ENABLED(NOZZLE_PARK_FEATURE) - MENU_ITEM(ICON_Park, MSG_FILAMENT_PARK_ENABLED, onDrawMenuItem, parkHead); - #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) - #if HAS_PREHEAT - MENU_ITEM(ICON_SetEndTemp, MSG_PREHEAT_HOTEND, onDrawSubMenu, drawPreheatHotendMenu); - #endif - MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament); - #endif - #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - MENU_ITEM(ICON_FilUnload, MSG_FILAMENTUNLOAD, onDrawMenuItem, unloadFilament); - MENU_ITEM(ICON_FilLoad, MSG_FILAMENTLOAD, onDrawMenuItem, loadFilament); +void drawFilamentManMenu() { + checkkey = ID_Menu; + if (SET_MENU(filamentMenu, MSG_FILAMENT_MAN, 6)) { + BACK_ITEM(drawPrepareMenu); + #if ENABLED(NOZZLE_PARK_FEATURE) + MENU_ITEM(ICON_Park, MSG_FILAMENT_PARK_ENABLED, onDrawMenuItem, parkHead); + #endif + #if ENABLED(ADVANCED_PAUSE_FEATURE) + #if HAS_PREHEAT + MENU_ITEM(ICON_SetEndTemp, MSG_PREHEAT_HOTEND, onDrawSubMenu, drawPreheatHotendMenu); #endif - } - updateMenu(filamentMenu); + MENU_ITEM(ICON_FilMan, MSG_FILAMENTCHANGE, onDrawMenuItem, changeFilament); + #endif + #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) + MENU_ITEM(ICON_FilUnload, MSG_FILAMENTUNLOAD, onDrawMenuItem, unloadFilament); + MENU_ITEM(ICON_FilLoad, MSG_FILAMENTLOAD, onDrawMenuItem, loadFilament); + #endif } + updateMenu(filamentMenu); +} #if ENABLED(MESH_BED_LEVELING) From b3e6a535ac4077fea1f283642957c2445d0aeb8a Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 7 Aug 2023 15:41:05 -0400 Subject: [PATCH 23/39] small updates --- Marlin/src/lcd/e3v2/common/encoder.cpp | 20 +++++++++++--------- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 ++-- buildroot/share/cmake/CMakeLists.txt | 5 +++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Marlin/src/lcd/e3v2/common/encoder.cpp b/Marlin/src/lcd/e3v2/common/encoder.cpp index fabaaf25df0c..eb064950ec59 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.cpp +++ b/Marlin/src/lcd/e3v2/common/encoder.cpp @@ -88,9 +88,12 @@ EncoderState encoderReceiveAnalyze() { //LED_Action(); #endif #if LCD_BACKLIGHT_TIMEOUT_MINS - ui.refresh_backlight_timeout(); // Reset timer on click + ui.refresh_backlight_timeout(); #endif - if (!ui.backlight) ui.refresh_brightness(); + if (!ui.backlight) { + ui.refresh_brightness(); + return ENCODER_DIFF_NO; + } const bool was_waiting = wait_for_user; wait_for_user = false; return was_waiting ? ENCODER_DIFF_NO : ENCODER_DIFF_ENTER; @@ -123,13 +126,6 @@ EncoderState encoderReceiveAnalyze() { if (temp_diff > 0) temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CCW, ENCODER_DIFF_CW); else temp_diffState = TERN(REVERSE_ENCODER_DIRECTION, ENCODER_DIFF_CW, ENCODER_DIFF_CCW); - #if LCD_BACKLIGHT_TIMEOUT_MINS - if (temp_diffState > 0) { - ui.refresh_backlight_timeout(); // Reset timer after encoder +- (this can be changed -> added to an all in one if statement) - if (!ui.backlight) ui.refresh_brightness(); - } - #endif - #if ENABLED(ENCODER_RATE_MULTIPLIER) millis_t ms = millis(); @@ -164,6 +160,12 @@ EncoderState encoderReceiveAnalyze() { temp_diff = 0; } + if (temp_diffState != ENCODER_DIFF_NO) { + #if LCD_BACKLIGHT_TIMEOUT_MINS + ui.refresh_backlight_timeout(); + #endif + if (!ui.backlight) ui.refresh_brightness(); + } return temp_diffState; } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 161725a9893d..131eacf59d2f 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -363,7 +363,7 @@ class TextScroller { const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x, cell_width_px = total_width_px / (GRID_MAX_POINTS_X), cell_height_px = total_width_px / (GRID_MAX_POINTS_Y); - const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max); + const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max), range2 = _MIN(v_min, v_max); // Clear background from previous selection and select new square dwinDrawRectangle(1, COLOR_BG_BLACK, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px); @@ -385,7 +385,7 @@ class TextScroller { isnan(bedlevel.z_values[x][y]) ? COLOR_GREY : ( // gray if undefined (bedlevel.z_values[x][y] < 0 ? (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_max)) << 5) | // green if mesh point value is positive + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range2 : v_max)) << 5) | // green if mesh point value is positive _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); diff --git a/buildroot/share/cmake/CMakeLists.txt b/buildroot/share/cmake/CMakeLists.txt index 8864a270e429..0316c7fc0bcf 100644 --- a/buildroot/share/cmake/CMakeLists.txt +++ b/buildroot/share/cmake/CMakeLists.txt @@ -111,8 +111,9 @@ set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/marlin-cmake/toolchain/Arduin # Setup Project # # # # If you receive this error: # -# 'Unknown CMake command "_cmake_record_install_prefix".' # -# go to the file in your CMake directory. # +# 'Unknown CMake command "_cmake_record_install_prefix".' # +# # +# Go to the file in your CMake directory. # # # # For Windows: cmake\Modules\Platform\WindowsPaths.cmake # # For Linux: cmake/Modules/Platform/UnixPaths.cmake # From 0345295571c2eb1baa6958c03fe2c2e3c8c9dc1b Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Wed, 9 Aug 2023 23:42:39 -0400 Subject: [PATCH 24/39] Update SanityCheck.h `HAS_DWIN_E3V2` encompasses DWIN_LCD_PROUI, DWIN_CREALITY_LCD (--> `HAS_DWIN_E3V2_BASIC 1` ) and DWIN_CREALITY_LCD_JYERSUI reverted back `!HAS_ENCODER_ACTION` from `NONE(...)` not sure if ```y #if ANY(EXTENSIBLE_UI, IS_NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, HAS_DWIN_E3V2) #define HAS_RESUME_CONTINUE 1 #endif ``` any of these other parameters matter, but it is what it is. --- Marlin/src/inc/SanityCheck.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 2cd9cbfc8ed6..ff9b740382ef 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2741,8 +2741,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif #endif -#if LCD_BACKLIGHT_TIMEOUT_MINS - #if NONE(HAS_ENCODER_ACTION, HAS_RESUME_CONTINUE) +#if LCD_BACKLIGHT_TIMEOUT_MINS && DISABLED(HAS_DWIN_E3V2) + #if !HAS_ENCODER_ACTION #error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad." #elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST) #if PIN_EXISTS(LCD_BACKLIGHT) @@ -2750,7 +2750,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #elif ENABLED(NEOPIXEL_BKGD_ALWAYS_ON) #error "LCD_BACKLIGHT_TIMEOUT is not compatible with NEOPIXEL_BKGD_ALWAYS_ON." #endif - #elif !PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2) + #elif !PIN_EXISTS(LCD_BACKLIGHT) #error "LCD_BACKLIGHT_TIMEOUT_MINS requires either LCD_BACKLIGHT_PIN or NEOPIXEL_BKGD_INDEX_FIRST." #endif #endif From 5425fb63b387a5e13e1635fa30f9d90e643f3ba4 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Thu, 10 Aug 2023 01:14:54 -0400 Subject: [PATCH 25/39] Update ubl_G29.cpp --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 09d557dac0ca..15e36ac678f7 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -772,7 +772,7 @@ void unified_bed_leveling::shift_mesh_height() { const grid_count_t point_num = (GRID_MAX_POINTS - count) + 1; SERIAL_ECHOLNPGM("Probing mesh point ", point_num, "/", GRID_MAX_POINTS, "."); TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_PROBING_POINT), point_num, int(GRID_MAX_POINTS))); - TERN_(LCD_BACKLIGHT_TIMEOUT_MINS, ui.refresh_backlight_timeout()); // refresh timeout to keep screen on + TERN_(LCD_BACKLIGHT_TIMEOUT_MINS, ui.refresh_backlight_timeout()); #if HAS_MARLINUI_MENU if (ui.button_pressed()) { From b8fa4bf8da2521116bcd9ef11e89f2bb3340071e Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:50:24 -0400 Subject: [PATCH 26/39] Update bedlevel_tools.cpp --- Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index e44546e3203a..63df5e5e9df1 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -262,8 +262,8 @@ bool BedLevelTools::meshValidate() { if ((GRID_MAX_POINTS_X) < TERN(TJC_DISPLAY, 8, 10)) msg.set(p_float_t(abs(bedlevel.z_values[x][y]), 2)); else - msg.setf_P(PSTR("%02i"), uint16_t(abs(bedlevel.z_values[x][y] - int16_t(bedlevel.z_values[x][y])) * 100)); - offset_x = cell_width_px / 2 - (fs / 2) * strlen(buf) - 2; + msg.setf(F("%02i"), uint16_t(abs(bedlevel.z_values[x][y] - int16_t(bedlevel.z_values[x][y])) * 100)); + offset_x = cell_width_px / 2 - (fs / 2) * msg.length() - 2; if ((GRID_MAX_POINTS_X) >= TERN(TJC_DISPLAY, 8, 10)) dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset_x, start_y_px + offset_y, F(".")); dwinDrawString(false, meshfont, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y, msg); From b9c9fd8639cca9fd533a134f7d9e0f882accccf9 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Sat, 12 Aug 2023 01:35:54 -0400 Subject: [PATCH 27/39] Update dwin.cpp fixes values to make it work correctly --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 131eacf59d2f..a715cc00bd0c 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -341,7 +341,7 @@ class TextScroller { } float getMaxValue() { - float max = __FLT_MIN__; + float max = __FLT_MAX__ * -1; GRID_LOOP(x, y) { if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max) max = bedlevel.z_values[x][y]; From 7c87e3af10f186c5451e557874024622199ad597 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Sun, 13 Aug 2023 18:21:01 -0400 Subject: [PATCH 28/39] Update meshviewer.cpp this works fine. could be simplified even more? using default:?? --- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 6952234c9316..354871e30e94 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -87,25 +87,20 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) else { char str_1[9]; str_1[0] = '\0'; + MString<12> msg; switch (v) { - case -999 ... -100: - DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3*fs, py(y) - fs, z); - break; - case -99 ... -1: - sprintf_P(str_1, PSTR("%.2f"), z); + case -999 ... -1: // -9.99 .. -0.01 mm + msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); break; case 0: - dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, py(y) - fs, "0"); - break; - case 1 ... 99: - sprintf_P(str_1, PSTR("%.2f"), z); + DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, px(x) - 4, py(y) - fs, "0"); break; - case 100 ... 999: - DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, py(y) - fs, z); + case 1 ... 999: // 0.01 .. 9.99 mm + msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); break; } if (str_1[0]) - dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 2 * fs, py(y) - fs, str_1); + DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, px(x) - 2 * fs, py(y) - fs, msg); } } From 05713f5046ac8bab10af3e7f7c0a3436222ff7a9 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Sun, 13 Aug 2023 18:24:36 -0400 Subject: [PATCH 29/39] revert unwanted changes in meshviewer.cpp --- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 354871e30e94..e23be61d2b3a 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -93,14 +93,14 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); break; case 0: - DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, px(x) - 4, py(y) - fs, "0"); + dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, py(y) - fs, "0"); break; case 1 ... 999: // 0.01 .. 9.99 mm msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); break; } if (str_1[0]) - DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, px(x) - 2 * fs, py(y) - fs, msg); + dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 2 * fs, py(y) - fs, msg); } } From 6174b2b09e2ecf1bf2bad400f3ccfe3182463453 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Wed, 16 Aug 2023 02:22:16 -0400 Subject: [PATCH 30/39] Update meshviewer.cpp - tested: works! --- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index e23be61d2b3a..eecd5ed22a3b 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -88,16 +88,11 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) char str_1[9]; str_1[0] = '\0'; MString<12> msg; - switch (v) { - case -999 ... -1: // -9.99 .. -0.01 mm - msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); - break; - case 0: - dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, py(y) - fs, "0"); - break; - case 1 ... 999: // 0.01 .. 9.99 mm - msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); - break; + if (v == 0) { // Handle value 0 + DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, px(x) - 4, py(y) - fs, "0"); + } + else { // +/- 0.00 + msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); } if (str_1[0]) dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 2 * fs, py(y) - fs, msg); From b8e04368860aaa1a4a5394736e62f1f52ee0be79 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Wed, 16 Aug 2023 03:15:44 -0400 Subject: [PATCH 31/39] revert meshviewer.cpp no changes --- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index eecd5ed22a3b..2781ccaa1df7 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -87,15 +87,25 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) else { char str_1[9]; str_1[0] = '\0'; - MString<12> msg; - if (v == 0) { // Handle value 0 - DWIN_Draw_String(false, meshfont, DWINUI::textcolor, DWINUI::backcolor, px(x) - 4, py(y) - fs, "0"); - } - else { // +/- 0.00 - msg.setf_P(PSTR("%.2f"), p_float_t(z, 2)); + switch (v) { + case -999 ... -100: + DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3*fs, py(y) - fs, z); + break; + case -99 ... -1: + sprintf_P(str_1, PSTR("-.%02i"), -v); + break; + case 0: + dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, py(y) - fs, "0"); + break; + case 1 ... 99: + sprintf_P(str_1, PSTR(".%02i"), v); + break; + case 100 ... 999: + DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, py(y) - fs, z); + break; } if (str_1[0]) - dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 2 * fs, py(y) - fs, msg); + dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 2 * fs, py(y) - fs, str_1); } } From 429ae63279a7923b03e5b881f4b3a21af91b9256 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Aug 2023 19:24:25 -0500 Subject: [PATCH 32/39] etc --- Marlin/src/inc/SanityCheck.h | 8 ++--- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 35 ++++++++---------- Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp | 32 ++++++----------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 2 +- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 38 ++++++++------------ Marlin/src/lcd/marlinui.cpp | 2 +- 7 files changed, 46 insertions(+), 73 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index ff9b740382ef..41636925ef6d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2741,8 +2741,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif #endif -#if LCD_BACKLIGHT_TIMEOUT_MINS && DISABLED(HAS_DWIN_E3V2) - #if !HAS_ENCODER_ACTION +#if LCD_BACKLIGHT_TIMEOUT_MINS + #if !HAS_ENCODER_ACTION && DISABLED(HAS_DWIN_E3V2) #error "LCD_BACKLIGHT_TIMEOUT_MINS requires an LCD with encoder or keypad." #elif ENABLED(NEOPIXEL_BKGD_INDEX_FIRST) #if PIN_EXISTS(LCD_BACKLIGHT) @@ -2750,8 +2750,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #elif ENABLED(NEOPIXEL_BKGD_ALWAYS_ON) #error "LCD_BACKLIGHT_TIMEOUT is not compatible with NEOPIXEL_BKGD_ALWAYS_ON." #endif - #elif !PIN_EXISTS(LCD_BACKLIGHT) - #error "LCD_BACKLIGHT_TIMEOUT_MINS requires either LCD_BACKLIGHT_PIN or NEOPIXEL_BKGD_INDEX_FIRST." + #elif !PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2) + #error "LCD_BACKLIGHT_TIMEOUT_MINS requires LCD_BACKLIGHT_PIN, NEOPIXEL_BKGD_INDEX_FIRST, or an Ender-3 V2 DWIN LCD." #endif #endif diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index a715cc00bd0c..276752f24331 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -341,20 +341,14 @@ class TextScroller { } float getMaxValue() { - float max = __FLT_MAX__ * -1; - GRID_LOOP(x, y) { - if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max) - max = bedlevel.z_values[x][y]; - } + float max = -(__FLT_MAX__); + GRID_LOOP(x, y) { const float z = bedlevel.z_values[x][y]; if (!isnan(z)) NOLESS(max, z); } return max; } float getMinValue() { float min = __FLT_MAX__; - GRID_LOOP(x, y) { - if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] < min) - min = bedlevel.z_values[x][y]; - } + GRID_LOOP(x, y) { const float z = bedlevel.z_values[x][y]; if (!isnan(z)) NOMORE(min, z); } return min; } @@ -363,7 +357,7 @@ class TextScroller { const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x, cell_width_px = total_width_px / (GRID_MAX_POINTS_X), cell_height_px = total_width_px / (GRID_MAX_POINTS_Y); - const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max), range2 = _MIN(v_min, v_max); + const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), rmax = _MAX(v_min, v_max), rmin = _MIN(v_min, v_max); // Clear background from previous selection and select new square dwinDrawRectangle(1, COLOR_BG_BLACK, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px); @@ -384,8 +378,8 @@ class TextScroller { dwinDrawRectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ isnan(bedlevel.z_values[x][y]) ? COLOR_GREY : ( // gray if undefined (bedlevel.z_values[x][y] < 0 ? - (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range : v_min)) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? range2 : v_max)) << 5) | // green if mesh point value is positive + (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmax : v_min)) << 11 : // red if mesh point value is negative + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmin : v_max)) << 5) | // green if mesh point value is positive _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); @@ -421,20 +415,19 @@ class TextScroller { v_min = abs(getMinValue()), v_max = abs(getMaxValue()); if (viewer_asymmetric_range) { - if (v_min > 3e+10F) v_min = 0.0000001; - if (v_max > 3e+10F) v_max = 0.0000001; + if (v_min > 3e+10f) v_min = 0.0000001; + if (v_max > 3e+10f) v_max = 0.0000001; v1 = -v_min; v2 = v_max; } else { - float range = _MAX(v_min, v_max); - float range2 = _MIN(v_min, v_max); - if (range > 3e+10F) range = 0.0000001; - if (range2 > 3e+10F) range2 = 0.0000001; - v1 = -range; - v2 = range2; + float rmax = _MAX(v_min, v_max), rmin = _MIN(v_min, v_max); + if (rmax > 3e+10f) rmax = 0.0000001; + if (rmin > 3e+10f) rmin = 0.0000001; + v1 = -rmax; + v2 = rmin; } - jyersDWIN.updateStatus(TS(F("Red "), p_float_t(v1, 3) , F("..0.."), p_float_t(v2, 3), F("+ Green"))); + jyersDWIN.updateStatus(TS(F("Red "), p_float_t(v1, 3) , F("..0.."), p_float_t(v2, 3), F(" Green"))); drawing_mesh = false; } diff --git a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index 63df5e5e9df1..db6c76269ca8 100644 --- a/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -185,20 +185,14 @@ void BedLevelTools::meshReset() { // Accessors float BedLevelTools::getMaxValue() { - float max = __FLT_MAX__ * -1; - GRID_LOOP(x, y) { - if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max) - max = bedlevel.z_values[x][y]; - } + float max = -(__FLT_MAX__); + GRID_LOOP(x, y) { const float z = bedlevel.z_values[x][y]; if (!isnan(z)) NOLESS(max, z); } return max; } float BedLevelTools::getMinValue() { float min = __FLT_MAX__; - GRID_LOOP(x, y) { - if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] < min) - min = bedlevel.z_values[x][y]; - } + GRID_LOOP(x, y) { const float z = bedlevel.z_values[x][y]; if (!isnan(z)) NOMORE(min, z); } return min; } @@ -220,7 +214,7 @@ bool BedLevelTools::meshValidate() { const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x; const uint16_t cell_width_px = total_width_px / (GRID_MAX_POINTS_X); const uint16_t cell_height_px = total_width_px / (GRID_MAX_POINTS_Y); - const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max); + const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), rmax = _MAX(v_min, v_max); // Clear background from previous selection and select new square dwinDrawRectangle(1, COLOR_BG_BLACK, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px); @@ -241,8 +235,8 @@ bool BedLevelTools::meshValidate() { dwinDrawRectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ isnan(bedlevel.z_values[x][y]) ? COLOR_GREY : ( // gray if undefined (bedlevel.z_values[x][y] < 0 ? - (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / range) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * bedlevel.z_values[x][y] / range) << 5) | // green if mesh point value is positive + (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / rmax) << 11 : // red if mesh point value is negative + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / rmax) << 5) | // green if mesh point value is positive _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); @@ -275,16 +269,10 @@ bool BedLevelTools::meshValidate() { } void BedLevelTools::setMeshViewerStatus() { // TODO: draw gradient with values as a legend instead - float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), range = _MAX(v_min, v_max), range2 = _MIN(v_min, v_max); - if (range > 3e+10f) range = 0.0000001; - if (range2 > 3e+10f) range2 = 0.0000001; - ui.set_status( - &MString<47>( - F("Red "), p_float_t(-range, 3), - F("..0.."), p_float_t(range2, 3), - F("+ Green") - ) - ); + float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), rmax = _MAX(v_min, v_max), rmin = _MIN(v_min, v_max); + if (rmax > 3e+10f) rmax = 0.0000001; + if (rmin > 3e+10f) rmin = 0.0000001; + ui.set_status(&MString<47>(F("Red "), p_float_t(-rmax, 3), F("..0.."), p_float_t(rmin, 3), F(" Green"))); drawing_mesh = false; } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index c5f2b95bbe8b..32857e81f34f 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3452,7 +3452,7 @@ void drawMotionMenu() { updateMenu(motionMenu); } -#if ENABLED(ADVANCED_PAUSE_FEATURE) && HAS_PREHEAT +#if ALL(ADVANCED_PAUSE_FEATURE, HAS_PREHEAT) void drawPreheatHotendMenu() { checkkey = ID_Menu; diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 3c4ab418887d..2145d8ead142 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -263,7 +263,7 @@ void DWINUI::drawCircle(uint16_t color, uint16_t x, uint16_t y, uint8_t r) { // x: the abscissa of the center of the circle // y: ordinate of the center of the circle // r: circle radius -void DWINUI::drawFillCircle(uint16_t bcolor, uint16_t x,uint16_t y,uint8_t r) { +void DWINUI::drawFillCircle(uint16_t bcolor, uint16_t x, uint16_t y, uint8_t r) { dwinDrawLine(bcolor, x - r, y, x + r, y); uint16_t b = 1; while (b <= r) { diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 2781ccaa1df7..529a89cb6432 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -75,37 +75,29 @@ void MeshViewer::drawMeshGrid(const uint8_t csizex, const uint8_t csizey) { void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) { const uint8_t fs = DWINUI::fontWidth(meshfont); const int16_t v = isnan(z) ? 0 : round(z * 100); - NOLESS(max, z); - NOMORE(min, z); + NOLESS(max, z); NOMORE(min, z); + const uint16_t color = DWINUI::RainbowInt(v, zmin, zmax); DWINUI::drawFillCircle(color, px(x), py(y), r(_MAX(_MIN(v,zmax),zmin))); TERN_(TJC_DISPLAY, delay(100)); - if (sizex < (ENABLED(TJC_DISPLAY) ? 8 : 9)) { - if (v == 0) DWINUI::drawFloat(meshfont, 1, 2, px(x) - 2*fs, py(y) - fs, 0); - else DWINUI::drawSignedFloat(meshfont, 1, 2, px(x) - 3*fs, py(y) - fs, z); + + const uint16_t fy = py(y) - fs; + if (sizex < TERN(TJC_DISPLAY, 8 : 9)) { + if (v == 0) DWINUI::drawFloat(meshfont, 1, 2, px(x) - 2 * fs, fy, 0); + else DWINUI::drawSignedFloat(meshfont, 1, 2, px(x) - 3 * fs, fy, z); } else { - char str_1[9]; - str_1[0] = '\0'; + char msg[9]; msg[0] = '\0'; switch (v) { case -999 ... -100: - DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3*fs, py(y) - fs, z); - break; - case -99 ... -1: - sprintf_P(str_1, PSTR("-.%02i"), -v); - break; - case 0: - dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, py(y) - fs, "0"); - break; - case 1 ... 99: - sprintf_P(str_1, PSTR(".%02i"), v); - break; - case 100 ... 999: - DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, py(y) - fs, z); - break; + case 100 ... 999: DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, fy, z); break; + case -99 ... -1: sprintf_P(msg, PSTR("-.%02i"), -v); break; + case 1 ... 99: sprintf_P(msg, PSTR( ".%02i"), v); break; + default: + dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, fy, "0"); + return; } - if (str_1[0]) - dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 2 * fs, py(y) - fs, str_1); + dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 2 * fs, fy, msg); } } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index e5219230cedb..1076d40de014 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -194,7 +194,7 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; #ifdef NEOPIXEL_BKGD_INDEX_FIRST neo.reset_background_color(); neo.show(); - #elif PIN_EXISTS(LCD_BACKLIGHT) && DISABLED(HAS_DWIN_E3V2) + #elif PIN_EXISTS(LCD_BACKLIGHT) WRITE(LCD_BACKLIGHT_PIN, HIGH); #endif } From 5e0c0a120af2be9abd9972e8381398e4b320a9bb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Aug 2023 20:18:43 -0500 Subject: [PATCH 33/39] squash, range + 1 --- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 39 ++++++++---------------- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 6 ++-- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 2145d8ead142..ab638cf27a7e 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -282,10 +282,10 @@ void DWINUI::drawFillCircle(uint16_t bcolor, uint16_t x, uint16_t y, uint8_t r) // color2 : End color uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) { uint8_t B, G, R; - const float n = float(val - minv) / (maxv - minv); - R = (1 - n) * GetRColor(color1) + n * GetRColor(color2); - G = (1 - n) * GetGColor(color1) + n * GetGColor(color2); - B = (1 - n) * GetBColor(color1) + n * GetBColor(color2); + const float n = float(val - minv) / (maxv - minv + 1); + R = (1.0f - n) * GetRColor(color1) + n * GetRColor(color2); + G = (1.0f - n) * GetGColor(color1) + n * GetGColor(color2); + B = (1.0f - n) * GetBColor(color1) + n * GetBColor(color2); return RGB(R, G, B); } @@ -294,31 +294,16 @@ uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t colo // minv : Minimum value // maxv : Maximum value uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) { - uint8_t B, G, R; - const uint8_t maxB = 28, maxR = 28, maxG = 38; const int16_t limv = _MAX(abs(minv), abs(maxv)); - float n = (minv >= 0) ? (float)(val - minv) / (maxv - minv) : (float)val / limv; + float n = (minv >= 0) ? float(val - minv) / (maxv - minv + 1) : (float)val / limv; LIMIT(n, -1, 1); - if (n <= -0.5) { - R = 0; - G = maxG * (1 + n); - B = maxB; - } - else if (n <= 0) { - R = 0; - G = maxG; - B = maxB * (-n) * 2; - } - else if (n < 0.5) { - R = maxR * n * 2; - G = maxG; - B = 0; - } - else { - R = maxR; - G = maxG * (1 - n); - B = 0; - } + + constexpr uint8_t maxB = 28, maxR = 28, maxG = 38; + uint8_t R, G, B; + if (n <= -0.5f) { R = 0; G = maxG * (1.0f + n); B = maxB; } + else if (n <= 0.0f) { R = 0; G = maxG; B = maxB * (-n) * 2; } + else if (n < 0.5f) { R = maxR * n * 2; G = maxG; B = 0; } + else { R = maxR; G = maxG * (1.0f - n); B = 0; } return RGB(R, G, B); } diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 529a89cb6432..a1c7f7d80156 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -78,7 +78,7 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) NOLESS(max, z); NOMORE(min, z); const uint16_t color = DWINUI::RainbowInt(v, zmin, zmax); - DWINUI::drawFillCircle(color, px(x), py(y), r(_MAX(_MIN(v,zmax),zmin))); + DWINUI::drawFillCircle(color, px(x), py(y), r(_MAX(_MIN(v, zmax), zmin))); TERN_(TJC_DISPLAY, delay(100)); const uint16_t fy = py(y) - fs; @@ -91,8 +91,8 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) switch (v) { case -999 ... -100: case 100 ... 999: DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, fy, z); break; - case -99 ... -1: sprintf_P(msg, PSTR("-.%02i"), -v); break; - case 1 ... 99: sprintf_P(msg, PSTR( ".%02i"), v); break; + case -99 ... -1: sprintf_P(msg, PSTR("-.%02i"), -v); break; + case 1 ... 99: sprintf_P(msg, PSTR( ".%02i"), v); break; default: dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, fy, "0"); return; From 8298732c11c0c35f244667323198d7ac3899606c Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Wed, 23 Aug 2023 01:44:39 -0400 Subject: [PATCH 34/39] fixes and rename --- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/dwinui.h | 8 ++++---- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 2 +- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index ab638cf27a7e..7e94fc3e5633 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -280,7 +280,7 @@ void DWINUI::drawFillCircle(uint16_t bcolor, uint16_t x, uint16_t y, uint8_t r) // maxv : Maximum value // color1 : Start color // color2 : End color -uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) { +uint16_t DWINUI::colorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2) { uint8_t B, G, R; const float n = float(val - minv) / (maxv - minv + 1); R = (1.0f - n) * GetRColor(color1) + n * GetRColor(color2); @@ -293,7 +293,7 @@ uint16_t DWINUI::ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t colo // val : Interpolator minv..maxv // minv : Minimum value // maxv : Maximum value -uint16_t DWINUI::RainbowInt(int16_t val, int16_t minv, int16_t maxv) { +uint16_t DWINUI::rainbowInt(int16_t val, int16_t minv, int16_t maxv) { const int16_t limv = _MAX(abs(minv), abs(maxv)); float n = (minv >= 0) ? float(val - minv) / (maxv - minv + 1) : (float)val / limv; LIMIT(n, -1, 1); diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 9f8ab70e71b3..255b7ac60139 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -564,7 +564,7 @@ namespace DWINUI { // maxv : Maximum value // color1 : Start color // color2 : End color - uint16_t ColorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2); + uint16_t colorInt(int16_t val, int16_t minv, int16_t maxv, uint16_t color1, uint16_t color2); // ------------------------- Buttons ------------------------------// @@ -593,13 +593,13 @@ namespace DWINUI { // val : Interpolator minv..maxv // minv : Minimum value // maxv : Maximum value - uint16_t RainbowInt(int16_t val, int16_t minv, int16_t maxv); + uint16_t rainbowInt(int16_t val, int16_t minv, int16_t maxv); // Write buffer data to the SRAM // addr: SRAM start address 0x0000-0x7FFF // length: Bytes to write // data: address of the buffer with data - inline void WriteToSRAM(uint16_t addr, uint16_t length, uint8_t *data) { + inline void writeToSRAM(uint16_t addr, uint16_t length, uint8_t *data) { dwinWriteToMem(0x5A, addr, length, data); } @@ -607,7 +607,7 @@ namespace DWINUI { // addr: Flash start address 0x0000-0x3FFF // length: Bytes to write // data: address of the buffer with data - inline void WriteToFlash(uint16_t addr, uint16_t length, uint8_t *data) { + inline void writeToFlash(uint16_t addr, uint16_t length, uint8_t *data) { dwinWriteToMem(0xA5, addr, length, data); } diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 8017847538e4..8bb552aa0baa 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -191,7 +191,7 @@ bool Has_Preview() { fileprop.thumbwidth = THUMBWIDTH; fileprop.thumbheight = THUMBHEIGHT; fileprop.thumbsize = decode_base64(buf64, fileprop.thumbdata); card.closefile(); - DWINUI::WriteToSRAM(0x00, fileprop.thumbsize, fileprop.thumbdata); + DWINUI::writeToSRAM(0x00, fileprop.thumbsize, fileprop.thumbdata); delete[] fileprop.thumbdata; return true; } diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index a1c7f7d80156..1c5f08bb4dfa 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -77,12 +77,12 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) const int16_t v = isnan(z) ? 0 : round(z * 100); NOLESS(max, z); NOMORE(min, z); - const uint16_t color = DWINUI::RainbowInt(v, zmin, zmax); + const uint16_t color = DWINUI::rainbowInt(v, zmin, zmax); DWINUI::drawFillCircle(color, px(x), py(y), r(_MAX(_MIN(v, zmax), zmin))); TERN_(TJC_DISPLAY, delay(100)); const uint16_t fy = py(y) - fs; - if (sizex < TERN(TJC_DISPLAY, 8 : 9)) { + if (sizex < TERN(TJC_DISPLAY, 8, 9)) { if (v == 0) DWINUI::drawFloat(meshfont, 1, 2, px(x) - 2 * fs, fy, 0); else DWINUI::drawSignedFloat(meshfont, 1, 2, px(x) - 3 * fs, fy, z); } @@ -91,8 +91,8 @@ void MeshViewer::drawMeshPoint(const uint8_t x, const uint8_t y, const float z) switch (v) { case -999 ... -100: case 100 ... 999: DWINUI::drawSignedFloat(meshfont, 1, 1, px(x) - 3 * fs, fy, z); break; - case -99 ... -1: sprintf_P(msg, PSTR("-.%02i"), -v); break; - case 1 ... 99: sprintf_P(msg, PSTR( ".%02i"), v); break; + case -99 ... -1: sprintf_P(msg, PSTR("-.%2i"), -v); break; + case 1 ... 99: sprintf_P(msg, PSTR( ".%2i"), v); break; default: dwinDrawString(false, meshfont, DWINUI::textColor, DWINUI::backColor, px(x) - 4, fy, "0"); return; From 7c0750439e0864a6d7497ac8f312c64d73b441d6 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Wed, 23 Aug 2023 02:05:28 -0400 Subject: [PATCH 35/39] roll back range/ omit `rmin` for color gradiant --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 276752f24331..f17a2177936b 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -357,7 +357,7 @@ class TextScroller { const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x, cell_width_px = total_width_px / (GRID_MAX_POINTS_X), cell_height_px = total_width_px / (GRID_MAX_POINTS_Y); - const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), rmax = _MAX(v_min, v_max), rmin = _MIN(v_min, v_max); + const float v_max = abs(getMaxValue()), v_min = abs(getMinValue()), rmax = _MAX(v_min, v_max); // Clear background from previous selection and select new square dwinDrawRectangle(1, COLOR_BG_BLACK, _MAX(0, padding_x - gridline_width), _MAX(0, padding_y_top - gridline_width), padding_x + total_width_px, padding_y_top + total_width_px); @@ -379,7 +379,7 @@ class TextScroller { isnan(bedlevel.z_values[x][y]) ? COLOR_GREY : ( // gray if undefined (bedlevel.z_values[x][y] < 0 ? (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmax : v_min)) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmin : v_max)) << 5) | // green if mesh point value is positive + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmax : v_max)) << 5) | // green if mesh point value is positive _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); From 74c7f3a0b146e230ba462aa4f3dc1281b7730fb4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 24 Aug 2023 13:25:30 -0500 Subject: [PATCH 36/39] Preview updates --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 8 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 10 +- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 227 +++++++++----------- Marlin/src/lcd/e3v2/proui/gcode_preview.h | 15 +- 4 files changed, 125 insertions(+), 135 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index f17a2177936b..e6768e1ef457 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -375,11 +375,11 @@ class TextScroller { const auto end_x_px = start_x_px + cell_width_px - 1 - gridline_width; const auto start_y_px = padding_y_top + (GRID_MAX_POINTS_Y - y - 1) * cell_height_px; const auto end_y_px = start_y_px + cell_height_px - 1 - gridline_width; - dwinDrawRectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ - isnan(bedlevel.z_values[x][y]) ? COLOR_GREY : ( // gray if undefined + dwinDrawRectangle(1, // RGB565 colors: http://www.barth-dev.de/online/rgb565-color-picker/ + isnan(bedlevel.z_values[x][y]) ? COLOR_GREY : ( // gray if undefined (bedlevel.z_values[x][y] < 0 ? - (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmax : v_min)) << 11 : // red if mesh point value is negative - (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmax : v_max)) << 5) | // green if mesh point value is positive + (uint16_t)round(0x1F * -bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmax : v_min)) << 11 : // red if mesh point value is negative + (uint16_t)round(0x3F * bedlevel.z_values[x][y] / (!viewer_asymmetric_range ? rmax : v_max)) << 5) | // green if mesh point value is positive _MIN(0x1F, (((uint8_t)abs(bedlevel.z_values[x][y]) / 10) * 4))), // + blue stepping for every mm start_x_px, start_y_px, end_x_px, end_y_px ); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 3d6a47037424..43c80264d34c 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -288,7 +288,7 @@ MenuItem *editZValueItem = nullptr; bool isPrinting() { return printingIsActive() || printingIsPaused(); } bool sdPrinting() { return isPrinting() && IS_SD_FILE_OPEN(); } -bool Host_Printing() { return isPrinting() && !IS_SD_FILE_OPEN(); } +bool hostPrinting() { return isPrinting() && !IS_SD_FILE_OPEN(); } #define DWIN_LANGUAGE_EEPROM_ADDRESS 0x01 // Between 0x01 and 0x63 (EEPROM_OFFSET-1) // BL24CXX::check() uses 0x00 @@ -634,9 +634,9 @@ void drawPrintDone() { DWINUI::clearMainArea(); dwinPrintHeader(nullptr); #if HAS_GCODE_PREVIEW - const bool haspreview = Preview_Valid(); + const bool haspreview = preview.valid(); if (haspreview) { - Preview_Show(); + preview.show(); DWINUI::drawButton(BTN_Continue, 86, 295); } #else @@ -1682,7 +1682,7 @@ void dwinLevelingDone() { // Started a Print Job void dwinPrintStarted() { - TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) Preview_Invalidate()); + TERN_(HAS_GCODE_PREVIEW, if (hostPrinting()) preview.invalidate()); TERN_(SET_PROGRESS_PERCENT, ui.progress_reset()); TERN_(SET_REMAINING_TIME, ui.reset_remaining_time()); hmiFlag.pause_flag = false; @@ -1967,7 +1967,7 @@ void dwinRedrawScreen() { void gotoConfirmToPrint() { #if HAS_GCODE_PREVIEW - if (hmiData.enablePreview) return gotoPopup(Preview_DrawFromSD, onClickConfirmToPrint); + if (hmiData.enablePreview) return gotoPopup(preview.drawFromSD, onClickConfirmToPrint); #endif card.openAndPrintFile(card.filename); // Direct print SD file } diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 8bb552aa0baa..53b38b641e70 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -31,6 +31,8 @@ #if ALL(DWIN_LCD_PROUI, HAS_GCODE_PREVIEW) +#include "gcode_preview.h" + #include "../../../core/types.h" #include "../../marlinui.h" #include "../../../sd/cardreader.h" @@ -38,78 +40,66 @@ #include "dwin.h" #include "dwin_popup.h" #include "base64.hpp" -#include "gcode_preview.h" #define THUMBWIDTH 230 #define THUMBHEIGHT 180 +Preview preview; + typedef struct { - char name[13] = ""; //8.3 + null + char name[13] = ""; // 8.3 + null uint32_t thumbstart = 0; int thumbsize = 0; - int thumbheight = 0; - int thumbwidth = 0; - uint8_t *thumbdata = nullptr; + int thumbheight = 0, thumbwidth = 0; float time = 0; float filament = 0; float layer = 0; - float width = 0; - float height = 0; - float length = 0; - void setname(const char * const fn); - void clear(); + float width = 0, height = 0, length = 0; + + void setname(const char * const fn) { + const uint8_t len = _MIN(sizeof(name) - 1, strlen(fn)); + memcpy(name, fn, len); + name[len] = '\0'; + } + + void clear() { + fileprop.name[0] = '\0'; + fileprop.thumbstart = 0; + fileprop.thumbsize = 0; + fileprop.thumbheight = fileprop.thumbwidth = 0; + fileprop.time = 0; + fileprop.filament = 0; + fileprop.layer = 0; + fileprop.height = fileprop.width = fileprop.length = 0; + } + } fileprop_t; + fileprop_t fileprop; -void fileprop_t::setname(const char * const fn) { - const uint8_t len = _MIN(sizeof(name) - 1, strlen(fn)); - memcpy(&name[0], fn, len); - name[len] = '\0'; -} +void getValue(const char * const buf, PGM_P const key, float &value) { + if (value != 0.0f) return; -void fileprop_t::clear() { - fileprop.name[0] = '\0'; - fileprop.thumbstart = 0; - fileprop.thumbsize = 0; - fileprop.thumbheight = 0; - fileprop.thumbwidth = 0; - fileprop.thumbdata = nullptr; - fileprop.time = 0; - fileprop.filament = 0; - fileprop.layer = 0; - fileprop.height = 0; - fileprop.width = 0; - fileprop.length = 0; -} + char *posptr = strstr_P(buf, key); + if (posptr == nullptr) return; -void Get_Value(char *buf, const char * const key, float &value) { char num[10] = ""; - char * posptr = 0; - uint8_t i = 0; - if (!!value) return; - posptr = strstr(buf, key); - if (posptr != nullptr) { - while (i < sizeof(num)) { - char c = posptr[0]; - if (!ISEOL(c) && (c != 0)) { - if ((c > 47 && c < 58) || (c == '.')) num[i++] = c; - posptr++; - } - else { - num[i] = '\0'; - value = atof(num); - return; - } + for (uint8_t i = 0; i < sizeof(num);) { + const char c = *posptr; + if (ISEOL(c) || c == '\0') { + num[i] = '\0'; + value = atof(num); + break; } + if (WITHIN(c, '0', '9') || c == '.') num[i++] = c; + posptr++; } } -bool Has_Preview() { - const char * tbstart = "; thumbnail begin " STRINGIFY(THUMBWIDTH) "x" STRINGIFY(THUMBHEIGHT); - char * posptr = 0; - uint8_t nbyte = 1; +bool Preview::hasPreview() { + const char * const tbstart = PSTR("; thumbnail begin " STRINGIFY(THUMBWIDTH) "x" STRINGIFY(THUMBHEIGHT)); + char *posptr = nullptr; uint32_t indx = 0; - char buf[256]; float tmp = 0; fileprop.clear(); @@ -117,30 +107,32 @@ bool Has_Preview() { card.openFileRead(fileprop.name); - while ((nbyte > 0) && (indx < 4 * sizeof(buf)) && !fileprop.thumbstart) { + char buf[256]; + uint8_t nbyte = 1; + while (!fileprop.thumbstart && nbyte > 0 && indx < 4 * sizeof(buf)) { nbyte = card.read(buf, sizeof(buf) - 1); if (nbyte > 0) { buf[nbyte] = '\0'; - Get_Value(buf, ";TIME:", fileprop.time); - Get_Value(buf, ";Filament used:", fileprop.filament); - Get_Value(buf, ";Layer height:", fileprop.layer); - Get_Value(buf, ";MINX:", tmp); - Get_Value(buf, ";MAXX:", fileprop.width); + getValue(buf, PSTR(";TIME:"), fileprop.time); + getValue(buf, PSTR(";Filament used:"), fileprop.filament); + getValue(buf, PSTR(";Layer height:"), fileprop.layer); + getValue(buf, PSTR(";MINX:"), tmp); + getValue(buf, PSTR(";MAXX:"), fileprop.width); fileprop.width -= tmp; tmp = 0; - Get_Value(buf, ";MINY:", tmp); - Get_Value(buf, ";MAXY:", fileprop.length); + getValue(buf, PSTR(";MINY:"), tmp); + getValue(buf, PSTR(";MAXY:"), fileprop.length); fileprop.length -= tmp; tmp = 0; - Get_Value(buf, ";MINZ:", tmp); - Get_Value(buf, ";MAXZ:", fileprop.height); + getValue(buf, PSTR(";MINZ:"), tmp); + getValue(buf, PSTR(";MAXZ:"), fileprop.height); fileprop.height -= tmp; - posptr = strstr(buf, tbstart); + posptr = strstr_P(buf, tbstart); if (posptr != nullptr) { fileprop.thumbstart = indx + (posptr - &buf[0]); } else { - indx += _MAX(10, nbyte - (signed)strlen(tbstart)); + indx += _MAX(10, nbyte - (signed)strlen_P(tbstart)); card.setIndex(indx); } } @@ -149,20 +141,15 @@ bool Has_Preview() { if (!fileprop.thumbstart) { card.closefile(); LCD_MESSAGE_F("Thumbnail not found"); - return 0; + return false; } // Get the size of the thumbnail - card.setIndex(fileprop.thumbstart + strlen(tbstart)); + card.setIndex(fileprop.thumbstart + strlen_P(tbstart)); for (uint8_t i = 0; i < 16; i++) { - char c = card.get(); - if (!ISEOL(c)) { - buf[i] = c; - } - else { - buf[i] = 0; - break; - } + const char c = card.get(); + if (ISEOL(c)) { buf[i] = '\0'; break; } + buf[i] = c; } fileprop.thumbsize = atoi(buf); @@ -170,77 +157,73 @@ bool Has_Preview() { if (!fileprop.thumbsize) { card.closefile(); LCD_MESSAGE_F("Invalid Thumbnail Size"); - return 0; + return false; } - uint16_t readed = 0; uint8_t buf64[fileprop.thumbsize]; - - fileprop.thumbdata = new uint8_t[3 + 3 * (fileprop.thumbsize / 4)]; // Reserve space for the JPEG thumbnail - - while (readed < fileprop.thumbsize) { - uint8_t c = card.get(); - if (!ISEOL(c) && (c != ';') && (c != ' ')) { - buf64[readed] = c; - readed++; - } + uint16_t nread = 0; + while (nread < fileprop.thumbsize) { + const uint8_t c = card.get(); + if (!ISEOL(c) && c != ';' && c != ' ') + buf64[nread++] = c; } card.closefile(); - buf64[readed] = 0; + buf64[nread] = '\0'; + + uint8_t thumbdata[3 + 3 * (fileprop.thumbsize / 4)]; // Reserve space for the JPEG thumbnail + fileprop.thumbsize = decode_base64(buf64, thumbdata); + DWINUI::writeToSRAM(0x00, fileprop.thumbsize, thumbdata); fileprop.thumbwidth = THUMBWIDTH; fileprop.thumbheight = THUMBHEIGHT; - fileprop.thumbsize = decode_base64(buf64, fileprop.thumbdata); card.closefile(); - DWINUI::writeToSRAM(0x00, fileprop.thumbsize, fileprop.thumbdata); - delete[] fileprop.thumbdata; + return true; } -void Preview_DrawFromSD() { - if (Has_Preview()) { - MString<45> buf; - char str_1[6] = "", str_2[6] = "", str_3[6] = ""; - dwinDrawRectangle(1, hmiData.colorBackground, 0, 0, DWIN_WIDTH, STATUS_Y - 1); - if (fileprop.time) { - buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop.time / 3600, ((uint16_t)fileprop.time % 3600) / 60); - DWINUI::drawString(20, 10, &buf); - } - if (fileprop.filament) { - buf.setf(F("Filament used: %s m"), dtostrf(fileprop.filament, 1, 2, str_1)); - DWINUI::drawString(20, 30, &buf); - } - if (fileprop.layer) { - buf.setf(F("Layer height: %s mm"), dtostrf(fileprop.layer, 1, 2, str_1)); - DWINUI::drawString(20, 50, &buf); - } - if (fileprop.width) { - buf.setf(F("Volume: %sx%sx%s mm"), dtostrf(fileprop.width, 1, 1, str_1), dtostrf(fileprop.length, 1, 1, str_2), dtostrf(fileprop.height, 1, 1, str_3)); - DWINUI::drawString(20, 70, &buf); - } - DWINUI::drawButton(BTN_Print, 26, 290); - DWINUI::drawButton(BTN_Cancel, 146, 290); - Preview_Show(); - drawSelectHighlight(true, 290); - dwinUpdateLCD(); - } - else { +void Preview::drawFromSD() { + if (!hasPreview()) { hmiFlag.select_flag = 1; wait_for_user = false; + return; + } + + MString<45> buf; + dwinDrawRectangle(1, hmiData.colorBackground, 0, 0, DWIN_WIDTH, STATUS_Y - 1); + if (fileprop.time) { + buf.setf(F("Estimated time: %i:%02i"), (uint16_t)fileprop.time / 3600, ((uint16_t)fileprop.time % 3600) / 60); + DWINUI::drawString(20, 10, &buf); + } + if (fileprop.filament) { + buf.set(F("Filament used: "), p_float_t(fileprop.filament, 2), F(" m")); + DWINUI::drawString(20, 30, &buf); + } + if (fileprop.layer) { + buf.set(F("Layer height: "), p_float_t(fileprop.layer, 2), F(" mm")); + DWINUI::drawString(20, 50, &buf); + } + if (fileprop.width) { + buf.set(F("Volume: "), p_float_t(fileprop.width, 1), 'x', p_float_t(fileprop.length, 1), 'x', p_float_t(fileprop.height, 1), F(" mm")); + DWINUI::drawString(20, 70, &buf); } + DWINUI::drawButton(BTN_Print, 26, 290); + DWINUI::drawButton(BTN_Cancel, 146, 290); + show(); + drawSelectHighlight(true, 290); + dwinUpdateLCD(); } -void Preview_Invalidate() { +void Preview::invalidate() { fileprop.thumbsize = 0; } -bool Preview_Valid() { +bool Preview::valid() { return !!fileprop.thumbsize; } -void Preview_Show() { - const uint8_t xpos = (DWIN_WIDTH - fileprop.thumbwidth) / 2; - const uint8_t ypos = (205 - fileprop.thumbheight) / 2 + 87; +void Preview::show() { + const uint8_t xpos = ((DWIN_WIDTH) - fileprop.thumbwidth) / 2, + ypos = (205 - fileprop.thumbheight) / 2 + 87; dwinIconShow(xpos, ypos, 0x00); } -#endif // HAS_GCODE_PREVIEW && DWIN_LCD_PROUI +#endif // DWIN_LCD_PROUI && HAS_GCODE_PREVIEW diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.h b/Marlin/src/lcd/e3v2/proui/gcode_preview.h index b90180db2912..91466424475d 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.h +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.h @@ -28,7 +28,14 @@ * Date: 2022/09/03 */ -void Preview_DrawFromSD(); -void Preview_Invalidate(); -bool Preview_Valid(); -void Preview_Show(); +class Preview { +public: + static void drawFromSD(); + static void invalidate(); + static bool valid(); + static void show(); +private: + static bool hasPreview(); +}; + +extern Preview preview; From 33aff884549457385b97f9d84161ea7ef90dd22d Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 25 Aug 2023 08:14:51 -0400 Subject: [PATCH 37/39] Rename Class Plot, fixes --- Marlin/src/lcd/e3v2/proui/plot.cpp | 26 +++++++++++++------------- Marlin/src/lcd/e3v2/proui/plot.h | 6 +++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index 59e474c7ccec..3ea0d555fe62 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -38,38 +38,38 @@ #define Plot_Bg_Color RGB( 1, 12, 8) -PlotClass plot; +Plot plot; -uint16_t grphpoints, r, x2, y2 = 0; -frame_rect_t grphframe = {0}; +uint16_t graphpoints, r, x2, y2 = 0; +frame_rect_t graphframe = {0}; float scale = 0; -void PlotClass::draw(const frame_rect_t &frame, const_float_t max, const_float_t ref/*=0*/) { - grphframe = frame; - grphpoints = 0; +void Plot::draw(const frame_rect_t &frame, const_celsius_float_t max, const_float_t ref/*=0*/) { + graphframe = frame; + graphpoints = 0; scale = frame.h / max; x2 = frame.x + frame.w - 1; y2 = frame.y + frame.h - 1; r = round((y2) - ref * scale); DWINUI::drawBox(1, Plot_Bg_Color, frame); - for (uint8_t i = 1; i < 4; i++) if (i * 50 < frame.w) dwinDrawVLine(COLOR_LINE, i * 50 + frame.x, frame.y, frame.h); + for (uint8_t i = 1; i < 4; i++) if (i * 60 < frame.w) dwinDrawVLine(COLOR_LINE, i * 60 + frame.x, frame.y, frame.h); DWINUI::drawBox(0, COLOR_WHITE, DWINUI::extendFrame(frame, 1)); dwinDrawHLine(COLOR_RED, frame.x, r, frame.w); } -void PlotClass::update(const_float_t value) { +void Plot::update(const_float_t value) { if (!scale) return; const uint16_t y = round((y2) - value * scale); - if (grphpoints < grphframe.w) { - dwinDrawPoint(COLOR_YELLOW, 1, 1, grphpoints + grphframe.x, y); + if (graphpoints < graphframe.w) { + dwinDrawPoint(COLOR_YELLOW, 1, 1, graphpoints + graphframe.x, y); } else { - dwinFrameAreaMove(1, 0, 1, Plot_Bg_Color, grphframe.x, grphframe.y, x2, y2); - if ((grphpoints % 50) == 0) dwinDrawVLine(COLOR_LINE, x2 - 1, grphframe.y + 1, grphframe.h - 2); + dwinFrameAreaMove(1, 0, 1, Plot_Bg_Color, graphframe.x, graphframe.y, x2, y2); + if ((graphpoints % 60) == 0) dwinDrawVLine(COLOR_LINE, x2 - 1, graphframe.y + 1, graphframe.h - 2); dwinDrawPoint(COLOR_RED, 1, 1, x2 - 1, r); dwinDrawPoint(COLOR_YELLOW, 1, 1, x2 - 1, y); } - grphpoints++; + graphpoints++; #if LCD_BACKLIGHT_TIMEOUT_MINS ui.refresh_backlight_timeout(); #endif diff --git a/Marlin/src/lcd/e3v2/proui/plot.h b/Marlin/src/lcd/e3v2/proui/plot.h index bc0e3a774ccd..275f0453becc 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.h +++ b/Marlin/src/lcd/e3v2/proui/plot.h @@ -30,10 +30,10 @@ #include "dwinui.h" -class PlotClass { +class Plot { public: - static void draw(const frame_rect_t &frame, const_float_t max, const_float_t ref=0); + static void draw(const frame_rect_t &frame, const_celsius_float_t max, const_float_t ref=0); static void update(const_float_t value); }; -extern PlotClass plot; +extern Plot plot; From 48a325e9c3ef478a902c53c7fba0fccca391c569 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Fri, 25 Aug 2023 08:15:41 -0400 Subject: [PATCH 38/39] Update Interval fix --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 43c80264d34c..0f038a30b214 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -161,8 +161,8 @@ #define MIN_BEDTEMP 0 #define MAX_BEDTEMP BED_MAX_TARGET -#define DWIN_VAR_UPDATE_INTERVAL 1024 -#define DWIN_UPDATE_INTERVAL 1024 +#define DWIN_VAR_UPDATE_INTERVAL 500 +#define DWIN_UPDATE_INTERVAL 1000 #if HAS_MESH && HAS_BED_PROBE #define BABY_Z_VAR probe.offset.z @@ -1283,7 +1283,7 @@ void eachMomentUpdate() { #endif if (ELAPSED(ms, next_status_update_ms)) { - next_status_update_ms = ms + 500; + next_status_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL; dwinDrawStatusMessage(); #if ENABLED(SCROLL_LONG_FILENAMES) if (isMenu(fileMenu)) fileMenuIdle(); From 4fbcd457cfe69a2d166fdcca6e794649a4ceb123 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 25 Aug 2023 14:22:25 -0500 Subject: [PATCH 39/39] Fix stack corruption --- Marlin/src/lcd/e3v2/proui/{base64.hpp => base64.h} | 14 +++++--------- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) rename Marlin/src/lcd/e3v2/proui/{base64.hpp => base64.h} (96%) diff --git a/Marlin/src/lcd/e3v2/proui/base64.hpp b/Marlin/src/lcd/e3v2/proui/base64.h similarity index 96% rename from Marlin/src/lcd/e3v2/proui/base64.hpp rename to Marlin/src/lcd/e3v2/proui/base64.h index a51cca7c52ec..520d0d7d7621 100644 --- a/Marlin/src/lcd/e3v2/proui/base64.hpp +++ b/Marlin/src/lcd/e3v2/proui/base64.h @@ -8,9 +8,7 @@ * Changed unsigned int to uint16_t for use in the professional Ender-3V2/S1 firmware * Url: https://www.arduino.cc/reference/en/libraries/base64/ */ - -#ifndef BASE64_H_INCLUDED -#define BASE64_H_INCLUDED +#pragma once /* binary_to_base64: * Description: @@ -135,11 +133,11 @@ uint16_t decode_base64_length(unsigned char input[], uint16_t input_length) { } input_length = input - start; - return input_length/4*3 + (input_length % 4 ? input_length % 4 - 1 : 0); + return input_length / 4 * 3 + (input_length % 4 ? input_length % 4 - 1 : 0); } uint16_t encode_base64(unsigned char input[], uint16_t input_length, unsigned char output[]) { - uint16_t full_sets = input_length/3; + uint16_t full_sets = input_length / 3; // While there are still full sets of 24 bits... for (uint16_t i = 0; i < full_sets; ++i) { @@ -152,7 +150,7 @@ uint16_t encode_base64(unsigned char input[], uint16_t input_length, unsigned ch output += 4; } - switch(input_length % 3) { + switch (input_length % 3) { case 0: output[0] = '\0'; break; @@ -192,7 +190,7 @@ uint16_t decode_base64(unsigned char input[], uint16_t input_length, unsigned ch output += 3; } - switch(output_length % 3) { + switch (output_length % 3) { case 1: output[0] = base64_to_binary(input[0]) << 2 | base64_to_binary(input[1]) >> 4; break; @@ -204,5 +202,3 @@ uint16_t decode_base64(unsigned char input[], uint16_t input_length, unsigned ch return output_length; } - -#endif // ifndef diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 53b38b641e70..30c6f9f1f6c2 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -39,7 +39,7 @@ #include "../../../MarlinCore.h" // for wait_for_user #include "dwin.h" #include "dwin_popup.h" -#include "base64.hpp" +#include "base64.h" #define THUMBWIDTH 230 #define THUMBHEIGHT 180 @@ -160,7 +160,7 @@ bool Preview::hasPreview() { return false; } - uint8_t buf64[fileprop.thumbsize]; + uint8_t buf64[fileprop.thumbsize + 1]; uint16_t nread = 0; while (nread < fileprop.thumbsize) { const uint8_t c = card.get();