From 4e31fa66e2f402ac574ec4afa52447824444d90d Mon Sep 17 00:00:00 2001 From: Dmitry Pogrebnyak Date: Fri, 4 Aug 2023 22:59:17 +0300 Subject: [PATCH 001/268] =?UTF-8?q?=E2=9C=A8=20STATUS=5FHEAT=5FPOWER=20(#2?= =?UTF-8?q?5268)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 3 + Marlin/src/inc/SanityCheck.h | 4 ++ Marlin/src/lcd/dogm/status_screen_DOGM.cpp | 74 +++++++++++++--------- 3 files changed, 51 insertions(+), 30 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6c29900cdf47..2577c27557e1 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1967,7 +1967,10 @@ //#define STATUS_ALT_BED_BITMAP // Use the alternative bed bitmap //#define STATUS_ALT_FAN_BITMAP // Use the alternative fan bitmap //#define STATUS_FAN_FRAMES 3 // :[0,1,2,3,4] Number of fan animation frames + + // Only one STATUS_HEAT_* option can be enabled //#define STATUS_HEAT_PERCENT // Show heating in a progress bar + //#define STATUS_HEAT_POWER // Show heater output power as a vertical bar // Frivolous Game Options //#define MARLIN_BRICKOUT diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 5933c8c396a7..ee23fc427078 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -404,6 +404,10 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #error "CUSTOM_STATUS_SCREEN_IMAGE requires a 128x64 DOGM B/W Graphical LCD." #endif +#if ALL(STATUS_HEAT_PERCENT, STATUS_HEAT_POWER) + #error "Only enable STATUS_HEAT_PERCENT or STATUS_HEAT_POWER, but not both." +#endif + /** * LCD Lightweight Screen Style */ diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp index 2067a8428da6..d38d28c8cd3b 100644 --- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp +++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp @@ -247,14 +247,13 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co const celsius_t temp = thermalManager.wholeDegHotend(heater_id), target = thermalManager.degTargetHotend(heater_id); - #if DISABLED(STATUS_HOTEND_ANIM) - #define STATIC_HOTEND true - #define HOTEND_DOT isHeat - #else - #define STATIC_HOTEND false - #define HOTEND_DOT false + #if ENABLED(STATUS_HEAT_POWER) + const uint16_t power = thermalManager.getHeaterPower(heater_id); #endif + #define STATIC_HOTEND DISABLED(STATUS_HOTEND_ANIM) + #define HOTEND_DOT TERN(STATUS_HOTEND_ANIM, false, isHeat) + #if ENABLED(STATUS_HOTEND_NUMBERLESS) #define OFF_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_b_bmp, status_hotend_a_bmp) #define ON_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_a_bmp, status_hotend_b_bmp) @@ -285,23 +284,34 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) - const float prop = target - 20, - perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; - uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); - NOMORE(tall, BAR_TALL); - // Draw hotend bitmap, either whole or split by the heating percent const uint8_t hx = STATUS_HOTEND_X(heater_id), bw = STATUS_HOTEND_BYTEWIDTH(heater_id); - #if ENABLED(STATUS_HEAT_PERCENT) - if (isHeat && tall <= BAR_TALL) { + #if ANY(STATUS_HEAT_PERCENT, STATUS_HEAT_POWER) + uint8_t tall = 0; + #if ENABLED(STATUS_HEAT_POWER) + // Rounded int. At least 1 pixel tall on minimal PWM. + tall = power ? (power >= 127 ? BAR_TALL : (uint16_t((uint8_t(power) * BAR_TALL) + 127U) / 128U)) : 0; + #elif ENABLED(STATUS_HEAT_PERCENT) + const float prop = target - 20, + perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; + tall = uint8_t(perc * BAR_TALL + 0.5f); + #endif + + NOMORE(tall, BAR_TALL); + + const bool draw_partial = isHeat && tall < BAR_TALL; + if (draw_partial) { const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall; u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), false)); u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), true) + ph * bw); } - else + #else + constexpr bool draw_partial = false; #endif - u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat)); + + if (!draw_partial) + u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat)); } // PAGE_CONTAINS @@ -342,29 +352,31 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co const celsius_t temp = thermalManager.wholeDegBed(), target = thermalManager.degTargetBed(); - #if ENABLED(STATUS_HEAT_PERCENT) || DISABLED(STATUS_BED_ANIM) + #if ANY(STATUS_HEAT_PERCENT, STATUS_HEAT_POWER) || DISABLED(STATUS_BED_ANIM) const bool isHeat = BED_ALT(); #endif - #if DISABLED(STATUS_BED_ANIM) - #define STATIC_BED true - #define BED_DOT isHeat - #else - #define STATIC_BED false - #define BED_DOT false - #endif + #define STATIC_BED DISABLED(STATUS_BED_ANIM) + #define BED_DOT TERN(STATUS_BED_ANIM, false, isHeat) if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) { #define BAR_TALL (STATUS_HEATERS_HEIGHT - 2) - const float prop = target - 20, - perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; - uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f); - NOMORE(tall, BAR_TALL); // Draw a heating progress bar, if specified - #if ENABLED(STATUS_HEAT_PERCENT) + #if ANY(STATUS_HEAT_PERCENT, STATUS_HEAT_POWER) + uint8_t tall = 0; + #if ENABLED(STATUS_HEAT_POWER) + const uint16_t power = thermalManager.getHeaterPower(H_BED); + tall = power ? (power >= 127) ? BAR_TALL : uint16_t((uint8_t(power) * BAR_TALL) + 127U) / 128U : 0; + #elif ENABLED(STATUS_HEAT_PERCENT) + const float prop = target - 20, + perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0; + tall = uint8_t(perc * BAR_TALL + 0.5f); + #endif + + NOMORE(tall, BAR_TALL); if (isHeat) { const uint8_t bx = STATUS_BED_X + STATUS_BED_WIDTH; @@ -538,9 +550,11 @@ void MarlinUI::draw_status_screen() { #if ANIM_HBCC uint8_t new_bits = 0; #if ANIM_HOTEND - HOTEND_LOOP() if (thermalManager.isHeatingHotend(e)) SBI(new_bits, DRAWBIT_HOTEND + e); + HOTEND_LOOP() if (thermalManager.TERN(STATUS_HEAT_POWER, getHeaterPower(heater_id_t(e)), isHeatingHotend(e))) SBI(new_bits, DRAWBIT_HOTEND + e); + #endif + #if ANIM_BED + if (TERN(STATUS_HEAT_POWER, (thermalManager.degTargetBed() || thermalManager.getHeaterPower(H_BED)), thermalManager.isHeatingBed())) SBI(new_bits, DRAWBIT_BED); #endif - if (TERN0(ANIM_BED, thermalManager.isHeatingBed())) SBI(new_bits, DRAWBIT_BED); #if DO_DRAW_CHAMBER && HAS_HEATED_CHAMBER if (thermalManager.isHeatingChamber()) SBI(new_bits, DRAWBIT_CHAMBER); #endif From 27e68a61fa0b1ec46084603880679810c53b3da3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 4 Aug 2023 18:29:52 -0500 Subject: [PATCH 002/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Upd?= =?UTF-8?q?ate=20some=20SDSUPPORT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/tft/ui_color_ui.cpp | 2 +- Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/tft/ui_color_ui.cpp b/Marlin/src/lcd/tft/ui_color_ui.cpp index a14f268d86c8..85d310ca42ea 100644 --- a/Marlin/src/lcd/tft/ui_color_ui.cpp +++ b/Marlin/src/lcd/tft/ui_color_ui.cpp @@ -319,7 +319,7 @@ void MarlinUI::draw_status_screen() { #if ENABLED(TOUCH_SCREEN) add_control(MENU_ICON_X, MENU_ICON_Y, menu_main, imgSettings); - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA const bool cm = card.isMounted(), pa = printingIsActive(); if (cm && pa) add_control(SDCARD_ICON_X, SDCARD_ICON_Y, STOP, imgCancel, true, COLOR_CONTROL_CANCEL); diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h index 4ded3294b950..b36c7140c45b 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h @@ -58,7 +58,7 @@ // #if ANY(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) #if ENABLED(CR10_STOCKDISPLAY) - #if ENABLED(SDSUPPORT) + #if HAS_MEDIA #error "Cannot have SDSUPPORT with CR10_STOCKDISPLAY on this motherboard." // Hardware SDCARD SCK and MOSI pins are reallocated. #endif #define LCD_PINS_RS EXP1_07_PIN // ST9720 CS From 06d46a0ef96a766b114db5902beccb86829ba57c Mon Sep 17 00:00:00 2001 From: "Alexey D. Filimonov" Date: Sat, 5 Aug 2023 03:07:56 +0300 Subject: [PATCH 003/268] =?UTF-8?q?=E2=9C=A8=20AUTO=5FPOWER=5FSPINDLE=5FLA?= =?UTF-8?q?SER=20(#25739)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 11 ++++++----- Marlin/src/feature/power.cpp | 8 ++++++++ Marlin/src/inc/Conditionals_post.h | 3 +++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 4dbc2a8c11ef..22b060dcb22c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -412,11 +412,12 @@ //#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin #if ENABLED(AUTO_POWER_CONTROL) - #define AUTO_POWER_FANS // Turn on PSU if fans need power - #define AUTO_POWER_E_FANS - #define AUTO_POWER_CONTROLLERFAN - #define AUTO_POWER_CHAMBER_FAN - #define AUTO_POWER_COOLER_FAN + #define AUTO_POWER_FANS // Turn on PSU for fans + #define AUTO_POWER_E_FANS // Turn on PSU for E Fans + #define AUTO_POWER_CONTROLLERFAN // Turn on PSU for Controller Fan + #define AUTO_POWER_CHAMBER_FAN // Turn on PSU for Chamber Fan + #define AUTO_POWER_COOLER_FAN // Turn on PSU for Cooler Fan + #define AUTO_POWER_SPINDLE_LASER // Turn on PSU for Spindle/Laser #define POWER_TIMEOUT 30 // (s) Turn off power if the machine is idle for this duration //#define POWER_OFF_DELAY 60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time. #endif diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index d0f8a66fec36..e908c8292fd6 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -53,6 +53,10 @@ bool Power::psu_on; #include "controllerfan.h" #endif + #if ANY(LASER_FEATURE, SPINDLE_FEATURE) + #include "spindle_laser.h" + #endif + millis_t Power::lastPowerOn; #endif @@ -196,6 +200,10 @@ void Power::power_off() { if (controllerFan.state()) return true; #endif + #if ANY(LASER_FEATURE, SPINDLE_FEATURE) + if (TERN0(AUTO_POWER_SPINDLE_LASER, cutter.enabled())) return true; + #endif + if (TERN0(AUTO_POWER_CHAMBER_FAN, thermalManager.chamberfan_speed)) return true; diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 13f20114e509..8f3a2eee27b9 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2623,6 +2623,9 @@ #if !HAS_AUTO_COOLER_FAN || AUTO_COOLER_IS_E #undef AUTO_POWER_COOLER_FAN #endif +#if !HAS_CUTTER + #undef AUTO_POWER_SPINDLE_LASER +#endif /** * Controller Fan Settings From c088081c0009d3eb2f218d39266cc08e902d03cf Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 5 Aug 2023 00:54:22 +0000 Subject: [PATCH 004/268] [cron] Bump distribution date (2023-08-05) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index f93128f2005e..e727c1601b7c 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-04" +//#define STRING_DISTRIBUTION_DATE "2023-08-05" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a1df5fe90a48..710c0cdcd7f9 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-04" + #define STRING_DISTRIBUTION_DATE "2023-08-05" #endif /** From ad112b4d3d47ff841334b16dcf497917fb8c1ec6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 4 Aug 2023 23:49:38 -0500 Subject: [PATCH 005/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20case=20TRRunaway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/temperature.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 1f9928f88e4e..c7e35c575457 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3220,11 +3220,13 @@ void Temperature::init() { case TRRunaway: TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); _TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_THERMAL_RUNAWAY, current); + break; #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) case TRMalfunction: TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); _TEMP_ERROR(heater_id, FPSTR(str_t_temp_malfunction), MSG_TEMP_MALFUNCTION, current); + break; #endif } } From 863198a73f8a07663a6a5f7c088631aa72b5fb45 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:56:40 +0200 Subject: [PATCH 006/268] =?UTF-8?q?=E2=9C=A8=20VOLUMETRIC=5FEXTRUDER=5FLIM?= =?UTF-8?q?IT=5FMAX=20(#25884)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 3 ++- Marlin/src/gcode/config/M200-M205.cpp | 4 ++-- Marlin/src/lcd/menu/menu_advanced.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 2577c27557e1..8e66d7555dbf 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3805,7 +3805,8 @@ * Use 'M200 [T] L' to override and 'M502' to reset. * A non-zero value activates Volume-based Extrusion Limiting. */ - #define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec) + #define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 // (mm^3/sec) + #define VOLUMETRIC_EXTRUDER_LIMIT_MAX 20 // (mm^3/sec) #endif #endif diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index e5e1edf3261f..06fbef631e75 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -64,10 +64,10 @@ if (parser.seenval('L')) { // Set volumetric limit (in mm^3/sec) const float lval = parser.value_float(); - if (WITHIN(lval, 0, 20)) + if (WITHIN(lval, 0, VOLUMETRIC_EXTRUDER_LIMIT_MAX)) planner.set_volumetric_extruder_limit(target_extruder, lval); else - SERIAL_ECHOLNPGM("?L value out of range (0-20)."); + SERIAL_ECHOLNPGM("?L value out of range (0-" STRINGIFY(VOLUMETRIC_EXTRUDER_LIMIT_MAX) ")."); } #endif diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 7cf4d34cb706..2bcd4e681b61 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -120,10 +120,10 @@ void menu_backlash(); EDIT_ITEM(bool, MSG_VOLUMETRIC_ENABLED, &parser.volumetric_enabled, planner.calculate_volumetric_multipliers); #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) - EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits); + EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, float(VOLUMETRIC_EXTRUDER_LIMIT_MAX), planner.calculate_volumetric_extruder_limits); #if HAS_MULTI_EXTRUDER EXTRUDER_LOOP() - EDIT_ITEM_FAST_N(float42_52, e, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[e], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits); + EDIT_ITEM_FAST_N(float42_52, e, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[e], 0.0f, float(VOLUMETRIC_EXTRUDER_LIMIT_MAX), planner.calculate_volumetric_extruder_limits); #endif #endif From f66323ecfbe067667234df286e14d43d409bfaea Mon Sep 17 00:00:00 2001 From: Pagliarulo Onofrio <78806035+oponyx@users.noreply.github.com> Date: Sat, 5 Aug 2023 07:03:10 +0200 Subject: [PATCH 007/268] =?UTF-8?q?=E2=9C=A8=20Geeetech=20GT2560=20V4.1B?= =?UTF-8?q?=20board=20(#25888)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/mega/pins_GT2560_V3.h | 18 +- Marlin/src/pins/mega/pins_GT2560_V41b.h | 248 ++++++++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 4 files changed, 264 insertions(+), 5 deletions(-) create mode 100644 Marlin/src/pins/mega/pins_GT2560_V41b.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 50a4ebc19461..5c4cabd08d3e 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -179,6 +179,7 @@ #define BOARD_GT2560_V4_A20 1328 // Geeetech GT2560 Rev B for A20(M/T/D) #define BOARD_PROTONEER_CNC_SHIELD_V3 1329 // Mega controller & Protoneer CNC Shield V3.00 #define BOARD_WEEDO_62A 1330 // WEEDO 62A board (TINA2, Monoprice Cadet, etc.) +#define BOARD_GT2560_V41B 1331 // Geeetech GT2560 V4.1B for A10(M/T/D) // // ATmega1281, ATmega2561 diff --git a/Marlin/src/pins/mega/pins_GT2560_V3.h b/Marlin/src/pins/mega/pins_GT2560_V3.h index 0c588e6516ee..b684214c6964 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V3.h +++ b/Marlin/src/pins/mega/pins_GT2560_V3.h @@ -95,7 +95,7 @@ #endif // -// Power Recovery +// Power Loss Detection // #define POWER_LOSS_PIN 69 // Pin to detect power loss #define POWER_LOSS_STATE LOW @@ -168,10 +168,18 @@ #define BEEPER_PIN 18 #if ENABLED(YHCB2004) - #define YHCB2004_MOSI_PIN 21 - #define YHCB2004_MISO_PIN 36 - #define YHCB2004_SCK_PIN 5 - #define YHCB2004_SS_PIN SS + #ifndef YHCB2004_MOSI_PIN + #define YHCB2004_MOSI_PIN 21 + #endif + #ifndef YHCB2004_MISO_PIN + #define YHCB2004_MISO_PIN 36 + #endif + #ifndef YHCB2004_SCK_PIN + #define YHCB2004_SCK_PIN 5 + #endif + #ifndef YHCB2004_SS_PIN + #define YHCB2004_SS_PIN SS + #endif #elif HAS_WIRED_LCD #ifndef LCD_PINS_RS #define LCD_PINS_RS 20 diff --git a/Marlin/src/pins/mega/pins_GT2560_V41b.h b/Marlin/src/pins/mega/pins_GT2560_V41b.h new file mode 100644 index 000000000000..03a82ca2f224 --- /dev/null +++ b/Marlin/src/pins/mega/pins_GT2560_V41b.h @@ -0,0 +1,248 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Geeetech GT2560 V4.1b Pins + * Schematic (4.1B): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20V4.x%20+%20A20/GT2560V4.1BSCHA20T.pdf + * Origin: https://www.geeetech.com/download.html?spm=a2g0s.imconversation.0.0.22d23e5fXlQBWv&download_id=45 + * ATmega2560 +*/ + +#define ALLOW_MEGA1280 +#include "env_validate.h" + +#if HOTENDS > 3 || E_STEPPERS > 3 + #error "GT2560 supports up to 3 hotends / E steppers." +#endif + +#define BOARD_INFO_NAME "GT2560 4.1b" + +/** Limit Switches Connectors + * All have external 10k pull-up resistors + * + * X-Y-Z AXIS MAX LIMIT SWITCHES CONNECTOR (H6) + * --------- + * | 1 4 7 | 5V 32 Z0_MAX GND + * | 2 5 8 | 5V 26 Y_MAX GND + * | 3 6 9 | 5V 22 X_MAX GND + * --------- + * H6 + * + * X AXIS Y AXIS Z1 AXIS Z0 AXIS + * --- --- --- --- + * | 1 | 5V | 1 | 5V | 1 | 5V | 1 | 5V + * | 2 | 24 X_MIN | 2 | 28 Y_MIN | 2 | PE7 Z1_MIN | 2 | 30 Z0_MIN + * | 3 | GND | 3 | GND | 3 | GND | 3 | GND + * --- --- --- --- + * J3 J4 J5 J6 + * +*/ + +//#define Z1_MIN PE7 // Number?? + +#ifndef X_STOP_PIN + #ifndef X_MIN_PIN + #define X_MIN_PIN 24 + #endif + #ifndef X_MAX_PIN + #define X_MAX_PIN 22 + #endif +#endif +#ifndef Y_STOP_PIN + #ifndef Y_MIN_PIN + #define Y_MIN_PIN 28 + #endif + #ifndef Y_MAX_PIN + #define Y_MAX_PIN 26 + #endif +#endif +#ifndef Z_STOP_PIN + #ifndef Z_MIN_PIN + #define Z_MIN_PIN 30 + #endif + #ifndef Z_MAX_PIN + #define Z_MAX_PIN 32 + #endif +#endif + +/** Filament Runout Sensors + * + * Filament 1 Filament 2 Filament 3 + * --- --- --- + * | 1 | 5V | 1 | 5V | 1 | 5V + * | 2 | 66 F_DET0 | 2 | 67 F_DET1 | 2 | 54 F_DET2 + * | 3 | GND | 3 | GND | 3 | GND + * --- --- --- + * J12 J13 J14 + */ + +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 66 +#endif +#ifndef FIL_RUNOUT2_PIN + #define FIL_RUNOUT2_PIN 67 +#endif +#ifndef FIL_RUNOUT3_PIN + #define FIL_RUNOUT3_PIN 54 +#endif + +// +// Power Loss Detection +// +#define POWER_LOSS_PIN 69 // Pin to detect power loss +#define POWER_LOSS_STATE LOW + +// +// Steppers +// +#define X_STEP_PIN 37 +#define X_DIR_PIN 39 +#define X_ENABLE_PIN 35 + +#define Y_STEP_PIN 31 +#define Y_DIR_PIN 33 +#define Y_ENABLE_PIN 29 + +#define Z_STEP_PIN 25 +#define Z_DIR_PIN 23 +#define Z_ENABLE_PIN 27 + +#define E0_STEP_PIN 46 +#define E0_DIR_PIN 44 +#define E0_ENABLE_PIN 12 + +#define E1_STEP_PIN 49 +#define E1_DIR_PIN 47 +#define E1_ENABLE_PIN 48 + +#define E2_STEP_PIN 43 +#define E2_DIR_PIN 45 +#define E2_ENABLE_PIN 41 + +/** Printhead Connector + * ------ + * (PWM8_FAN0) FAN_E0 9 | 1 2 | 9 FAN_E0 24V PWM FROM (PWM8_FAN0) + * (T0) A11 | 3 4 | A11 (T0) E0 Temp + * GND | 5 6 | 30 Z_MIN1 same as (Z0_MIN) + * 5V | 7 8 | 11 (PB5) servo for BL_TOUCH/3D_TOUCH + * (PB4_HE2) HE2 19 | 9 10 | GND + * (PB4_HE2) HE2 19 |11 12 | 19 HE2 24V PWM out for E0 (PB4_HE2) + * V24 |13 14 | V24 + * V24 |15 16 | V24 + * ------ + * H3 + */ + +#define SERVO0_PIN 11 // BLTouch / 3DTouch + +// +// Z Probe PIN6 Header H3 (Print head connector) +// +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN Z_MIN_PIN +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN 11 // Analog Input +#define TEMP_1_PIN 9 // Analog Input +#define TEMP_2_PIN 8 // Analog Input +#define TEMP_BED_PIN 10 // Analog Input + +// +// Heaters / Fans +// +#define HEATER_0_PIN 10 // PWM out to E0 +#define HEATER_1_PIN 3 +#define HEATER_2_PIN 2 +#define HEATER_BED_PIN 4 +#define FAN0_PIN 9 +#define FAN1_PIN 8 +#define FAN2_PIN 7 + +// +// Misc. Functions +// +#define SD_DETECT_PIN 38 +#define SDSS 53 +#define LED_PIN 13 // Use 6 (case light) for external LED. 13 is internal (yellow) LED. +#define PS_ON_PIN 12 + +#if NUM_RUNOUT_SENSORS < 3 + #define SUICIDE_PIN 54 // This pin must be enabled at boot to keep power flowing +#endif + +#ifndef CASE_LIGHT_PIN + #define CASE_LIGHT_PIN 6 // 21 +#endif + +/** LCD Connector + * ------ + * 5V | 1 2 | GND + * (LCM_D7) 36 | 3 4 | 5 (LCM_D6) + * (LCM_D5) 21 | 5 6 | GND + * (LCM_D4) 16 | 7 8 | 17 (LCM_EN) + * (EC_PRESS) 19 | 9 10 | GND + * (RESET) |11 12 | 19 (BEEP) + * ------ + * H2 + */ + +#define LCM_D4 16 // Used as BTN_EN1 for YHCB2004 LCD Module +#define LCM_D5 21 // YHCB2004_SCK_PIN +#define LCM_D6 5 // YHCB2004_SS_PIN +#define LCM_D7 36 // YHCB2004_MOSI_PIN +#define LCM_EN 17 // BTN_EN2 +#define EC_PRESS 19 // BTN_ENC +#define BEEP 18 + +#define BEEPER_PIN BEEP +#define LCM_RS 20 // Pin named and connected to 10k pull-up resistor but unused + +#if ENABLED(YHCB2004) + #define YHCB2004_SS_PIN LCM_D6 + #define YHCB2004_SCK_PIN LCM_D5 + #define YHCB2004_MOSI_PIN LCM_D7 + #define YHCB2004_MISO_PIN LCM_RS // Unused on V4.1b board +#elif HAS_WIRED_LCD + #error "GT2560 V4.1b requires an adapter for common LCDs." + /* Cannot use because V4.1b board has not LCD_PINS_RS wired to display connector + #define LCD_PINS_RS 20 + #define LCD_PINS_EN 17 + #define LCD_PINS_D4 16 + #define LCD_PINS_D5 21 + #define LCD_PINS_D6 5 + #define LCD_PINS_D7 36 + //*/ +#endif + +#if ENABLED(YHCB2004) + #define BTN_EN1 LCM_D4 + #define BTN_EN2 LCM_EN + #define BTN_ENC EC_PRESS +#elif IS_NEWPANEL + #define BTN_EN1 42 + #define BTN_EN2 40 + #define BTN_ENC 19 +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5c90dbc9626e..652feeb23c42 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -348,6 +348,8 @@ #include "mega/pins_PROTONEER_CNC_SHIELD_V3.h" // ATmega2560 env:mega2560 #elif MB(WEEDO_62A) #include "mega/pins_WEEDO_62A.h" // ATmega2560 env:mega2560 +#elif MB(GT2560_V41B) + #include "mega/pins_GT2560_V41b.h" // ATmega2560 env:mega2560 // // ATmega1281, ATmega2561 From 4d89db52095cb4f182bc11d4cfd72ceef8e2273f Mon Sep 17 00:00:00 2001 From: magicmaker3 <66371323+magicmaker3@users.noreply.github.com> Date: Sun, 6 Aug 2023 07:10:49 +0800 Subject: [PATCH 008/268] =?UTF-8?q?=E2=9C=A8=20MM-JOKER=20(ESP32)=20board?= =?UTF-8?q?=20(#25897)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/inc/SanityCheck.h | 10 +- Marlin/src/pins/esp32/pins_MM_JOKER.h | 266 ++++++++++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 4 files changed, 275 insertions(+), 4 deletions(-) create mode 100644 Marlin/src/pins/esp32/pins_MM_JOKER.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 5c4cabd08d3e..e72607e2a14c 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -490,6 +490,7 @@ #define BOARD_MKS_TINYBEE 7008 // MKS TinyBee based on ESP32 (with I2S stepper stream) #define BOARD_ENWI_ESPNP 7009 // enwi ESPNP based on ESP32 (with I2S stepper stream) #define BOARD_GODI_CONTROLLER_V1_0 7010 // Godi Controller based on ESP32 32-Bit V1.0 +#define BOARD_MM_JOKER 7011 // MagicMaker JOKER based on ESP32 (with I2S stepper stream) // // SAMD51 ARM Cortex-M4 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index ee23fc427078..4b56204db570 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -648,10 +648,12 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L */ #if HAS_MULTI_EXTRUDER - #if HAS_EXTENDABLE_MMU - #define MAX_EXTRUDERS 15 - #else - #define MAX_EXTRUDERS 8 + #ifndef MAX_EXTRUDERS + #if HAS_EXTENDABLE_MMU + #define MAX_EXTRUDERS 15 + #else + #define MAX_EXTRUDERS 8 + #endif #endif static_assert(EXTRUDERS <= MAX_EXTRUDERS, "Marlin supports a maximum of " STRINGIFY(MAX_EXTRUDERS) " EXTRUDERS."); #undef MAX_EXTRUDERS diff --git a/Marlin/src/pins/esp32/pins_MM_JOKER.h b/Marlin/src/pins/esp32/pins_MM_JOKER.h new file mode 100644 index 000000000000..184a94c01b30 --- /dev/null +++ b/Marlin/src/pins/esp32/pins_MM_JOKER.h @@ -0,0 +1,266 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * JOKER pin assignments + */ + +#include "env_validate.h" + +#define BOARD_INFO_NAME "JOKER" +#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME + +// +// Expansion Boards for more axes, sensors, heaters +// Only enable one of these options. +// +//#define JOKER_PLUS_2 +//#define JOKER_PLUS_5 + +#if ENABLED(JOKER_PLUS_2) + #define MAX_EXTRUDERS 2 + #if E_STEPPERS > 2 + #error "JOKER with +2 expansion supports up to 2 E steppers." + #elif HOTENDS > 2 + #error "JOKER with +2 expansion supports up to 2 hotends." + #endif +#elif ENABLED(JOKER_PLUS_5) + #define MAX_EXTRUDERS 3 + #if E_STEPPERS > 3 + #error "JOKER with +5 expansion supports up to 3 E steppers." + #elif HOTENDS > 3 + #error "JOKER with +5 expansion supports up to 3 hotends." + #endif +#else + #if E_STEPPERS > 1 + #error "JOKER without expansion only supports 1 E stepper." + #elif HAS_MULTI_HOTEND + #error "JOKER without expansion only supports 1 hotend." + #endif +#endif + +// +// Servos +// +#define SERVO0_PIN 14 + +// +// Limit Switches +// +#define X_STOP_PIN 15 +#define Y_STOP_PIN 16 +#define Z_STOP_PIN 17 + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN 13 +#endif + +#ifndef Z_MIN_PROBE_PIN + //#define Z_MIN_PROBE_PIN 35 // Pin 35 is the RAMPS default +#endif + +// +// Enable I2S stepper stream +// +#define I2S_STEPPER_STREAM +#if ENABLED(I2S_STEPPER_STREAM) + #define I2S_WS 26 + #define I2S_BCK 25 + #define I2S_DATA 27 + #if ENABLED(LIN_ADVANCE) + #error "I2S stream is currently incompatible with LIN_ADVANCE." + #endif +#endif + +// +// Steppers +// +#define X_STEP_PIN 128 +#define X_DIR_PIN 129 +#define X_ENABLE_PIN 136 + +#define Y_STEP_PIN 130 +#define Y_DIR_PIN 131 +#define Y_ENABLE_PIN X_ENABLE_PIN + +#define Z_STEP_PIN 132 +#define Z_DIR_PIN 133 +#define Z_ENABLE_PIN 137 + +#define E0_STEP_PIN 134 +#define E0_DIR_PIN 135 +#define E0_ENABLE_PIN 138 + +#if ENABLED(JOKER_PLUS_2) + + #define E1_STEP_PIN 144 + #define E1_DIR_PIN 145 + #define E1_ENABLE_PIN 146 + + #define E2_STEP_PIN 147 + #define E2_DIR_PIN 148 + #define E2_ENABLE_PIN 149 + +#elif ENABLED(JOKER_PLUS_5) + + #define E1_STEP_PIN 144 + #define E1_DIR_PIN 145 + #define E1_ENABLE_PIN 146 + + #define E2_STEP_PIN 153 + #define E2_DIR_PIN 154 + #define E2_ENABLE_PIN 155 + + #define E3_STEP_PIN 156 + #define E3_DIR_PIN 157 + #define E3_ENABLE_PIN 158 + + // Are these preferred for X2, Y2, Z2, Z3 ? + #define E4_STEP_PIN 147 + #define E4_DIR_PIN 148 + #define E4_ENABLE_PIN 149 + + #define E5_STEP_PIN 150 + #define E5_DIR_PIN 151 + #define E5_ENABLE_PIN 152 + +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN 36 // Analog Input +#define TEMP_BED_PIN 39 // Analog Input + +#if ENABLED(JOKER_PLUS_2) + #define TEMP_1_PIN 34 // Analog Input +#elif ENABLED(JOKER_PLUS_5) + #define TEMP_1_PIN 32 // Analog Input + #define TEMP_2_PIN 33 // Analog Input + #define TEMP_3_PIN 34 // Analog Input +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN 141 +#define HEATER_BED_PIN 140 +#define FAN0_PIN 143 + +#ifndef E0_AUTO_FAN_PIN + #define E0_AUTO_FAN_PIN 142 // Enabled in Configuration_adv.h +#endif + +#ifndef CONTROLLER_FAN_PIN + //#define CONTROLLER_FAN_PIN -1 +#endif + +#if ENABLED(JOKER_PLUS_2) + + #define HEATER_1_PIN 150 + #define FAN1_PIN 151 + +#elif ENABLED(JOKER_PLUS_5) + + #define HEATER_1_PIN 159 + #define HEATER_2_PIN 160 + #define HEATER_3_PIN 161 + + #define FAN1_PIN 162 + #define FAN2_PIN 163 + #define FAN3_PIN 164 + + #ifndef E1_AUTO_FAN_PIN + #define E1_AUTO_FAN_PIN 165 + #endif + #ifndef E2_AUTO_FAN_PIN + #define E2_AUTO_FAN_PIN 166 + #endif + #ifndef E3_AUTO_FAN_PIN + #define E3_AUTO_FAN_PIN 167 + #endif + +#endif + +// +// SD Card +// +#define SD_MOSI_PIN 23 +#define SD_MISO_PIN 19 +#define SD_SCK_PIN 18 +#define SDSS 5 +#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers + +// +// LCD / Controller +// +#if HAS_WIRED_LCD + + //#define LCD_PINS_RS 13 + //#define LCD_PINS_ENABLE 17 + //#define LCD_PINS_D4 16 + + #if ENABLED(CR10_STOCKDISPLAY) + + #define BEEPER_PIN 151 + + #elif IS_RRD_FG_SC + + #define BEEPER_PIN 151 + + //#define LCD_PINS_D5 -1 + //#define LCD_PINS_D6 -1 + //#define LCD_PINS_D7 -1 + + #endif + + #define BTN_EN1 2 + #define BTN_EN2 4 + #define BTN_ENC 12 + #define BEEPER_PIN 139 + +#endif // HAS_WIRED_LCD + +/** + * Hardware Serial + * Add the following to Configuration.h or Configuration_adv.h to assign + * specific pins to hardware Serial1 and Serial2. + * Note: Serial2 can be defined using HARDWARE_SERIAL2_RX and HARDWARE_SERIAL2_TX but + * JOKER does not have enough spare pins for such reassignment. + */ +//#define HARDWARE_SERIAL1_RX 21 +//#define HARDWARE_SERIAL1_TX 22 +//#define HARDWARE_SERIAL2_RX 2 +//#define HARDWARE_SERIAL2_TX 4 + +// +// M3/M4/M5 - Spindle/Laser Control +// +#if HAS_CUTTER + #define SPINDLE_LASER_ENA_PIN -1 // FET 1 + #define SPINDLE_LASER_PWM_PIN 33 // Bed FET + //#define SPINDLE_DIR_PIN -1 // FET 3 +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 652feeb23c42..b823f480d732 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -856,6 +856,8 @@ #include "esp32/pins_ENWI_ESPNP.h" // ESP32 env:esp32 #elif MB(GODI_CONTROLLER_V1_0) #include "esp32/pins_GODI_CONTROLLER_V1_0.h" // ESP32 env:godi_esp32 +#elif MB(MM_JOKER) + #include "esp32/pins_MM_JOKER.h" // ESP32 env:esp32 // // Adafruit Grand Central M4 (SAMD51 ARM Cortex-M4) From 27fd97a8bbb63f676c32c307afd491dd865a271f Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 6 Aug 2023 00:21:12 +0000 Subject: [PATCH 009/268] [cron] Bump distribution date (2023-08-06) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index e727c1601b7c..60a70a42c9e8 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-05" +//#define STRING_DISTRIBUTION_DATE "2023-08-06" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 710c0cdcd7f9..6c857b2aecbd 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-05" + #define STRING_DISTRIBUTION_DATE "2023-08-06" #endif /** From 8d74a63e4bc210ce96ef7cf148f3598afc9fe1ad Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 6 Aug 2023 21:04:40 -0500 Subject: [PATCH 010/268] =?UTF-8?q?=F0=9F=93=9D=20Update=20a=20config=20co?= =?UTF-8?q?mment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 22b060dcb22c..119f81415a30 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1514,7 +1514,7 @@ * * Tune and Adjust * - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc. - * - PROBE_OFFSET_WIZARD (configuration_adv.h) can be used for setting the Z offset. + * - PROBE_OFFSET_WIZARD (Configuration_adv.h) can be used for setting the Z offset. * * Assuming the typical work area orientation: * - Probe to RIGHT of the Nozzle has a Positive X offset From 1dd3c9e73f59ddac098173c4cc3642e798f18623 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 6 Aug 2023 20:04:11 -0700 Subject: [PATCH 011/268] =?UTF-8?q?=F0=9F=93=9D=20STM32G0B0=20SKR=20Mini?= =?UTF-8?q?=20E3=20V3.0=20/=20Manta=20M4P=20(#26087)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 4 ++-- ini/stm32g0.ini | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index e72607e2a14c..5e404fc85041 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -318,9 +318,9 @@ // #define BOARD_BTT_EBB42_V1_1 4000 // BigTreeTech EBB42 V1.1 (STM32G0B1CB) -#define BOARD_BTT_SKR_MINI_E3_V3_0 4001 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RE) +#define BOARD_BTT_SKR_MINI_E3_V3_0 4001 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B0RE / STM32G0B1RE) #define BOARD_BTT_MANTA_E3_EZ_V1_0 4002 // BigTreeTech Manta E3 EZ V1.0 (STM32G0B1RE) -#define BOARD_BTT_MANTA_M4P_V1_0 4003 // BigTreeTech Manta M4P V1.0 (STM32G0B1RE) +#define BOARD_BTT_MANTA_M4P_V1_0 4003 // BigTreeTech Manta M4P V1.0 (STM32G0B0RE) #define BOARD_BTT_MANTA_M5P_V1_0 4004 // BigTreeTech Manta M5P V1.0 (STM32G0B1RE) #define BOARD_BTT_MANTA_M8P_V1_0 4005 // BigTreeTech Manta M8P V1.0 (STM32G0B1VE) #define BOARD_BTT_MANTA_M8P_V1_1 4006 // BigTreeTech Manta M8P V1.1 (STM32G0B1VE) diff --git a/ini/stm32g0.ini b/ini/stm32g0.ini index f67002fa5c3c..fa6e5cba74ce 100644 --- a/ini/stm32g0.ini +++ b/ini/stm32g0.ini @@ -43,7 +43,7 @@ upload_protocol = dfu upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" # -# BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RET6 ARM Cortex-M0+) +# BigTreeTech SKR Mini E3 V3.0 (STM32G0B0RET6 / STM32G0B1RET6 ARM Cortex-M0+) # [env:STM32G0B1RE_btt] extends = stm32_variant @@ -62,7 +62,7 @@ upload_protocol = stlink debug_tool = stlink # -# BigTreeTech SKR Mini E3 V3.0 (STM32G0B1RET6 ARM Cortex-M0+) +# BigTreeTech SKR Mini E3 V3.0 (STM32G0B0RET6 / STM32G0B1RET6 ARM Cortex-M0+) # Custom upload to SD via Marlin with Binary Protocol # Requires Marlin with BINARY_FILE_TRANSFER already installed on the target board. # If CUSTOM_FIRMWARE_UPLOAD is also installed, Marlin will reboot the board to install the firmware. @@ -76,7 +76,8 @@ extra_scripts = ${env:STM32G0B1RE_btt.extra_scripts} upload_protocol = custom # -# BigTreeTech Manta E3 EZ V1.0 / Manta M4P V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+) +# BigTreeTech Manta M4P V1.0 (STM32G0B0RET6 ARM Cortex-M0+) +# BigTreeTech Manta E3 EZ V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+) # [env:STM32G0B1RE_manta_btt] extends = env:STM32G0B1RE_btt @@ -84,7 +85,8 @@ build_flags = ${env:STM32G0B1RE_btt.build_flags} -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 -DENABLE_HWSERIAL3 # -# BigTreeTech Manta E3 EZ V1.0 / Manta M4P V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+) +# BigTreeTech Manta M4P V1.0 (STM32G0B0RET6 ARM Cortex-M0+) +# BigTreeTech Manta E3 EZ V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+) # Custom upload to SD via Marlin with Binary Protocol # Requires Marlin with BINARY_FILE_TRANSFER already installed on the target board. # If CUSTOM_FIRMWARE_UPLOAD is also installed, Marlin will reboot the board to install the firmware. From b956001d8175b3f01ef0be2ef6b07825a8509317 Mon Sep 17 00:00:00 2001 From: lukasradek Date: Mon, 7 Aug 2023 05:08:35 +0200 Subject: [PATCH 012/268] =?UTF-8?q?=F0=9F=9A=B8=20Update=20LCD=20Manual=20?= =?UTF-8?q?Leveling=20display=20(#26088)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 2 +- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 4 ++-- Marlin/src/lcd/menu/menu_x_twist.cpp | 4 ++-- Marlin/src/lcd/tft/ui_color_ui.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index ebfb10c8c040..27e5b38bd0a3 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -422,7 +422,7 @@ void MarlinUI::draw_status_message(const bool blink) { const dwin_coord_t by = (row * MENU_LINE_HEIGHT) + MENU_FONT_HEIGHT + EXTRA_ROW_HEIGHT / 2; dwinDrawString(true, font16x32, COLOR_YELLOW, COLOR_BG_BLACK, (LCD_PIXEL_WIDTH - vallen * 16) / 2, by, S(dwin_string.string())); - if (ui.can_show_slider()) { + if (ui.can_show_slider() && maxEditValue > 0) { const dwin_coord_t slider_length = LCD_PIXEL_WIDTH - TERN(DWIN_MARLINUI_LANDSCAPE, 120, 20), slider_height = 16, diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index beb9342fb9b8..981c51a6b056 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -139,8 +139,8 @@ void _lcd_level_bed_moving() { if (ui.should_draw()) { MString<9> msg; - msg.setf(F("%i / %u"), int(manual_probe_index + 1), total_probe_points); - MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), &msg); + msg.setf(F(" %i / %u"), int(manual_probe_index + 1), total_probe_points); + MenuItem_static::draw(LCD_HEIGHT / 2, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), SS_CENTER, msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z); diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp index 6162a5e30d3b..f5ceec8f12f1 100644 --- a/Marlin/src/lcd/menu/menu_x_twist.cpp +++ b/Marlin/src/lcd/menu/menu_x_twist.cpp @@ -113,8 +113,8 @@ void xatc_wizard_menu() { void xatc_wizard_moving() { if (ui.should_draw()) { MString<9> msg; - msg.setf(F("%i / %u"), manual_probe_index + 1, XATC_MAX_POINTS); - MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), &msg); + msg.setf(F(" %i / %u"), manual_probe_index + 1, XATC_MAX_POINTS); + MenuItem_static::draw(LCD_HEIGHT / 2, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT), SS_CENTER, msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); if (!ui.wait_for_move) ui.goto_screen(xatc_wizard_menu); diff --git a/Marlin/src/lcd/tft/ui_color_ui.cpp b/Marlin/src/lcd/tft/ui_color_ui.cpp index 85d310ca42ea..cefbd05d1953 100644 --- a/Marlin/src/lcd/tft/ui_color_ui.cpp +++ b/Marlin/src/lcd/tft/ui_color_ui.cpp @@ -429,7 +429,7 @@ void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const va } #endif - if (ui.can_show_slider()) { + if (ui.can_show_slider() && maxEditValue > 0) { tft.canvas((TFT_WIDTH - SLIDER_W) / 2, SLIDER_Y, SLIDER_W, 16); tft.set_background(COLOR_BACKGROUND); From 205a679959432dff54352b390354a4324f29a97a Mon Sep 17 00:00:00 2001 From: Bart Meijer Date: Mon, 7 Aug 2023 06:12:30 +0200 Subject: [PATCH 013/268] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20SAMD21=20LCD=20use?= =?UTF-8?q?s=20HW=20SPI=20with=20media=20(#26012)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp | 8 ++-- Marlin/src/lcd/dogm/HAL_LCD_class_defines.h | 40 +++++++++---------- Marlin/src/lcd/dogm/HAL_LCD_com_defines.h | 2 - Marlin/src/lcd/dogm/marlinui_DOGM.h | 14 ++++--- ini/samd21.ini | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp index 025e5a3bb60d..42630a6ce5ca 100644 --- a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp +++ b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp @@ -70,7 +70,7 @@ #include "../../shared/HAL_SPI.h" #ifndef LCD_SPI_SPEED - #define LCD_SPI_SPEED SPI_QUARTER_SPEED + #define LCD_SPI_SPEED SPI_HALF_SPEED #endif void u8g_SetPIOutput(u8g_t *u8g, uint8_t pin_index) { @@ -85,7 +85,6 @@ void u8g_SetPILevel(u8g_t *u8g, uint8_t pin_index, uint8_t level) { uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) { - static SPISettings lcdSPIConfig; switch (msg) { case U8G_COM_MSG_STOP: @@ -99,7 +98,6 @@ uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val u8g_SetPILevel(u8g, U8G_PI_CS, LOW); spiBegin(); - lcdSPIConfig = SPISettings(900000, MSBFIRST, SPI_MODE0); u8g->pin_list[U8G_PI_A0_STATE] = 0; break; @@ -117,7 +115,7 @@ uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val break; case U8G_COM_MSG_WRITE_BYTE: - SPI.beginTransaction(lcdSPIConfig); + spiBeginTransaction(LCD_SPI_SPEED, MSBFIRST, SPI_MODE0); if (u8g->pin_list[U8G_PI_A0_STATE] == 0) { // command SPI.transfer(0x0f8); u8g->pin_list[U8G_PI_A0_STATE] = 2; @@ -132,7 +130,7 @@ uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val break; case U8G_COM_MSG_WRITE_SEQ: - SPI.beginTransaction(lcdSPIConfig); + spiBeginTransaction(LCD_SPI_SPEED, MSBFIRST, SPI_MODE0); if (u8g->pin_list[U8G_PI_A0_STATE] == 0 ) { // command SPI.transfer(0x0f8); u8g->pin_list[U8G_PI_A0_STATE] = 2; diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h index 28ca26134e16..dc40aba04628 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h @@ -31,12 +31,12 @@ extern u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi; class U8GLIB_64128N_2X_HAL : public U8GLIB { public: U8GLIB_64128N_2X_HAL() : U8GLIB() { } - U8GLIB_64128N_2X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); } - U8GLIB_64128N_2X_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(cs, a0, reset); } - void init(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { + U8GLIB_64128N_2X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); } + U8GLIB_64128N_2X_HAL(pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { init(cs, a0, reset); } + void init(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_st7565_64128n_HAL_2x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset); } - void init(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { + void init(pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_st7565_64128n_HAL_2x_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset); } }; @@ -47,12 +47,12 @@ extern u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi; class U8GLIB_ST7920_128X64_4X_HAL : public U8GLIB { public: U8GLIB_ST7920_128X64_4X_HAL() : U8GLIB() { } - U8GLIB_ST7920_128X64_4X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, reset); } - U8GLIB_ST7920_128X64_4X_HAL(pin_t cs, pin_t reset = U8G_PIN_NONE) { init(cs, reset); } - void init(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) { + U8GLIB_ST7920_128X64_4X_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t reset=U8G_PIN_NONE) { init(sck, mosi, cs, reset); } + U8GLIB_ST7920_128X64_4X_HAL(pin_t cs, pin_t reset=U8G_PIN_NONE) { init(cs, reset); } + void init(pin_t sck, pin_t mosi, pin_t cs, pin_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_st7920_128x64_HAL_4x_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE } - void init(pin_t cs, pin_t reset = U8G_PIN_NONE) { + void init(pin_t cs, pin_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_st7920_128x64_HAL_4x_hw_spi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE } }; @@ -66,8 +66,8 @@ extern u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi; class U8GLIB_ST7920_128X64_RRD : public U8GLIB { public: U8GLIB_ST7920_128X64_RRD() : U8GLIB() { } - U8GLIB_ST7920_128X64_RRD(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, reset); } - void init(pin_t sck, pin_t mosi, pin_t cs, pin_t reset = U8G_PIN_NONE) { + U8GLIB_ST7920_128X64_RRD(pin_t sck, pin_t mosi, pin_t cs, pin_t reset=U8G_PIN_NONE) { init(sck, mosi, cs, reset); } + void init(pin_t sck, pin_t mosi, pin_t cs, pin_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_st7920_128x64_rrd_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, U8G_PIN_NONE, (uint8_t)reset); // a0 = U8G_PIN_NONE } }; @@ -99,8 +99,8 @@ extern u8g_dev_t u8g_dev_tft_320x240_upscale_from_128x64; class U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 : public U8GLIB { public: U8GLIB_TFT_320X240_UPSCALE_FROM_128X64() : U8GLIB() { } - U8GLIB_TFT_320X240_UPSCALE_FROM_128X64(uint8_t cs, uint8_t rs, uint8_t reset = U8G_PIN_NONE) { init(cs, rs, reset); } - void init(uint8_t cs, uint8_t rs, uint8_t reset = U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset); } + U8GLIB_TFT_320X240_UPSCALE_FROM_128X64(uint8_t cs, uint8_t rs, uint8_t reset=U8G_PIN_NONE) { init(cs, rs, reset); } + void init(uint8_t cs, uint8_t rs, uint8_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset); } }; @@ -109,12 +109,12 @@ extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini1286 class U8GLIB_MINI12864_2X_HAL : public U8GLIB { public: U8GLIB_MINI12864_2X_HAL() : U8GLIB() { } - U8GLIB_MINI12864_2X_HAL(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); } - U8GLIB_MINI12864_2X_HAL(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) { init(cs, a0, reset); } - void init(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) { + U8GLIB_MINI12864_2X_HAL(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset=U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); } + U8GLIB_MINI12864_2X_HAL(uint8_t cs, uint8_t a0, uint8_t reset=U8G_PIN_NONE) { init(cs, a0, reset); } + void init(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, sck, mosi, cs, a0, reset); } - void init(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) { + void init(uint8_t cs, uint8_t a0, uint8_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_uc1701_mini12864_HAL_2x_hw_spi, cs, a0, reset); } }; @@ -125,12 +125,12 @@ extern u8g_dev_t u8g_dev_ssd1309_hw_spi; class U8GLIB_SSD1309_128X64_HAL : public U8GLIB { public: U8GLIB_SSD1309_128X64_HAL() : U8GLIB() { } - U8GLIB_SSD1309_128X64_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); } - U8GLIB_SSD1309_128X64_HAL(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { init(cs, a0, reset); } - void init(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { + U8GLIB_SSD1309_128X64_HAL(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { init(sck, mosi, cs, a0, reset); } + U8GLIB_SSD1309_128X64_HAL(pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { init(cs, a0, reset); } + void init(pin_t sck, pin_t mosi, pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_ssd1309_sw_spi, (uint8_t)sck, (uint8_t)mosi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset); } - void init(pin_t cs, pin_t a0, pin_t reset = U8G_PIN_NONE) { + void init(pin_t cs, pin_t a0, pin_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_ssd1309_hw_spi, (uint8_t)cs, (uint8_t)a0, (uint8_t)reset); } }; diff --git a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h index cfba12acff1b..6df641315895 100644 --- a/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h +++ b/Marlin/src/lcd/dogm/HAL_LCD_com_defines.h @@ -41,11 +41,9 @@ #define U8G_COM_HAL_HW_SPI_FN u8g_com_samd51_hw_spi_fn #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_samd51_st7920_hw_spi_fn - #elif defined(__SAMD21__) uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr); - #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_samd21_st7920_hw_spi_fn #elif defined(__STM32F1__) diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.h b/Marlin/src/lcd/dogm/marlinui_DOGM.h index 414508b1294c..d23df6e2a370 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.h +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.h @@ -36,11 +36,15 @@ // RepRapWorld Graphical LCD - #if !HAS_MEDIA && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) - #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL + #if HAS_MEDIA + #ifdef __SAMD21__ + #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL + #else + #define U8G_CLASS U8GLIB_ST7920_128X64_4X + #endif #define U8G_PARAM LCD_PINS_RS - #elif HAS_MEDIA && __SAMD21__ - #define U8G_CLASS U8GLIB_ST7920_128X64_4X + #elif (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN) + #define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL #define U8G_PARAM LCD_PINS_RS #else #define U8G_CLASS U8GLIB_ST7920_128X64_4X @@ -61,7 +65,7 @@ #else #define U8G_CLASS U8GLIB_ST7920_128X64_RRD // Adjust stripes with PAGE_HEIGHT in ultralcd_st7920_u8glib_rrd.h #endif - #define U8G_PARAM LCD_PINS_D4, LCD_PINS_EN, LCD_PINS_RS // AVR version ignores these pin settings + #define U8G_PARAM LCD_PINS_D4, LCD_PINS_EN, LCD_PINS_RS // AVR version ignores these pin settings // HAL version uses these pin settings #endif diff --git a/ini/samd21.ini b/ini/samd21.ini index 969ce3b9571e..f2acf829ff83 100644 --- a/ini/samd21.ini +++ b/ini/samd21.ini @@ -16,7 +16,7 @@ platform = atmelsam board = minitronics20 build_flags = ${common.build_flags} -std=gnu++17 - -DUSBCON -DUSBD_USE_CDC -D__SAMD21__ -DARDUINO_SAMD_MINITRONICS20 -Wno-deprecated-declarations -DU8G_HAL_LINKS -DDEBUG + -DUSBCON -DUSBD_USE_CDC -D__SAMD21__ -DARDUINO_SAMD_MINITRONICS20 -Wno-deprecated-declarations -DDEBUG -IMarlin/src/HAL/SAMD21/u8g build_unflags = -std=gnu++11 build_src_filter = ${common.default_src_filter} + From ffef8f1b297e83aa37eeb5ffcc5369e5c9c42a09 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 7 Aug 2023 12:33:20 +0800 Subject: [PATCH 014/268] =?UTF-8?q?=F0=9F=9A=B8=20BD=20Sensor=20Z=20axis?= =?UTF-8?q?=20stop=20height=20(#26015)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/bedlevel/bdl/bdl.cpp | 27 ++++++++++++++----------- Marlin/src/feature/bedlevel/bdl/bdl.h | 4 ++++ Marlin/src/gcode/bedlevel/abl/G29.cpp | 1 + Marlin/src/module/motion.cpp | 7 ++++++- Marlin/src/module/probe.cpp | 1 + 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Marlin/src/feature/bedlevel/bdl/bdl.cpp b/Marlin/src/feature/bedlevel/bdl/bdl.cpp index 14989a07d344..5345bb78c590 100644 --- a/Marlin/src/feature/bedlevel/bdl/bdl.cpp +++ b/Marlin/src/feature/bedlevel/bdl/bdl.cpp @@ -78,8 +78,8 @@ bool BDS_Leveling::check(const uint16_t data, const bool raw_data/*=false*/, con return true; // error } if (raw_data == true) { - if (hicheck && (data & 0x3FF) > 550) - SERIAL_ECHOLNPGM("BD Sensor mounted too high!"); + if (hicheck && (data & 0x3FF) > 400) + SERIAL_ECHOLNPGM("Bad BD Sensor height! Recommended distance 0.5-2.0mm"); else if (!good_data(data)) SERIAL_ECHOLNPGM("Invalid data, please calibrate."); else @@ -109,7 +109,8 @@ void BDS_Leveling::process() { static float zpos = 0.0f; const millis_t ms = millis(); if (ELAPSED(ms, next_check_ms)) { // timed out (or first run) - next_check_ms = ms + (config_state < BDS_IDLE ? 200 : 50); // check at 5Hz or 20Hz + // Check at 1KHz, 5Hz, or 20Hz + next_check_ms = ms + (config_state == BDS_HOMING_Z ? 1 : (config_state < BDS_IDLE ? 200 : 50)); uint16_t tmp = 0; const float cur_z = planner.get_axis_position_mm(Z_AXIS) - pos_zero_offset; @@ -127,16 +128,14 @@ void BDS_Leveling::process() { babystep.set_mm(Z_AXIS, cur_z - z_sensor); DEBUG_ECHOLNPGM("BD:", z_sensor, ", Z:", cur_z, "|", current_position.z); } - else { - babystep.set_mm(Z_AXIS, 0); //if (old_cur_z <= cur_z) Z_DIR_WRITE(HIGH); - //stepper.apply_directions(); // TODO: Remove this line as probably not needed - } + else + babystep.set_mm(Z_AXIS, 0); } #endif old_cur_z = cur_z; old_buf_z = current_position.z; - endstops.bdp_state_update(z_sensor <= 0.01f); + endstops.bdp_state_update(z_sensor <= BD_SENSOR_HOME_Z_POSITION); #if HAS_STATUS_MESSAGE static float old_z_sensor = 0; @@ -149,8 +148,10 @@ void BDS_Leveling::process() { } #endif } - else - stepper.apply_directions(); + else if (config_state == BDS_HOMING_Z) { + SERIAL_ECHOLNPGM("Read:", tmp); + kill(F("BDsensor connect Err!")); + } DEBUG_ECHOLNPGM("BD:", tmp & 0x3FF, " Z:", cur_z, "|", current_position.z); if (TERN0(DEBUG_OUT_BD, BD_I2C_SENSOR.BD_Check_OddEven(tmp) == 0)) DEBUG_ECHOLNPGM("CRC error"); @@ -233,11 +234,13 @@ void BDS_Leveling::process() { sprintf_P(tmp_1, PSTR("G1Z%d.%d"), int(zpos), int(zpos * 10) % 10); gcode.process_subcommands_now(tmp_1); SERIAL_ECHO(tmp_1); SERIAL_ECHOLNPGM(", Z:", current_position.z); - for (float tmp_k = 0; abs(zpos - tmp_k) > 0.004f;) { + uint16_t failcount = 300; + for (float tmp_k = 0; abs(zpos - tmp_k) > 0.006f && failcount--;) { tmp_k = planner.get_axis_position_mm(Z_AXIS) - pos_zero_offset; safe_delay(10); + if (!failcount--) break; } - safe_delay(zpos <= 0.4f ? 600 : 100); + safe_delay(600); tmp = uint16_t((zpos + 0.00001f) * 10); BD_I2C_SENSOR.BD_i2c_write(tmp); SERIAL_ECHOLNPGM("w:", tmp, ", Z:", zpos); diff --git a/Marlin/src/feature/bedlevel/bdl/bdl.h b/Marlin/src/feature/bedlevel/bdl/bdl.h index b3037bc1c277..ed91d7081b67 100644 --- a/Marlin/src/feature/bedlevel/bdl/bdl.h +++ b/Marlin/src/feature/bedlevel/bdl/bdl.h @@ -23,6 +23,10 @@ #include +#ifndef BD_SENSOR_HOME_Z_POSITION + #define BD_SENSOR_HOME_Z_POSITION 0.5 +#endif + enum BDS_State : int8_t { BDS_IDLE, BDS_VERSION = -1, diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 5ecb6af66c58..d6d648c12560 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -748,6 +748,7 @@ G29_TYPE GcodeSuite::G29() { } //if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM_P(axis == Y_AXIS ? PSTR("Y=") : PSTR("X=", pos); + safe_delay(4); abl.measured_z = current_position.z - bdl.read(); if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("x_cur ", planner.get_axis_position_mm(X_AXIS), " z ", abl.measured_z); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 80729df759da..272b16c9ac0f 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -2479,7 +2479,12 @@ void set_axis_is_at_home(const AxisEnum axis) { #if HAS_BED_PROBE && Z_HOME_TO_MIN if (axis == Z_AXIS) { #if HOMING_Z_WITH_PROBE - current_position.z -= probe.offset.z; + #if ENABLED(BD_SENSOR) + safe_delay(100); + current_position.z = bdl.read(); + #else + current_position.z -= probe.offset.z; + #endif if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("*** Z homed with PROBE" TERN_(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, " (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)") " ***\n> (M851 Z", probe.offset.z, ")"); #else if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("*** Z homed to ENDSTOP ***"); diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 68fcfd00e0a2..989965d6d884 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -980,6 +980,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai #if ENABLED(BD_SENSOR) + safe_delay(4); return current_position.z - bdl.read(); // Difference between Z-home-relative Z and sensor reading #else // !BD_SENSOR From a8177944443a7a1186a77cefbe1ae7be19722ddd Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 7 Aug 2023 06:51:07 +0000 Subject: [PATCH 015/268] [cron] Bump distribution date (2023-08-07) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 60a70a42c9e8..c8fe764a0e01 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-06" +//#define STRING_DISTRIBUTION_DATE "2023-08-07" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 6c857b2aecbd..bc7b53a84393 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-06" + #define STRING_DISTRIBUTION_DATE "2023-08-07" #endif /** From a5e4b4bd7d18f84c29a13430c636ecae289c352a Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Mon, 7 Aug 2023 10:30:24 +0200 Subject: [PATCH 016/268] =?UTF-8?q?=F0=9F=9A=B8=20FT=5FMOTION=20menu=20upd?= =?UTF-8?q?ates=20(#26083)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_en.h | 2 + Marlin/src/lcd/menu/menu_motion.cpp | 80 +++++++++++++-------------- Marlin/src/module/ft_motion.cpp | 6 +- Marlin/src/module/ft_motion.h | 12 +++- Marlin/src/sd/SdBaseFile.cpp | 2 +- 5 files changed, 55 insertions(+), 47 deletions(-) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index ea86812d0eb7..9fdc33e5f202 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -824,6 +824,8 @@ namespace LanguageNarrow_en { LSTR MSG_FTM_MASS_BASED = _UxGT("Mass-based"); LSTR MSG_FTM_BASE_FREQ_N = _UxGT("@ Base Freq."); LSTR MSG_FTM_DFREQ_K_N = _UxGT("@ Dyn. Freq."); + LSTR MSG_FTM_ZETA = _UxGT("Damping"); + LSTR MSG_FTM_VTOL = _UxGT("Vib. Level"); LSTR MSG_LEVEL_X_AXIS = _UxGT("Level X Axis"); LSTR MSG_AUTO_CALIBRATE = _UxGT("Auto Calibrate"); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 67fcbdd8511e..ae6e87af6585 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -318,10 +318,9 @@ void menu_move() { #include "../../module/ft_motion.h" #include "../../gcode/gcode.h" - void _M493_S(const ftMotionMode_t s) { - char cmd[10]; - sprintf_P(cmd, PSTR("M493S%i"), int(s)); - gcode.process_subcommands_now(cmd); + void ftm_menu_setShaping(const ftMotionMode_t s) { + fxdTiCtrl.cfg.mode = s; + fxdTiCtrl.refreshShapingN(); ui.go_back(); } @@ -331,17 +330,17 @@ void menu_move() { START_MENU(); BACK_ITEM(MSG_FIXED_TIME_MOTION); - if (mode != ftMotionMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ _M493_S(ftMotionMode_DISABLED); }); - if (mode != ftMotionMode_ENABLED) ACTION_ITEM(MSG_LCD_ON, []{ _M493_S(ftMotionMode_ENABLED); }); + if (mode != ftMotionMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ ftm_menu_setShaping(ftMotionMode_DISABLED); }); + if (mode != ftMotionMode_ENABLED) ACTION_ITEM(MSG_LCD_ON, []{ ftm_menu_setShaping(ftMotionMode_ENABLED); }); #if HAS_X_AXIS - if (mode != ftMotionMode_ZV) ACTION_ITEM(MSG_FTM_ZV, []{ _M493_S(ftMotionMode_ZV); }); - if (mode != ftMotionMode_ZVD) ACTION_ITEM(MSG_FTM_ZVD, []{ _M493_S(ftMotionMode_ZVD); }); - if (mode != ftMotionMode_EI) ACTION_ITEM(MSG_FTM_EI, []{ _M493_S(ftMotionMode_EI); }); - if (mode != ftMotionMode_2HEI) ACTION_ITEM(MSG_FTM_2HEI, []{ _M493_S(ftMotionMode_2HEI); }); - if (mode != ftMotionMode_3HEI) ACTION_ITEM(MSG_FTM_3HEI, []{ _M493_S(ftMotionMode_3HEI); }); - if (mode != ftMotionMode_MZV) ACTION_ITEM(MSG_FTM_MZV, []{ _M493_S(ftMotionMode_MZV); }); - //if (mode != ftMotionMode_ULENDO_FBS) ACTION_ITEM(MSG_FTM_ULENDO_FBS, []{ _M493_S(ftMotionMode_ULENDO_FBS); }); - //if (mode != ftMotionMode_DISCTF) ACTION_ITEM(MSG_FTM_DISCTF, []{ _M493_S(ftMotionMode_DISCTF); }); + if (mode != ftMotionMode_ZV) ACTION_ITEM(MSG_FTM_ZV, []{ ftm_menu_setShaping(ftMotionMode_ZV); }); + if (mode != ftMotionMode_ZVD) ACTION_ITEM(MSG_FTM_ZVD, []{ ftm_menu_setShaping(ftMotionMode_ZVD); }); + if (mode != ftMotionMode_EI) ACTION_ITEM(MSG_FTM_EI, []{ ftm_menu_setShaping(ftMotionMode_EI); }); + if (mode != ftMotionMode_2HEI) ACTION_ITEM(MSG_FTM_2HEI, []{ ftm_menu_setShaping(ftMotionMode_2HEI); }); + if (mode != ftMotionMode_3HEI) ACTION_ITEM(MSG_FTM_3HEI, []{ ftm_menu_setShaping(ftMotionMode_3HEI); }); + if (mode != ftMotionMode_MZV) ACTION_ITEM(MSG_FTM_MZV, []{ ftm_menu_setShaping(ftMotionMode_MZV); }); + //if (mode != ftMotionMode_ULENDO_FBS) ACTION_ITEM(MSG_FTM_ULENDO_FBS, []{ ftm_menu_setShaping(ftMotionMode_ULENDO_FBS); }); + //if (mode != ftMotionMode_DISCTF) ACTION_ITEM(MSG_FTM_DISCTF, []{ ftm_menu_setShaping(ftMotionMode_DISCTF); }); #endif END_MENU(); @@ -349,25 +348,18 @@ void menu_move() { #if HAS_DYNAMIC_FREQ - void _M493_D(const dynFreqMode_t d) { - char cmd[10]; - sprintf_P(cmd, PSTR("M493D%i"), int(d)); - gcode.process_subcommands_now(cmd); - ui.go_back(); - } - inline void menu_ftm_dyn_mode() { const dynFreqMode_t dmode = fxdTiCtrl.cfg.dynFreqMode; START_MENU(); BACK_ITEM(MSG_FIXED_TIME_MOTION); - if (dmode != dynFreqMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ _M493_D(dynFreqMode_DISABLED); }); + if (dmode != dynFreqMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_DISABLED; ui.go_back(); }); #if HAS_DYNAMIC_FREQ_MM - if (dmode != dynFreqMode_Z_BASED) ACTION_ITEM(MSG_FTM_Z_BASED, []{ _M493_D(dynFreqMode_Z_BASED); }); + if (dmode != dynFreqMode_Z_BASED) ACTION_ITEM(MSG_FTM_Z_BASED, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_Z_BASED; ui.go_back(); }); #endif #if HAS_DYNAMIC_FREQ_G - if (dmode != dynFreqMode_MASS_BASED) ACTION_ITEM(MSG_FTM_MASS_BASED, []{ _M493_D(dynFreqMode_MASS_BASED); }); + if (dmode != dynFreqMode_MASS_BASED) ACTION_ITEM(MSG_FTM_MASS_BASED, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_MASS_BASED; ui.go_back(); }); #endif END_MENU(); @@ -409,25 +401,33 @@ void menu_move() { SUBMENU(MSG_FTM_MODE, menu_ftm_mode); MENU_ITEM_ADDON_START_RJ(5); lcd_put_u8str(ftmode); MENU_ITEM_ADDON_END(); - #if HAS_X_AXIS - EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[X_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); - #endif - #if HAS_Y_AXIS - EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[Y_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); - #endif + if (c.modeHasShaper()) { + #if HAS_X_AXIS + EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[X_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); + #endif + #if HAS_Y_AXIS + EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[Y_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); + #endif - #if HAS_DYNAMIC_FREQ - if (c.modeHasShaper()) { + EDIT_ITEM_FAST(float42_52, MSG_FTM_ZETA, &c.zeta, 0.0f, 1.0f, fxdTiCtrl.refreshShapingN); + + if (WITHIN(c.mode, ftMotionMode_EI, ftMotionMode_3HEI)) + EDIT_ITEM_FAST(float42_52, MSG_FTM_VTOL, &c.vtol, 0.0f, 1.0f, fxdTiCtrl.refreshShapingN); + + #if HAS_DYNAMIC_FREQ SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode); MENU_ITEM_ADDON_START_RJ(11); lcd_put_u8str(dmode); MENU_ITEM_ADDON_END(); - #if HAS_X_AXIS - EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_DFREQ_K_N, &c.dynFreqK[X_AXIS], 0.0f, 20.0f); - #endif - #if HAS_Y_AXIS - EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_DFREQ_K_N, &c.dynFreqK[Y_AXIS], 0.0f, 20.0f); - #endif - } - #endif + if (c.dynFreqMode != dynFreqMode_DISABLED) { + #if HAS_X_AXIS + EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_DFREQ_K_N, &c.dynFreqK[X_AXIS], 0.0f, 20.0f); + #endif + #if HAS_Y_AXIS + EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_DFREQ_K_N, &c.dynFreqK[Y_AXIS], 0.0f, 20.0f); + #endif + } + #endif + } + #if HAS_EXTRUDERS EDIT_ITEM(bool, MSG_LINEAR_ADVANCE, &c.linearAdvEna); EDIT_ITEM(float42_52, MSG_ADVANCE_K, &c.linearAdvK, 0, 10); diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 6fe8e936e0e5..385d81622e8c 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -276,7 +276,7 @@ void FxdTiCtrl::loop() { // Refresh the gains used by shaping functions. // To be called on init or mode or zeta change. - void FxdTiCtrl::Shaping::updateShapingA(const_float_t zeta/*=FTM_SHAPING_ZETA*/, const_float_t vtol/*=FTM_SHAPING_V_TOL*/) { + void FxdTiCtrl::Shaping::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { const float K = exp(-zeta * M_PI / sqrt(1.0f - sq(zeta))), K2 = sq(K); @@ -345,7 +345,7 @@ void FxdTiCtrl::loop() { #endif } - void FxdTiCtrl::updateShapingA(const_float_t zeta/*=FTM_SHAPING_ZETA*/, const_float_t vtol/*=FTM_SHAPING_V_TOL*/) { + void FxdTiCtrl::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { shaping.updateShapingA(zeta, vtol); } @@ -382,7 +382,7 @@ void FxdTiCtrl::loop() { } } - void FxdTiCtrl::updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta/*=FTM_SHAPING_ZETA*/) { + void FxdTiCtrl::updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta/*=cfg.zeta*/) { const float df = sqrt(1.0f - sq(zeta)); shaping.x.updateShapingN(xf, df); TERN_(HAS_Y_AXIS, shaping.y.updateShapingN(yf, df)); diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index 2186ecb710a8..d607ac103038 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -48,6 +48,9 @@ typedef struct FTConfig { { FTM_SHAPING_DEFAULT_X_FREQ OPTARG(HAS_Y_AXIS, FTM_SHAPING_DEFAULT_Y_FREQ) }; #endif + float zeta = FTM_SHAPING_ZETA; // Damping factor + float vtol = FTM_SHAPING_V_TOL; // Vibration Level + #if HAS_DYNAMIC_FREQ dynFreqMode_t dynFreqMode = FTM_DEFAULT_DYNFREQ_MODE; // Dynamic frequency mode configuration. float dynFreqK[1 + ENABLED(HAS_Y_AXIS)] = { 0.0f }; // Scaling / gain for dynamic frequency. [Hz/mm] or [Hz/g] @@ -74,6 +77,9 @@ class FxdTiCtrl { TERN_(HAS_X_AXIS, cfg.baseFreq[X_AXIS] = FTM_SHAPING_DEFAULT_X_FREQ); TERN_(HAS_Y_AXIS, cfg.baseFreq[Y_AXIS] = FTM_SHAPING_DEFAULT_Y_FREQ); + cfg.zeta = FTM_SHAPING_ZETA; + cfg.vtol = FTM_SHAPING_V_TOL; + #if HAS_DYNAMIC_FREQ cfg.dynFreqMode = FTM_DEFAULT_DYNFREQ_MODE; cfg.dynFreqK[X_AXIS] = TERN_(HAS_Y_AXIS, cfg.dynFreqK[Y_AXIS]) = 0.0f; @@ -112,11 +118,11 @@ class FxdTiCtrl { #if HAS_X_AXIS // Refresh the gains used by shaping functions. // To be called on init or mode or zeta change. - static void updateShapingA(const_float_t zeta=FTM_SHAPING_ZETA, const_float_t vtol=FTM_SHAPING_V_TOL); + static void updateShapingA(const_float_t zeta=cfg.zeta, const_float_t vtol=cfg.vtol); // Refresh the indices used by shaping functions. // To be called when frequencies change. - static void updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta=FTM_SHAPING_ZETA); + static void updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta=cfg.zeta); static void refreshShapingN() { updateShapingN(cfg.baseFreq[X_AXIS] OPTARG(HAS_Y_AXIS, cfg.baseFreq[Y_AXIS])); } @@ -181,7 +187,7 @@ class FxdTiCtrl { axis_shaping_t y; #endif - void updateShapingA(const_float_t zeta=FTM_SHAPING_ZETA, const_float_t vtol=FTM_SHAPING_V_TOL); + void updateShapingA(const_float_t zeta=cfg.zeta, const_float_t vtol=cfg.vtol); } shaping_t; diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 46312bca82fb..7180b675d7fc 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -708,7 +708,7 @@ bool SdBaseFile::open(SdBaseFile * const dirFile, const uint8_t dname[11] } // Get LFN sequence number lfnSequenceNumber = pvFat->sequenceNumber & 0x1F; - if WITHIN(lfnSequenceNumber, 1, reqEntriesNum) { + if (WITHIN(lfnSequenceNumber, 1, reqEntriesNum)) { // Check checksum for all other entries with the starting checksum fetched before if (lfnChecksum == pvFat->checksum) { // Set chunk of LFN from VFAT entry into lfnName From 709def5e7baa57911d604ffec701c3ba7ef61ffa Mon Sep 17 00:00:00 2001 From: Aleks <96996458+alx3dev@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:09:26 +0200 Subject: [PATCH 017/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20M3=20`uninitialize?= =?UTF-8?q?d`=20warning=20(#26091)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/control/M3-M5.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Marlin/src/gcode/control/M3-M5.cpp b/Marlin/src/gcode/control/M3-M5.cpp index 5d5d44e8bfe8..ec24cf8a6585 100644 --- a/Marlin/src/gcode/control/M3-M5.cpp +++ b/Marlin/src/gcode/control/M3-M5.cpp @@ -32,21 +32,18 @@ * Laser: * M3 - Laser ON/Power (Ramped power) * M4 - Laser ON/Power (Ramped power) - * M5 - Set power output to 0 (leaving inline mode unchanged). * * M3I - Enable continuous inline power to be processed by the planner, with power * calculated and set in the planner blocks, processed inline during stepping. - * Within inline mode M3 S-Values will set the power for the next moves e.g. G1 X10 Y10 powers on with the last S-Value. + * In inline mode M3 S-Values will set the power for the next moves. + * (e.g., G1 X10 Y10 powers on with the last S-Value.) * M3I must be set before using planner-synced M3 inline S-Values (LASER_POWER_SYNC). * * M4I - Set dynamic mode which calculates laser power OCR based on the current feedrate. * - * M5I - Clear inline mode and set power to 0. - * * Spindle: * M3 - Spindle ON (Clockwise) * M4 - Spindle ON (Counter-clockwise) - * M5 - Spindle OFF * * Parameters: * S - Set power. S0 will turn the spindle/laser off. @@ -92,19 +89,15 @@ void GcodeSuite::M3_M4(const bool is_M4) { #endif auto get_s_power = [] { - float u; if (parser.seenval('S')) { const float v = parser.value_float(); - u = TERN(LASER_POWER_TRAP, v, cutter.power_to_range(v)); + cutter.menuPower = cutter.unitPower = TERN(LASER_POWER_TRAP, v, cutter.power_to_range(v)); } else if (cutter.cutter_mode == CUTTER_MODE_STANDARD) - u = cutter.cpwr_to_upwr(SPEED_POWER_STARTUP); - - cutter.menuPower = cutter.unitPower = u; + cutter.menuPower = cutter.unitPower = cutter.cpwr_to_upwr(SPEED_POWER_STARTUP); // PWM not implied, power converted to OCR from unit definition and on/off if not PWM. - cutter.power = TERN(SPINDLE_LASER_USE_PWM, cutter.upower_to_ocr(u), u > 0 ? 255 : 0); - return u; + cutter.power = TERN(SPINDLE_LASER_USE_PWM, cutter.upower_to_ocr(cutter.unitPower), cutter.unitPower > 0 ? 255 : 0); }; if (cutter.cutter_mode == CUTTER_MODE_CONTINUOUS || cutter.cutter_mode == CUTTER_MODE_DYNAMIC) { // Laser power in inline mode @@ -138,6 +131,13 @@ void GcodeSuite::M3_M4(const bool is_M4) { /** * M5 - Cutter OFF (when moves are complete) + * + * Laser: + * M5 - Set power output to 0 (leaving inline mode unchanged). + * M5I - Clear inline mode and set power to 0. + * + * Spindle: + * M5 - Spindle OFF */ void GcodeSuite::M5() { planner.synchronize(); From fecadaca82e49c2558b42684382ede121274bfea Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Aug 2023 04:24:04 -0500 Subject: [PATCH 018/268] =?UTF-8?q?=F0=9F=94=A7=20Clarify=20WIFISUPPORT=20?= =?UTF-8?q?(#26097)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 12 ++++++++---- Marlin/src/inc/SanityCheck.h | 20 ++++++++++++++------ Marlin/src/module/temperature.cpp | 8 ++++++-- buildroot/tests/esp32 | 4 ++-- buildroot/tests/mks_tinybee | 8 +++----- 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 8e66d7555dbf..82cfc99b30ff 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -4222,13 +4222,17 @@ #endif /** - * WiFi Support (Espressif ESP32 WiFi) + * Native ESP32 board with WiFi or add-on ESP32 WiFi-101 module */ -//#define WIFISUPPORT // Marlin embedded WiFi management +//#define WIFISUPPORT // Marlin embedded WiFi management. Not needed for simple WiFi serial port. //#define ESP3D_WIFISUPPORT // ESP3D Library WiFi management (https://github.com/luc-github/ESP3DLib) -#if ANY(WIFISUPPORT, ESP3D_WIFISUPPORT) - //#define WEBSUPPORT // Start a webserver (which may include auto-discovery) +/** + * Extras for an ESP32-based motherboard with WIFISUPPORT + * These options don't apply to add-on WiFi modules based on ESP32 WiFi101. + */ +#if ENABLED(WIFISUPPORT) + //#define WEBSUPPORT // Start a webserver (which may include auto-discovery) using SPIFFS //#define OTASUPPORT // Support over-the-air firmware updates //#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 4b56204db570..cfc3b20cd501 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3810,12 +3810,20 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." /** * Sanity check WiFi options */ -#if ENABLED(ESP3D_WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32) - #error "ESP3D_WIFISUPPORT requires an ESP32 MOTHERBOARD." -#elif ENABLED(WEBSUPPORT) && NONE(ARDUINO_ARCH_ESP32, WIFISUPPORT) - #error "WEBSUPPORT requires WIFISUPPORT and an ESP32 MOTHERBOARD." -#elif ALL(ESP3D_WIFISUPPORT, WIFISUPPORT) - #error "Enable only one of ESP3D_WIFISUPPORT or WIFISUPPORT." +#if ALL(WIFISUPPORT, ESP3D_WIFISUPPORT) + #error "Enable only one of WIFISUPPORT or ESP3D_WIFISUPPORT." +#elif ENABLED(ESP3D_WIFISUPPORT) && DISABLED(ARDUINO_ARCH_ESP32) + #error "ESP3D_WIFISUPPORT requires an ESP32 motherboard." +#elif ALL(ARDUINO_ARCH_ESP32, WIFISUPPORT) + #if !(defined(WIFI_SSID) && defined(WIFI_PWD)) + #error "ESP32 motherboard with WIFISUPPORT requires WIFI_SSID and WIFI_PWD." + #endif +#elif ENABLED(WIFI_CUSTOM_COMMAND) + #error "WIFI_CUSTOM_COMMAND requires an ESP32 motherboard and WIFISUPPORT." +#elif ENABLED(OTASUPPORT) + #error "OTASUPPORT requires an ESP32 motherboard and WIFISUPPORT." +#elif defined(WIFI_SSID) || defined(WIFI_PWD) + #error "WIFI_SSID and WIFI_PWD only apply to ESP32 motherboard with WIFISUPPORT." #endif /** diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index c7e35c575457..6139ebe12004 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -3080,7 +3080,9 @@ void Temperature::init() { #if HAS_THERMAL_PROTECTION #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + #if __has_cpp_attribute(fallthrough) + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + #endif Temperature::tr_state_machine_t Temperature::tr_state_machine[NR_HEATER_RUNAWAY]; // = { { TRInactive, 0 } }; @@ -3978,7 +3980,9 @@ void Temperature::isr() { switch (adc_sensor_state) { #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + #if __has_cpp_attribute(fallthrough) + #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + #endif case SensorsReady: { // All sensors have been read. Stay in this state for a few diff --git a/buildroot/tests/esp32 b/buildroot/tests/esp32 index a0f79107cf2f..2229b950c6ea 100755 --- a/buildroot/tests/esp32 +++ b/buildroot/tests/esp32 @@ -12,8 +12,8 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_ESPRESSIF_ESP32 TX_BUFFER_SIZE 64 \ WIFI_SSID '"ssid"' WIFI_PWD '"password"' -opt_enable WIFISUPPORT WEBSUPPORT GCODE_MACROS BAUD_RATE_GCODE M115_GEOMETRY_REPORT REPETIER_GCODE_M360 -exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT" "$3" +opt_enable WIFISUPPORT WEBSUPPORT OTASUPPORT GCODE_MACROS BAUD_RATE_GCODE M115_GEOMETRY_REPORT REPETIER_GCODE_M360 +exec_test $1 $2 "ESP32 with WIFISUPPORT and WEBSUPPORT and OTASUPPORT" "$3" # # Build with TMC drivers using hardware serial diff --git a/buildroot/tests/mks_tinybee b/buildroot/tests/mks_tinybee index 0351946d0aea..d3b258051bc0 100755 --- a/buildroot/tests/mks_tinybee +++ b/buildroot/tests/mks_tinybee @@ -10,11 +10,9 @@ set -e # Build with ESP3D WiFi, OTA and custom WIFI commands support # restore_configs -opt_set MOTHERBOARD BOARD_MKS_TINYBEE TX_BUFFER_SIZE 64 \ - WIFI_SSID '"ssid"' WIFI_PWD '"password"' \ - SERIAL_PORT_2 -1 BAUDRATE_2 250000 -opt_enable ESP3D_WIFISUPPORT WEBSUPPORT OTASUPPORT WIFI_CUSTOM_COMMAND -exec_test $1 "$2" "MKS TinyBee with ESP3D_WIFISUPPORT" "$3" +opt_set MOTHERBOARD BOARD_MKS_TINYBEE TX_BUFFER_SIZE 64 SERIAL_PORT_2 -1 BAUDRATE_2 250000 +opt_enable ESP3D_WIFISUPPORT +exec_test $1 $2 "MKS TinyBee with ESP3D_WIFISUPPORT" "$3" # # Build with LCD, SD support and Speaker support From 4f691e622f3dc1de5a64bcaf42d3de56c9808322 Mon Sep 17 00:00:00 2001 From: Ari-SSO <85907917+Ari-SSO@users.noreply.github.com> Date: Mon, 7 Aug 2023 06:35:22 -0300 Subject: [PATCH 019/268] =?UTF-8?q?=F0=9F=A9=B9=20PROBING=5FTOOL=20followu?= =?UTF-8?q?p=20(#26122)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #24411 Co-authored-by: Scott Lahteine --- Marlin/src/gcode/calibrate/G33.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 10f5afca2db4..23753e077fdc 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -84,7 +84,7 @@ void ac_setup(const bool reset_bed) { #endif } -void ac_cleanup(TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index)) { +void ac_cleanup() { TERN_(DELTA_HOME_TO_SAFE_ZONE, do_blocking_move_to_z(delta_clip_start_height)); TERN_(HAS_BED_PROBE, probe.stow()); restore_feedrate_and_scaling(); @@ -97,7 +97,7 @@ void print_signed_float(FSTR_P const prefix, const_float_t f) { } /** - * - Print the delta settings + * - Print the delta settings */ static void print_calibration_settings(const bool end_stops, const bool tower_angles) { SERIAL_ECHOPGM(".Height:", delta_height); @@ -123,7 +123,7 @@ static void print_calibration_settings(const bool end_stops, const bool tower_an } /** - * - Print the probe results + * - Print the probe results */ static void print_calibration_results(const float z_pt[NPP + 1], const bool tower_points, const bool opposite_points) { SERIAL_ECHOPGM(". "); @@ -147,7 +147,7 @@ static void print_calibration_results(const float z_pt[NPP + 1], const bool towe } /** - * - Calculate the standard deviation from the zero plane + * - Calculate the standard deviation from the zero plane */ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool _1p_cal, const bool _4p_cal, const bool _4p_opp) { if (!_0p_cal) { @@ -165,7 +165,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool } /** - * - Probe a point + * - Probe a point */ static float calibration_probe(const xy_pos_t &xy, const bool stow, const bool probe_at_offset) { #if HAS_BED_PROBE @@ -177,7 +177,7 @@ static float calibration_probe(const xy_pos_t &xy, const bool stow, const bool p } /** - * - Probe a grid + * - Probe a grid */ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_points, const float dcr, const bool towers_set, const bool stow_after_each, const bool probe_at_offset) { const bool _0p_calibration = probe_points == 0, @@ -501,7 +501,7 @@ void GcodeSuite::G33() { zero_std_dev_old = zero_std_dev; if (!probe_calibration_points(z_at_pt, probe_points, dcr, towers_set, stow_after_each, probe_at_offset)) { SERIAL_ECHOLNPGM("Correct delta settings with M665 and M666"); - return ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index)); + return ac_cleanup(); } zero_std_dev = std_dev_points(z_at_pt, _0p_calibration, _1p_calibration, _4p_calibration, _4p_opposite_points); @@ -678,7 +678,7 @@ void GcodeSuite::G33() { } while (((zero_std_dev < test_precision && iterations < 31) || iterations <= force_iterations) && zero_std_dev > calibration_precision); - ac_cleanup(TERN_(HAS_MULTI_HOTEND, old_tool_index)); + ac_cleanup(); TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE)); #if HAS_DELTA_SENSORLESS_PROBING From ca0209b868be80d1438e1d695e2f103ab1025f92 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Mon, 7 Aug 2023 14:00:50 -0700 Subject: [PATCH 020/268] =?UTF-8?q?=F0=9F=94=A8=20Fix=20USB=20FD=20env=20n?= =?UTF-8?q?ames=20(#26131)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/pins.h | 6 +++--- ini/renamed.ini | 15 ++++++++++++--- ini/stm32f1-maple.ini | 4 ++-- ini/stm32f1.ini | 4 ++-- ini/stm32f4.ini | 6 +++--- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index b823f480d732..fe356520d8f7 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -739,11 +739,11 @@ #elif MB(BTT_SKR_V2_0_REV_B) #include "stm32f4/pins_BTT_SKR_V2_0_REV_B.h" // STM32F4 env:BIGTREE_SKR_2 env:BIGTREE_SKR_2_USB env:BIGTREE_SKR_2_USB_debug env:BIGTREE_SKR_2_F429 env:BIGTREE_SKR_2_F429_USB env:BIGTREE_SKR_2_F429_USB_debug #elif MB(BTT_OCTOPUS_V1_0) - #include "stm32f4/pins_BTT_OCTOPUS_V1_0.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_USB + #include "stm32f4/pins_BTT_OCTOPUS_V1_0.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_usb_flash_drive #elif MB(BTT_OCTOPUS_V1_1) - #include "stm32f4/pins_BTT_OCTOPUS_V1_1.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_USB env:STM32F429ZG_btt env:STM32F429ZG_btt_USB env:STM32F407ZE_btt env:STM32F407ZE_btt_USB + #include "stm32f4/pins_BTT_OCTOPUS_V1_1.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_usb_flash_drive env:STM32F429ZG_btt env:STM32F429ZG_btt_usb_flash_drive env:STM32F407ZE_btt env:STM32F407ZE_btt_usb_flash_drive #elif MB(BTT_OCTOPUS_PRO_V1_0) - #include "stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_USB env:STM32F429ZG_btt env:STM32F429ZG_btt_USB env:STM32H723ZE_btt + #include "stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_usb_flash_drive env:STM32F429ZG_btt env:STM32F429ZG_btt_usb_flash_drive env:STM32H723ZE_btt #elif MB(LERDGE_K) #include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:LERDGEK env:LERDGEK_usb_flash_drive #elif MB(LERDGE_S) diff --git a/ini/renamed.ini b/ini/renamed.ini index 91ac55f5b251..84f6acd7fab9 100644 --- a/ini/renamed.ini +++ b/ini/renamed.ini @@ -63,19 +63,19 @@ extends = renamed [env:BIGTREE_OCTOPUS_V1] ;=> STM32F446ZE_btt extends = renamed -[env:BIGTREE_OCTOPUS_V1_USB] ;=> STM32F446ZE_btt_USB +[env:BIGTREE_OCTOPUS_V1_USB] ;=> STM32F446ZE_btt_usb_flash_drive extends = renamed [env:BIGTREE_OCTOPUS_PRO_V1_F429] ;=> STM32F429ZG_btt extends = renamed -[env:BIGTREE_OCTOPUS_PRO_V1_F429_USB] ;=> STM32F429ZG_btt_USB +[env:BIGTREE_OCTOPUS_PRO_V1_F429_USB] ;=> STM32F429ZG_btt_usb_flash_drive extends = renamed [env:BIGTREE_OCTOPUS_V1_F407] ;=> STM32F407ZE_btt extends = renamed -[env:BIGTREE_OCTOPUS_V1_F407_USB] ;=> STM32F407ZE_btt_USB +[env:BIGTREE_OCTOPUS_V1_F407_USB] ;=> STM32F407ZE_btt_usb_flash_drive extends = renamed [env:STM32H723Vx_btt] ;=> STM32H723VG_btt @@ -86,3 +86,12 @@ extends = renamed [env:STM32H743Vx_btt] ;=> STM32H743VI_btt extends = renamed + +[env:STM32F446ZE_btt_USB] ;=> STM32F446ZE_btt_usb_flash_drive +extends = renamed + +[env:STM32F429ZG_btt_USB] ;=> STM32F429ZG_btt_usb_flash_drive +extends = renamed + +[env:STM32F407ZE_btt_USB] ;=> STM32F407ZE_btt_usb_flash_drive +extends = renamed diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 0a8453f3076f..b9d9198e3255 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -95,7 +95,7 @@ upload_protocol = serial # BigTreeTech SKR Mini V1.1 / SKR Mini E3 & MZ (STM32F103RCT6 ARM Cortex-M3) # # STM32F103RC_btt_maple ............. RCT6 with 256K -# STM32F103RC_btt_USB_maple ......... RCT6 with 256K (USB mass storage) +# STM32F103RC_btt_USB_maple ......... RCT6 with 256K with USB Media Share Support # [env:STM32F103RC_btt_maple] extends = env:STM32F103RC_maple @@ -146,7 +146,7 @@ board_build.ldscript = crealityPro.ld # BigTreeTech SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # # STM32F103RE_btt_maple ............. RET6 -# STM32F103RE_btt_USB_maple ......... RET6 (USB mass storage) +# STM32F103RE_btt_USB_maple ......... RET6 with USB Media Share Support # [env:STM32F103RE_btt_maple] extends = env:STM32F103RE_maple diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 08686a1fb475..35a4dc4078e5 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -54,7 +54,7 @@ monitor_speed = 115200 # BigTreeTech SKR Mini V1.1 / SKR Mini E3 & MZ (STM32F103RCT6 ARM Cortex-M3) # # STM32F103RC_btt ............. RCT6 with 256K -# STM32F103RC_btt_USB ......... RCT6 with 256K (USB mass storage) +# STM32F103RC_btt_USB ......... RCT6 with 256K with USB Media Share Support # [env:STM32F103RC_btt] extends = common_STM32F103RC_variant @@ -206,7 +206,7 @@ build_flags = ${stm32_variant.build_flags} # BigTreeTech SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3) # # STM32F103RE_btt ............. RET6 -# STM32F103RE_btt_USB ......... RET6 (USB mass storage) +# STM32F103RE_btt_USB ......... RET6 with USB Media Share Support # [env:STM32F103RE_btt] extends = stm32_variant diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 8708a6dbcacd..bb594b97f909 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -283,7 +283,7 @@ build_flags = ${stm32_variant.build_flags} # # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support # -[env:STM32F446ZE_btt_USB] +[env:STM32F446ZE_btt_usb_flash_drive] extends = env:STM32F446ZE_btt platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC @@ -309,7 +309,7 @@ build_flags = ${stm32_variant.build_flags} # # BigTreeTech Octopus V1.1 / Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) with USB Flash Drive Support # -[env:STM32F429ZG_btt_USB] +[env:STM32F429ZG_btt_usb_flash_drive] extends = env:STM32F429ZG_btt platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC @@ -331,7 +331,7 @@ build_flags = ${stm32_variant.build_flags} # # BigTreeTech Octopus / Octopus Pro (STM32F407ZET6 ARM Cortex-M4) with USB Flash Drive Support # -[env:STM32F407ZE_btt_USB] +[env:STM32F407ZE_btt_usb_flash_drive] extends = env:STM32F407ZE_btt platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC From 88f5e2c6394cde42969fd4a21ba579cf2cd2db77 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Mon, 7 Aug 2023 16:11:12 -0500 Subject: [PATCH 021/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20UBL=20probe=5Fenti?= =?UTF-8?q?re=5Fmesh=20skips=20points=20(#26141)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #26132 --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 6f5187cc9f39..ed4363acbc0a 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -786,14 +786,18 @@ void unified_bed_leveling::shift_mesh_height() { } #endif - best = do_furthest + #ifndef HUGE_VALF + #define HUGE_VALF (10e100F) + #endif + + best = do_furthest // Points with valid data or HUGE_VALF are skipped ? find_furthest_invalid_mesh_point() : find_closest_mesh_point_of_type(INVALID, nearby, true); if (best.pos.x >= 0) { // mesh point found and is reachable by probe TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::G29_POINT_START)); const float measured_z = probe.probe_at_point(best.meshpos(), stow_probe ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); - z_values[best.pos.x][best.pos.y] = measured_z; + z_values[best.pos.x][best.pos.y] = isnan(measured_z) ? HUGE_VALF : measured_z; // Mark invalid point already probed with HUGE_VALF to omit it in the next loop #if ENABLED(EXTENSIBLE_UI) ExtUI::onMeshUpdate(best.pos, ExtUI::G29_POINT_FINISH); ExtUI::onMeshUpdate(best.pos, measured_z); @@ -803,6 +807,8 @@ void unified_bed_leveling::shift_mesh_height() { } while (best.pos.x >= 0 && --count); + GRID_LOOP(x, y) if (z_values[x][y] == HUGE_VALF) z_values[x][y] = NAN; // Restore NAN for HUGE_VALF marks + TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(best.pos, ExtUI::G29_FINISH)); // Release UI during stow to allow for PAUSE_BEFORE_DEPLOY_STOW From 867f5e90697451429ae2fa7760089d165f9319eb Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Mon, 7 Aug 2023 16:16:33 -0500 Subject: [PATCH 022/268] =?UTF-8?q?=F0=9F=9A=B8=20UI=20Sound=20off/on=20wi?= =?UTF-8?q?th=20M300=20E<0|1>=20(#26142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/lcd/M300.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Marlin/src/gcode/lcd/M300.cpp b/Marlin/src/gcode/lcd/M300.cpp index 7ee811f0bdce..2658b52a7ce4 100644 --- a/Marlin/src/gcode/lcd/M300.cpp +++ b/Marlin/src/gcode/lcd/M300.cpp @@ -34,8 +34,19 @@ * * S - (Hz) The frequency of the tone. 0 for silence. * P - (ms) The duration of the tone. + * + * With SOUND_MENU_ITEM: + * E<0|1> - Mute or enable sound */ void GcodeSuite::M300() { + + #if ENABLED(SOUND_MENU_ITEM) + if (parser.seen('E')) { + ui.sound_on = parser.value_bool(); + return; + } + #endif + const uint16_t frequency = parser.ushortval('S', 260); uint16_t duration = parser.ushortval('P', 1000); From f338f65bdfc7e6b629e939db49dbe6f6731986de Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Mon, 7 Aug 2023 23:51:22 +0200 Subject: [PATCH 023/268] =?UTF-8?q?=F0=9F=9A=B8=20Adjust=20ColorUI=20chamb?= =?UTF-8?q?er=20bmp=20(#26149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/dogm/status/chamber.h | 48 ++++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Marlin/src/lcd/dogm/status/chamber.h b/Marlin/src/lcd/dogm/status/chamber.h index 787a90884ae8..9b8cc7a0a063 100644 --- a/Marlin/src/lcd/dogm/status/chamber.h +++ b/Marlin/src/lcd/dogm/status/chamber.h @@ -41,32 +41,32 @@ #ifdef STATUS_CHAMBER_ANIM const unsigned char status_chamber_bmp[] PROGMEM = { - B00011111,B11111111,B11111000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00010000,B00000000,B00001000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 + B00001111,B11111111,B11111000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001000,B00000000,B00001000, + B00001111,B11111111,B11111000, + B00001111,B11111111,B11111000 }; const unsigned char status_chamber_on_bmp[] PROGMEM = { - B00011111,B11111111,B11111000, - B00010000,B00000000,B00001000, - B00010000,B10000100,B00001000, - B00010000,B01000010,B00001000, - B00010000,B01000010,B00001000, - B00010000,B10000100,B00001000, - B00010001,B00001000,B00001000, - B00010001,B00001000,B00001000, - B00010000,B10000100,B00001000, - B00010000,B00000000,B00001000, - B00011111,B11111111,B11111000, - B00011111,B11111111,B11111000 + B00001111,B11111111,B11111000, + B00001000,B00000000,B00001000, + B00001000,B10000100,B00001000, + B00001000,B01000010,B00001000, + B00001000,B01000010,B00001000, + B00001000,B10000100,B00001000, + B00001001,B00001000,B00001000, + B00001001,B00001000,B00001000, + B00001000,B10000100,B00001000, + B00001000,B00000000,B00001000, + B00001111,B11111111,B11111000, + B00001111,B11111111,B11111000 }; #else From fd41757aef29c167fb8284ff8a8fc94ef566018a Mon Sep 17 00:00:00 2001 From: EvilGremlin <22657714+EvilGremlin@users.noreply.github.com> Date: Tue, 8 Aug 2023 00:54:27 +0300 Subject: [PATCH 024/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MKS=20Robin=20Mini?= =?UTF-8?q?=20servo=20timer=20(#26150)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/stm32f1.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index 35a4dc4078e5..2eab5d6f46e2 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -302,7 +302,8 @@ build_unflags = ${mks_robin_nano_v1v2_common.build_unflags} -DUSBC [env:mks_robin_mini] extends = STM32F103VE_robin board_build.encrypt_mks = Robin_mini.bin -build_unflags = ${STM32F103VE_robin.build_unflags} -DSS_TIMER=4 +build_unflags = ${STM32F103VE_robin.build_unflags} -DSS_TIMER=4 -DTIMER_SERVO=TIM2 +build_flags = ${STM32F103VE_robin.build_flags} -DTIMER_SERVO=TIM1 # # MKS Robin E3p (STM32F103VET6) From 2bac7835e801c413c3d9e75a1dbe3e94dc689f3d Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 8 Aug 2023 00:22:24 +0000 Subject: [PATCH 025/268] [cron] Bump distribution date (2023-08-08) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index c8fe764a0e01..5a80e1242efe 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-07" +//#define STRING_DISTRIBUTION_DATE "2023-08-08" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index bc7b53a84393..f681a9e7b08e 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-07" + #define STRING_DISTRIBUTION_DATE "2023-08-08" #endif /** From 6af6060aa0240ccc03020edba661fe42125d3713 Mon Sep 17 00:00:00 2001 From: Martin Turski Date: Sun, 13 Aug 2023 22:57:38 +0200 Subject: [PATCH 026/268] =?UTF-8?q?=F0=9F=94=A7=20Configurable=20SD=20card?= =?UTF-8?q?=20retry/timeout=20(#25340)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/STM32/msc_sd.cpp | 66 ++++++---- Marlin/src/sd/Sd2Card.cpp | 208 +++++++++++++++++++++++--------- Marlin/src/sd/Sd2Card.h | 5 - 3 files changed, 193 insertions(+), 86 deletions(-) diff --git a/Marlin/src/HAL/STM32/msc_sd.cpp b/Marlin/src/HAL/STM32/msc_sd.cpp index a40bec9d644d..f03f533a7195 100644 --- a/Marlin/src/HAL/STM32/msc_sd.cpp +++ b/Marlin/src/HAL/STM32/msc_sd.cpp @@ -33,6 +33,12 @@ #define BLOCK_SIZE 512 #define PRODUCT_ID 0x29 +#ifndef SD_MULTIBLOCK_RETRY_CNT + #define SD_MULTIBLOCK_RETRY_CNT 1 +#elif SD_MULTIBLOCK_RETRY_CNT < 1 + #error "SD_MULTIBLOCK_RETRY_CNT must be greater than or equal to 1." +#endif + class Sd2CardUSBMscHandler : public USBMscHandler { public: DiskIODriver* diskIODriver() { @@ -58,19 +64,29 @@ class Sd2CardUSBMscHandler : public USBMscHandler { // single block if (blkLen == 1) { hal.watchdog_refresh(); - sd2card->writeBlock(blkAddr, pBuf); - return true; + return sd2card->writeBlock(blkAddr, pBuf); } // multi block optimization - sd2card->writeStart(blkAddr, blkLen); - while (blkLen--) { - hal.watchdog_refresh(); - sd2card->writeData(pBuf); - pBuf += BLOCK_SIZE; + bool done = false; + for (uint16_t rcount = SD_MULTIBLOCK_RETRY_CNT; !done && rcount--;) { + uint8_t *cBuf = pBuf; + sd2card->writeStart(blkAddr); + bool okay = true; // Assume success + for (uint32 i = blkLen; i--;) { + hal.watchdog_refresh(); + if (!sd2card->writeData(cBuf)) { // Write. Did it fail? + sd2card->writeStop(); // writeStop for new writeStart + okay = false; // Failed, so retry + break; // Go to while... below + } + cBuf += BLOCK_SIZE; + } + done = okay; // Done if no error occurred } - sd2card->writeStop(); - return true; + + if (done) sd2card->writeStop(); + return done; } bool Read(uint8_t *pBuf, uint32_t blkAddr, uint16_t blkLen) { @@ -78,24 +94,32 @@ class Sd2CardUSBMscHandler : public USBMscHandler { // single block if (blkLen == 1) { hal.watchdog_refresh(); - sd2card->readBlock(blkAddr, pBuf); - return true; + return sd2card->readBlock(blkAddr, pBuf); } // multi block optimization - sd2card->readStart(blkAddr); - while (blkLen--) { - hal.watchdog_refresh(); - sd2card->readData(pBuf); - pBuf += BLOCK_SIZE; + bool done = false; + for (uint16_t rcount = SD_MULTIBLOCK_RETRY_CNT; !done && rcount--;) { + uint8_t *cBuf = pBuf; + sd2card->readStart(blkAddr); + bool okay = true; // Assume success + for (uint32 i = blkLen; i--;) { + hal.watchdog_refresh(); + if (!sd2card->readData(cBuf)) { // Read. Did it fail? + sd2card->readStop(); // readStop for new readStart + okay = false; // Failed, so retry + break; // Go to while... below + } + cBuf += BLOCK_SIZE; + } + done = okay; // Done if no error occurred } - sd2card->readStop(); - return true; - } - bool IsReady() { - return diskIODriver()->isReady(); + if (done) sd2card->readStop(); + return done; } + + bool IsReady() { return diskIODriver()->isReady(); } }; Sd2CardUSBMscHandler usbMscHandler; diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index 7deebd4776a2..25fc35e6ab93 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -40,6 +40,37 @@ #include "../MarlinCore.h" +#if DISABLED(SD_NO_DEFAULT_TIMEOUT) + #ifndef SD_INIT_TIMEOUT + #define SD_INIT_TIMEOUT 2000u // (ms) Init timeout + #elif SD_INIT_TIMEOUT < 0 + #error "SD_INIT_TIMEOUT must be greater than or equal to 0." + #endif + #ifndef SD_ERASE_TIMEOUT + #define SD_ERASE_TIMEOUT 10000u // (ms) Erase timeout + #elif SD_ERASE_TIMEOUT < 0 + #error "SD_ERASE_TIMEOUT must be greater than or equal to 0." + #endif + #ifndef SD_READ_TIMEOUT + #define SD_READ_TIMEOUT 300u // (ms) Read timeout + #elif SD_READ_TIMEOUT < 0 + #error "SD_READ_TIMEOUT must be greater than or equal to 0." + #endif + #ifndef SD_WRITE_TIMEOUT + #define SD_WRITE_TIMEOUT 600u // (ms) Write timeout + #elif SD_WRITE_TIMEOUT < 0 + #error "SD_WRITE_TIMEOUT must be greater than or equal to 0." + #endif +#endif // SD_NO_DEFAULT_TIMEOUT + +#if ENABLED(SD_CHECK_AND_RETRY) + #ifndef SD_RETRY_COUNT + #define SD_RETRY_COUNT 3 + #elif SD_RETRY_COUNT < 1 + #error "SD_RETRY_COUNT must be greater than or equal to 1." + #endif +#endif + #if ENABLED(SD_CHECK_AND_RETRY) static bool crcSupported = true; @@ -97,15 +128,16 @@ uint8_t DiskIODriver_SPI_SD::cardCommand(const uint8_t cmd, const uint32_t arg) // Select card chipSelect(); - // Wait up to 300 ms if busy - waitNotBusy(SD_WRITE_TIMEOUT); + #if SD_WRITE_TIMEOUT + waitNotBusy(SD_WRITE_TIMEOUT); // Wait up to 600 ms (by default) if busy + #endif uint8_t *pa = (uint8_t *)(&arg); #if ENABLED(SD_CHECK_AND_RETRY) // Form message - uint8_t d[6] = {(uint8_t) (cmd | 0x40), pa[3], pa[2], pa[1], pa[0] }; + uint8_t d[6] = { uint8_t(cmd | 0x40), pa[3], pa[2], pa[1], pa[0] }; // Add crc d[5] = CRC7(d, 5); @@ -186,33 +218,42 @@ void DiskIODriver_SPI_SD::chipSelect() { bool DiskIODriver_SPI_SD::erase(uint32_t firstBlock, uint32_t lastBlock) { if (ENABLED(SDCARD_READONLY)) return false; - csd_t csd; - if (!readCSD(&csd)) goto FAIL; - - // check for single block erase - if (!csd.v1.erase_blk_en) { - // erase size mask - uint8_t m = (csd.v1.sector_size_high << 1) | csd.v1.sector_size_low; - if ((firstBlock & m) != 0 || ((lastBlock + 1) & m) != 0) { - // error card can't erase specified area - error(SD_CARD_ERROR_ERASE_SINGLE_BLOCK); - goto FAIL; + bool success = false; + do { + + csd_t csd; + if (!readCSD(&csd)) break; + + // check for single block erase + if (!csd.v1.erase_blk_en) { + // erase size mask + uint8_t m = (csd.v1.sector_size_high << 1) | csd.v1.sector_size_low; + if ((firstBlock & m) || ((lastBlock + 1) & m)) { + // error card can't erase specified area + error(SD_CARD_ERROR_ERASE_SINGLE_BLOCK); + break; + } } - } - if (type_ != SD_CARD_TYPE_SDHC) { firstBlock <<= 9; lastBlock <<= 9; } - if (cardCommand(CMD32, firstBlock) || cardCommand(CMD33, lastBlock) || cardCommand(CMD38, 0)) { - error(SD_CARD_ERROR_ERASE); - goto FAIL; - } - if (!waitNotBusy(SD_ERASE_TIMEOUT)) { - error(SD_CARD_ERROR_ERASE_TIMEOUT); - goto FAIL; - } - chipDeselect(); - return true; - FAIL: + if (type_ != SD_CARD_TYPE_SDHC) { firstBlock <<= 9; lastBlock <<= 9; } + if (cardCommand(CMD32, firstBlock) || cardCommand(CMD33, lastBlock) || cardCommand(CMD38, 0)) { + error(SD_CARD_ERROR_ERASE); + break; + } + #if SD_ERASE_TIMEOUT + if (!waitNotBusy(SD_ERASE_TIMEOUT)) { + error(SD_CARD_ERROR_ERASE_TIMEOUT); + break; + } + #else + while (spiRec() != 0xFF) {} + #endif + + success = true; + + } while (0); + chipDeselect(); - return false; + return success; } /** @@ -245,8 +286,15 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi errorCode_ = type_ = 0; chipSelectPin_ = chipSelectPin; + // 16-bit init start time allows over a minute - const millis_t init_timeout = millis() + SD_INIT_TIMEOUT; + #if SD_INIT_TIMEOUT + const millis_t init_timeout = millis() + SD_INIT_TIMEOUT; + #define INIT_TIMEOUT() ELAPSED(millis(), init_timeout) + #else + #define INIT_TIMEOUT() false + #endif + uint32_t arg; hal.watchdog_refresh(); // In case init takes too long @@ -274,7 +322,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi // Command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { - if (ELAPSED(millis(), init_timeout)) { + if (INIT_TIMEOUT()) { error(SD_CARD_ERROR_CMD0); goto FAIL; } @@ -300,7 +348,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi break; } - if (ELAPSED(millis(), init_timeout)) { + if (INIT_TIMEOUT()) { error(SD_CARD_ERROR_CMD8); goto FAIL; } @@ -312,11 +360,12 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi arg = type() == SD_CARD_TYPE_SD2 ? 0x40000000 : 0; while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { // Check for timeout - if (ELAPSED(millis(), init_timeout)) { + if (INIT_TIMEOUT()) { error(SD_CARD_ERROR_ACMD41); goto FAIL; } } + // If SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { if (cardCommand(CMD58, 0)) { @@ -327,6 +376,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi // Discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; ++i) spiRec(); } + chipDeselect(); ready = true; @@ -353,7 +403,7 @@ bool DiskIODriver_SPI_SD::readBlock(uint32_t blockNumber, uint8_t * const dst) { if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; // Use address if not SDHC card #if ENABLED(SD_CHECK_AND_RETRY) - uint8_t retryCnt = 3; + uint8_t retryCnt = SD_RETRY_COUNT; for (;;) { if (cardCommand(CMD17, blockNumber)) error(SD_CARD_ERROR_CMD17); @@ -458,9 +508,15 @@ bool DiskIODriver_SPI_SD::readData(uint8_t * const dst) { bool DiskIODriver_SPI_SD::readData(uint8_t * const dst, const uint16_t count) { bool success = false; - const millis_t read_timeout = millis() + SD_READ_TIMEOUT; + #if SD_READ_TIMEOUT + const millis_t read_timeout = millis() + SD_READ_TIMEOUT; + #define READ_TIMEOUT() ELAPSED(millis(), read_timeout) + #else + #define READ_TIMEOUT() false + #endif + while ((status_ = spiRec()) == 0xFF) { // Wait for start block token - if (ELAPSED(millis(), read_timeout)) { + if (READ_TIMEOUT()) { error(SD_CARD_ERROR_READ_TIMEOUT); goto FAIL; } @@ -469,7 +525,7 @@ bool DiskIODriver_SPI_SD::readData(uint8_t * const dst, const uint16_t count) { if (status_ == DATA_START_BLOCK) { spiRead(dst, count); // Transfer data - const uint16_t recvCrc = (spiRec() << 8) | spiRec(); + const uint16_t recvCrc = ((uint16_t)spiRec() << 8) | (uint16_t)spiRec(); #if ENABLED(SD_CHECK_AND_RETRY) success = !crcSupported || recvCrc == CRC_CCITT(dst, count); if (!success) error(SD_CARD_ERROR_READ_CRC); @@ -574,20 +630,23 @@ bool DiskIODriver_SPI_SD::writeBlock(uint32_t blockNumber, const uint8_t * const return 0 == SDHC_CardWriteBlock(src, blockNumber); #endif - bool success = false; - if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; // Use address if not SDHC card - if (!cardCommand(CMD24, blockNumber)) { - if (writeData(DATA_START_BLOCK, src)) { - if (waitNotBusy(SD_WRITE_TIMEOUT)) { // Wait for flashing to complete - success = !(cardCommand(CMD13, 0) || spiRec()); // Response is r2 so get and check two bytes for nonzero - if (!success) error(SD_CARD_ERROR_WRITE_PROGRAMMING); - } - else - error(SD_CARD_ERROR_WRITE_TIMEOUT); + if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; // Use address if not SDHC card + bool success = !cardCommand(CMD24, blockNumber); + if (!success) { + error(SD_CARD_ERROR_CMD24); + } + else if (writeData(DATA_START_BLOCK, src)) { + #if SD_WRITE_TIMEOUT + success = waitNotBusy(SD_WRITE_TIMEOUT); // Wait for flashing to complete + if (!success) error(SD_CARD_ERROR_WRITE_TIMEOUT); + #else + while (spiRec() != 0xFF) {} + #endif + if (success) { + success = !(cardCommand(CMD13, 0) || spiRec()); // Response is r2 so get and check two bytes for nonzero + if (!success) error(SD_CARD_ERROR_WRITE_PROGRAMMING); } } - else - error(SD_CARD_ERROR_CMD24); chipDeselect(); return success; @@ -601,13 +660,25 @@ bool DiskIODriver_SPI_SD::writeBlock(uint32_t blockNumber, const uint8_t * const bool DiskIODriver_SPI_SD::writeData(const uint8_t * const src) { if (ENABLED(SDCARD_READONLY)) return false; - bool success = true; chipSelect(); - // Wait for previous write to finish - if (!waitNotBusy(SD_WRITE_TIMEOUT) || !writeData(WRITE_MULTIPLE_TOKEN, src)) { - error(SD_CARD_ERROR_WRITE_MULTIPLE); - success = false; - } + + bool success = false; + do { + + // Wait for previous write to finish + #if SD_WRITE_TIMEOUT + if (!waitNotBusy(SD_WRITE_TIMEOUT)) { + error(SD_CARD_ERROR_WRITE_MULTIPLE); + break; + } + #else + while (spiRec() != 0xFF) {} + #endif + + success = writeData(WRITE_MULTIPLE_TOKEN, src); + + } while (0); + chipDeselect(); return success; } @@ -665,14 +736,31 @@ bool DiskIODriver_SPI_SD::writeStart(uint32_t blockNumber, const uint32_t eraseC bool DiskIODriver_SPI_SD::writeStop() { if (ENABLED(SDCARD_READONLY)) return false; - bool success = false; chipSelect(); - if (waitNotBusy(SD_WRITE_TIMEOUT)) { + + bool success = false; + do { + + #if SD_WRITE_TIMEOUT + if (!waitNotBusy(SD_WRITE_TIMEOUT)) { + error(SD_CARD_ERROR_STOP_TRAN); + break; + } + #else + while (spiRec() != 0xFF) {} + #endif + spiSend(STOP_TRAN_TOKEN); - success = waitNotBusy(SD_WRITE_TIMEOUT); - } - else - error(SD_CARD_ERROR_STOP_TRAN); + + #if SD_WRITE_TIMEOUT + if (!waitNotBusy(SD_WRITE_TIMEOUT)) break; + #else + while (spiRec() != 0xFF) {} + #endif + + success = true; + + } while (0); chipDeselect(); return success; diff --git a/Marlin/src/sd/Sd2Card.h b/Marlin/src/sd/Sd2Card.h index 49569af5121f..dd021364e033 100644 --- a/Marlin/src/sd/Sd2Card.h +++ b/Marlin/src/sd/Sd2Card.h @@ -39,11 +39,6 @@ #include -uint16_t const SD_INIT_TIMEOUT = 2000, // (ms) Init timeout - SD_ERASE_TIMEOUT = 10000, // (ms) Erase timeout - SD_READ_TIMEOUT = 300, // (ms) Read timeout - SD_WRITE_TIMEOUT = 600; // (ms) Write timeout - // SD card errors typedef enum : uint8_t { SD_CARD_ERROR_CMD0 = 0x01, // Timeout error for command CMD0 (initialize card in SPI mode) From 79f6d9bdaca7764271809b8a92df5e7e38318528 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 14 Aug 2023 00:19:27 +0000 Subject: [PATCH 027/268] [cron] Bump distribution date (2023-08-14) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 5a80e1242efe..c272eeb5d15a 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-08" +//#define STRING_DISTRIBUTION_DATE "2023-08-14" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index f681a9e7b08e..d9518b4ee222 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-08" + #define STRING_DISTRIBUTION_DATE "2023-08-14" #endif /** From cf50240e82e9bf187b9d6733d9dd0aed1fe57806 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 15 Aug 2023 21:03:42 -0500 Subject: [PATCH 028/268] =?UTF-8?q?=F0=9F=93=9D=20Update=20INO=20(c)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Marlin.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino index 744e98c2e313..81652000a8a6 100644 --- a/Marlin/Marlin.ino +++ b/Marlin/Marlin.ino @@ -2,7 +2,7 @@ Marlin Firmware - (c) 2011-2020 MarlinFirmware + (c) 2011-2023 MarlinFirmware Portions of Marlin are (c) by their respective authors. All code complies with GPLv2 and/or GPLv3 From 7e7dcb869257bb82adffbb349699560dc34a1f09 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 16 Aug 2023 06:08:59 +0000 Subject: [PATCH 029/268] [cron] Bump distribution date (2023-08-16) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index c272eeb5d15a..0db93b776dcd 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-14" +//#define STRING_DISTRIBUTION_DATE "2023-08-16" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d9518b4ee222..f9fb01a64b0c 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-14" + #define STRING_DISTRIBUTION_DATE "2023-08-16" #endif /** From 49ead19d008dd54403b37818b21e79b8ccfa4b89 Mon Sep 17 00:00:00 2001 From: Vovodroid Date: Fri, 18 Aug 2023 02:13:10 +0300 Subject: [PATCH 030/268] =?UTF-8?q?=F0=9F=94=A7=20Reversible=20file=20alph?= =?UTF-8?q?a=20sorting=20(#26130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 5 +-- Marlin/src/gcode/sd/M34.cpp | 12 ++++++- Marlin/src/inc/Changes.h | 2 ++ Marlin/src/inc/Conditionals_post.h | 4 +-- Marlin/src/lcd/e3v2/proui/dwin.cpp | 4 +-- Marlin/src/sd/SdBaseFile.cpp | 14 ++++---- Marlin/src/sd/cardreader.cpp | 46 ++++++++++++------------ Marlin/src/sd/cardreader.h | 16 +++++---- buildroot/tests/STM32F103VE_longer_maple | 6 ++-- 9 files changed, 65 insertions(+), 44 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 82cfc99b30ff..da9f3a66c688 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1746,9 +1746,10 @@ // SD Card Sorting options #if ENABLED(SDCARD_SORT_ALPHA) + #define SDSORT_REVERSE false // Default to sorting file names in reverse order. #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 false // Allow turning sorting on/off with LCD and M34 G-code. + #define SDSORT_FOLDERS -1 // -1=above 0=none 1=below + #define SDSORT_GCODE false // Enable G-code M34 to set sorting behaviors: M34 S<-1|0|1> F<-1|0|1> #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 false // Keep sorted items in RAM longer for speedy performance. Most expensive option. diff --git a/Marlin/src/gcode/sd/M34.cpp b/Marlin/src/gcode/sd/M34.cpp index 0a7d4d8c6221..3a7544292842 100644 --- a/Marlin/src/gcode/sd/M34.cpp +++ b/Marlin/src/gcode/sd/M34.cpp @@ -29,9 +29,19 @@ /** * M34: Set SD Card Sorting Options + * + * S - Default sorting (i.e., SDSORT_REVERSE) + * S-1 - Reverse alpha sorting + * S0 - FID Order (not always newest) + * S1 - Forward alpha sorting + * S2 - Alias for S-1 [deprecated] + * + * F-1 - Folders above files + * F0 - Sort According to 'S' + * F1 - Folders after files */ void GcodeSuite::M34() { - if (parser.seen('S')) card.setSortOn(parser.value_bool()); + if (parser.seen('S')) card.setSortOn(SortFlag(parser.ushortval('S', TERN(SDSORT_REVERSE, AS_REV, AS_FWD)))); if (parser.seenval('F')) { const int v = parser.value_long(); card.setSortFolders(v < 0 ? -1 : v > 0 ? 1 : 0); diff --git a/Marlin/src/inc/Changes.h b/Marlin/src/inc/Changes.h index b64b6a7ca766..942c5303d1fd 100644 --- a/Marlin/src/inc/Changes.h +++ b/Marlin/src/inc/Changes.h @@ -661,6 +661,8 @@ #error "Z4_USE_ENDSTOP is obsolete. Instead set Z4_STOP_PIN directly. (e.g., 'Z4_USE_ENDSTOP _ZMAX_' becomes 'Z4_STOP_PIN Z_MAX_PIN')" #elif defined(INTEGRATED_BABYSTEPPING) #error "INTEGRATED_BABYSTEPPING is no longer needed and should be removed." +#elif defined(FOLDER_SORTING) + #error "FOLDER_SORTING is now SDSORT_FOLDERS." #endif // L64xx stepper drivers have been removed diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 8f3a2eee27b9..33b42e851195 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -3337,8 +3337,8 @@ #define SDSORT_CACHE_NAMES true #define SDSORT_CACHE_LPC1768_WARNING 1 #endif - #ifndef FOLDER_SORTING - #define FOLDER_SORTING -1 + #ifndef SDSORT_FOLDERS + #define SDSORT_FOLDERS -1 #endif #ifndef SDSORT_GCODE #define SDSORT_GCODE false diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 2c52b0cabc8c..824b730019b1 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -850,7 +850,7 @@ bool DWIN_lcd_sd_status = false; #if ENABLED(MEDIASORT_MENU_ITEM) void setMediaSort() { toggleCheckboxLine(hmiData.mediaSort); - card.setSortOn(hmiData.mediaSort); + card.setSortOn(hmiData.mediaSort ? TERN(SDSORT_REVERSE, AS_REV, AS_FWD) : AS_OFF); } #endif @@ -1754,7 +1754,7 @@ void dwinSetDataDefaults() { #endif #if ENABLED(MEDIASORT_MENU_ITEM) hmiData.mediaSort = true; - card.setSortOn(true); + card.setSortOn(TERN(SDSORT_REVERSE, AS_REV, AS_FWD)); #endif hmiData.mediaAutoMount = ENABLED(HAS_SD_EXTENDER); #if ALL(INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp index 7180b675d7fc..94c1b02e0e58 100644 --- a/Marlin/src/sd/SdBaseFile.cpp +++ b/Marlin/src/sd/SdBaseFile.cpp @@ -1422,11 +1422,13 @@ int16_t SdBaseFile::read(void * const buf, uint16_t nbyte) { * * \param[out] dir The dir_t struct that will receive the data. * - * \return For success readDir() returns the number of bytes read. - * A value of zero will be returned if end of file is reached. - * If an error occurs, readDir() returns -1. Possible errors include - * readDir() called before a directory has been opened, this is not - * a directory file or an I/O error occurred. + * \return For success return a non-zero value (number of bytes read). + * A value of zero will be returned if end of dir is reached. + * If an error occurs, readDir() returns -1. Possible errors: + * - readDir() called on unopened dir + * - not a directory file + * - bad dir entry + * - I/O error */ int8_t SdBaseFile::readDir(dir_t * const dir, char * const longFilename) { int16_t n; @@ -1488,7 +1490,7 @@ int8_t SdBaseFile::readDir(dir_t * const dir, char * const longFilename) { longFilename[idx] = utf16_ch & 0xFF; longFilename[idx + 1] = (utf16_ch >> 8) & 0xFF; #else - // Replace all multibyte characters to '_' + // Replace multibyte character with '_' longFilename[n + i] = (utf16_ch > 0xFF) ? '_' : (utf16_ch & 0xFF); #endif } diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index e09bc5265a38..8ec33d1f72ef 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -91,8 +91,8 @@ int16_t CardReader::nrItems = -1; int16_t CardReader::sort_count; #if ENABLED(SDSORT_GCODE) - bool CardReader::sort_alpha; - int CardReader::sort_folders; + SortFlag CardReader::sort_alpha; + int8_t CardReader::sort_folders; //bool CardReader::sort_reverse; #endif @@ -160,8 +160,8 @@ CardReader::CardReader() { #if ENABLED(SDCARD_SORT_ALPHA) sort_count = 0; #if ENABLED(SDSORT_GCODE) - sort_alpha = true; - sort_folders = FOLDER_SORTING; + sort_alpha = TERN(SDSORT_REVERSE, AS_REV, AS_FWD); + sort_folders = SDSORT_FOLDERS; //sort_reverse = false; #endif #endif @@ -993,7 +993,7 @@ void CardReader::selectFileByIndex(const int16_t nr) { if (nr < sort_count) { strcpy(filename, sortshort[nr]); strcpy(longFilename, sortnames[nr]); - flag.filenameIsDir = IS_DIR(nr); + TERN_(HAS_FOLDER_SORTING, flag.filenameIsDir = IS_DIR(nr)); setBinFlag(strcmp_P(strrchr(filename, '.'), PSTR(".BIN")) == 0); return; } @@ -1011,7 +1011,7 @@ void CardReader::selectFileByName(const char * const match) { if (strcasecmp(match, sortshort[nr]) == 0) { strcpy(filename, sortshort[nr]); strcpy(longFilename, sortnames[nr]); - flag.filenameIsDir = IS_DIR(nr); + TERN_(HAS_FOLDER_SORTING, flag.filenameIsDir = IS_DIR(nr)); setBinFlag(strcmp_P(strrchr(filename, '.'), PSTR(".BIN")) == 0); return; } @@ -1163,7 +1163,7 @@ void CardReader::cdroot() { * Get the name of a file in the working directory by sort-index */ void CardReader::selectFileByIndexSorted(const int16_t nr) { - selectFileByIndex(TERN1(SDSORT_GCODE, sort_alpha) && (nr < sort_count) ? sort_order[nr] : nr); + selectFileByIndex(SortFlag(TERN1(SDSORT_GCODE, sort_alpha != AS_OFF)) && (nr < sort_count) ? sort_order[nr] : nr); } #if ENABLED(SDSORT_USES_RAM) @@ -1210,7 +1210,7 @@ void CardReader::cdroot() { int16_t fileCnt = get_num_items(); // Sorting may be turned off - if (TERN0(SDSORT_GCODE, !sort_alpha)) return; + if (TERN0(SDSORT_GCODE, sort_alpha == AS_OFF)) return; // If there are files, sort up to the limit if (fileCnt > 0) { @@ -1239,9 +1239,9 @@ void CardReader::cdroot() { // Folder sorting needs 1 bit per entry for flags. #if HAS_FOLDER_SORTING #if ENABLED(SDSORT_DYNAMIC_RAM) - isDir = new uint8_t[(fileCnt + 7) >> 3]; + isDir = new uint8_t[(fileCnt + 7) >> 3]; // Allocate space with 'new' #elif ENABLED(SDSORT_USES_STACK) - uint8_t isDir[(fileCnt + 7) >> 3]; + uint8_t isDir[(fileCnt + 7) >> 3]; // Use stack in this scope #endif #endif @@ -1291,18 +1291,18 @@ void CardReader::cdroot() { const int16_t o2 = sort_order[j + 1]; // Compare names from the array or just the two buffered names - #if ENABLED(SDSORT_USES_RAM) - #define _SORT_CMP_NODIR() (strcasecmp(sortnames[o1], sortnames[o2]) > 0) - #else - #define _SORT_CMP_NODIR() (strcasecmp(name1, name2) > 0) - #endif + auto _sort_cmp_file = [](char * const n1, char * const n2) -> bool { + const bool sort = strcasecmp(n1, n2) > 0; + return (TERN(SDSORT_GCODE, card.sort_alpha == AS_REV, ENABLED(SDSORT_REVERSE))) ? !sort : sort; + }; + #define _SORT_CMP_FILE() _sort_cmp_file(TERN(SDSORT_USES_RAM, sortnames[o1], name1), TERN(SDSORT_USES_RAM, sortnames[o2], name2)) #if HAS_FOLDER_SORTING #if ENABLED(SDSORT_USES_RAM) // Folder sorting needs an index and bit to test for folder-ness. - #define _SORT_CMP_DIR(fs) (IS_DIR(o1) == IS_DIR(o2) ? _SORT_CMP_NODIR() : IS_DIR(fs > 0 ? o1 : o2)) + #define _SORT_CMP_DIR(fs) (IS_DIR(o1) == IS_DIR(o2) ? _SORT_CMP_FILE() : IS_DIR(fs > 0 ? o1 : o2)) #else - #define _SORT_CMP_DIR(fs) ((dir1 == flag.filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? dir1 : !dir1)) + #define _SORT_CMP_DIR(fs) ((dir1 == flag.filenameIsDir) ? _SORT_CMP_FILE() : (fs > 0 ? dir1 : !dir1)) #endif #endif @@ -1318,12 +1318,12 @@ void CardReader::cdroot() { if ( #if HAS_FOLDER_SORTING #if ENABLED(SDSORT_GCODE) - sort_folders ? _SORT_CMP_DIR(sort_folders) : _SORT_CMP_NODIR() + sort_folders ? _SORT_CMP_DIR(sort_folders) : _SORT_CMP_FILE() #else - _SORT_CMP_DIR(FOLDER_SORTING) + _SORT_CMP_DIR(SDSORT_FOLDERS) #endif #else - _SORT_CMP_NODIR() + _SORT_CMP_FILE() #endif ) { // Reorder the index, indicate that sorting happened @@ -1357,12 +1357,14 @@ void CardReader::cdroot() { #if ENABLED(SDSORT_DYNAMIC_RAM) sortnames = new char*[1]; sortshort = new char*[1]; - isDir = new uint8_t[1]; #endif selectFileByIndex(0); SET_SORTNAME(0); SET_SORTSHORT(0); - isDir[0] = flag.filenameIsDir; + #if ALL(HAS_FOLDER_SORTING, SDSORT_DYNAMIC_RAM) + isDir = new uint8_t[1]; + isDir[0] = flag.filenameIsDir; + #endif #endif } diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 80e317ebcf10..7dc140b3170e 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -31,7 +31,10 @@ extern const char M23_STR[], M24_STR[]; #if ENABLED(SDSORT_DYNAMIC_RAM) #define SD_RESORT 1 #endif - #if FOLDER_SORTING || ENABLED(SDSORT_GCODE) + #ifndef SDSORT_FOLDERS + #define SDSORT_FOLDERS 0 + #endif + #if SDSORT_FOLDERS || ENABLED(SDSORT_GCODE) #define HAS_FOLDER_SORTING 1 #endif #endif @@ -84,6 +87,7 @@ typedef struct { } card_flags_t; enum ListingFlags : uint8_t { LS_LONG_FILENAME, LS_ONLY_BIN, LS_TIMESTAMP }; +enum SortFlag : int8_t { AS_REV = -1, AS_OFF, AS_FWD, AS_ALSO_REV }; #if ENABLED(AUTO_REPORT_SD_STATUS) #include "../libs/autoreport.h" @@ -199,8 +203,8 @@ class CardReader { static void presort(); static void selectFileByIndexSorted(const int16_t nr); #if ENABLED(SDSORT_GCODE) - FORCE_INLINE static void setSortOn(bool b) { sort_alpha = b; presort(); } - FORCE_INLINE static void setSortFolders(int i) { sort_folders = i; presort(); } + FORCE_INLINE static void setSortOn(const SortFlag f) { sort_alpha = (f == AS_ALSO_REV) ? AS_REV : f; presort(); } + FORCE_INLINE static void setSortFolders(const int8_t i) { sort_folders = i; presort(); } //FORCE_INLINE static void setSortReverse(bool b) { sort_reverse = b; } #endif #else @@ -272,12 +276,12 @@ class CardReader { #if ENABLED(SDCARD_SORT_ALPHA) static int16_t sort_count; // Count of sorted items in the current directory #if ENABLED(SDSORT_GCODE) - static bool sort_alpha; // Flag to enable / disable the feature - static int sort_folders; // Folder sorting before/none/after + static SortFlag sort_alpha; // Sorting: REV, OFF, FWD + static int8_t sort_folders; // Folder sorting before/none/after //static bool sort_reverse; // Flag to enable / disable reverse sorting #endif - // By default the sort index is static + // By default the sort index is statically allocated #if ENABLED(SDSORT_DYNAMIC_RAM) static uint8_t *sort_order; #else diff --git a/buildroot/tests/STM32F103VE_longer_maple b/buildroot/tests/STM32F103VE_longer_maple index 4570a3214d17..9f594be61ac0 100755 --- a/buildroot/tests/STM32F103VE_longer_maple +++ b/buildroot/tests/STM32F103VE_longer_maple @@ -8,16 +8,16 @@ set -e use_example_configs Alfawise/U20 opt_enable BAUD_RATE_GCODE -exec_test $1 $2 "maple CLASSIC_UI U20 config" "$3" +exec_test $1 $2 "Maple - Alfawise U20 - CLASSIC_UI" "$3" use_example_configs Alfawise/U20 opt_enable BAUD_RATE_GCODE TFT_COLOR_UI opt_disable TFT_CLASSIC_UI CUSTOM_STATUS_SCREEN_IMAGE -exec_test $1 $2 "maple COLOR_UI U20 config" "$3" +exec_test $1 $2 "Maple - Alfawise U20 - COLOR_UI" "$3" use_example_configs Alfawise/U20-bltouch opt_enable BAUD_RATE_GCODE -exec_test $1 $2 "maple BLTouch U20 config" +exec_test $1 $2 "Maple - Alfawise U20 - BLTouch" # cleanup restore_configs From 1d17c34e123f74d820f42fcd179104c884719007 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 18 Aug 2023 00:18:38 +0000 Subject: [PATCH 031/268] [cron] Bump distribution date (2023-08-18) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 0db93b776dcd..9a8c7e9d4849 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-16" +//#define STRING_DISTRIBUTION_DATE "2023-08-18" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index f9fb01a64b0c..979359dc5484 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-16" + #define STRING_DISTRIBUTION_DATE "2023-08-18" #endif /** From f7d5188b2f0a59b752fbabf6b96ff1ed4aed8112 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Sat, 19 Aug 2023 22:53:45 +0200 Subject: [PATCH 032/268] =?UTF-8?q?=F0=9F=90=9B=20Fixes=20for=20ProUI,=20b?= =?UTF-8?q?uild=20rename=20(#26177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/caselight.h | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 65 ++++++++++++------- Marlin/src/lcd/e3v2/proui/dwin.h | 3 + Marlin/src/lcd/e3v2/proui/dwin_defines.h | 2 +- Marlin/src/lcd/e3v2/proui/menus.cpp | 12 ++-- Marlin/src/lcd/e3v2/proui/menus.h | 6 +- Marlin/src/module/motion.h | 2 +- .../PlatformIO/scripts/offset_and_rename.py | 5 +- buildroot/share/scripts/upload.py | 3 +- 9 files changed, 61 insertions(+), 39 deletions(-) diff --git a/Marlin/src/feature/caselight.h b/Marlin/src/feature/caselight.h index 17e1222acbfa..d88b3d67bf83 100644 --- a/Marlin/src/feature/caselight.h +++ b/Marlin/src/feature/caselight.h @@ -30,7 +30,7 @@ class CaseLight { public: static bool on; - #if ENABLED(CASELIGHT_USES_BRIGHTNESS) + #if CASELIGHT_USES_BRIGHTNESS static uint8_t brightness; #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 824b730019b1..7c69d0f900d8 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -214,13 +214,13 @@ Menu *prepareMenu = nullptr; Menu *trammingMenu = nullptr; #endif Menu *moveMenu = nullptr; -Menu *ControlMenu = nullptr; -Menu *AdvancedSettings = nullptr; +Menu *controlMenu = nullptr; +Menu *advancedSettingsMenu = nullptr; #if HAS_HOME_OFFSET Menu *homeOffsetMenu = nullptr; #endif #if HAS_BED_PROBE - Menu *ProbeSetMenu = nullptr; + Menu *probeSettingsMenu = nullptr; #endif Menu *filSetMenu = nullptr; Menu *selectColorMenu = nullptr; @@ -229,7 +229,7 @@ Menu *tuneMenu = nullptr; Menu *motionMenu = nullptr; Menu *filamentMenu = nullptr; #if ENABLED(MESH_BED_LEVELING) - Menu *manualMesh = nullptr; + Menu *manualMeshMenu = nullptr; #endif #if HAS_PREHEAT Menu *preheatMenu = nullptr; @@ -251,7 +251,7 @@ Menu *stepsMenu = nullptr; #if ENABLED(PIDTEMPBED) && ANY(PID_EDIT_MENU, PID_AUTOTUNE_MENU) Menu *bedPIDMenu = nullptr; #endif -#if ENABLED(CASELIGHT_USES_BRIGHTNESS) +#if CASELIGHT_USES_BRIGHTNESS Menu *caseLightMenu = nullptr; #endif #if ENABLED(LED_CONTROL_MENU) @@ -2152,9 +2152,10 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS, toggleCheckboxLine(caselight.on); caselight.update_enabled(); } - #if ENABLED(CASELIGHT_USES_BRIGHTNESS) + #if CASELIGHT_USES_BRIGHTNESS + bool enableLiveCaseLightBrightness = true; void liveCaseLightBrightness() { caselight.brightness = menuData.value; caselight.update_brightness(); } - void setCaseLightBrightness() { setIntOnClick(0, 255, caselight.brightness, nullptr, liveCaseLightBrightness); } + void setCaseLightBrightness() { setIntOnClick(0, 255, caselight.brightness, liveCaseLightBrightness, enableLiveCaseLightBrightness ? liveCaseLightBrightness : nullptr); } #endif #endif @@ -2166,10 +2167,12 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS, } #endif #if HAS_COLOR_LEDS + bool enableLiveLedColor = true; void applyLEDColor() { hmiData.ledColor = LEDColor( {leds.color.r, leds.color.g, leds.color.b OPTARG(HAS_WHITE_LED, hmiData.ledColor.w) } ); + if (!enableLiveLedColor) leds.update(); } - void liveLEDColor(uint8_t *color) { *color = menuData.value; leds.update(); } + void liveLEDColor(uint8_t *color) { *color = menuData.value; if (enableLiveLedColor) leds.update(); } void liveLEDColorR() { liveLEDColor(&leds.color.r); } void liveLEDColorG() { liveLEDColor(&leds.color.g); } void liveLEDColorB() { liveLEDColor(&leds.color.b); } @@ -3039,35 +3042,37 @@ void drawPrepareMenu() { void drawControlMenu() { checkkey = ID_Menu; - if (SET_MENU_R(ControlMenu, selrect({103, 1, 28, 14}), MSG_CONTROL, 11)) { + 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); - #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, writeEEPROM); - MENU_ITEM(ICON_ReadEEPROM, MSG_LOAD_EEPROM, onDrawReadEeprom, readEEPROM); - MENU_ITEM(ICON_ResumeEEPROM, MSG_RESTORE_DEFAULTS, onDrawResetEeprom, resetEEPROM); - #endif - MENU_ITEM(ICON_Reboot, MSG_RESET_PRINTER, onDrawMenuItem, rebootPrinter); #if ENABLED(CASE_LIGHT_MENU) - #if ENABLED(CASELIGHT_USES_BRIGHTNESS) + #if CASELIGHT_USES_BRIGHTNESS + enableLiveCaseLightBrightness = true; // Allow live update of brightness in control menu MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawSubMenu, drawCaseLightMenu); #else MENU_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on); #endif #endif #if ENABLED(LED_CONTROL_MENU) + enableLiveLedColor = true; // Allow live update of color in control menu MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, drawLedControlMenu); #endif + #if ENABLED(EEPROM_SETTINGS) + MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawWriteEeprom, writeEEPROM); + MENU_ITEM(ICON_ReadEEPROM, MSG_LOAD_EEPROM, onDrawReadEeprom, readEEPROM); + MENU_ITEM(ICON_ResumeEEPROM, MSG_RESTORE_DEFAULTS, onDrawResetEeprom, resetEEPROM); + #endif + MENU_ITEM(ICON_Reboot, MSG_RESET_PRINTER, onDrawMenuItem, rebootPrinter); MENU_ITEM(ICON_Info, MSG_INFO_SCREEN, onDrawInfoSubMenu, gotoInfoMenu); } ui.reset_status(true); - updateMenu(ControlMenu); + updateMenu(controlMenu); } void drawAdvancedSettingsMenu() { checkkey = ID_Menu; - if (SET_MENU(AdvancedSettings, MSG_ADVANCED_SETTINGS, 23)) { + if (SET_MENU(advancedSettingsMenu, MSG_ADVANCED_SETTINGS, 23)) { BACK_ITEM(gotoMainMenu); #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); @@ -3129,7 +3134,7 @@ void drawAdvancedSettingsMenu() { #endif } ui.reset_status(true); - updateMenu(AdvancedSettings); + updateMenu(advancedSettingsMenu); } void drawMoveMenu() { @@ -3180,7 +3185,7 @@ void drawMoveMenu() { void drawProbeSetMenu() { checkkey = ID_Menu; - if (SET_MENU(ProbeSetMenu, MSG_ZPROBE_SETTINGS, 9)) { + if (SET_MENU(probeSettingsMenu, MSG_ZPROBE_SETTINGS, 9)) { BACK_ITEM(drawAdvancedSettingsMenu); #if HAS_X_AXIS EDIT_ITEM(ICON_ProbeOffsetX, MSG_ZPROBE_XOFFSET, onDrawPFloatMenu, setProbeOffsetX, &probe.offset.x); @@ -3203,7 +3208,7 @@ void drawMoveMenu() { MENU_ITEM(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, probeTest); #endif } - updateMenu(ProbeSetMenu); + updateMenu(probeSettingsMenu); } #endif // HAS_BED_PROBE @@ -3251,7 +3256,7 @@ void drawFilSetMenu() { void drawLedControlMenu() { checkkey = ID_Menu; if (SET_MENU(ledControlMenu, MSG_LED_CONTROL, 10)) { - BACK_ITEM(drawControlMenu); + BACK_ITEM((currentMenu == tuneMenu) ? drawTuneMenu : drawControlMenu); #if !ALL(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) EDIT_ITEM(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, setLedStatus, &leds.lights_on); #endif @@ -3282,7 +3287,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 @@ -3327,6 +3332,16 @@ void drawTuneMenu() { #endif #if ENABLED(CASE_LIGHT_MENU) EDIT_ITEM(ICON_CaseLight, MSG_CASE_LIGHT, onDrawChkbMenu, setCaseLight, &caselight.on); + #if CASELIGHT_USES_BRIGHTNESS + // Avoid heavy interference with print job disabling live update of brightness in tune menu + enableLiveCaseLightBrightness = false; + EDIT_ITEM(ICON_Brightness, MSG_CASE_LIGHT_BRIGHTNESS, onDrawPInt8Menu, setCaseLightBrightness, &caselight.brightness); + #endif + #if ENABLED(LED_CONTROL_MENU) + // Avoid heavy interference with print job disabling live update of color in tune menu + enableLiveLedColor = false; + MENU_ITEM(ICON_LedControl, MSG_LED_CONTROL, onDrawSubMenu, drawLedControlMenu); + #endif #elif ENABLED(LED_CONTROL_MENU) && DISABLED(CASE_LIGHT_USE_NEOPIXEL) EDIT_ITEM(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, setLedStatus, &leds.lights_on); #endif @@ -3478,7 +3493,7 @@ void drawMotionMenu() { void drawManualMeshMenu() { checkkey = ID_Menu; - if (SET_MENU(manualMesh, MSG_UBL_MANUAL_MESH, 6)) { + if (SET_MENU(manualMeshMenu, MSG_UBL_MANUAL_MESH, 6)) { BACK_ITEM(drawPrepareMenu); MENU_ITEM(ICON_ManualMesh, MSG_LEVEL_BED, onDrawMenuItem, manualMeshStart); mMeshMoveZItem = EDIT_ITEM(ICON_Zoffset, MSG_MOVE_Z, onDrawMMeshMoveZ, setMMeshMoveZ, ¤t_position.z); @@ -3486,7 +3501,7 @@ void drawMotionMenu() { MENU_ITEM(ICON_MeshViewer, MSG_MESH_VIEW, onDrawSubMenu, dwinMeshViewer); MENU_ITEM(ICON_MeshSave, MSG_UBL_SAVE_MESH, onDrawMenuItem, manualMeshSave); } - updateMenu(manualMesh); + updateMenu(manualMeshMenu); } #endif // MESH_BED_LEVELING diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index ccc90b3de608..21b72d321a60 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -35,6 +35,9 @@ #include "../common/encoder.h" #include "../common/limits.h" #include "../../../libs/BL24CXX.h" +#if ENABLED(LED_CONTROL_MENU) + #include "../../../feature/leds/leds.h" +#endif #if ANY(BABYSTEPPING, HAS_BED_PROBE) #define HAS_ZOFFSET_ITEM 1 diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 8ac7c5eb6231..e3526849a808 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -66,7 +66,7 @@ #if ALL(LED_CONTROL_MENU, HAS_COLOR_LEDS) #define defColorLeds LEDColorWhite() #endif -#if ENABLED(CASELIGHT_USES_BRIGHTNESS) +#if CASELIGHT_USES_BRIGHTNESS #define defCaseLightBrightness 255 #endif #ifdef Z_AFTER_HOMING diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 347130743c63..d537bc5ae663 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -507,25 +507,25 @@ void initMenu() { bool setMenu(Menu* &menu, FSTR_P fTitle, int8_t totalitems) { if (!menu) menu = new Menu(); - const bool NotCurrent = (currentMenu != menu); - if (NotCurrent) { + const bool notCurrent = (currentMenu != menu); + if (notCurrent) { menu->menuTitle.setCaption(fTitle); menuItemsPrepare(totalitems); } - return NotCurrent; + return notCurrent; } bool setMenu(Menu* &menu, frame_rect_t cn, FSTR_P fTitle, int8_t totalitems) { if (!menu) menu = new Menu(); - const bool NotCurrent = (currentMenu != menu); - if (NotCurrent) { + const bool notCurrent = (currentMenu != menu); + if (notCurrent) { if (cn.w != 0) menu->menuTitle.setFrame(cn.x, cn.y, cn.w, cn.h); else menu->menuTitle.setCaption(fTitle); menuItemsPrepare(totalitems); } - return NotCurrent; + return notCurrent; } void resetMenu(Menu* &menu) { diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index 58dd92f0f6ac..be0c88176006 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -183,13 +183,13 @@ void resetMenu(Menu* &menu); // Invalidate currentMenu to prepare for full menu drawing void invalidateMenu(); -//Update the Menu and Draw if it is valid +// Update the Menu and Draw if it is valid void updateMenu(Menu* &menu); -//Redraw the current Menu if it is valid +// Redraw the current Menu if it is valid void ReDrawMenu(bool force=false); -//Redraw selected menu item +// Redraw selected menu item void ReDrawItem(); // Clear menuItems array and free menuItems elements diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index fceeffa70748..7d5d657ac735 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -407,7 +407,7 @@ void restore_feedrate_and_scaling(); #if HAS_Z_AXIS #if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) - #define Z_POST_CLEARANCE hmiData.z_after_homing + #define Z_POST_CLEARANCE hmiData.zAfterHoming #elif defined(Z_AFTER_HOMING) #define Z_POST_CLEARANCE Z_AFTER_HOMING #else diff --git a/buildroot/share/PlatformIO/scripts/offset_and_rename.py b/buildroot/share/PlatformIO/scripts/offset_and_rename.py index e9940a50d014..20f2b78024b8 100644 --- a/buildroot/share/PlatformIO/scripts/offset_and_rename.py +++ b/buildroot/share/PlatformIO/scripts/offset_and_rename.py @@ -61,6 +61,9 @@ def encrypt(source, target, env): def rename_target(source, target, env): from pathlib import Path from datetime import datetime - Path(target[0].path).replace(Path(target[0].dir.path, datetime.now().strftime(new_name.replace('{date}', '%Y%m%d').replace('{time}', '%H%M%S')))) + from os import path + _newpath = Path(target[0].dir.path, datetime.now().strftime(new_name.replace('{date}', '%Y%m%d').replace('{time}', '%H%M%S'))) + Path(target[0].path).replace(_newpath) + env['PROGNAME'] = path.splitext(_newpath)[0] marlin.add_post_action(rename_target) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index c97605e3f4b7..ee48af6fc6de 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -157,7 +157,8 @@ def _RollbackUpload(FirmwareFile): marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') # Get firmware upload params - upload_firmware_source_name = str(source[0]) # Source firmware filename + upload_firmware_source_name = env['PROGNAME'] + '.bin' if env['PROGNAME'] else str(source[0]) + # Source firmware filename upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 # baud rate of serial connection upload_port = _GetUploadPort(env) # Serial port to use From db5ead4230eda3e05d8beb919c8e7d5bdef960a9 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 20 Aug 2023 00:19:51 +0000 Subject: [PATCH 033/268] [cron] Bump distribution date (2023-08-20) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 9a8c7e9d4849..ff9fa03df1b3 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-18" +//#define STRING_DISTRIBUTION_DATE "2023-08-20" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 979359dc5484..e87f39d62e56 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-18" + #define STRING_DISTRIBUTION_DATE "2023-08-20" #endif /** From f2665e597f944d7a054a72302349a6edf9c4c082 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 25 Jul 2023 18:36:50 -0500 Subject: [PATCH 034/268] =?UTF-8?q?=F0=9F=8E=A8=20FTDI=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp index 47540b0f5519..ee9eecf742fd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/leveling_menu.cpp @@ -81,7 +81,7 @@ void LevelingMenu::onRedraw(draw_mode_t what) { .text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) #endif .font(font_medium).colors(normal_btn) - .enabled(ANY(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)) + .enabled(ANY(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION)) .tag(2).button(LEVEL_AXIS_POS, GET_TEXT_F(MSG_LEVEL_X_AXIS)) .enabled(ENABLED(HAS_BED_PROBE)) .tag(3).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED)) @@ -103,7 +103,7 @@ void LevelingMenu::onRedraw(draw_mode_t what) { bool LevelingMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); break; - #if ANY(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION) + #if ANY(Z_STEPPER_AUTO_ALIGN, MECHANICAL_GANTRY_CALIBRATION) case 2: SpinnerDialogBox::enqueueAndWait(F("G34")); break; #endif #if HAS_BED_PROBE From d1803ec04434a9b5a9e18c12cc392cee15d8f5c6 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 21 Aug 2023 00:19:10 +0000 Subject: [PATCH 035/268] [cron] Bump distribution date (2023-08-21) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index ff9fa03df1b3..7cb7ff8cb95d 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-20" +//#define STRING_DISTRIBUTION_DATE "2023-08-21" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e87f39d62e56..955231be95ce 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-20" + #define STRING_DISTRIBUTION_DATE "2023-08-21" #endif /** From d69ce775032bc254bf3da67088ebdfcaad0612b5 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 21 Aug 2023 21:39:49 +0200 Subject: [PATCH 036/268] =?UTF-8?q?=F0=9F=90=9B=20Fixes=20for=20G2/G3=20ar?= =?UTF-8?q?cs=20(#26170)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/motion/G2_G3.cpp | 130 +++++++++++++++--------------- 1 file changed, 64 insertions(+), 66 deletions(-) diff --git a/Marlin/src/gcode/motion/G2_G3.cpp b/Marlin/src/gcode/motion/G2_G3.cpp index b3a281bcc805..c87d64d19b26 100644 --- a/Marlin/src/gcode/motion/G2_G3.cpp +++ b/Marlin/src/gcode/motion/G2_G3.cpp @@ -82,14 +82,17 @@ void plan_arc( rt_X = cart[axis_p] - center_P, rt_Y = cart[axis_q] - center_Q; - ARC_LIJKUVW_CODE( - const float start_L = current_position[axis_l], - const float start_I = current_position.i, - const float start_J = current_position.j, - const float start_K = current_position.k, - const float start_U = current_position.u, - const float start_V = current_position.v, - const float start_W = current_position.w + // Starting position of the move for all non-arc axes + // i.e., only one of X, Y, or Z, plus the rest. + ARC_LIJKUVWE_CODE( + float start_L = current_position[axis_l], + float start_I = current_position.i, + float start_J = current_position.j, + float start_K = current_position.k, + float start_U = current_position.u, + float start_V = current_position.v, + float start_W = current_position.w, + float start_E = current_position.e ); // Angle of rotation between position and target from the circle center. @@ -125,6 +128,7 @@ void plan_arc( min_segments = CEIL((MIN_CIRCLE_SEGMENTS) * portion_of_circle); // Minimum segments for the arc } + // Total travel on all the non-arc axes ARC_LIJKUVWE_CODE( float travel_L = cart[axis_l] - start_L, float travel_I = cart.i - start_I, @@ -133,7 +137,7 @@ void plan_arc( float travel_U = cart.u - start_U, float travel_V = cart.v - start_V, float travel_W = cart.w - start_W, - float travel_E = cart.e - current_position.e + float travel_E = cart.e - start_E ); // If "P" specified circles, call plan_arc recursively then continue with the rest of the arc @@ -166,15 +170,29 @@ void plan_arc( ); plan_arc(temp_position, offset, clockwise, 0); // Plan a single whole circle } + + // Get starting coordinates for the remainder from the current position + ARC_LIJKUVWE_CODE( + start_L = current_position[axis_l], + start_I = current_position.i, + start_J = current_position.j, + start_K = current_position.k, + start_U = current_position.u, + start_V = current_position.v, + start_W = current_position.w, + start_E = current_position.e + ); + + // Update travel distance for the remainder ARC_LIJKUVWE_CODE( - travel_L = cart[axis_l] - current_position[axis_l], // Linear X, Y, or Z - travel_I = cart.i - current_position.i, // The rest are also non-arc - travel_J = cart.j - current_position.j, - travel_K = cart.k - current_position.k, - travel_U = cart.u - current_position.u, - travel_V = cart.v - current_position.v, - travel_W = cart.w - current_position.w, - travel_E = cart.e - current_position.e + travel_L = cart[axis_l] - start_L, // Linear X, Y, or Z + travel_I = cart.i - start_I, // The rest are also non-arc + travel_J = cart.j - start_J, + travel_K = cart.k - start_K, + travel_U = cart.u - start_U, + travel_V = cart.v - start_V, + travel_W = cart.w - start_W, + travel_E = cart.e - start_E ); } @@ -256,7 +274,7 @@ void plan_arc( xyze_pos_t raw; - // do not calculate rotation parameters for trivial single-segment arcs + // Don't calculate rotation parameters for trivial single-segment arcs if (segments > 1) { // Vector rotation matrix values const float theta_per_segment = angular_travel / segments, @@ -264,30 +282,27 @@ void plan_arc( sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, cos_T = 1 - 0.5f * sq_theta_per_segment; // Small angle approximation - #if DISABLED(AUTO_BED_LEVELING_UBL) - ARC_LIJKUVW_CODE( - const float per_segment_L = travel_L / segments, - const float per_segment_I = travel_I / segments, - const float per_segment_J = travel_J / segments, - const float per_segment_K = travel_K / segments, - const float per_segment_U = travel_U / segments, - const float per_segment_V = travel_V / segments, - const float per_segment_W = travel_W / segments - ); - #endif - - CODE_ITEM_E(const float extruder_per_segment = travel_E / segments); + ARC_LIJKUVWE_CODE( + const float per_segment_L = travel_L / segments, + const float per_segment_I = travel_I / segments, + const float per_segment_J = travel_J / segments, + const float per_segment_K = travel_K / segments, + const float per_segment_U = travel_U / segments, + const float per_segment_V = travel_V / segments, + const float per_segment_W = travel_W / segments, + const float per_segment_E = travel_E / segments + ); // Initialize all linear axes and E ARC_LIJKUVWE_CODE( - raw[axis_l] = current_position[axis_l], - raw.i = current_position.i, - raw.j = current_position.j, - raw.k = current_position.k, - raw.u = current_position.u, - raw.v = current_position.v, - raw.w = current_position.w, - raw.e = current_position.e + raw[axis_l] = start_L, + raw.i = start_I, + raw.j = start_J, + raw.k = start_K, + raw.u = start_U, + raw.v = start_V, + raw.w = start_W, + raw.e = start_E ); millis_t next_idle_ms = millis() + 200UL; @@ -305,7 +320,6 @@ void plan_arc( const float limiting_accel = _MIN(planner.settings.max_acceleration_mm_per_s2[axis_p], planner.settings.max_acceleration_mm_per_s2[axis_q]), limiting_speed = _MIN(planner.settings.max_feedrate_mm_s[axis_p], planner.settings.max_feedrate_mm_s[axis_q]), limiting_speed_sqr = _MIN(sq(limiting_speed), limiting_accel * radius, sq(scaled_fr_mm_s)); - float arc_mm_remaining = flat_mm; for (uint16_t i = 1; i < segments; i++) { // Iterate (segments-1) times @@ -343,16 +357,14 @@ void plan_arc( raw[axis_p] = center_P + rvec.a; raw[axis_q] = center_Q + rvec.b; ARC_LIJKUVWE_CODE( - #if ENABLED(AUTO_BED_LEVELING_UBL) - raw[axis_l] = start_L, - raw.i = start_I, raw.j = start_J, raw.k = start_K, - raw.u = start_U, raw.v = start_V, raw.w = start_V - #else - raw[axis_l] += per_segment_L, - raw.i += per_segment_I, raw.j += per_segment_J, raw.k += per_segment_K, - raw.u += per_segment_U, raw.v += per_segment_V, raw.w += per_segment_W - #endif - , raw.e += extruder_per_segment + raw[axis_l] = start_L + per_segment_L * i, + raw.i = start_I + per_segment_I * i, + raw.j = start_J + per_segment_J * i, + raw.k = start_K + per_segment_K * i, + raw.u = start_U + per_segment_U * i, + raw.v = start_V + per_segment_V * i, + raw.w = start_W + per_segment_W * i, + raw.e = start_E + per_segment_E * i ); apply_motion_limits(raw); @@ -362,7 +374,7 @@ void plan_arc( #endif // calculate safe speed for stopping by the end of the arc - arc_mm_remaining -= segment_mm; + const float arc_mm_remaining = flat_mm - segment_mm * i; hints.safe_exit_speed_sqr = _MIN(limiting_speed_sqr, 2 * limiting_accel * arc_mm_remaining); if (!planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints)) @@ -374,13 +386,6 @@ void plan_arc( // Ensure last segment arrives at target location. raw = cart; - #if ENABLED(AUTO_BED_LEVELING_UBL) - ARC_LIJKUVW_CODE( - raw[axis_l] = start_L, - raw.i = start_I, raw.j = start_J, raw.k = start_K, - raw.u = start_U, raw.v = start_V, raw.w = start_W - ); - #endif apply_motion_limits(raw); @@ -392,14 +397,7 @@ void plan_arc( hints.safe_exit_speed_sqr = 0.0f; planner.buffer_line(raw, scaled_fr_mm_s, active_extruder, hints); - #if ENABLED(AUTO_BED_LEVELING_UBL) - ARC_LIJKUVW_CODE( - raw[axis_l] = start_L, - raw.i = start_I, raw.j = start_J, raw.k = start_K, - raw.u = start_U, raw.v = start_V, raw.w = start_W - ); - #endif - current_position = raw; + current_position = cart; } // plan_arc From b02ea02dbb89892916045079423ca91532adc61c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 21 Aug 2023 16:52:26 -0500 Subject: [PATCH 037/268] =?UTF-8?q?=E2=9C=85=20Fix=20unused=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/tests/STM32F103RE | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildroot/tests/STM32F103RE b/buildroot/tests/STM32F103RE index 641f1fa56c80..111eb266441a 100755 --- a/buildroot/tests/STM32F103RE +++ b/buildroot/tests/STM32F103RE @@ -11,12 +11,12 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_STM32F103RE SERIAL_PORT -1 EXTRUDERS 2 \ - NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \ - NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }" -opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT \ + NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 } }" \ + NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 } }" +opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT SDSUPPORT \ PAREN_COMMENTS GCODE_MOTION_MODES SINGLENOZZLE TOOLCHANGE_FILAMENT_SWAP TOOLCHANGE_PARK \ BAUD_RATE_GCODE GCODE_MACROS NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE -exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT PAREN_COMMENTS GCODE_MOTION_MODES" "$3" +exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT SDSUPPORT PAREN_COMMENTS GCODE_MOTION_MODES" "$3" # cleanup restore_configs From b5a08c251853e0b7122bc33d1c6fcd3de967e478 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 22 Aug 2023 00:18:52 +0000 Subject: [PATCH 038/268] [cron] Bump distribution date (2023-08-22) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 7cb7ff8cb95d..bd9b9ea7e577 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-21" +//#define STRING_DISTRIBUTION_DATE "2023-08-22" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 955231be95ce..6d1966575e9f 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-21" + #define STRING_DISTRIBUTION_DATE "2023-08-22" #endif /** From be91eaed2c707924cbaa8a4d79a0495b43495870 Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Wed, 23 Aug 2023 00:13:53 +0200 Subject: [PATCH 039/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20FT=20Motion=20menu?= =?UTF-8?q?=20Back=20item=20(#26175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_motion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index ae6e87af6585..dcabb7861e51 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -396,7 +396,7 @@ void menu_move() { #endif START_MENU(); - BACK_ITEM(MSG_ADVANCED_SETTINGS); + BACK_ITEM(MSG_MOTION); SUBMENU(MSG_FTM_MODE, menu_ftm_mode); MENU_ITEM_ADDON_START_RJ(5); lcd_put_u8str(ftmode); MENU_ITEM_ADDON_END(); From 88cdf487b433bf2187f2dad31587882ebf02cc59 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Aug 2023 17:36:53 -0500 Subject: [PATCH 040/268] =?UTF-8?q?=F0=9F=9A=B8=20Avoid=20LCD=20messages?= =?UTF-8?q?=20starting=20with=20"Error:"=20(#26164)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/language.h | 4 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- .../src/lcd/extui/anycubic_vyper/dgus_tft.cpp | 10 ++-- Marlin/src/lcd/language/language_an.h | 10 ++-- Marlin/src/lcd/language/language_ca.h | 4 +- Marlin/src/lcd/language/language_cz.h | 6 +-- Marlin/src/lcd/language/language_da.h | 4 +- Marlin/src/lcd/language/language_de.h | 11 ++--- Marlin/src/lcd/language/language_el.h | 6 +-- Marlin/src/lcd/language/language_el_gr.h | 4 +- Marlin/src/lcd/language/language_en.h | 17 +++---- Marlin/src/lcd/language/language_es.h | 10 ++-- Marlin/src/lcd/language/language_eu.h | 4 +- Marlin/src/lcd/language/language_fr.h | 4 +- Marlin/src/lcd/language/language_fr_na.h | 4 +- Marlin/src/lcd/language/language_gl.h | 6 +-- Marlin/src/lcd/language/language_hr.h | 2 +- Marlin/src/lcd/language/language_hu.h | 9 ++-- Marlin/src/lcd/language/language_it.h | 11 ++--- Marlin/src/lcd/language/language_jp_kana.h | 4 +- Marlin/src/lcd/language/language_nl.h | 4 +- Marlin/src/lcd/language/language_pl.h | 6 +-- Marlin/src/lcd/language/language_pt.h | 2 +- Marlin/src/lcd/language/language_pt_br.h | 6 +-- Marlin/src/lcd/language/language_ro.h | 6 +-- Marlin/src/lcd/language/language_ru.h | 11 ++--- Marlin/src/lcd/language/language_sk.h | 11 ++--- Marlin/src/lcd/language/language_sv.h | 6 +-- Marlin/src/lcd/language/language_tr.h | 11 ++--- Marlin/src/lcd/language/language_uk.h | 11 ++--- Marlin/src/lcd/language/language_vi.h | 5 +- Marlin/src/lcd/language/language_zh_CN.h | 6 +-- Marlin/src/lcd/language/language_zh_TW.h | 6 +-- Marlin/src/module/temperature.cpp | 49 +++++++------------ 34 files changed, 107 insertions(+), 165 deletions(-) diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 649f05cf69d9..9fc7e99bf565 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -154,7 +154,7 @@ #define STR_ERR_ARC_ARGS "G2/G3 bad parameters" #define STR_ERR_PROTECTED_PIN "Protected Pin" #define STR_ERR_M420_FAILED "Failed to enable Bed Leveling" -#define STR_ERR_M428_TOO_FAR "Too far from reference point" +#define STR_ERR_M428_TOO_FAR "Too far from MIN/MAX" #define STR_ERR_M303_DISABLED "PIDTEMP disabled" #define STR_M119_REPORT "Reporting endstop status" #define STR_ON "ON" @@ -254,7 +254,7 @@ #define STR_REDUNDANCY "Heater switched off. Temperature difference between temp sensors is too high !" #define STR_T_HEATING_FAILED "Heating failed" #define STR_T_THERMAL_RUNAWAY "Thermal Runaway" -#define STR_T_MALFUNCTION "Thermal Malfunction" +#define STR_T_THERMAL_MALFUNCTION "Thermal Malfunction" #define STR_T_MAXTEMP "MAXTEMP triggered" #define STR_T_MINTEMP "MINTEMP triggered" #define STR_ERR_PROBING_FAILED "Probing Failed" diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 7c69d0f900d8..83c7eebe3812 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1825,7 +1825,7 @@ void MarlinUI::refresh() { /* Nothing to see here */ } void MarlinUI::_set_brightness() { dwinLCDBrightness(backlight ? brightness : 0); } #endif -void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { +void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const) { dwinDrawPopup(ICON_BLTouch, GET_TEXT_F(MSG_PRINTER_KILLED), lcd_error); DWINUI::drawCenteredString(hmiData.colorPopupTxt, 270, GET_TEXT_F(MSG_TURN_OFF)); dwinUpdateLCD(); diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index f27e638b3280..1aaa37870806 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -293,7 +293,7 @@ namespace Anycubic { DEBUG_ECHOLNPGM("printerKilled()\nerror: ", error, "\ncomponent: ", component); #endif - if (strcmp_P(error, PSTR("Heating Failed")) == 0) { + if (strcmp_P(error, GET_TEXT(MSG_ERR_HEATING_FAILED)) == 0) { if (strcmp_P(component, PSTR("Bed")) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_HEATER); @@ -305,7 +305,7 @@ namespace Anycubic { } } - else if (strcmp_P(error, PSTR("Err: MINTEMP")) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_ERR_MINTEMP)) == 0) { if (strcmp_P(component, PSTR("Bed")) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_NTC); @@ -317,7 +317,7 @@ namespace Anycubic { } } - else if (strcmp_P(error, PSTR("Err: MAXTEMP")) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_ERR_MAXTEMP)) == 0) { if (strcmp_P(component, PSTR("Bed")) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_NTC); @@ -329,7 +329,7 @@ namespace Anycubic { } } - else if (strcmp_P(error, PSTR("THERMAL RUNAWAY")) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_ERR_THERMAL_RUNAWAY)) == 0) { if (strcmp_P(component, PSTR("Bed")) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_HEATER); @@ -341,7 +341,7 @@ namespace Anycubic { } } - else if (strcmp_P(error, PSTR("Homing Failed")) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_KILL_HOMING_FAILED)) == 0) { if (strcmp_P(component, PSTR("X")) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_X_ENDSTOP); diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 0d2b96d5a459..d1f7a1d39160 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -167,11 +167,11 @@ namespace LanguageNarrow_an { LSTR MSG_BABYSTEP_Z = _UxGT("Micropaso Z"); LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Error: en calentar"); - LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Error: temperatura"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("Error de temperatura"); - LSTR MSG_ERR_MAXTEMP = _UxGT("Error: Temp Max"); - LSTR MSG_ERR_MINTEMP = _UxGT("Error: Temp Min"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Error en calentar"); + LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Error temp adicional"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("Error de temperatura"); + LSTR MSG_ERR_MAXTEMP = _UxGT("Error Temp Max"); + LSTR MSG_ERR_MINTEMP = _UxGT("Error Temp Min"); LSTR MSG_HALTED = _UxGT("IMPRESORA ATURADA"); LSTR MSG_PLEASE_RESET = _UxGT("Per favor reinic."); LSTR MSG_HEATING = _UxGT("Calentando..."); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 7a83da7d4e54..b35ab4084df9 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -158,9 +158,9 @@ namespace LanguageNarrow_ca { LSTR MSG_BABYSTEP_Z = _UxGT("Micropas Z"); LSTR MSG_BABYSTEP_N = _UxGT("Micropas @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancel. Endstop"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Error al escalfar"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Error al escalfar"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP REDUNDANT"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err: TEMP MAXIMA"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: TEMP MINIMA"); LSTR MSG_HALTED = _UxGT("IMPRESSORA PARADA"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index ba54eb051e29..ac1c81580df1 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -397,11 +397,9 @@ namespace LanguageNarrow_cz { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Celkem"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop abort"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Chyba zahřívání"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Chyba zahřívání"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("REDUND. TEPLOTA"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("TEPLOTNÍ ÚNIK"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("TEPL. ÚNIK PODL."); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("TEPL. ÚNIK KOMORA"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("TEPLOTNÍ ÚNIK"); LSTR MSG_ERR_MAXTEMP = _UxGT("VYSOKÁ TEPLOTA"); LSTR MSG_ERR_MINTEMP = _UxGT("NÍZKA TEPLOTA"); LSTR MSG_HALTED = _UxGT("TISK. ZASTAVENA"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 6a7bcad59823..89466f89e589 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -139,9 +139,9 @@ namespace LanguageNarrow_da { LSTR MSG_ZPROBE_OUT = _UxGT("Probe udenfor plade"); LSTR MSG_BLTOUCH_SELFTEST = _UxGT("BLTouch Selv-Test"); LSTR MSG_HOME_FIRST = _UxGT("Home %s først"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Opvarmning fejlet"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Opvarmning fejlet"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Fejl: reserve temp"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("Temp løber løbsk"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("Temp løber løbsk"); LSTR MSG_ERR_MAXTEMP = _UxGT("Fejl: Maks temp"); LSTR MSG_ERR_MINTEMP = _UxGT("Fejl: Min temp"); LSTR MSG_HALTED = _UxGT("PRINTER STOPPET"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 30e2521d2302..beb878631f24 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -546,14 +546,11 @@ namespace LanguageNarrow_de { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Abbr. mit Endstopp"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("HEIZEN ERFOLGLOS"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("HEIZEN ERFOLGLOS"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("REDUND. TEMP-ABWEI."); - LSTR MSG_THERMAL_RUNAWAY = " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); - LSTR MSG_TEMP_MALFUNCTION = _UxGT("TEMP-FEHLER"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("BETT") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("GEH.") " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("Kühler Runaway"); - LSTR MSG_COOLING_FAILED = _UxGT("Kühlung fehlgeschla."); + LSTR MSG_ERR_THERMAL_RUNAWAY = " " LCD_STR_THERMOMETER _UxGT(" NICHT ERREICHT"); + LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("TEMP-FEHLER"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("Kühlung fehlgeschla."); LSTR MSG_ERR_MAXTEMP = " " LCD_STR_THERMOMETER _UxGT(" ÜBERSCHRITTEN"); LSTR MSG_ERR_MINTEMP = " " LCD_STR_THERMOMETER _UxGT(" UNTERSCHRITTEN"); LSTR MSG_HALTED = _UxGT("DRUCKER GESTOPPT"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 0a8e50109b6e..6809b72256f4 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -192,10 +192,10 @@ namespace LanguageNarrow_el { LSTR MSG_BABYSTEP_Y = _UxGT("Μικρό βήμα Υ"); LSTR MSG_BABYSTEP_Z = _UxGT("Μικρό βήμα Ζ"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Ακύρωση endstop"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Αποτυχία θέρμανσης"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Αποτυχία θέρμανσης"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("ΘΕΡΜΙΚΗ ΔΙΑΦΥΓΗ"); - LSTR MSG_TEMP_MALFUNCTION = _UxGT("ΘΕΡΜΙΚΗ ΔΥΣΛΕΙΤΟΥΡΓΙΑ"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ΘΕΡΜΙΚΗ ΔΙΑΦΥΓΗ"); + LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("ΘΕΡΜΙΚΗ ΔΥΣΛΕΙΤΟΥΡΓΙΑ"); LSTR MSG_ERR_MAXTEMP = _UxGT("ΠΕΡΙΤΤΗ ΘΕΡΜΟΚΡΑΣΙΑ"); LSTR MSG_ERR_MINTEMP = _UxGT("ΑΝΕΠΑΡΚΗΣ ΘΕΡΜΟΚΡΑΣΙΑ"); LSTR MSG_HALTED = _UxGT("Εκτυπωτής διεκόπη"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index e766ecb941d6..65d6c194e088 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -182,9 +182,9 @@ namespace LanguageNarrow_el_gr { LSTR MSG_BABYSTEP_Y = _UxGT("Μικρό βήμα Υ"); LSTR MSG_BABYSTEP_Z = _UxGT("Μικρό βήμα Ζ"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Ματαίωση endstop "); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Ανεπιτυχής θέρμανση"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Ανεπιτυχής θέρμανση"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Λάθος: ΠΛΕΟΝΑΖΟΥΣΑ ΘΕΡΜΟΤΗΤΑ"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ΔΙΑΦΥΓΗ ΘΕΡΜΟΤΗΤΑΣ"); LSTR MSG_ERR_MAXTEMP = _UxGT("Λάθος: ΜΕΓΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"); LSTR MSG_ERR_MINTEMP = _UxGT("Λάθος: ΕΛΑΧΙΣΤΗ ΘΕΡΜΟΤΗΤΑ"); LSTR MSG_HEATING = _UxGT("Θερμαίνεται…"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 9fdc33e5f202..d6a5915dcc06 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -113,7 +113,7 @@ namespace LanguageNarrow_en { LSTR MSG_HOME_OFFSET_Y = _UxGT("Home Offset Y"); LSTR MSG_HOME_OFFSET_Z = _UxGT("Home Offset Z"); LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Offsets Applied"); - LSTR MSG_ERR_M428_TOO_FAR = _UxGT("Err: Too far!"); + LSTR MSG_ERR_M428_TOO_FAR = _UxGT("MIN/MAX Too Far"); LSTR MSG_TRAMMING_WIZARD = _UxGT("Tramming Wizard"); LSTR MSG_SELECT_ORIGIN = _UxGT("Select Origin"); LSTR MSG_LAST_VALUE_SP = _UxGT("Last value "); @@ -271,8 +271,8 @@ namespace LanguageNarrow_en { LSTR MSG_MESH_SAVED = _UxGT("Mesh %i Saved"); LSTR MSG_MESH_ACTIVE = _UxGT("Mesh %i active"); LSTR MSG_UBL_NO_STORAGE = _UxGT("No Storage"); - LSTR MSG_UBL_SAVE_ERROR = _UxGT("Err: UBL Save"); - LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Err: UBL Restore"); + LSTR MSG_UBL_SAVE_ERROR = _UxGT("UBL Save Error"); + LSTR MSG_UBL_RESTORE_ERROR = _UxGT("UBL Restore Error"); LSTR MSG_UBL_Z_OFFSET = _UxGT("Z-Offset: "); LSTR MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Z-Offset Stopped"); LSTR MSG_UBL_STEP_BY_STEP_MENU = _UxGT("Step-By-Step UBL"); @@ -611,14 +611,11 @@ namespace LanguageNarrow_en { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Heating Failed"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: REDUNDANT TEMP"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); - LSTR MSG_TEMP_MALFUNCTION = _UxGT("TEMP MALFUNCTION"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("BED THERMAL RUNAWAY"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("CHAMBER T. RUNAWAY"); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("Cooler Runaway"); - LSTR MSG_COOLING_FAILED = _UxGT("Cooling Failed"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); + LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("TEMP MALFUNCTION"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("Cooling Failed"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err: MAXTEMP"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: MINTEMP"); LSTR MSG_HALTED = _UxGT("PRINTER HALTED"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 3726e25270fb..1c2269d8d92d 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -187,8 +187,8 @@ namespace LanguageNarrow_es { LSTR MSG_MESH_LOADED = _UxGT("Malla %i Cargada"); LSTR MSG_MESH_SAVED = _UxGT("Malla %i Guardada"); LSTR MSG_UBL_NO_STORAGE = _UxGT("Sin guardar"); - LSTR MSG_UBL_SAVE_ERROR = _UxGT("Error: Guardar UBL"); - LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Error: Restaurar UBL"); + LSTR MSG_UBL_SAVE_ERROR = _UxGT("Error Guardar UBL"); + LSTR MSG_UBL_RESTORE_ERROR = _UxGT("Error Restaurar UBL"); LSTR MSG_UBL_Z_OFFSET = _UxGT("Desfase de Z: "); LSTR MSG_UBL_Z_OFFSET_STOPPED = _UxGT("Desfase de Z Parado"); LSTR MSG_UBL_STEP_BY_STEP_MENU = _UxGT("UBL Paso a Paso"); @@ -407,11 +407,9 @@ namespace LanguageNarrow_es { LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Cancelado - Endstop"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Calent. fallido"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Calent. fallido"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP. REDUN."); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("FUGA TÉRMICA"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("FUGA TÉRMICA CAMA"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("FUGA TÉRMICA CAMARA"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("FUGA TÉRMICA"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err:TEMP. MÁX"); LSTR MSG_ERR_MINTEMP = _UxGT("Err:TEMP. MIN"); LSTR MSG_HALTED = _UxGT("IMPRESORA DETENIDA"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index d96b099f3e4a..5d46b14d5073 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -240,9 +240,9 @@ namespace LanguageNarrow_eu { LSTR MSG_BABYSTEP_Z = _UxGT("Mikro-urratsa Z"); LSTR MSG_BABYSTEP_N = _UxGT("Mikro-urratsa @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop deusezta."); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Err: Beroketa"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Err: Beroketa"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: Tenperatura"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("TENP. KONTROL EZA"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("TENP. KONTROL EZA"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err: Tenp Maximoa"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: Tenp Minimoa"); LSTR MSG_HALTED = _UxGT("INPRIMA. GELDIRIK"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index c281497e9629..65b5bbc4b880 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -433,9 +433,9 @@ namespace LanguageNarrow_fr { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Butée abandon"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Err de chauffe"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Err de chauffe"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err TEMP. REDONDANTE"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("Err THERMIQUE"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("Err THERMIQUE"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err TEMP. MAX"); LSTR MSG_ERR_MINTEMP = _UxGT("Err TEMP. MIN"); diff --git a/Marlin/src/lcd/language/language_fr_na.h b/Marlin/src/lcd/language/language_fr_na.h index 05e5b061ddef..6ad854f14c24 100644 --- a/Marlin/src/lcd/language/language_fr_na.h +++ b/Marlin/src/lcd/language/language_fr_na.h @@ -433,9 +433,9 @@ namespace LanguageNarrow_fr_na { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Butee abandon"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Err de chauffe"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Err de chauffe"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err TEMP. REDONDANTE"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("Err THERMIQUE"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("Err THERMIQUE"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err TEMP. MAX"); LSTR MSG_ERR_MINTEMP = _UxGT("Err TEMP. MIN"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index b55a74bb171a..f1798748d411 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -422,11 +422,9 @@ namespace LanguageNarrow_gl { LSTR MSG_BABYSTEP_N = _UxGT("Micropaso @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Erro FinCarro"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Fallo Quentando"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Fallo Quentando"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Erro:Temp Redundante"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("FUGA TÉRMICA"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("FUGA TÉRMICA CAMA"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("FUGA TÉRMICA CÁMARA"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("FUGA TÉRMICA"); LSTR MSG_ERR_MAXTEMP = _UxGT("Erro:TEMP MÁX"); LSTR MSG_ERR_MINTEMP = _UxGT("Erro:TEMP MÍN"); LSTR MSG_HALTED = _UxGT("IMPRESORA DETIDA"); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 8480708e7895..678d9c290a9b 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -120,7 +120,7 @@ namespace LanguageNarrow_hr { LSTR MSG_FILAMENTCHANGE_E = _UxGT("Promijeni filament *"); LSTR MSG_ATTACH_MEDIA = _UxGT("Init. SD karticu"); LSTR MSG_CHANGE_MEDIA = _UxGT("Promijeni SD karticu"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Grijanje neuspješno"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Grijanje neuspješno"); LSTR MSG_HEATING = _UxGT("Grijanje..."); LSTR MSG_BED_HEATING = _UxGT("Grijanje Bed-a..."); LSTR MSG_DELTA_CALIBRATE = _UxGT("Delta Kalibracija"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 39ee0fc558a3..a371fc5a4329 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -479,13 +479,10 @@ namespace LanguageNarrow_hu { LSTR MSG_BABYSTEP_N = _UxGT("Mikrolépés @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Teljes"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Végállás megszakítva!"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Fütés hiba!"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Fütés hiba!"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Hiba: SZÜKSÉGTELEN HÖFOK"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("FÜTÉS KIMARADÁS"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("ÁGY FÜTÉS KIMARADÁS"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("KAMRA FÜTÉS KIMARADÁS"); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("Hütés kimaradás"); - LSTR MSG_COOLING_FAILED = _UxGT("Hütés sikertelen"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("FÜTÉS KIMARADÁS"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("Hütés sikertelen"); LSTR MSG_ERR_MAXTEMP = _UxGT("Hiba: MAX höfok"); LSTR MSG_ERR_MINTEMP = _UxGT("Hiba: MIN höfok"); LSTR MSG_HALTED = _UxGT("A NYOMTATÓ LEÁLLT"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 9c78918fcf23..9e3776d36b8e 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -591,14 +591,11 @@ namespace LanguageNarrow_it { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Totali"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Interrompi se FC"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Risc.Fallito"); // Max 12 characters + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Risc.Fallito"); // Max 12 characters LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: TEMP RIDONDANTE"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("TEMP FUORI CONTROLLO"); - LSTR MSG_TEMP_MALFUNCTION = _UxGT("MALFUNZIONAMENTO TEMP"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("TEMP PIAT.FUORI CTRL"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("T.CAMERA FUORI CTRL"); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("RAFFREDAM.FUORI CTRL"); - LSTR MSG_COOLING_FAILED = _UxGT("Raffreddam. fallito"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("TEMP FUORI CONTROLLO"); + LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("MALFUNZIONAMENTO TEMP"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("Raffreddam. fallito"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err: TEMP MASSIMA"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: TEMP MINIMA"); LSTR MSG_HALTED = _UxGT("STAMPANTE FERMATA"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index d40b972427f0..e75ebeb1231e 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -181,9 +181,9 @@ namespace LanguageNarrow_jp_kana { LSTR MSG_BABYSTEP_Y = _UxGT("Yジク ビドウ"); // "Babystep Y" LSTR MSG_BABYSTEP_Z = _UxGT("Zジク ビドウ"); // "Babystep Z" LSTR MSG_ENDSTOP_ABORT = _UxGT("イドウゲンカイケンチキノウ"); // "Endstop abort" - LSTR MSG_HEATING_FAILED_LCD = _UxGT("カネツシッパイ"); // "Heating failed" + LSTR MSG_ERR_HEATING_FAILED = _UxGT("カネツシッパイ"); // "Heating failed" LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("エラー:ジョウチョウサーミスターキノウ"); // "Err: REDUNDANT TEMP" - LSTR MSG_THERMAL_RUNAWAY = _UxGT("ネツボウソウ"); // "THERMAL RUNAWAY" + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ネツボウソウ"); // "THERMAL RUNAWAY" LSTR MSG_ERR_MAXTEMP = _UxGT("エラー:サイコウオンチョウカ"); // "Err: MAXTEMP" LSTR MSG_ERR_MINTEMP = _UxGT("エラー:サイテイオンミマン"); // "Err: MINTEMP" LSTR MSG_HALTED = _UxGT("プリンターハテイシシマシタ"); // "PRINTER HALTED" diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 85b484a10050..215e5b83ba94 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -159,9 +159,9 @@ namespace LanguageNarrow_nl { LSTR MSG_BABYSTEP_Z = _UxGT("Babystap Z"); LSTR MSG_BABYSTEP_N = _UxGT("Babystap @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop afbr."); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Voorverw. fout"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Voorverw. fout"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Redun. temp fout"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("Therm. wegloop"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("Therm. wegloop"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err: Max. temp"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: Min. temp"); LSTR MSG_HALTED = _UxGT("PRINTER GESTOPT"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 4efc1720dbc2..f9f60ef37ca2 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -377,11 +377,9 @@ namespace LanguageNarrow_pl { LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Przesuń dyszę do stołu"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Łącznie"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Błąd krańcówki"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Rozgrz. nieudane"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Rozgrz. nieudane"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Błąd temperatury"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("ZANIK TEMPERATURY"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("ZANIK TEMP. STOŁU"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ZANIK TEMP.KOMORY"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ZANIK TEMPERATURY"); LSTR MSG_ERR_MAXTEMP = _UxGT("Błąd: MAXTEMP"); LSTR MSG_ERR_MINTEMP = _UxGT("Błąd: MINTEMP"); LSTR MSG_HALTED = _UxGT("Drukarka zatrzym."); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index e339c8afd444..3a2329f8aed2 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -148,7 +148,7 @@ namespace LanguageNarrow_pt { LSTR MSG_ZPROBE_OUT = _UxGT("Sensor fora/base"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Desvio Z"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Fim de curso"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Aquecimento falhou"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err: T Máxima"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: T Mínima"); LSTR MSG_HEATING = _UxGT("Aquecendo..."); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 14b057d98021..30459454b786 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -349,11 +349,9 @@ namespace LanguageNarrow_pt_br { LSTR MSG_BABYSTEP_N = _UxGT("Passinho @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Abortar Fim de Curso"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Aquecimento falhou"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Aquecimento falhou"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Erro:Temp Redundante"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("ESCAPE TÉRMICO"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("ESCAPE TÉRMICO MESA"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ESCAPE TÉRMICO CAMARA"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ESCAPE TÉRMICO"); LSTR MSG_ERR_MAXTEMP = _UxGT("Erro:Temp Máxima"); LSTR MSG_ERR_MINTEMP = _UxGT("Erro:Temp Mínima"); LSTR MSG_HALTED = _UxGT("IMPRESSORA PAROU"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index 579c7eb22467..a2a915dd77c7 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -428,11 +428,9 @@ namespace LanguageNarrow_ro { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop Abort"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Heating Failed"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Heating Failed"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Err: REDUNDANT TEMP"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("BED THERMAL RUNAWAY"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("CHAMBER T. RUNAWAY"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("THERMAL RUNAWAY"); LSTR MSG_ERR_MAXTEMP = _UxGT("Err: MAXTEMP"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: MINTEMP"); LSTR MSG_HALTED = _UxGT("PRINTER HALTED"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 46bace2ad96b..789af09ab5d2 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -484,12 +484,9 @@ namespace LanguageNarrow_ru { LSTR MSG_BABYSTEP_N = _UxGT("Микрошаг @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Суммарно"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Сработал концевик"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Разогрев не удался"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("УТЕЧКА ТЕМПЕРАТУРЫ"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("УТЕЧКА ТЕМП. СТОЛА"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("УТЕЧКА ТЕМП. КАМЕРЫ"); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("УТЕЧКА ТЕМП. КУЛЕРА"); - LSTR MSG_COOLING_FAILED = _UxGT("НЕ УДАЛОСЬ ОХЛАДИТЬ"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Разогрев не удался"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("УТЕЧКА ТЕМПЕРАТУРЫ"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("НЕ УДАЛОСЬ ОХЛАДИТЬ"); LSTR MSG_ERR_MAXTEMP = _UxGT("Ошибка: Т макс."); LSTR MSG_ERR_MINTEMP = _UxGT("Ошибка: Т мин."); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Ошибка: Т контр."); @@ -784,7 +781,7 @@ namespace LanguageNarrow_ru { LSTR MSG_ZPROBE_MARGIN = _UxGT("Отступы зонда"); LSTR MSG_Z_FEED_RATE = _UxGT("Скорость Z"); LSTR MSG_ENABLE_HS_MODE = _UxGT("Включить режим ВС"); - LSTR MSG_TEMP_MALFUNCTION = _UxGT("СБОЙ ТЕМПЕРАТУРЫ"); + LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("СБОЙ ТЕМПЕРАТУРЫ"); LSTR MSG_PLEASE_WAIT = _UxGT("Ожидайте..."); LSTR MSG_PREHEATING = _UxGT("Нагреваю..."); LSTR MSG_DELTA_CALIBRATION_IN_PROGRESS = _UxGT("Делаю дельта-калибровку"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 290b0cdcde29..fa353523072b 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -588,14 +588,11 @@ namespace LanguageNarrow_sk { LSTR MSG_BABYSTEP_N = _UxGT("Babystep @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Celkom"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Zastavenie Endstop"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Chyba ohrevu"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Chyba ohrevu"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Chyba: REDUND. TEP."); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("TEPLOTNÝ SKOK"); - LSTR MSG_TEMP_MALFUNCTION = _UxGT("TEPLOTNÁ PORUCHA"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("TEPLOTNÝ SKOK PODL."); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("TEPLOTNÝ SKOK KOMO."); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("TEPLOTNÝ SKOK CHLAD."); - LSTR MSG_COOLING_FAILED = _UxGT("Ochladz. zlyhalo"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("TEPLOTNÝ SKOK"); + LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("TEPLOTNÁ PORUCHA"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("Ochladz. zlyhalo"); LSTR MSG_ERR_MAXTEMP = _UxGT("Chyba: MAXTEMP"); LSTR MSG_ERR_MINTEMP = _UxGT("Chyba: MINTEMP"); LSTR MSG_HALTED = _UxGT("TLAČIAREŇ ZASTAVENÁ"); diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index ea3c1c61dd21..9820882b8daa 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -462,11 +462,9 @@ namespace LanguageNarrow_sv { LSTR MSG_BABYSTEP_N = _UxGT("Småsteg @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Total"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Slutstopp Avbrott"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Värma Misslyckad"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Värma Misslyckad"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Fel: REDUNDANT TEMP"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("TERMISK ÖVERDRIFT"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("BÄDD TERMISK ÖVERDRIFT"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("KAMMARE T. ÖVERDRIFT"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("TERMISK ÖVERDRIFT"); LSTR MSG_ERR_MAXTEMP = _UxGT("Fel: MAXTEMP"); LSTR MSG_ERR_MINTEMP = _UxGT("Fel: MINTEMP"); LSTR MSG_HALTED = _UxGT("Utskrift stoppad"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index a6a75a2acef6..e912885ee894 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -566,14 +566,11 @@ namespace LanguageNarrow_tr { LSTR MSG_BABYSTEP_N = _UxGT("Miniadım @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Toplam"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Endstop iptal"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Isınma başarısız"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Isınma başarısız"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Hata: ISI AŞIMI"); - LSTR MSG_THERMAL_RUNAWAY = _UxGT("ISI SORUNU"); - LSTR MSG_TEMP_MALFUNCTION = _UxGT("SICAKLIK ARIZASI"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("TABLA ISI SORUNU"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("KABİN ISI SORUNU"); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("Soğutucu Isı Sorunu"); - LSTR MSG_COOLING_FAILED = _UxGT("Soğutma Başarısız"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ISI SORUNU"); + LSTR MSG_ERR_TEMP_MALFUNCTION = _UxGT("SICAKLIK ARIZASI"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("Soğutma Başarısız"); LSTR MSG_ERR_MAXTEMP = _UxGT("Hata: MAX.SICAKLIK"); LSTR MSG_ERR_MINTEMP = _UxGT("Hata: MIN.SICAKLIK"); LSTR MSG_HALTED = _UxGT("YAZICI DURDURULDU"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 78e91b0484e3..626eb8979eb5 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -490,13 +490,10 @@ namespace LanguageNarrow_uk { LSTR MSG_BABYSTEP_N = _UxGT("Мікрокрок @"); LSTR MSG_BABYSTEP_TOTAL = _UxGT("Сумарно"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Кінцевик спрацював"); - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Збій нагріву"); + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Збій нагріву"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("ЗАВИЩЕНА Т") LCD_STR_DEGREE; - LSTR MSG_THERMAL_RUNAWAY = _UxGT("ВИТІК ТЕПЛА"); - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("ВИТІК ТЕПЛА СТОЛУ"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ВИТІК ТЕПЛА КАМЕРИ"); - LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("ВИТІК ОХОЛОДЖЕННЯ"); - LSTR MSG_COOLING_FAILED = _UxGT("ОХОЛОДЖ. НЕ ВДАЛОСЬ"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("ВИТІК ТЕПЛА"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("ОХОЛОДЖ. НЕ ВДАЛОСЬ"); LSTR MSG_ERR_MAXTEMP = _UxGT("МАКСИМАЛЬНА Т") LCD_STR_DEGREE; LSTR MSG_ERR_MINTEMP = _UxGT("МІНІМАЛЬНА Т") LCD_STR_DEGREE; LSTR MSG_HALTED = _UxGT("ПРИНТЕР ЗУПИНЕНО"); @@ -754,7 +751,7 @@ namespace LanguageWide_uk { LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Швидкість втягув."); LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти вентилятора"); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час вентилятора"); - LSTR MSG_COOLING_FAILED = _UxGT("ОХОЛОДЖЕННЯ НЕ ВДАЛОСЬ"); + LSTR MSG_ERR_COOLING_FAILED = _UxGT("ОХОЛОДЖЕННЯ НЕ ВДАЛОСЬ"); LSTR MSG_BED_COOLING = _UxGT("Охолодження столу..."); LSTR MSG_PROBE_COOLING = _UxGT("Охолодження зонду..."); LSTR MSG_CHAMBER_COOLING = _UxGT("Охолодження камери..."); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index d37358219d5d..038c6864bc17 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -331,10 +331,9 @@ namespace LanguageNarrow_vi { LSTR MSG_BABYSTEP_Z = _UxGT("Nhít Z"); LSTR MSG_BABYSTEP_N = _UxGT("Nhít @"); LSTR MSG_ENDSTOP_ABORT = _UxGT("Hủy bỏ công tắc"); // Endstop abort - LSTR MSG_HEATING_FAILED_LCD = _UxGT("Sưởi đầu phun không thành công"); // Heating failed + LSTR MSG_ERR_HEATING_FAILED = _UxGT("Sưởi đầu phun không thành công"); // Heating failed LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Điều sai: nhiệt độ dư"); // Err: REDUNDANT TEMP - LSTR MSG_THERMAL_RUNAWAY = _UxGT("Vấn đề nhiệt"); // THERMAL RUNAWAY | problem - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("Vấn đề nhiệt bàn"); // BED THERMAL RUNAWAY + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("Vấn đề nhiệt"); // THERMAL RUNAWAY | problem LSTR MSG_ERR_MAXTEMP = _UxGT("Điều sai: nhiệt độ tối đa"); // Err: MAXTEMP LSTR MSG_ERR_MINTEMP = _UxGT("Điều sai: nhiệt độ tối thiểu"); // Err: MINTEMP LSTR MSG_HALTED = _UxGT("MÁY IN ĐÃ DỪNG LẠI"); // PRINTER HALTED diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 7f4d5af37456..7432044cdb50 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -427,11 +427,9 @@ namespace LanguageNarrow_zh_CN { LSTR MSG_BABYSTEP_Z = _UxGT("微量调整Z轴"); // "Babystep Z" LSTR MSG_BABYSTEP_TOTAL = _UxGT("总计"); LSTR MSG_ENDSTOP_ABORT = _UxGT("挡块终止"); // "Endstop abort" - LSTR MSG_HEATING_FAILED_LCD = _UxGT("加热失败"); // "Heating failed" + LSTR MSG_ERR_HEATING_FAILED = _UxGT("加热失败"); // "Heating failed" LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("错误:冗余温度"); // "Err: REDUNDANT TEMP" - LSTR MSG_THERMAL_RUNAWAY = _UxGT("温控失控"); // "THERMAL RUNAWAY" - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("热床热量失控"); - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("机箱热量失控"); + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("温控失控"); // "THERMAL RUNAWAY" LSTR MSG_ERR_MAXTEMP = _UxGT("错误:最高温度"); // "Err: MAXTEMP" LSTR MSG_ERR_MINTEMP = _UxGT("错误:最低温度"); // "Err: MINTEMP" LSTR MSG_HALTED = _UxGT("打印停机"); // "PRINTER HALTED" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index b22a3cd1ac92..9106487b1459 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -377,11 +377,9 @@ namespace LanguageNarrow_zh_TW { LSTR MSG_BABYSTEP_Z = _UxGT("微量調整Z軸"); // "Babystep Z" LSTR MSG_BABYSTEP_TOTAL = _UxGT("總計"); // "Total" LSTR MSG_ENDSTOP_ABORT = _UxGT("擋塊終止"); // "Endstop abort" - LSTR MSG_HEATING_FAILED_LCD = _UxGT("加熱失敗"); // "Heating failed" + LSTR MSG_ERR_HEATING_FAILED = _UxGT("加熱失敗"); // "Heating failed" LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("錯誤:冗餘溫度"); // "Err: REDUNDANT TEMP" - LSTR MSG_THERMAL_RUNAWAY = _UxGT("溫度失控"); // "THERMAL RUNAWAY" - LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("熱床溫度失控"); // "BED THERMAL RUNAWAY" - LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("機箱溫度失控"); // "CHAMBER T. RUNAWAY" + LSTR MSG_ERR_THERMAL_RUNAWAY = _UxGT("溫度失控"); // "THERMAL RUNAWAY" LSTR MSG_ERR_MAXTEMP = _UxGT("錯誤:最高溫度"); // "Err: MAXTEMP" LSTR MSG_ERR_MINTEMP = _UxGT("錯誤:最低溫度"); // "Err: MINTEMP" LSTR MSG_HALTED = _UxGT("印表機停機"); // "PRINTER HALTED" diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 6139ebe12004..b2e2915d17d0 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -207,32 +207,8 @@ Temperature thermalManager; PGMSTR(str_t_thermal_runaway, STR_T_THERMAL_RUNAWAY); -PGMSTR(str_t_temp_malfunction, STR_T_MALFUNCTION); PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED); -/** - * Macros to include the heater id in temp errors. The compiler's dead-code - * elimination should (hopefully) optimize out the unused strings. - */ - -#if HAS_HEATED_BED - #define _BED_FSTR(h) (h) == H_BED ? GET_TEXT_F(MSG_BED) : -#else - #define _BED_FSTR(h) -#endif -#if HAS_HEATED_CHAMBER - #define _CHAMBER_FSTR(h) (h) == H_CHAMBER ? GET_TEXT_F(MSG_CHAMBER) : -#else - #define _CHAMBER_FSTR(h) -#endif -#if HAS_COOLER - #define _COOLER_FSTR(h) (h) == H_COOLER ? GET_TEXT_F(MSG_COOLER) : -#else - #define _COOLER_FSTR(h) -#endif -#define _E_FSTR(h,N) ((HOTENDS) > N && (h) == N) ? F(STR_E##N) : -#define HEATER_FSTR(h) _BED_FSTR(h) _CHAMBER_FSTR(h) _COOLER_FSTR(h) _E_FSTR(h,1) _E_FSTR(h,2) _E_FSTR(h,3) _E_FSTR(h,4) _E_FSTR(h,5) _E_FSTR(h,6) _E_FSTR(h,7) F(STR_E0) - // // Initialize MAX TC objects/SPI // @@ -839,10 +815,10 @@ volatile bool Temperature::raw_temps_ready = false; if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached } else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired - _TEMP_ERROR(heater_id, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, current_temp); + _TEMP_ERROR(heater_id, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, current_temp); } else if (current_temp < target - (MAX_OVERSHOOT_PID_AUTOTUNE)) // Heated, then temperature fell too far? - _TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_THERMAL_RUNAWAY, current_temp); + _TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_ERR_THERMAL_RUNAWAY, current_temp); } #endif } // every 2 seconds @@ -1464,6 +1440,15 @@ inline void loud_kill(FSTR_P const lcd_msg, const heater_id_t heater_id) { planner.synchronize(); } #endif + + #define _FSTR_BED(h) TERN(HAS_HEATED_BED, (h) == H_BED ? GET_TEXT_F(MSG_BED) :,) + #define _FSTR_CHAMBER(h) TERN(HAS_HEATED_CHAMBER, (h) == H_CHAMBER ? GET_TEXT_F(MSG_CHAMBER) :,) + #define _FSTR_COOLER(h) TERN(HAS_COOLER, (h) == H_COOLER ? GET_TEXT_F(MSG_COOLER) :,) + #define _FSTR_E(h,N) TERN(HAS_HOTEND, ((h) == N && (HOTENDS) > N) ? F(STR_E##N) :,) + #define HEATER_FSTR(h) _FSTR_BED(h) _FSTR_CHAMBER(h) _FSTR_COOLER(h) \ + _FSTR_E(h,1) _FSTR_E(h,2) _FSTR_E(h,3) _FSTR_E(h,4) \ + _FSTR_E(h,5) _FSTR_E(h,6) _FSTR_E(h,7) F(STR_E0) + kill(lcd_msg, HEATER_FSTR(heater_id)); } @@ -1765,7 +1750,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T start_watching_hotend(e); // If temp reached, turn off elapsed check else { TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); - _TEMP_ERROR(e, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, temp); + _TEMP_ERROR(e, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, temp); } } #endif @@ -1795,7 +1780,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T start_watching_bed(); // If temp reached, turn off elapsed check else { TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); - _TEMP_ERROR(H_BED, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, deg); + _TEMP_ERROR(H_BED, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, deg); } } } @@ -1890,7 +1875,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (watch_chamber.check(deg)) // Increased enough? Error below. start_watching_chamber(); // If temp reached, turn off elapsed check. else - _TEMP_ERROR(H_CHAMBER, FPSTR(str_t_heating_failed), MSG_HEATING_FAILED_LCD, deg); + _TEMP_ERROR(H_CHAMBER, FPSTR(str_t_heating_failed), MSG_ERR_HEATING_FAILED, deg); } } #endif @@ -2019,7 +2004,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id OPTARG(ERR_INCLUDE_T if (watch_cooler.elapsed(ms)) { // Time to check the cooler? const auto deg = degCooler(); if (deg > watch_cooler.target) // Failed to decrease enough? - _TEMP_ERROR(H_COOLER, GET_TEXT_F(MSG_COOLING_FAILED), MSG_COOLING_FAILED, deg); + _TEMP_ERROR(H_COOLER, GET_EN_TEXT_F(MSG_ERR_COOLING_FAILED), MSG_ERR_COOLING_FAILED, deg); else start_watching_cooler(); // Start again if the target is still far off } @@ -3221,13 +3206,13 @@ void Temperature::init() { case TRRunaway: TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); - _TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_THERMAL_RUNAWAY, current); + _TEMP_ERROR(heater_id, FPSTR(str_t_thermal_runaway), MSG_ERR_THERMAL_RUNAWAY, current); break; #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR) case TRMalfunction: TERN_(HAS_DWIN_E3V2_BASIC, dwinPopupTemperature(0)); - _TEMP_ERROR(heater_id, FPSTR(str_t_temp_malfunction), MSG_TEMP_MALFUNCTION, current); + _TEMP_ERROR(heater_id, F(STR_T_THERMAL_MALFUNCTION), MSG_ERR_TEMP_MALFUNCTION, current); break; #endif } From fb74caebb5d9e17c5b6c369cbc8965130e1ec93f Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:40:59 -0700 Subject: [PATCH 041/268] =?UTF-8?q?=F0=9F=94=A7=20Fix=20Linear=20Leveling?= =?UTF-8?q?=20grid=20size=20sanity=20check=20(#26199)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index cfc3b20cd501..c68f85720e9a 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1504,46 +1504,26 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L * Bed Leveling Requirements */ -#if ENABLED(AUTO_BED_LEVELING_UBL) - - /** - * Unified Bed Leveling - */ - - #if IS_SCARA - #error "AUTO_BED_LEVELING_UBL does not yet support SCARA printers." - #elif ENABLED(POLAR) +#if IS_SCARA && ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL) + #error "SCARA machines can only use AUTO_BED_LEVELING_BILINEAR or MESH_BED_LEVELING leveling." +#elif ENABLED(AUTO_BED_LEVELING_LINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 2, 255) && WITHIN(GRID_MAX_POINTS_Y, 2, 255)) + #error "GRID_MAX_POINTS_[XY] must be between 2 and 255 with AUTO_BED_LEVELING_LINEAR." +#elif ENABLED(AUTO_BED_LEVELING_BILINEAR) && !(WITHIN(GRID_MAX_POINTS_X, 3, 255) && WITHIN(GRID_MAX_POINTS_Y, 3, 255)) + #error "GRID_MAX_POINTS_[XY] must be between 3 and 255 with AUTO_BED_LEVELING_BILINEAR." +#elif ENABLED(AUTO_BED_LEVELING_UBL) + #if ENABLED(POLAR) #error "AUTO_BED_LEVELING_UBL does not yet support POLAR printers." #elif DISABLED(EEPROM_SETTINGS) #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 255) || !WITHIN(GRID_MAX_POINTS_Y, 3, 255) #error "GRID_MAX_POINTS_[XY] must be between 3 and 255." #endif - -#elif HAS_ABL_NOT_UBL - - /** - * Auto Bed Leveling - */ - - /** - * Delta and SCARA have limited bed leveling options - */ - #if IS_SCARA && DISABLED(AUTO_BED_LEVELING_BILINEAR) - #error "SCARA machines can only use the AUTO_BED_LEVELING_BILINEAR leveling option." - #elif ABL_USES_GRID && !(WITHIN(GRID_MAX_POINTS_X, 3, 255) && WITHIN(GRID_MAX_POINTS_Y, 3, 255)) - #error "GRID_MAX_POINTS_[XY] must be between 3 and 255." - #endif - #elif ENABLED(MESH_BED_LEVELING) - - // Mesh Bed Leveling #if ENABLED(DELTA) #error "MESH_BED_LEVELING is not compatible with DELTA printers." #elif (GRID_MAX_POINTS_X) > 9 || (GRID_MAX_POINTS_Y) > 9 #error "GRID_MAX_POINTS_X and GRID_MAX_POINTS_Y must be less than 10 for MBL." #endif - #endif #define _POINT_COUNT (defined(PROBE_PT_1) + defined(PROBE_PT_2) + defined(PROBE_PT_3)) From ab8af7fa9cb7007ac710f62137e91f73446f8b60 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 22 Aug 2023 19:16:35 -0500 Subject: [PATCH 042/268] =?UTF-8?q?=F0=9F=94=A7=20Allow=20arbitrary=20BLOC?= =?UTF-8?q?K=5FBUFFER=5FSIZE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 1 - Marlin/src/feature/max7219.cpp | 2 +- Marlin/src/module/planner.h | 10 +++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index da9f3a66c688..b95b0c49e0c4 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2526,7 +2526,6 @@ // @section motion // 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 #elif HAS_MEDIA diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp index 991f3e79db95..e27f6eb974da 100644 --- a/Marlin/src/feature/max7219.cpp +++ b/Marlin/src/feature/max7219.cpp @@ -706,7 +706,7 @@ void Max7219::idle_tasks() { #ifdef MAX7219_DEBUG_PLANNER_QUEUE static int16_t last_depth = 0; - const int16_t current_depth = (head - tail + BLOCK_BUFFER_SIZE) & (BLOCK_BUFFER_SIZE - 1) & 0xF; + const int16_t current_depth = BLOCK_MOD(head - tail + (BLOCK_BUFFER_SIZE)) & 0xF; if (current_depth != last_depth) { quantity16(MAX7219_DEBUG_PLANNER_QUEUE, last_depth, current_depth, &row_change_mask); last_depth = current_depth; diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index c45ff6ad1d1d..238657be7b36 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -310,7 +310,11 @@ typedef struct PlannerBlock { #define HAS_POSITION_FLOAT 1 #endif -#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1)) +#if IS_POWER_OF_2(BLOCK_BUFFER_SIZE) + #define BLOCK_MOD(n) ((n)&((BLOCK_BUFFER_SIZE)-1)) +#else + #define BLOCK_MOD(n) ((n)%(BLOCK_BUFFER_SIZE)) +#endif #if ENABLED(LASER_FEATURE) typedef struct { @@ -366,7 +370,7 @@ typedef struct { #endif #if ENABLED(DISABLE_OTHER_EXTRUDERS) - typedef uvalue_t(BLOCK_BUFFER_SIZE * 2) last_move_t; + typedef uvalue_t((BLOCK_BUFFER_SIZE) * 2) last_move_t; #endif #if ENABLED(ARC_SUPPORT) @@ -780,7 +784,7 @@ class Planner { FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); } // Get count of movement slots free - FORCE_INLINE static uint8_t moves_free() { return BLOCK_BUFFER_SIZE - 1 - movesplanned(); } + FORCE_INLINE static uint8_t moves_free() { return (BLOCK_BUFFER_SIZE) - 1 - movesplanned(); } /** * Planner::get_next_free_block From edc737954653cd174c51cced37917ff4df2867e1 Mon Sep 17 00:00:00 2001 From: Anson Liu Date: Tue, 22 Aug 2023 20:21:41 -0400 Subject: [PATCH 043/268] =?UTF-8?q?=E2=9C=A8=20G-code=20'T'=20report=20cur?= =?UTF-8?q?rent=20tool=20(#26151)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/control/T.cpp | 12 ++++++++++-- Marlin/src/gcode/parser.cpp | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index 5e1579ec123a..c5ebbcf50e7f 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -41,13 +41,21 @@ * S1 Don't move the tool in XY after change * * For PRUSA_MMU2(S) and EXTENDABLE_EMU_MMU2(S) - * T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. - * T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically. + * T[n] G-code to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. + * T? G-code to extrude shouldn't have to follow. Load to extruder wheels is done automatically. * Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load. * Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated. */ void GcodeSuite::T(const int8_t tool_index) { + #if HAS_MULTI_EXTRUDER + // For 'T' with no parameter report the current tool. + if (parser.string_arg && *parser.string_arg == '*') { + SERIAL_ECHOLNPGM(STR_ACTIVE_EXTRUDER, active_extruder); + return; + } + #endif + DEBUG_SECTION(log_T, "T", DEBUGGING(LEVELING)); if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("...(", tool_index, ")"); diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index ccd6b4111f10..f2835f58918a 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -189,7 +189,13 @@ void GCodeParser::parse(char *p) { #endif // Bail if there's no command code number - if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) return; + if (!TERN(SIGNED_CODENUM, NUMERIC_SIGNED(*p), NUMERIC(*p))) { + if (TERN0(HAS_MULTI_EXTRUDER, letter == 'T')) { + p[0] = '*'; p[1] = '\0'; string_arg = p; // Convert 'T' alone into 'T*' + command_letter = letter; + } + return; + } // Save the command letter at this point // A '?' signifies an unknown command From f6de698fc8bf284c76a2ae09b1c7b5041c74d495 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 23 Aug 2023 00:25:27 +0000 Subject: [PATCH 044/268] [cron] Bump distribution date (2023-08-23) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index bd9b9ea7e577..464217907bb8 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-22" +//#define STRING_DISTRIBUTION_DATE "2023-08-23" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 6d1966575e9f..ea3f7c984bcf 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-22" + #define STRING_DISTRIBUTION_DATE "2023-08-23" #endif /** From 86be9a85d0f819fc0f3f6cfe743906ac3309f366 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Aug 2023 13:44:40 -0500 Subject: [PATCH 045/268] =?UTF-8?q?=F0=9F=93=9D=20Thermistor=20info=20upda?= =?UTF-8?q?tes=20(#26202)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 + Marlin/src/lcd/menu/menu_info.cpp | 79 +++------- Marlin/src/lcd/thermistornames.h | 56 ++++--- Marlin/src/module/thermistor/thermistors.h | 174 ++++++++++++--------- 4 files changed, 161 insertions(+), 150 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 119f81415a30..c00e59b5cd5d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -466,6 +466,7 @@ * 13 : 100kΩ Hisens up to 300°C - for "Simple ONE" & "All In ONE" hotend - beta 3950, 1% * 14 : 100kΩ (R25), 4092K (beta25), 4.7kΩ pull-up, bed thermistor as used in Ender-5 S1 * 15 : 100kΩ Calibrated for JGAurora A5 hotend + * 17 : 100kΩ Dagoma NTC white thermistor * 18 : 200kΩ ATC Semitec 204GT-2 Dagoma.Fr - MKS_Base_DKU001327 * 22 : 100kΩ GTM32 Pro vB - hotend - 4.7kΩ pullup to 3.3V and 220Ω to analog input * 23 : 100kΩ GTM32 Pro vB - bed - 4.7kΩ pullup to 3.3v and 220Ω to analog input @@ -477,6 +478,7 @@ * 68 : PT100 Smplifier board from Dyze Design * 70 : 100kΩ bq Hephestos 2 * 75 : 100kΩ Generic Silicon Heat Pad with NTC100K MGB18-104F39050L32 + * 666 : 200kΩ Einstart S custom thermistor with 10k pullup. * 2000 : 100kΩ Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor * * ================================================================ diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 59ed52e6f17b..874b7dbd59f6 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -100,113 +100,86 @@ void menu_info_thermistors() { START_SCREEN(); + #define THERM_ITEMS(LBL,HTR,WAT) \ + STATIC_ITEM_F(F(LBL ": " THERMISTOR_NAME), SS_INVERT); \ + PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HTR##_MINTEMP), SS_FULL); \ + PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HTR##_MAXTEMP), SS_FULL); \ + STATIC_ITEM(TERN(WAT, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL) \ + #if HAS_EXTRUDERS #define THERMISTOR_ID TEMP_SENSOR_0 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E0 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_0_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_0_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS(STR_E0, HEATER_0, WATCH_HOTENDS); #endif #if TEMP_SENSOR_1 != 0 - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_1 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E1 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_1_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_1_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + THERM_ITEMS(STR_E1, HEATER_1, WATCH_HOTENDS); #endif #if TEMP_SENSOR_2 != 0 - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_2 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E2 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_2_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_2_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS(STR_E2, HEATER_2, WATCH_HOTENDS); #endif #if TEMP_SENSOR_3 != 0 - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_3 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E3 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_3_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_3_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS(STR_E3, HEATER_3, WATCH_HOTENDS); #endif #if TEMP_SENSOR_4 != 0 - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_4 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E4 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_4_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_4_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS(STR_E4, HEATER_4, WATCH_HOTENDS); #endif #if TEMP_SENSOR_5 != 0 - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_5 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E5 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_5_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS(STR_E5, HEATER_5, WATCH_HOTENDS); #endif #if TEMP_SENSOR_6 != 0 - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_6 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E6 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_6_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_6_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS(STR_E6, HEATER_6, WATCH_HOTENDS); #endif #if TEMP_SENSOR_7 != 0 - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_7 #include "../thermistornames.h" - STATIC_ITEM_F(F(STR_E7 ": " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_7_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_7_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_HOTENDS, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS(STR_E7, HEATER_7, WATCH_HOTENDS); #endif #if HAS_HEATED_BED #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_BED #include "../thermistornames.h" - STATIC_ITEM_F(F("BED: " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(BED_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(BED_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_BED, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + THERM_ITEMS("BED", BED, WATCH_BED); #endif #if HAS_HEATED_CHAMBER - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_CHAMBER #include "../thermistornames.h" - STATIC_ITEM_F(F("CHAM: " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(CHAMBER_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(CHAMBER_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_CHAMBER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS("CHAM", CHAMBER, WATCH_CHAMBER); #endif #if HAS_COOLER - #undef THERMISTOR_ID #define THERMISTOR_ID TEMP_SENSOR_COOLER #include "../thermistornames.h" - STATIC_ITEM_F(F("COOL: " THERMISTOR_NAME), SS_INVERT); - PSTRING_ITEM(MSG_INFO_MIN_TEMP, STRINGIFY(COOLER_MINTEMP), SS_FULL); - PSTRING_ITEM(MSG_INFO_MAX_TEMP, STRINGIFY(COOLER_MAXTEMP), SS_FULL); - STATIC_ITEM(TERN(WATCH_COOLER, MSG_INFO_RUNAWAY_ON, MSG_INFO_RUNAWAY_OFF), SS_FULL); + #undef THERMISTOR_ID + THERM_ITEMS("COOL", COOLER, WATCH_COOLER); #endif END_SCREEN(); diff --git a/Marlin/src/lcd/thermistornames.h b/Marlin/src/lcd/thermistornames.h index 54542bed4ed8..71f48775bdbe 100644 --- a/Marlin/src/lcd/thermistornames.h +++ b/Marlin/src/lcd/thermistornames.h @@ -35,15 +35,17 @@ #if THERMISTOR_ID == 1000 #define THERMISTOR_NAME "User Parameters" -// Thermcouples +// SPI RTD/Thermocouple Boards #elif THERMISTOR_ID == -5 #define THERMISTOR_NAME "MAX31865" -#elif THERMISTOR_ID == -4 - #define THERMISTOR_NAME "AD8495" #elif THERMISTOR_ID == -3 #define THERMISTOR_NAME "MAX31855" #elif THERMISTOR_ID == -2 #define THERMISTOR_NAME "MAX6675" + +// Analog Thermocouple Boards +#elif THERMISTOR_ID == -4 + #define THERMISTOR_NAME "AD8495" #elif THERMISTOR_ID == -1 #define THERMISTOR_NAME "AD595" @@ -94,44 +96,54 @@ #define THERMISTOR_NAME "E3104FXT (alt)" #elif THERMISTOR_ID == 13 #define THERMISTOR_NAME "Hisens 3950" +#elif THERMISTOR_ID == 14 + #define THERMISTOR_NAME "100k Ender-5 S1" #elif THERMISTOR_ID == 15 #define THERMISTOR_NAME "100k JGAurora A5" +#elif THERMISTOR_ID == 17 + #define THERMISTOR_NAME "100k Dagoma NTC" #elif THERMISTOR_ID == 18 #define THERMISTOR_NAME "ATC Semitec 204GT-2" -#elif THERMISTOR_ID == 20 - #define THERMISTOR_NAME "Pt100 UltiMB 5v" -#elif THERMISTOR_ID == 21 - #define THERMISTOR_NAME "Pt100 UltiMB 3.3v" -#elif THERMISTOR_ID == 201 - #define THERMISTOR_NAME "Pt100 OverLord" #elif THERMISTOR_ID == 60 #define THERMISTOR_NAME "Makers Tool" #elif THERMISTOR_ID == 70 #define THERMISTOR_NAME "Hephestos 2" #elif THERMISTOR_ID == 75 #define THERMISTOR_NAME "MGB18" -#elif THERMISTOR_ID == 99 - #define THERMISTOR_NAME "100k with 10k pull-up" -// Modified thermistors -#elif THERMISTOR_ID == 30 - #define THERMISTOR_NAME "Kis3d EN AW NTC100K/3950" +// Analog Thermistors - 1kΩ pullup #elif THERMISTOR_ID == 51 #define THERMISTOR_NAME "EPCOS 1K" #elif THERMISTOR_ID == 52 #define THERMISTOR_NAME "ATC204GT-2 1K" #elif THERMISTOR_ID == 55 #define THERMISTOR_NAME "ATC104GT-2 1K" -#elif THERMISTOR_ID == 1047 - #define THERMISTOR_NAME "PT1000 4K7" -#elif THERMISTOR_ID == 1022 - #define THERMISTOR_NAME "PT1000 2K2" -#elif THERMISTOR_ID == 1010 - #define THERMISTOR_NAME "PT1000 1K" -#elif THERMISTOR_ID == 147 - #define THERMISTOR_NAME "Pt100 4K7" + +// Analog Thermistors - 10kΩ pullup - Atypical +#elif THERMISTOR_ID == 99 + #define THERMISTOR_NAME "100k with 10k pull-up" + +// Analog RTDs (Pt100/Pt1000) #elif THERMISTOR_ID == 110 #define THERMISTOR_NAME "Pt100 1K" +#elif THERMISTOR_ID == 147 + #define THERMISTOR_NAME "Pt100 4K7" +#elif THERMISTOR_ID == 1010 + #define THERMISTOR_NAME "PT1000 1K" +#elif THERMISTOR_ID == 1022 + #define THERMISTOR_NAME "PT1000 2K2" +#elif THERMISTOR_ID == 1047 + #define THERMISTOR_NAME "PT1000 4K7" +#elif THERMISTOR_ID == 20 + #define THERMISTOR_NAME "Pt100 UltiMB 5v" +#elif THERMISTOR_ID == 21 + #define THERMISTOR_NAME "Pt100 UltiMB 3.3v" +#elif THERMISTOR_ID == 201 + #define THERMISTOR_NAME "Pt100 OverLord" + +// Modified thermistors +#elif THERMISTOR_ID == 30 + #define THERMISTOR_NAME "Kis3d EN AW NTC100K/3950" #elif THERMISTOR_ID == 666 #define THERMISTOR_NAME "Einstart S" #elif THERMISTOR_ID == 2000 diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 5d4a8a7c92bc..f3562d15053f 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -52,166 +52,190 @@ typedef struct { raw_adc_t value; celsius_t celsius; } temp_entry_t; #define PtAdVal(T,R0,Rup) (short)(1024 / (Rup / PtRt(T, R0) + 1)) #define PtLine(T,R0,Rup) { OV(PtAdVal(T, R0, Rup)), T } -#if ANY_THERMISTOR_IS(1) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "EPCOS" +// +// Analog Thermistors - 4.7kΩ pullup - Normal +// + +#if ANY_THERMISTOR_IS(1) // beta25 = 4092 K, R25 = 100kΩ, Pullup = 4.7kΩ, "EPCOS" #include "thermistor_1.h" #endif -#if ANY_THERMISTOR_IS(2) // 4338 K, R25 = 200 kOhm, Pull-up = 4.7 kOhm, "ATC Semitec 204GT-2" +#if ANY_THERMISTOR_IS(331) // Like table 1, but with 3V3 as input voltage for MEGA + #include "thermistor_331.h" +#endif +#if ANY_THERMISTOR_IS(332) // Like table 1, but with 3V3 as input voltage for DUE + #include "thermistor_332.h" +#endif +#if ANY_THERMISTOR_IS(2) // 4338 K, R25 = 200kΩ, Pullup = 4.7kΩ, "ATC Semitec 204GT-2" #include "thermistor_2.h" #endif -#if ANY_THERMISTOR_IS(3) // beta25 = 4120 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Mendel-parts" +#if ANY_THERMISTOR_IS(202) // 200K thermistor in Copymaker3D hotend + #include "thermistor_202.h" +#endif +#if ANY_THERMISTOR_IS(3) // beta25 = 4120 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Mendel-parts" #include "thermistor_3.h" #endif -#if ANY_THERMISTOR_IS(4) // beta25 = 3950 K, R25 = 10 kOhm, Pull-up = 4.7 kOhm, "Generic" +#if ANY_THERMISTOR_IS(4) // beta25 = 3950 K, R25 = 10kΩ, Pullup = 4.7kΩ, "Generic" #include "thermistor_4.h" #endif -#if ANY_THERMISTOR_IS(5) // beta25 = 4267 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "ParCan, ATC 104GT-2" +#if ANY_THERMISTOR_IS(5) // beta25 = 4267 K, R25 = 100kΩ, Pullup = 4.7kΩ, "ParCan, ATC 104GT-2" #include "thermistor_5.h" #endif -#if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor +#if ANY_THERMISTOR_IS(501) // 100K Zonestar thermistor #include "thermistor_501.h" #endif -#if ANY_THERMISTOR_IS(502) // Unknown thermistor used by the Zonestar Průša P802M hot bed +#if ANY_THERMISTOR_IS(502) // Unknown thermistor used by the Zonestar Průša P802M hot bed #include "thermistor_502.h" #endif -#if ANY_THERMISTOR_IS(503) // Zonestar (Z8XM2) Heated Bed thermistor +#if ANY_THERMISTOR_IS(503) // Zonestar (Z8XM2) Heated Bed thermistor #include "thermistor_503.h" #endif -#if ANY_THERMISTOR_IS(504) // Zonestar (P802QR2 Hot End) thermistors +#if ANY_THERMISTOR_IS(504) // Zonestar (P802QR2 Hot End) thermistors #include "thermistor_504.h" #endif -#if ANY_THERMISTOR_IS(505) // Zonestar (P802QR2 Bed) thermistor +#if ANY_THERMISTOR_IS(505) // Zonestar (P802QR2 Bed) thermistor #include "thermistor_505.h" #endif -#if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pull-up = 4.7 kOhm, "unknown model" +#if ANY_THERMISTOR_IS(512) // 100k thermistor in RPW-Ultra hotend, Pullup = 4.7kΩ, "unknown model" #include "thermistor_512.h" #endif -#if ANY_THERMISTOR_IS(6) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 8.2 kOhm, "EPCOS ?" +#if ANY_THERMISTOR_IS(6) // beta25 = 4092 K, R25 = 100kΩ, Pullup = 8.2kΩ, "EPCOS ?" #include "thermistor_6.h" #endif -#if ANY_THERMISTOR_IS(7) // beta25 = 3974 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Honeywell 135-104LAG-J01" +#if ANY_THERMISTOR_IS(7) // beta25 = 3974 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Honeywell 135-104LAG-J01" #include "thermistor_7.h" #endif -#if ANY_THERMISTOR_IS(71) // beta25 = 3974 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Honeywell 135-104LAF-J01" +#if ANY_THERMISTOR_IS(71) // beta25 = 3974 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Honeywell 135-104LAF-J01" #include "thermistor_71.h" #endif -#if ANY_THERMISTOR_IS(8) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 10 kOhm, "Vishay E3104FHT" +#if ANY_THERMISTOR_IS(8) // beta25 = 3950 K, R25 = 100kΩ, Pullup = 10kΩ, "Vishay E3104FHT" #include "thermistor_8.h" #endif -#if ANY_THERMISTOR_IS(9) // beta25 = 3960 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "GE Sensing AL03006-58.2K-97-G1" +#if ANY_THERMISTOR_IS(9) // beta25 = 3960 K, R25 = 100kΩ, Pullup = 4.7kΩ, "GE Sensing AL03006-58.2K-97-G1" #include "thermistor_9.h" #endif -#if ANY_THERMISTOR_IS(10) // beta25 = 3960 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "RS 198-961" +#if ANY_THERMISTOR_IS(10) // beta25 = 3960 K, R25 = 100kΩ, Pullup = 4.7kΩ, "RS 198-961" #include "thermistor_10.h" #endif -#if ANY_THERMISTOR_IS(11) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "QU-BD silicone bed, QWG-104F-3950" +#if ANY_THERMISTOR_IS(11) // beta25 = 3950 K, R25 = 100kΩ, Pullup = 4.7kΩ, "QU-BD silicone bed, QWG-104F-3950" #include "thermistor_11.h" #endif -#if ANY_THERMISTOR_IS(13) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Hisens" +#if ANY_THERMISTOR_IS(12) // beta25 = 4700 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Personal calibration for Makibox hot bed" + #include "thermistor_12.h" +#endif +#if ANY_THERMISTOR_IS(13) // beta25 = 4100 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Hisens" #include "thermistor_13.h" #endif -#if ANY_THERMISTOR_IS(14) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "EPCOS" for hot bed +#if ANY_THERMISTOR_IS(14) // beta25 = 4092 K, R25 = 100kΩ, Pullup = 4.7kΩ, "EPCOS" for hot bed #include "thermistor_14.h" #endif -#if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration +#if ANY_THERMISTOR_IS(15) // JGAurora A5 thermistor calibration #include "thermistor_15.h" #endif -#if ANY_THERMISTOR_IS(17) // Dagoma NTC 100k white thermistor +#if ANY_THERMISTOR_IS(17) // Dagoma NTC 100k white thermistor #include "thermistor_17.h" #endif -#if ANY_THERMISTOR_IS(18) // ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 +#if ANY_THERMISTOR_IS(18) // ATC Semitec 204GT-2 (4.7k pullup) Dagoma.Fr - MKS_Base_DKU001327 #include "thermistor_18.h" #endif -#if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics - #include "thermistor_20.h" -#endif -#if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" - #include "thermistor_21.h" -#endif -#if ANY_THERMISTOR_IS(22) // Thermistor in a Rostock 301 hot end, calibrated with a multimeter +#if ANY_THERMISTOR_IS(22) // Thermistor in a Rostock 301 hot end, calibrated with a multimeter #include "thermistor_22.h" #endif -#if ANY_THERMISTOR_IS(23) // By AluOne #12622. Formerly 22 above. May need calibration/checking. +#if ANY_THERMISTOR_IS(23) // By AluOne #12622. Formerly 22 above. May need calibration/checking. #include "thermistor_23.h" #endif -#if ANY_THERMISTOR_IS(30) // Kis3d Silicone mat 24V 200W/300W with 6mm Precision cast plate (EN AW 5083) +#if ANY_THERMISTOR_IS(30) // Kis3d Silicone mat 24V 200W/300W with 6mm Precision cast plate (EN AW 5083) #include "thermistor_30.h" #endif -#if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "EPCOS" - #include "thermistor_51.h" -#endif -#if ANY_THERMISTOR_IS(52) // beta25 = 4338 K, R25 = 200 kOhm, Pull-up = 1 kOhm, "ATC Semitec 204GT-2" - #include "thermistor_52.h" -#endif -#if ANY_THERMISTOR_IS(55) // beta25 = 4267 K, R25 = 100 kOhm, Pull-up = 1 kOhm, "ATC Semitec 104GT-2 (Used on ParCan)" - #include "thermistor_55.h" -#endif -#if ANY_THERMISTOR_IS(60) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Maker's Tool Works Kapton Bed" +#if ANY_THERMISTOR_IS(60) // beta25 = 3950 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Maker's Tool Works Kapton Bed" #include "thermistor_60.h" #endif -#if ANY_THERMISTOR_IS(61) // beta25 = 3950 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Formbot 350°C Thermistor" +#if ANY_THERMISTOR_IS(61) // beta25 = 3950 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Formbot 350°C Thermistor" #include "thermistor_61.h" #endif -#if ANY_THERMISTOR_IS(66) // beta25 = 4500 K, R25 = 2.5 MOhm, Pull-up = 4.7 kOhm, "DyzeDesign 500 °C Thermistor" +#if ANY_THERMISTOR_IS(66) // beta25 = 4500 K, R25 = 2.5MΩ, Pullup = 4.7kΩ, "DyzeDesign 500 °C Thermistor" #include "thermistor_66.h" #endif -#if ANY_THERMISTOR_IS(67) // R25 = 500 KOhm, beta25 = 3800 K, 4.7 kOhm pull-up, SliceEngineering 450 °C Thermistor +#if ANY_THERMISTOR_IS(67) // R25 = 500kΩ, beta25 = 3800 K, 4.7kΩ pull-up, SliceEngineering 450 °C Thermistor #include "thermistor_67.h" #endif -#if ANY_THERMISTOR_IS(68) // PT-100 with Dyze amplifier board +#if ANY_THERMISTOR_IS(68) // PT-100 with Dyze amplifier board #include "thermistor_68.h" #endif -#if ANY_THERMISTOR_IS(12) // beta25 = 4700 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Personal calibration for Makibox hot bed" - #include "thermistor_12.h" -#endif -#if ANY_THERMISTOR_IS(70) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "Hephestos 2, bqh2 stock thermistor" +#if ANY_THERMISTOR_IS(70) // beta25 = 4100 K, R25 = 100kΩ, Pullup = 4.7kΩ, "Hephestos 2, bqh2 stock thermistor" #include "thermistor_70.h" #endif -#if ANY_THERMISTOR_IS(75) // beta25 = 4100 K, R25 = 100 kOhm, Pull-up = 4.7 kOhm, "MGB18-104F39050L32 thermistor" +#if ANY_THERMISTOR_IS(75) // beta25 = 4100 K, R25 = 100kΩ, Pullup = 4.7kΩ, "MGB18-104F39050L32 thermistor" #include "thermistor_75.h" #endif -#if ANY_THERMISTOR_IS(99) // 100k bed thermistor with a 10K pull-up resistor (on some Wanhao i3 models) - #include "thermistor_99.h" +#if ANY_THERMISTOR_IS(666) // beta25 = UNK, R25 = 200K, Pullup = 10kΩ, "Unidentified 200K NTC thermistor (Einstart S)" + #include "thermistor_666.h" #endif -#if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup - #include "thermistor_110.h" +#if ANY_THERMISTOR_IS(2000) // "Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor" https://product.tdk.com/en/search/sensor/ntc/chip-ntc-thermistor/info?part_no=NTCG104LH104KT1 + #include "thermistor_2000.h" #endif -#if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup - #include "thermistor_147.h" + +// +// Analog Thermistors - 1kΩ pullup +// + +#if ANY_THERMISTOR_IS(51) // beta25 = 4092 K, R25 = 100kΩ, Pullup = 1kΩ, "EPCOS" + #include "thermistor_51.h" #endif -#if ANY_THERMISTOR_IS(201) // Pt100 with LMV324 Overlord - #include "thermistor_201.h" +#if ANY_THERMISTOR_IS(52) // beta25 = 4338 K, R25 = 200kΩ, Pullup = 1kΩ, "ATC Semitec 204GT-2" + #include "thermistor_52.h" #endif -#if ANY_THERMISTOR_IS(202) // 200K thermistor in Copymaker3D hotend - #include "thermistor_202.h" +#if ANY_THERMISTOR_IS(55) // beta25 = 4267 K, R25 = 100kΩ, Pullup = 1kΩ, "ATC Semitec 104GT-2 (Used on ParCan)" + #include "thermistor_55.h" #endif -#if ANY_THERMISTOR_IS(331) // Like table 1, but with 3V3 as input voltage for MEGA - #include "thermistor_331.h" + +// +// Analog Thermistors - 10kΩ pullup - Atypical +// + +#if ANY_THERMISTOR_IS(99) // 100k bed thermistor with a 10K pull-up resistor (on some Wanhao i3 models) + #include "thermistor_99.h" #endif -#if ANY_THERMISTOR_IS(332) // Like table 1, but with 3V3 as input voltage for DUE - #include "thermistor_332.h" + +// +// Analog RTDs (Pt100/Pt1000) +// + +#if ANY_THERMISTOR_IS(110) // Pt100 with 1k0 pullup + #include "thermistor_110.h" #endif -#if ANY_THERMISTOR_IS(666) // beta25 = UNK, R25 = 200K, Pull-up = 10 kOhm, "Unidentified 200K NTC thermistor (Einstart S)" - #include "thermistor_666.h" +#if ANY_THERMISTOR_IS(147) // Pt100 with 4k7 pullup + #include "thermistor_147.h" #endif -#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup +#if ANY_THERMISTOR_IS(1010) // Pt1000 with 1k0 pullup #include "thermistor_1010.h" #endif -#if ANY_THERMISTOR_IS(1022) // Pt1000 with 2k2 pullup +#if ANY_THERMISTOR_IS(1022) // Pt1000 with 2k2 pullup #include "thermistor_1022.h" #endif -#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup +#if ANY_THERMISTOR_IS(1047) // Pt1000 with 4k7 pullup #include "thermistor_1047.h" #endif -#if ANY_THERMISTOR_IS(2000) // "Ultimachine Rambo TDK NTCG104LH104KT1 NTC100K motherboard Thermistor" https://product.tdk.com/en/search/sensor/ntc/chip-ntc-thermistor/info?part_no=NTCG104LH104KT1 - #include "thermistor_2000.h" +#if ANY_THERMISTOR_IS(20) // Pt100 with INA826 amp on Ultimaker v2.0 electronics + #include "thermistor_20.h" #endif -#if ANY_THERMISTOR_IS(998) // User-defined table 1 +#if ANY_THERMISTOR_IS(21) // Pt100 with INA826 amp with 3.3v excitation based on "Pt100 with INA826 amp on Ultimaker v2.0 electronics" + #include "thermistor_21.h" +#endif +#if ANY_THERMISTOR_IS(201) // Pt100 with LMV324 Overlord + #include "thermistor_201.h" +#endif + +// +// Custom/Dummy/Other Thermal Sensors +// + +#if ANY_THERMISTOR_IS(998) // User-defined table 1 #include "thermistor_998.h" #endif -#if ANY_THERMISTOR_IS(999) // User-defined table 2 +#if ANY_THERMISTOR_IS(999) // User-defined table 2 #include "thermistor_999.h" #endif -#if ANY_THERMISTOR_IS(1000) // Custom +#if ANY_THERMISTOR_IS(1000) // Custom constexpr temp_entry_t temptable_1000[] PROGMEM = { { 0, 0 } }; #endif From adfc787a45432e918f024241d5ba4387724cd6e9 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 24 Aug 2023 00:18:43 +0000 Subject: [PATCH 046/268] [cron] Bump distribution date (2023-08-24) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 464217907bb8..448dd4c1b861 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-23" +//#define STRING_DISTRIBUTION_DATE "2023-08-24" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ea3f7c984bcf..4bdc58276fa4 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-23" + #define STRING_DISTRIBUTION_DATE "2023-08-24" #endif /** From 20fec98f70208546b90ccc0b8f6766de6f2f8230 Mon Sep 17 00:00:00 2001 From: lukasradek Date: Thu, 24 Aug 2023 19:41:30 +0200 Subject: [PATCH 047/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Adj?= =?UTF-8?q?ust=20LCD=20string=20draw=20(#26154)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 16 +++++++--------- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 16 +++++++--------- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 18 ++++++++---------- Marlin/src/lcd/lcdprint.cpp | 4 ++-- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 897070c4dd89..3206cb63347c 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1178,11 +1178,7 @@ void MarlinUI::draw_status_screen() { if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd_put_u8str(F(" ")); n--; } // Draw as much of the label as fits - if (plen) { - const int8_t expl = n; - n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); - pad -= (expl - n - plen); // Reduce the padding - } + if (plen) n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n - vlen); if (vlen && n > 0) { // SS_FULL: Pad with enough space to justify the value @@ -1203,7 +1199,8 @@ void MarlinUI::draw_status_screen() { // Draw a generic menu item with pre_char (if selected) and post_char void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) { lcd_put_lchar(0, row, sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2); + uint8_t n = LCD_WIDTH - 2; + n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); for (; n; --n) lcd_put_u8str(F(" ")); lcd_put_lchar(post_char); } @@ -1224,7 +1221,8 @@ void MarlinUI::draw_status_screen() { // Low-level draw_edit_screen can be used to draw an edit screen from anyplace void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); - uint8_t n = lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1); + uint8_t n = LCD_WIDTH - 1; + n -= lcd_put_u8str(0, 1, ftpl, itemIndex, itemStringC, itemStringF, n); if (value) { lcd_put_u8str(F(":")); n--; const uint8_t len = utf8_strlen(value) + 1; // Plus one for a leading space @@ -1251,8 +1249,8 @@ void MarlinUI::draw_status_screen() { void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { lcd_put_lchar(0, row, sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - constexpr uint8_t maxlen = LCD_WIDTH - 2; - uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); + uint8_t n = LCD_WIDTH - 2; + n -= lcd_put_u8str_max(ui.scrolled_filename(theCard, n, row, sel), n); for (; n; --n) lcd_put_u8str(F(" ")); lcd_put_lchar(isDir ? LCD_STR_FOLDER[0] : ' '); } diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 4cec4dfa43bd..2d621d74cf2e 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -983,11 +983,7 @@ void MarlinUI::draw_status_screen() { if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd.write(' '); n--; } // Draw as much of the label as fits - if (plen) { - const int8_t expl = n; - n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); - pad -= (expl - n - plen); // Reduce the padding - } + if (plen) n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n - vlen); if (vlen && n > 0) { // SS_FULL: Pad with enough space to justify the value @@ -1012,7 +1008,8 @@ void MarlinUI::draw_status_screen() { if (!PanelDetected) return; lcd_moveto(0, row); lcd.write(sel ? pre_char : ' '); - uint8_t n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2); + uint8_t n = LCD_WIDTH - 2; + n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); for (; n; --n) lcd.write(' '); lcd.write(post_char); lcd.print_line(); @@ -1024,7 +1021,8 @@ void MarlinUI::draw_status_screen() { const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; lcd_moveto(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - uint8_t n = lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vlen); + uint8_t n = LCD_WIDTH - 2 - vlen; + n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); if (vlen) { lcd.write(':'); for (; n; --n) lcd.write(' '); @@ -1074,8 +1072,8 @@ void MarlinUI::draw_status_screen() { if (!PanelDetected) return; lcd_moveto(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); - constexpr uint8_t maxlen = LCD_WIDTH - 2; - uint8_t n = maxlen - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); + uint8_t n = LCD_WIDTH - 2; + n -= lcd_put_u8str_max(ui.scrolled_filename(theCard, n, row, sel), n); for (; n; --n) lcd.write(' '); lcd.write(isDir ? LCD_STR_FOLDER[0] : ' '); lcd.print_line(); diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 5b2db31fbbd2..c2671b1b750e 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -424,11 +424,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (center) for (int lpad = pad / 2; lpad > 0; --lpad) n -= lcd_put_u8str(F(" ")); // Draw as much of the label as fits - if (pwide) { - const pixel_len_t expw = n; - n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); - pad -= (expw - n - pwide) / (MENU_FONT_WIDTH); // Reduce the padding - } + if (pwide) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); if (vlen) { // SS_FULL: Pad with enough space to justify the value @@ -449,8 +445,9 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Draw a generic menu item void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { if (mark_as_selected(row, sel)) { - pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 1) * (MENU_FONT_WIDTH); - while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); + uint8_t n = LCD_WIDTH - 1; + n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); + for (; n; --n) lcd_put_u8str(F(" ")); lcd_put_lchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); lcd_put_u8str(F(" ")); } @@ -463,10 +460,11 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), inStr)); const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - pixel_len_t n = lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, LCD_WIDTH - 2 - vallen * prop) * (MENU_FONT_WIDTH); + uint8_t n = LCD_WIDTH - 2 - vallen * prop; + n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); if (vallen) { lcd_put_u8str(F(":")); - while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); + for (; n; --n) lcd_put_u8str(F(" ")); lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2); if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } @@ -552,7 +550,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (isDir) lcd_put_lchar(LCD_STR_FOLDER[0]); const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH); pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); - while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); + for (; n > MENU_FONT_WIDTH; n -= MENU_FONT_WIDTH) lcd_put_u8str(F(" ")); } } diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 912344c14fc7..bdf2513121ec 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -42,7 +42,7 @@ * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) * @ displays an axis name such as XYZUVW, or E for an extruder * - * Return the given maxlen minus the number of characters emitted, i.e., the number of unused columns + * Return the number of characters emitted */ lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { const uint8_t prop = USE_WIDE_GLYPH ? 2 : 1; @@ -88,7 +88,7 @@ lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/ n -= wc > 255 ? prop : 1; } } - return n; + return maxlen - n; } // Calculate UTF8 width with a simple check From e1121a4cd009ee447eaef2ab49a2de896e5a5eef Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 25 Aug 2023 00:19:03 +0000 Subject: [PATCH 048/268] [cron] Bump distribution date (2023-08-25) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 448dd4c1b861..ea5235f27ec1 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-24" +//#define STRING_DISTRIBUTION_DATE "2023-08-25" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 4bdc58276fa4..c6e01ed925e4 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-24" + #define STRING_DISTRIBUTION_DATE "2023-08-25" #endif /** From 4613f85bb754991b1ea4fa5218ae94e758be0e8a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 24 Aug 2023 15:09:03 -0500 Subject: [PATCH 049/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Enc?= =?UTF-8?q?apsulate=20ProUI=20G-code=20preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 +- 3 files changed, 121 insertions(+), 131 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 83c7eebe3812..af69e8d3edfe 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 @@ -1675,7 +1675,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; @@ -1960,7 +1960,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 8017847538e4..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 8fa6a4da2eebc1dbe120dcac87b159e389e17dc3 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Fri, 25 Aug 2023 19:33:49 -0400 Subject: [PATCH 050/268] =?UTF-8?q?=F0=9F=9A=B8=20Fixes=20for=20ProUI,=20J?= =?UTF-8?q?yersUI,=20backlight,=20etc.=20(#26086)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 1 + Marlin/src/inc/SanityCheck.h | 6 +- Marlin/src/lcd/e3v2/common/encoder.cpp | 18 ++++- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 35 ++++---- .../lcd/e3v2/proui/{base64.hpp => base64.h} | 14 ++-- Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp | 48 ++++------- Marlin/src/lcd/e3v2/proui/dwin.cpp | 79 +++++++++++-------- Marlin/src/lcd/e3v2/proui/dwin.h | 4 +- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 40 ++++------ Marlin/src/lcd/e3v2/proui/dwinui.h | 8 +- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 4 +- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 42 ++++------ Marlin/src/lcd/e3v2/proui/plot.cpp | 29 ++++--- Marlin/src/lcd/e3v2/proui/plot.h | 6 +- Marlin/src/lcd/marlinui.cpp | 2 +- buildroot/share/cmake/CMakeLists.txt | 18 ++++- 16 files changed, 177 insertions(+), 177 deletions(-) rename Marlin/src/lcd/e3v2/proui/{base64.hpp => base64.h} (96%) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index ed4363acbc0a..15e36ac678f7 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()); #if HAS_MARLINUI_MENU if (ui.button_pressed()) { diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c68f85720e9a..b2b336bd17a7 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2722,7 +2722,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 && 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) @@ -2730,8 +2730,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/common/encoder.cpp b/Marlin/src/lcd/e3v2/common/encoder.cpp index 2ff67059e98d..eb064950ec59 100644 --- a/Marlin/src/lcd/e3v2/common/encoder.cpp +++ b/Marlin/src/lcd/e3v2/common/encoder.cpp @@ -87,7 +87,13 @@ EncoderState encoderReceiveAnalyze() { #if PIN_EXISTS(LCD_LED) //LED_Action(); #endif - if (!ui.backlight) ui.refresh_brightness(); + #if LCD_BACKLIGHT_TIMEOUT_MINS + ui.refresh_backlight_timeout(); + #endif + 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; @@ -154,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; } @@ -164,9 +176,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/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 5156848a436f..e6768e1ef457 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_MIN__; - 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); + 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); @@ -381,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 ? 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] / (!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 ); @@ -421,16 +415,17 @@ 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); - if (range > 3e+10F) range = 0.0000001; - v1 = -range; - v2 = range; + 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"))); drawing_mesh = false; 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/bedlevel_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index bd2f8a88e6a6..db6c76269ca8 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; @@ -186,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; } @@ -221,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); @@ -242,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] / (!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] / 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 ); @@ -252,7 +245,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 +252,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(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, 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(); @@ -276,17 +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); - if (v_min > 3e+10f) v_min = 0.0000001; - if (v_max > 3e+10f) v_max = 0.0000001; - if (range > 3e+10f) range = 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") - ) - ); + 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 af69e8d3edfe..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 @@ -1253,6 +1253,13 @@ 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; blink = !blink; @@ -1276,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(); @@ -2220,6 +2227,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(); @@ -2258,6 +2269,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() { @@ -2265,13 +2283,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); @@ -2979,9 +2990,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); @@ -3072,7 +3081,7 @@ void drawControlMenu() { void drawAdvancedSettingsMenu() { checkkey = ID_Menu; - if (SET_MENU(advancedSettingsMenu, MSG_ADVANCED_SETTINGS, 23)) { + if (SET_MENU(advancedSettingsMenu, MSG_ADVANCED_SETTINGS, 24)) { BACK_ITEM(gotoMainMenu); #if ENABLED(EEPROM_SETTINGS) MENU_ITEM(ICON_WriteEEPROM, MSG_STORE_EEPROM, onDrawMenuItem, writeEEPROM); @@ -3109,6 +3118,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 @@ -3330,6 +3342,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); #if CASELIGHT_USES_BRIGHTNESS @@ -3452,9 +3467,7 @@ void drawMotionMenu() { updateMenu(motionMenu); } -#if ENABLED(ADVANCED_PAUSE_FEATURE) - - #if HAS_PREHEAT +#if ALL(ADVANCED_PAUSE_FEATURE, HAS_PREHEAT) void drawPreheatHotendMenu() { checkkey = ID_Menu; @@ -3466,28 +3479,28 @@ void drawMotionMenu() { updateMenu(preheatHotendMenu); } - #endif +#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 +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); - #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); + #endif + #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) + MENU_ITEM(ICON_FilUnload, MSG_FILAMENTUNLOAD, onDrawMenuItem, unloadFilament); + MENU_ITEM(ICON_FilLoad, MSG_FILAMENTLOAD, onDrawMenuItem, loadFilament); + #endif } - -#endif + updateMenu(filamentMenu); +} #if ENABLED(MESH_BED_LEVELING) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 21b72d321a60..9c11cc49167f 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -321,9 +321,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 diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index 72b66fb5b3e4..7e94fc3e5633 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) { @@ -280,12 +280,12 @@ 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); - 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); } @@ -293,27 +293,17 @@ 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) { - uint8_t B, G, R; - const uint8_t maxB = 28, maxR = 28, maxG = 38; +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) : (float)val / limv; + float n = (minv >= 0) ? float(val - minv) / (maxv - minv + 1) : (float)val / limv; LIMIT(n, -1, 1); - if (n < 0) { - R = 0; - G = (1 + n) * maxG; - B = (-n) * maxB; - } - 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/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 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(); diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index 2781ccaa1df7..1c5f08bb4dfa 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); - const uint16_t color = DWINUI::RainbowInt(v, zmin, zmax); - DWINUI::drawFillCircle(color, px(x), py(y), r(_MAX(_MIN(v,zmax),zmin))); + 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("-.%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; } - 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/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index 95d8ec291d1b..3ea0d555fe62 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -38,38 +38,41 @@ #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 } #endif // DWIN_LCD_PROUI && PROUI_TUNING_GRAPH 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; diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 69a8e2336365..1076d40de014 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -190,7 +190,7 @@ 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(); diff --git a/buildroot/share/cmake/CMakeLists.txt b/buildroot/share/cmake/CMakeLists.txt index b861f79b952b..0316c7fc0bcf 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,19 @@ 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 209fadd2e6039e050e33eaed9c59465ffa5c30f0 Mon Sep 17 00:00:00 2001 From: jaysuk Date: Sat, 26 Aug 2023 00:43:57 +0100 Subject: [PATCH 051/268] =?UTF-8?q?=E2=9C=A8=20Mellow=20Fly=20E3=20V2=20(S?= =?UTF-8?q?TM32F407VG)=20(#26081)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f4/pins_CREALITY_F401.h | 2 +- .../src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h | 521 ++++++++++++++++++ .../pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h | 2 +- ini/stm32f4.ini | 19 + 6 files changed, 545 insertions(+), 2 deletions(-) create mode 100644 Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 5e404fc85041..0c27fbbe25bf 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -459,6 +459,7 @@ #define BOARD_CREALITY_F401RE 5245 // Creality CR4NS200141C13 (STM32F401RE) as found in the Ender-5 S1 #define BOARD_BLACKPILL_CUSTOM 5246 // Custom board based on STM32F401CDU6. #define BOARD_I3DBEEZ9_V1 5247 // I3DBEEZ9 V1 (STM32F407ZG) +#define BOARD_MELLOW_FLY_E3_V2 5248 // Mellow Fly E3 V2 (STM32F407VG) // // ARM Cortex-M7 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index fe356520d8f7..48405335ef20 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -804,6 +804,8 @@ #include "stm32f4/pins_BLACKPILL_CUSTOM.h" // STM32F4 env:STM32F401CD_blackpill_stlink #elif MB(I3DBEEZ9_V1) #include "stm32f4/pins_I3DBEEZ9.h" // STM32F4 env:I3DBEEZ9_V1 +#elif MB(MELLOW_FLY_E3_V2) + #include "stm32f4/pins_MELLOW_FLY_E3_V2.h" // STM32F4 env:FLY_E3_V2 // // ARM Cortex-M7 diff --git a/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h b/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h index f4b5b7d96a72..b4c5bad0938a 100644 --- a/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h +++ b/Marlin/src/pins/stm32f4/pins_CREALITY_F401.h @@ -140,7 +140,7 @@ //#define LED_CONTROL_PIN PA7 // -// WiFI Reset +// WiFi Reset // #ifdef MENU_RESET_WIFI #define RESET_WIFI_PIN PB12 diff --git a/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h b/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h new file mode 100644 index 000000000000..39073bffceca --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h @@ -0,0 +1,521 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#if NOT_TARGET(STM32F4) + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#endif + +#ifndef BOARD_INFO_NAME + #define BOARD_INFO_NAME "Mellow Fly E3 V2" +#endif + +// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION +// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT +//#define BTT_MOTOR_EXPANSION + +#if ALL(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION) + #if ANY(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY) + #define EXP_MOT_USE_EXP2_ONLY 1 + #else + #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time." + #endif +#endif + +// Use one of these or SDCard-based Emulation will be used +#if NO_EEPROM_SELECTED + //#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation + #define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation +#endif + +#if ENABLED(FLASH_EEPROM_EMULATION) + // Decrease delays and flash wear by spreading writes across the + // 128 kB sector allocated for EEPROM emulation. + #define FLASH_EEPROM_LEVELING +#endif + +// +// Servos +// +#define SERVO0_PIN PE6 // SERVOS + +// +// Trinamic Stallguard pins +// +#define X_DIAG_PIN PE7 // X-STOP +#define Y_DIAG_PIN PE8 // Y-STOP +#define Z_DIAG_PIN PE9 // Z-STOP + +// +// Limit Switches +// +#ifdef X_STALL_SENSITIVITY + #define X_STOP_PIN X_DIAG_PIN +#else + #define X_STOP_PIN PE7 // X-STOP +#endif + +#ifdef Y_STALL_SENSITIVITY + #define Y_STOP_PIN Y_DIAG_PIN +#else + #define Y_STOP_PIN PE8 // Y-STOP +#endif + +#ifdef Z_STALL_SENSITIVITY + #define Z_STOP_PIN Z_DIAG_PIN +#else + #ifndef Z_STOP_PIN + #define Z_STOP_PIN PE9 // Z-STOP + #endif +#endif + +// +// Z Probe must be this pin +// +#define Z_MIN_PROBE_PIN PC2 // PROBE + +// +// Probe enable +// +#if ENABLED(PROBE_ENABLE_DISABLE) + #ifndef PROBE_ENABLE_PIN + #define PROBE_ENABLE_PIN SERVO0_PIN + #endif +#endif + +// +// Steppers +// +#define X_ENABLE_PIN PC1 +#define X_STEP_PIN PE5 +#define X_DIR_PIN PC0 +#ifndef X_CS_PIN + #define X_CS_PIN PC15 +#endif + +#define Y_ENABLE_PIN PC14 +#define Y_STEP_PIN PE4 +#define Y_DIR_PIN PC13 +#ifndef Y_CS_PIN + #define Y_CS_PIN PB6 +#endif + +#define Z_ENABLE_PIN PE3 +#define Z_STEP_PIN PE1 +#define Z_DIR_PIN PB7 +#ifndef Z_CS_PIN + #define Z_CS_PIN PD7 +#endif + +#define E0_ENABLE_PIN PD6 +#define E0_STEP_PIN PE2 +#define E0_DIR_PIN PD5 +#ifndef E0_CS_PIN + #define E0_CS_PIN PD4 +#endif + +#define E1_ENABLE_PIN PD3 +#define E1_STEP_PIN PE0 +#define E1_DIR_PIN PD1 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD0 +#endif + +// +// Temperature Sensors +// +#define TEMP_BED_PIN PB1 // Analog Input "TB" +#define TEMP_0_PIN PC4 // Analog Input "TH0" +#define TEMP_1_PIN PC5 // Analog Input "TH0" + +// +// Heaters / Fans +// +#ifndef HEATER_BED_PIN + #define HEATER_BED_PIN PB0 // "HB" +#endif +#ifndef HEATER_0_PIN + #define HEATER_0_PIN PC6 // "HE0" +#endif +#ifndef HEATER_1_PIN + #define HEATER_1_PIN PC7 // "HE0" +#endif + +#ifndef FAN0_PIN + #define FAN0_PIN PA0 // "FAN0" +#endif +#ifndef FAN1_PIN + #define FAN1_PIN PA1 +#endif +#ifndef FAN2_PIN + #define FAN2_PIN PA2 +#endif +#ifndef FAN3_PIN + #define FAN3_PIN PA3 +#endif + +#ifndef TMC_SPI_MOSI + #define TMC_SPI_MOSI PB5 +#endif +#ifndef TMC_SPI_MISO + #define TMC_SPI_MISO PB4 +#endif +#ifndef TMC_SPI_SCK + #define TMC_SPI_SCK PB3 +#endif + +#if HAS_TMC_UART + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial1 + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PC15 + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + + #define Y_SERIAL_TX_PIN PB6 + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + + #define Z_SERIAL_TX_PIN PD7 + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + + #define E0_SERIAL_TX_PIN PD4 + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + + #define E1_SERIAL_TX_PIN PD0 + #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + + // Reduce baud rate to improve software serial reliability + #ifndef TMC_BAUD_RATE + #define TMC_BAUD_RATE 19200 + #endif + +#endif // HAS_TMC_UART + +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +/** + * Fly-E3-v2 + * ------ ------ + * (BEEPER) PD10 | 1 2 | PA9 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK) + * (LCD_EN) PA8 | 3 4 | PA10 (LCD_RS) (BTN_EN1) PB11 | 3 4 | PA4 (SD_SS) + * (LCD_D4) PE15 | 5 6 PE14 (LCD_D5) (BTN_EN2) PB10 | 5 6 | PA7 (MOSI) + * (LCD_D6) PA14 | 7 8 | PA13 (LCD_D7) (SD_DETECT) PE13 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_01_PIN PD10 +#define EXP1_02_PIN PA9 +#define EXP1_03_PIN PA8 +#define EXP1_04_PIN PA10 +#define EXP1_05_PIN PE15 +#define EXP1_06_PIN PE14 +#define EXP1_07_PIN PA14 +#define EXP1_08_PIN PA13 + +#define EXP2_01_PIN PA6 +#define EXP2_02_PIN PA5 +#define EXP2_03_PIN PB11 +#define EXP2_04_PIN PA4 +#define EXP2_05_PIN PB10 +#define EXP2_06_PIN PA7 +#define EXP2_07_PIN PE13 +#define EXP2_08_PIN -1 + +// +// Onboard SD card +// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 +// +#if SD_CONNECTION_IS(LCD) + #define SDSS EXP2_04_PIN + #define SD_SS_PIN SDSS + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN +#elif SD_CONNECTION_IS(ONBOARD) + #define ONBOARD_SDIO // Use SDIO for onboard SD +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif + +#if ENABLED(BTT_MOTOR_EXPANSION) + /** ----- ----- + * -- | . . | GND -- | . . | GND + * -- | . . | M1EN M2EN | . . | M3EN + * M1STP | . . M1DIR M1RX | . . M1DIAG + * M2DIR | . . | M2STP M2RX | . . | M2DIAG + * M3DIR | . . | M3STP M3RX | . . | M3DIAG + * ----- ----- + * EXP2 EXP1 + * + * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN + */ + + // M1 on Driver Expansion Module + #define E2_STEP_PIN EXP2_06_PIN + #define E2_DIR_PIN EXP2_05_PIN + #define E2_ENABLE_PIN EXP2_07_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E2_DIAG_PIN EXP1_05_PIN + #define E2_CS_PIN EXP1_06_PIN + #if HAS_TMC_UART + #define E2_SERIAL_TX_PIN EXP1_06_PIN + #define E2_SERIAL_RX_PIN EXP1_06_PIN + #endif + #endif + + // M2 on Driver Expansion Module + #define E3_STEP_PIN EXP2_03_PIN + #define E3_DIR_PIN EXP2_04_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E3_ENABLE_PIN EXP1_08_PIN + #define E3_DIAG_PIN EXP1_03_PIN + #define E3_CS_PIN EXP1_04_PIN + #if HAS_TMC_UART + #define E3_SERIAL_TX_PIN EXP1_04_PIN + #define E3_SERIAL_RX_PIN EXP1_04_PIN + #endif + #else + #define E3_ENABLE_PIN EXP2_07_PIN + #endif + + // M3 on Driver Expansion Module + #define E4_STEP_PIN EXP2_01_PIN + #define E4_DIR_PIN EXP2_02_PIN + #if !EXP_MOT_USE_EXP2_ONLY + #define E4_ENABLE_PIN EXP1_07_PIN + #define E4_DIAG_PIN EXP1_01_PIN + #define E4_CS_PIN EXP1_02_PIN + #if HAS_TMC_UART + #define E4_SERIAL_TX_PIN EXP1_02_PIN + #define E4_SERIAL_RX_PIN EXP1_02_PIN + #endif + #else + #define E4_ENABLE_PIN EXP2_07_PIN + #endif + +#endif // BTT_MOTOR_EXPANSION + +// +// LCDs and Controllers +// +#if IS_TFTGLCD_PANEL + + #if ENABLED(TFTGLCD_PANEL_SPI) + #define TFTGLCD_CS EXP2_03_PIN + #endif + +#elif HAS_WIRED_LCD + + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #else + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #define LCD_PINS_EN EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally. + #if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN EXP1_06_PIN + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN EXP1_07_PIN + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN EXP1_08_PIN + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN EXP1_06_PIN + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + +#endif // HAS_WIRED_LCD + +#if HAS_SPI_TFT + + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN + + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #ifndef TFT_WIDTH + #define TFT_WIDTH 480 + #endif + #ifndef TFT_HEIGHT + #define TFT_HEIGHT 320 + #endif + + #if ENABLED(BTT_TFT35_SPI_V1_0) + // 480x320, 3.5", SPI Display with Rotary Encoder. + // Stock Display for the BIQU B1 SE. + #define TFT_CS_PIN EXP2_04_PIN + #define TFT_DC_PIN EXP2_07_PIN + #define TFT_A0_PIN TFT_DC_PIN + + #define TOUCH_CS_PIN EXP1_04_PIN + #define TOUCH_SCK_PIN EXP1_05_PIN + #define TOUCH_MISO_PIN EXP1_06_PIN + #define TOUCH_MOSI_PIN EXP1_03_PIN + #define TOUCH_INT_PIN EXP1_07_PIN + + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 17540 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -11388 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -21 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 337 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif + + #elif ENABLED(MKS_TS35_V2_0) + + /** ------ ------ + * BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK + * TFT_BKL / LCD_EN | 3 4 | TFT_RESET / LCD_RS BTN_EN1 | 3 4 | SPI1_CS + * TOUCH_CS / LCD_D4 | 5 6 TOUCH_INT / LCD_D5 BTN_EN2 | 5 6 SPI1_MOSI + * SPI1_CS / LCD_D6 | 7 8 | SPI1_RS / LCD_D7 SPI1_RS | 7 8 | RESET + * GND | 9 10 | VCC GND | 9 10 | VCC + * ------ ------ + * EXP1 EXP2 + */ + #define TFT_CS_PIN EXP1_07_PIN // SPI1_CS + #define TFT_DC_PIN EXP1_08_PIN // SPI1_RS + #define TFT_A0_PIN TFT_DC_PIN + + #define TFT_RESET_PIN EXP1_04_PIN + + #define LCD_BACKLIGHT_PIN EXP1_03_PIN + #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN + + #define TOUCH_BUTTONS_HW_SPI + #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 + + #define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI + + #define LCD_READ_ID 0xD3 + #define LCD_USE_DMA_SPI + + #define TFT_BUFFER_SIZE 14400 + + #endif + +#endif // HAS_SPI_TFT + +// Alter timing for graphical display +#if IS_U8GLIB_ST7920 + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 120 + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 80 + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 580 + #endif +#endif + +//#define POWER_MONITOR_VOLTAGE_PIN PC3 + +// +// WiFi +// +#if ENABLED(WIFISUPPORT) + #define ESP_WIFI_MODULE_COM 3 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this + #define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2 + #define ESP_WIFI_MODULE_RESET_PIN PE11 + #define ESP_WIFI_MODULE_GPIO0_PIN PE10 + #define ESP_WIFI_MODULE_GPIO4_PIN PE12 +#endif diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h index 9d30d853b5dd..ded9ec4e8913 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h @@ -449,7 +449,7 @@ #endif // -// WIFI +// WiFi // #if ENABLED(WIFISUPPORT) /** diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index bb594b97f909..454337295d29 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -806,3 +806,22 @@ board_build.offset = 0x8000 build_flags = ${stm32_variant.build_flags} -DSTM32F407_5ZX debug_tool = stlink upload_protocol = stlink + +# +# Mellow Fly E3 V2 (STM32F407VGT6 ARM Cortex-M4) +# +[env:FLY_E3_V2] +extends = stm32_variant +board = marlin_STM32F407VGT6_CCM +board_build.variant = MARLIN_F4x7Vx +board_build.offset = 0x8000 +board_upload.offset_address = 0x08008000 +build_flags = ${stm32_variant.build_flags} + -DHAVE_HWSERIAL1 -DHAVE_HWSERIAL3 + -DPIN_SERIAL1_RX=PA_10 -DPIN_SERIAL1_TX=PA_9 + -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 + -DHAL_SD_MODULE_ENABLED + -DUSE_USBHOST_HS -DUSE_USB_HS_IN_FS + -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 + -DHSE_VALUE=8000000U +upload_protocol = stlink From 11f98adcce51f06a85ef0dd64e6e6b16139a34bd Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 26 Aug 2023 00:22:53 +0000 Subject: [PATCH 052/268] [cron] Bump distribution date (2023-08-26) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index ea5235f27ec1..307dd9820f8e 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-25" +//#define STRING_DISTRIBUTION_DATE "2023-08-26" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index c6e01ed925e4..dcc5e30021cc 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-25" + #define STRING_DISTRIBUTION_DATE "2023-08-26" #endif /** From 34a0c9d143ff5c5018c4713a1ed5dad32c8c3a5d Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 30 Sep 2023 12:12:29 +1300 Subject: [PATCH 053/268] =?UTF-8?q?=F0=9F=93=9D=20Update=20BTT=20SKR=20Min?= =?UTF-8?q?i=20E3=20v3.0=20comments=20(#26318)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index ef6a22b88f1b..d88dccc57964 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -322,7 +322,7 @@ * ------ ------ * (EN2) PB5 | 1 2 | PA15(BTN_ENC) 5V |10 9 | GND * (LCD_CS) PA9 | 3 4 | RST (RESET) -- | 8 7 | -- - * (LCD_A0) PA10 5 6 | PB9 (EN1) (DIN) | 6 5 (RESET) + * (LCD_A0) PA10 5 6 | PB9 (EN1) (DIN) | 6 5 (RESET) LCD_RESET * (LCD_SCK)PB8 | 7 8 | PD6 (MOSI) (LCD_A0) | 4 3 | (LCD_CS) * GND | 9 10 | 5V (BTN_ENC) | 2 1 | -- * ------ ------ @@ -330,7 +330,7 @@ * * ------ * -- |10 9 | -- - * --- (RESET) | 8 7 | -- + * --- RESET_BUTTON (RESET) | 8 7 | -- * | 3 | (MOSI) | 6 5 (EN2) * | 2 | (DIN) -- | 4 3 | (EN1) * | 1 | (LCD_SCK)| 2 1 | -- @@ -338,6 +338,7 @@ * Neopixel EXP2 * * Needs custom cable. Connect EN2-EN2, LCD_CS-LCD_CS and so on. + * Note: The RESET line is connected to 3 pins. * * Check the index/notch position twice!!! * On BTT boards pins from IDC10 connector are numbered in unusual order. From d56136f06cca075e801aabcff76bd207d4da349f Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 30 Sep 2023 00:19:06 +0000 Subject: [PATCH 054/268] [cron] Bump distribution date (2023-09-30) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 307dd9820f8e..4ec85eed6b39 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-08-26" +//#define STRING_DISTRIBUTION_DATE "2023-09-30" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index dcc5e30021cc..a2f440fb687b 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-08-26" + #define STRING_DISTRIBUTION_DATE "2023-09-30" #endif /** From 7338a2fec82caf7ccc469274c8ecef1d75c3abbd Mon Sep 17 00:00:00 2001 From: kisslorand <50251547+kisslorand@users.noreply.github.com> Date: Tue, 3 Oct 2023 22:48:52 +0300 Subject: [PATCH 055/268] =?UTF-8?q?=F0=9F=9A=B8=20Use=20SERIAL=5FFLOAT=5FP?= =?UTF-8?q?RECISION=20for=20SERIAL=5FECHO(float)=20(#26254)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/serial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 2e07f3335a1d..addd01388ef7 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -69,7 +69,7 @@ MAP(_N_LBL, LOGICAL_AXIS_NAMES); MAP(_SP_N_LBL, LOGICAL_AXIS_NAMES); #endif // Specializations for float, p_float_t, w_float_t -template <> void SERIAL_ECHO(const float f) { SERIAL_IMPL.print(f); } +template <> void SERIAL_ECHO(const float f) { SERIAL_IMPL.print(f, SERIAL_FLOAT_PRECISION); } template <> void SERIAL_ECHO(const p_float_t pf) { SERIAL_IMPL.print(pf.value, pf.prec); } template <> void SERIAL_ECHO(const w_float_t wf) { char f1[20]; SERIAL_IMPL.print(dtostrf(wf.value, wf.width, wf.prec, f1)); } From 102de7dac3cbfa088180375ee0a550a35828ffba Mon Sep 17 00:00:00 2001 From: kisslorand <50251547+kisslorand@users.noreply.github.com> Date: Tue, 3 Oct 2023 22:50:33 +0300 Subject: [PATCH 056/268] =?UTF-8?q?=F0=9F=9A=B8=20More=20precision=20in=20?= =?UTF-8?q?G30=20output=20(#26255)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/probe/G30.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index f8fe88d3397a..383b5015a014 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -82,9 +82,9 @@ void GcodeSuite::G30() { if (!isnan(measured_z)) { const xy_pos_t lpos = probepos.asLogical(); SString<30> msg( - F("Bed X:"), p_float_t(lpos.x, 1), - F( " Y:"), p_float_t(lpos.y, 1), - F( " Z:"), p_float_t(measured_z, 2) + F("Bed X:"), p_float_t(lpos.x, 2), + F( " Y:"), p_float_t(lpos.y, 2), + F( " Z:"), p_float_t(measured_z, 3) ); msg.echoln(); #if ANY(DWIN_LCD_PROUI, DWIN_CREALITY_LCD_JYERSUI) From 15dfbabc9cbfde0551571b550e56f5d2d5271dd4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 3 Oct 2023 14:52:04 -0500 Subject: [PATCH 057/268] =?UTF-8?q?=F0=9F=94=A7=20Temp=20report=20precisio?= =?UTF-8?q?n=20option=20(#26253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/temperature.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b2e2915d17d0..2f8761ec39f3 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -4205,12 +4205,14 @@ void Temperature::isr() { case H_REDUNDANT: k = 'R'; break; #endif } - #define SFP _MIN(SERIAL_FLOAT_PRECISION, 2) + #ifndef HEATER_STATE_FLOAT_PRECISION + #define HEATER_STATE_FLOAT_PRECISION _MIN(SERIAL_FLOAT_PRECISION, 2) + #endif SString<50> s(' ', k); if (TERN0(HAS_MULTI_HOTEND, e >= 0)) s += char('0' + e); - s += ':'; s += p_float_t(c, SFP); - if (show_t) { s += F(" /"); s += p_float_t(t, SFP); } + s += ':'; s += p_float_t(c, HEATER_STATE_FLOAT_PRECISION); + if (show_t) { s += F(" /"); s += p_float_t(t, HEATER_STATE_FLOAT_PRECISION); } #if ENABLED(SHOW_TEMP_ADC_VALUES) // Temperature MAX SPI boards do not have an OVERSAMPLENR defined s.append(F(" ("), TERN(HAS_MAXTC_LIBRARIES, k == 'T', false) ? r : r * RECIPROCAL(OVERSAMPLENR), ')'); From be031e18509884c42051fba6849af06e089e383f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 3 Oct 2023 14:57:07 -0500 Subject: [PATCH 058/268] =?UTF-8?q?=F0=9F=93=9D=20More=20ExtUI=20documenta?= =?UTF-8?q?tion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/lcd/e3v2/common/dwin_api.cpp | 2 +- Marlin/src/lcd/extui/ui_api.cpp | 98 +++++++++++++++++-------- Marlin/src/lcd/extui/ui_api.h | 84 +++++++++++++++++---- 4 files changed, 140 insertions(+), 46 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b069e2d2b173..2e51e3db6add 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -490,7 +490,7 @@ // Extensible UI serial touch screens. (See src/lcd/extui) #if ANY(HAS_DGUS_LCD, MALYAN_LCD, ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, NEXTION_TFT, TOUCH_UI_FTDI_EVE) - #define IS_EXTUI 1 + #define IS_EXTUI 1 // Just for sanity check. #define EXTENSIBLE_UI #endif diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.cpp b/Marlin/src/lcd/e3v2/common/dwin_api.cpp index af28cfe62bfc..4442b5847d58 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_api.cpp +++ b/Marlin/src/lcd/e3v2/common/dwin_api.cpp @@ -317,7 +317,7 @@ void dwinDrawFloatValue(uint8_t bShow, bool zeroFill, uint8_t zeroMode, uint8_t //uint8_t *fvalue = (uint8_t*)&value; size_t i = 0; #if DISABLED(DWIN_CREALITY_LCD_JYERSUI) - dwinDrawRectangle(1, bColor, x, y, x + fontWidth(size) * (iNum+fNum+1), y + fontHeight(size)); + dwinDrawRectangle(1, bColor, x, y, x + fontWidth(size) * (iNum + fNum + 1), y + fontHeight(size)); #endif dwinByte(i, 0x14); dwinByte(i, (bShow * 0x80) | (zeroFill * 0x20) | (zeroMode * 0x10) | size); diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 7f216107289a..bccc543b7f34 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -172,35 +172,6 @@ namespace ExtUI { if (!flags.printer_killed) thermalManager.task(); } - void enableHeater(const extruder_t extruder) { - #if HAS_HOTEND && HEATER_IDLE_HANDLER - thermalManager.reset_hotend_idle_timer(extruder - E0); - #else - UNUSED(extruder); - #endif - } - - void enableHeater(const heater_t heater) { - #if HEATER_IDLE_HANDLER - switch (heater) { - #if HAS_HEATED_BED - case BED: thermalManager.reset_bed_idle_timer(); return; - #endif - #if HAS_HEATED_CHAMBER - case CHAMBER: return; // Chamber has no idle timer - #endif - #if HAS_COOLER - case COOLER: return; // Cooler has no idle timer - #endif - default: - TERN_(HAS_HOTEND, thermalManager.reset_hotend_idle_timer(heater - H0)); - break; - } - #else - UNUSED(heater); - #endif - } - #if ENABLED(JOYSTICK) /** * Jogs in the direction given by the vector (dx, dy, dz). @@ -237,6 +208,39 @@ namespace ExtUI { } #endif + // + // Heaters locked / idle + // + + void enableHeater(const extruder_t extruder) { + #if HAS_HOTEND && HEATER_IDLE_HANDLER + thermalManager.reset_hotend_idle_timer(extruder - E0); + #else + UNUSED(extruder); + #endif + } + + void enableHeater(const heater_t heater) { + #if HEATER_IDLE_HANDLER + switch (heater) { + #if HAS_HEATED_BED + case BED: thermalManager.reset_bed_idle_timer(); return; + #endif + #if HAS_HEATED_CHAMBER + case CHAMBER: return; // Chamber has no idle timer + #endif + #if HAS_COOLER + case COOLER: return; // Cooler has no idle timer + #endif + default: + TERN_(HAS_HOTEND, thermalManager.reset_hotend_idle_timer(heater - H0)); + break; + } + #else + UNUSED(heater); + #endif + } + bool isHeaterIdle(const extruder_t extruder) { #if HAS_HOTEND && HEATER_IDLE_HANDLER return thermalManager.heater_idle[extruder - E0].timed_out; @@ -302,6 +306,9 @@ namespace ExtUI { return GET_TEMP_ADJUSTMENT(thermalManager.degTargetHotend(extruder - E0)); } + // + // Fan target/actual speed + // float getTargetFan_percent(const fan_t fan) { UNUSED(fan); return TERN0(HAS_FAN, thermalManager.fanSpeedPercent(fan - FAN0)); @@ -312,6 +319,9 @@ namespace ExtUI { return TERN0(HAS_FAN, thermalManager.scaledFanSpeedPercent(fan - FAN0)); } + // + // High level axis and extruder positions + // float getAxisPosition_mm(const axis_t axis) { return current_position[axis]; } @@ -349,6 +359,9 @@ namespace ExtUI { line_to_current_position(feedrate ?: manual_feedrate_mm_s.e); } + // + // Tool changing + // void setActiveTool(const extruder_t extruder, bool no_move) { #if HAS_MULTI_EXTRUDER const uint8_t e = extruder - E0; @@ -370,11 +383,17 @@ namespace ExtUI { extruder_t getActiveTool() { return getTool(active_extruder); } + // + // Moving axes and extruders + // bool isMoving() { return planner.has_blocks_queued(); } + // + // Motion might be blocked by NO_MOTION_BEFORE_HOMING + // bool canMove(const axis_t axis) { switch (axis) { - #if IS_KINEMATIC || ENABLED(NO_MOTION_BEFORE_HOMING) + #if ANY(IS_KINEMATIC, NO_MOTION_BEFORE_HOMING) OPTCODE(HAS_X_AXIS, case X: return !axis_should_home(X_AXIS)) OPTCODE(HAS_Y_AXIS, case Y: return !axis_should_home(Y_AXIS)) OPTCODE(HAS_Z_AXIS, case Z: return !axis_should_home(Z_AXIS)) @@ -385,20 +404,34 @@ namespace ExtUI { } } + // + // E Motion might be prevented by cold material + // bool canMove(const extruder_t extruder) { return !thermalManager.tooColdToExtrude(extruder - E0); } + // + // Host Keepalive, used by awaitingUserConfirm + // #if ENABLED(HOST_KEEPALIVE_FEATURE) GcodeSuite::MarlinBusyState getHostKeepaliveState() { return gcode.busy_state; } bool getHostKeepaliveIsPaused() { return gcode.host_keepalive_is_paused(); } #endif + // + // Soft Endstops Enabled/Disabled State + // + #if HAS_SOFTWARE_ENDSTOPS bool getSoftEndstopState() { return soft_endstop._enabled; } void setSoftEndstopState(const bool value) { soft_endstop._enabled = value; } #endif + // + // Trinamic Current / Bump Sensitivity + // + #if HAS_TRINAMIC_CONFIG float getAxisCurrent_mA(const axis_t axis) { switch (axis) { @@ -626,6 +659,10 @@ namespace ExtUI { } #endif + // + // Planner Accessors / Setters + // + float getAxisSteps_per_mm(const axis_t axis) { return planner.settings.axis_steps_per_mm[axis]; } @@ -1103,6 +1140,7 @@ namespace ExtUI { bool isMediaInserted() { return TERN0(HAS_MEDIA, IS_SD_INSERTED()); } + // Pause/Resume/Stop are implemented in MarlinUI void pausePrint() { ui.pause_print(); } void resumePrint() { ui.resume_print(); } void stopPrint() { ui.abort_print(); } diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 125c85ffa275..0d2c3e8d86a5 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -72,6 +72,28 @@ namespace ExtUI { typedef float bed_mesh_t[GRID_MAX_POINTS_X][GRID_MAX_POINTS_Y]; #endif + /** + * The Extensible UI API is a utility class that can be used to implement: + * - An LCD view that responds to standard events, e.g., onMediaInserted(...) + * - An LCD that polls firmware states and settings in a standard manner. + * (e.g., With tool indexes and extruder indexes). + * - Standard hooks to send data to a serial-based controller. + * + * ExtUI is best used when: + * - The display handles LCD touch / buttons so the firmware doesn't see these events. + * - Commands and value edits are sent over serial to Marlin as G-codes. + * - The display can get data from Marlin, but is not necessarily drawn by Marlin. + * - The display cannot implement a MarlinUI menu. + * - The display is implemented with code callbacks alongside ExtUI callbacks. + * + * Building an ExtUI layer: + * - Start by making an lcd/extui subfolder. Copy 'example' or another display. + * - Many of these methods are optional. Implement them according to your UI needs. + * - If your display needs information from Marlin, add an accessor to ExtUI. + * - If some addition seems like it should be standard part of ExtUI, submit a PR with the new + * methods added to this API. Implement in the ExtUI example and/or with some existing displays. + */ + bool isMoving(); bool isAxisPositionKnown(const axis_t); bool isAxisPositionKnown(const extruder_t); @@ -89,11 +111,6 @@ namespace ExtUI { bool getHostKeepaliveIsPaused(); #endif - bool isHeaterIdle(const heater_t); - bool isHeaterIdle(const extruder_t); - void enableHeater(const heater_t); - void enableHeater(const extruder_t); - #if ENABLED(JOYSTICK) void jog(const xyz_float_t &dir); void _joystick_update(xyz_float_t &norm_jog); @@ -101,7 +118,7 @@ namespace ExtUI { /** * Getters and setters - * Should be used by the EXTENSIBLE_UI to query or change Marlin's state. + * Use to query or change Marlin's state. */ PGM_P getFirmwareName_str(); @@ -110,6 +127,7 @@ namespace ExtUI { void setSoftEndstopState(const bool); #endif + // Trinamic Current / Bump Sensitivity #if HAS_TRINAMIC_CONFIG float getAxisCurrent_mA(const axis_t); float getAxisCurrent_mA(const extruder_t); @@ -120,37 +138,50 @@ namespace ExtUI { void setTMCBumpSensitivity(const_float_t, const axis_t); #endif + // Actual and target accessors, by Heater ID, Extruder ID, Fan ID + void enableHeater(const heater_t); + void enableHeater(const extruder_t); + bool isHeaterIdle(const heater_t); + bool isHeaterIdle(const extruder_t); celsius_float_t getActualTemp_celsius(const heater_t); celsius_float_t getActualTemp_celsius(const extruder_t); celsius_float_t getTargetTemp_celsius(const heater_t); celsius_float_t getTargetTemp_celsius(const extruder_t); - float getTargetFan_percent(const fan_t); float getActualFan_percent(const fan_t); + float getTargetFan_percent(const fan_t); + + // High level positions, by Axis ID, Extruder ID float getAxisPosition_mm(const axis_t); float getAxisPosition_mm(const extruder_t); + // Axis steps-per-mm, by Axis ID, Extruder ID float getAxisSteps_per_mm(const axis_t); float getAxisSteps_per_mm(const extruder_t); + // Speed and acceleration limits, per Axis ID or Extruder ID feedRate_t getAxisMaxFeedrate_mm_s(const axis_t); feedRate_t getAxisMaxFeedrate_mm_s(const extruder_t); float getAxisMaxAcceleration_mm_s2(const axis_t); float getAxisMaxAcceleration_mm_s2(const extruder_t); + // Standard speeds, as set in the planner feedRate_t getMinFeedrate_mm_s(); feedRate_t getMinTravelFeedrate_mm_s(); feedRate_t getFeedrate_mm_s(); + // Standard accelerations, as set in the planner float getPrintingAcceleration_mm_s2(); float getRetractAcceleration_mm_s2(); float getTravelAcceleration_mm_s2(); + // A speed multiplier for overall printing float getFeedrate_percent(); + // The flow percentage of an extruder int16_t getFlow_percent(const extruder_t); + // Progress / Elapsed Time inline uint8_t getProgress_percent() { return ui.get_progress_percent(); } - #if HAS_PRINT_PROGRESS_PERMYRIAD inline uint16_t getProgress_permyriad() { return ui.get_progress_permyriad(); } #endif - uint32_t getProgress_seconds_elapsed(); + // Material Preheat Presets #if HAS_PREHEAT uint16_t getMaterial_preset_E(const uint16_t); #if HAS_HEATED_BED @@ -158,6 +189,7 @@ namespace ExtUI { #endif #endif + // IDEX Machine Mode #if ENABLED(DUAL_X_CARRIAGE) uint8_t getIDEX_Mode(); #endif @@ -170,12 +202,14 @@ namespace ExtUI { #endif #if HAS_LEVELING + // Global leveling state, events bool getLevelingActive(); void setLevelingActive(const bool); bool getLevelingIsValid(); void onLevelingStart(); void onLevelingDone(); #if HAS_MESH + // Mesh data, utilities, events bed_mesh_t& getMeshArray(); float getMeshPoint(const xy_uint8_t &pos); void setMeshPoint(const xy_uint8_t &pos, const_float_t zval); @@ -198,17 +232,20 @@ namespace ExtUI { #endif #endif + // Send an 'M876 S' host response #if ENABLED(HOST_PROMPT_SUPPORT) void setHostResponse(const uint8_t); #endif + // Provide a simulated click to MarlinUI inline void simulateUserClick() { - #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_JYERSUI) + #if ANY(HAS_MARLINUI_MENU, EXTENSIBLE_UI) ui.lcd_clicked = true; #endif } #if ENABLED(PRINTCOUNTER) + // Printcounter strings (See nextion_tft.cpp) char* getFailedPrints_str(char buffer[21]); char* getTotalPrints_str(char buffer[21]); char* getFinishedPrints_str(char buffer[21]); @@ -217,12 +254,17 @@ namespace ExtUI { char* getFilamentUsed_str(char buffer[21]); #endif + // Temperature Control void setTargetTemp_celsius(const_float_t, const heater_t); void setTargetTemp_celsius(const_float_t, const extruder_t); void setTargetFan_percent(const_float_t, const fan_t); void coolDown(); + + // Motion Control void setAxisPosition_mm(const_float_t, const axis_t, const feedRate_t=0); void setAxisPosition_mm(const_float_t, const extruder_t, const feedRate_t=0); + + // Planner Control void setAxisSteps_per_mm(const_float_t, const axis_t); void setAxisSteps_per_mm(const_float_t, const extruder_t); void setAxisMaxFeedrate_mm_s(const feedRate_t, const axis_t); @@ -237,20 +279,25 @@ namespace ExtUI { void setTravelAcceleration_mm_s2(const_float_t); void setFeedrate_percent(const_float_t); void setFlow_percent(const int16_t, const extruder_t); + + // Waiting for User Interaction bool awaitingUserConfirm(); void setUserConfirmed(); #if M600_PURGE_MORE_RESUMABLE + // "Purge More" has a control screen void setPauseMenuResponse(PauseMenuResponse); extern PauseMessage pauseModeStatus; PauseMode getPauseMode(); #endif #if ENABLED(LIN_ADVANCE) + // Linear Advance Control float getLinearAdvance_mm_mm_s(const extruder_t); void setLinearAdvance_mm_mm_s(const_float_t, const extruder_t); #endif + // JD or Jerk Control #if HAS_JUNCTION_DEVIATION float getJunctionDeviation_mm(); void setJunctionDeviation_mm(const_float_t); @@ -261,10 +308,12 @@ namespace ExtUI { void setAxisMaxJerk_mm_s(const_float_t, const extruder_t); #endif + // Tool Changing extruder_t getTool(const uint8_t extruder); extruder_t getActiveTool(); void setActiveTool(const extruder_t, bool no_move); + // Babystepping (axis, probe offset) #if ENABLED(BABYSTEPPING) int16_t mmToWholeSteps(const_float_t mm, const axis_t axis); float mmFromWholeSteps(int16_t steps, const axis_t axis); @@ -273,20 +322,24 @@ namespace ExtUI { void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles); #endif + // Hotend Offsets #if HAS_HOTEND_OFFSET float getNozzleOffset_mm(const axis_t, const extruder_t); void setNozzleOffset_mm(const_float_t, const axis_t, const extruder_t); void normalizeNozzleOffset(const axis_t axis); #endif + // The Probe Z Offset float getZOffset_mm(); void setZOffset_mm(const_float_t); + // The Probe XYZ Offset #if HAS_BED_PROBE float getProbeOffset_mm(const axis_t); void setProbeOffset_mm(const_float_t, const axis_t); #endif + // Backlash Control #if ENABLED(BACKLASH_GCODE) float getAxisBacklash_mm(const axis_t); void setAxisBacklash_mm(const_float_t, const axis_t); @@ -300,6 +353,7 @@ namespace ExtUI { #endif #endif + // Filament Runout Sensor #if HAS_FILAMENT_SENSOR bool getFilamentRunoutEnabled(); void setFilamentRunoutEnabled(const bool); @@ -312,6 +366,7 @@ namespace ExtUI { #endif #endif + // Case Light Control #if ENABLED(CASE_LIGHT_ENABLE) bool getCaseLightState(); void setCaseLightState(const bool); @@ -322,11 +377,13 @@ namespace ExtUI { #endif #endif + // Power-Loss Recovery #if ENABLED(POWER_LOSS_RECOVERY) bool getPowerLossRecoveryEnabled(); void setPowerLossRecoveryEnabled(const bool); #endif + // Hotend PID #if ENABLED(PIDTEMP) float getPID_Kp(const extruder_t); float getPID_Ki(const extruder_t); @@ -335,6 +392,7 @@ namespace ExtUI { void startPIDTune(const celsius_t, extruder_t); #endif + // Bed PID #if ENABLED(PIDTEMPBED) float getBedPID_Kp(); float getBedPID_Ki(); @@ -361,8 +419,7 @@ namespace ExtUI { /** * Media access routines - * - * Should be used by the EXTENSIBLE_UI to operate on files + * Use these to operate on files */ bool isMediaInserted(); bool isPrintingFromMediaPaused(); @@ -394,8 +451,7 @@ namespace ExtUI { /** * Event callback routines - * - * Should be declared by EXTENSIBLE_UI and will be called by Marlin + * Must be defined, and will be called by Marlin as needed */ void onStartup(); void onIdle(); From d961dbae8d5c037b76725ee999016773bb2f3f68 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 4 Oct 2023 09:21:53 +1300 Subject: [PATCH 059/268] =?UTF-8?q?=F0=9F=94=A7=20Fix=20SanityCheck=20typo?= =?UTF-8?q?=20(#26223)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b2b336bd17a7..361bd5b27ee3 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2314,9 +2314,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #elif Y_HOME_TO_MAX && !HAS_Y_MAX_STATE #error "Y_MAX_PIN, Y_STOP_PIN, or Y_SPI_SENSORLESS is required for Y axis homing." #elif Z_HOME_TO_MIN && !HAS_Z_MIN_STATE - #error "Z_MIN_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Y axis homing." + #error "Z_MIN_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Z axis homing." #elif Z_HOME_TO_MAX && !HAS_Z_MAX_STATE - #error "Z_MAX_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Y axis homing." + #error "Z_MAX_PIN, Z_STOP_PIN, or Z_SPI_SENSORLESS is required for Z axis homing." #elif I_HOME_TO_MIN && !HAS_I_MIN_STATE #error "I_MIN_PIN, I_STOP_PIN, or I_SPI_SENSORLESS is required for I axis homing." #elif I_HOME_TO_MAX && !HAS_I_MAX_STATE From b9e58cd3eae21b0df94e8db16cd503730c7510a8 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:23:40 -0700 Subject: [PATCH 060/268] =?UTF-8?q?=F0=9F=94=A7=20BigTreeTech=20Manta=20M4?= =?UTF-8?q?P=20is=20v2.1=20(#26226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 2 +- Marlin/src/pins/pins.h | 8 ++++++-- ...ins_BTT_MANTA_M4P_V1_0.h => pins_BTT_MANTA_M4P_V2_1.h} | 2 +- ini/stm32g0.ini | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) rename Marlin/src/pins/stm32g0/{pins_BTT_MANTA_M4P_V1_0.h => pins_BTT_MANTA_M4P_V2_1.h} (99%) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 0c27fbbe25bf..020907fe875e 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -320,7 +320,7 @@ #define BOARD_BTT_EBB42_V1_1 4000 // BigTreeTech EBB42 V1.1 (STM32G0B1CB) #define BOARD_BTT_SKR_MINI_E3_V3_0 4001 // BigTreeTech SKR Mini E3 V3.0 (STM32G0B0RE / STM32G0B1RE) #define BOARD_BTT_MANTA_E3_EZ_V1_0 4002 // BigTreeTech Manta E3 EZ V1.0 (STM32G0B1RE) -#define BOARD_BTT_MANTA_M4P_V1_0 4003 // BigTreeTech Manta M4P V1.0 (STM32G0B0RE) +#define BOARD_BTT_MANTA_M4P_V2_1 4003 // BigTreeTech Manta M4P V2.1 (STM32G0B0RE) #define BOARD_BTT_MANTA_M5P_V1_0 4004 // BigTreeTech Manta M5P V1.0 (STM32G0B1RE) #define BOARD_BTT_MANTA_M8P_V1_0 4005 // BigTreeTech Manta M8P V1.0 (STM32G0B1VE) #define BOARD_BTT_MANTA_M8P_V1_1 4006 // BigTreeTech Manta M8P V1.1 (STM32G0B1VE) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 48405335ef20..5737f3eea0f8 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -555,8 +555,8 @@ #include "stm32g0/pins_BTT_EBB42_V1_1.h" // STM32G0 env:BTT_EBB42_V1_1_filament_extruder #elif MB(BTT_SKR_MINI_E3_V3_0) #include "stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h" // STM32G0 env:STM32G0B1RE_btt env:STM32G0B1RE_btt_xfer -#elif MB(BTT_MANTA_M4P_V1_0) - #include "stm32g0/pins_BTT_MANTA_M4P_V1_0.h" // STM32G0 env:STM32G0B1RE_manta_btt env:STM32G0B1RE_manta_btt_xfer +#elif MB(BTT_MANTA_M4P_V2_1) + #include "stm32g0/pins_BTT_MANTA_M4P_V2_1.h" // STM32G0 env:STM32G0B1RE_manta_btt env:STM32G0B1RE_manta_btt_xfer #elif MB(BTT_MANTA_M5P_V1_0) #include "stm32g0/pins_BTT_MANTA_M5P_V1_0.h" // STM32G0 env:STM32G0B1RE_manta_btt env:STM32G0B1RE_manta_btt_xfer #elif MB(BTT_MANTA_E3_EZ_V1_0) @@ -927,6 +927,7 @@ #define BOARD_BTT_SKR_SE_BX 99924 #define BOARD_MKS_MONSTER8 99925 #define BOARD_LINUX_RAMPS 99926 + #define BOARD_BTT_MANTA_M4P_V1_0 99927 #if MB(MKS_13) #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration." @@ -984,6 +985,8 @@ #error "BOARD_MKS_MONSTER8 is now BOARD_MKS_MONSTER8_V1 or BOARD_MKS_MONSTER8_V2. Please update your configuration." #elif MB(LINUX_RAMPS) #error "BOARD_LINUX_RAMPS is now BOARD_SIMULATED. Please update your configuration." + #elif MB(BTT_MANTA_M4P_V1_0) + #error "BOARD_BTT_MANTA_M4P_V1_0 is now BOARD_BTT_MANTA_M4P_V2_1. Please update your configuration." #elif defined(MOTHERBOARD) #error "Unknown MOTHERBOARD value set in Configuration.h." #else @@ -1018,6 +1021,7 @@ #undef BOARD_BTT_SKR_SE_BX #undef BOARD_MKS_MONSTER8 #undef BOARD_LINUX_RAMPS + #undef BOARD_BTT_MANTA_M4P_V1_0 #endif diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h similarity index 99% rename from Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h rename to Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h index f3c79f0cdcac..2990fc50a1b9 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h @@ -26,7 +26,7 @@ //#define BOARD_CUSTOM_BUILD_FLAGS -DTONE_CHANNEL=4 -DTONE_TIMER=4 -DTIMER_TONE=4 #ifndef BOARD_INFO_NAME - #define BOARD_INFO_NAME "BTT Manta M4P V1.0" + #define BOARD_INFO_NAME "BTT Manta M4P V2.1" #endif #define USES_DIAG_JUMPERS diff --git a/ini/stm32g0.ini b/ini/stm32g0.ini index fa6e5cba74ce..64abd62b32f1 100644 --- a/ini/stm32g0.ini +++ b/ini/stm32g0.ini @@ -76,7 +76,7 @@ extra_scripts = ${env:STM32G0B1RE_btt.extra_scripts} upload_protocol = custom # -# BigTreeTech Manta M4P V1.0 (STM32G0B0RET6 ARM Cortex-M0+) +# BigTreeTech Manta M4P V2.1 (STM32G0B0RET6 ARM Cortex-M0+) # BigTreeTech Manta E3 EZ V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+) # [env:STM32G0B1RE_manta_btt] @@ -85,7 +85,7 @@ build_flags = ${env:STM32G0B1RE_btt.build_flags} -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8 -DENABLE_HWSERIAL3 # -# BigTreeTech Manta M4P V1.0 (STM32G0B0RET6 ARM Cortex-M0+) +# BigTreeTech Manta M4P V2.1 (STM32G0B0RET6 ARM Cortex-M0+) # BigTreeTech Manta E3 EZ V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+) # Custom upload to SD via Marlin with Binary Protocol # Requires Marlin with BINARY_FILE_TRANSFER already installed on the target board. From 896492442c3e1ae8335f7011fb44b368667a3067 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 4 Oct 2023 00:36:20 +0000 Subject: [PATCH 061/268] [cron] Bump distribution date (2023-10-04) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 4ec85eed6b39..c3647885d3ab 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-09-30" +//#define STRING_DISTRIBUTION_DATE "2023-10-04" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a2f440fb687b..bee6129524bb 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-09-30" + #define STRING_DISTRIBUTION_DATE "2023-10-04" #endif /** From 596d1ff104aa809165862bdf272caa6cc1f8ddb1 Mon Sep 17 00:00:00 2001 From: EvilGremlin <22657714+EvilGremlin@users.noreply.github.com> Date: Thu, 5 Oct 2023 07:47:23 +0300 Subject: [PATCH 062/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20TFT=20string=20cod?= =?UTF-8?q?e=20(#26292)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/tft/tft_string.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index 6ee1bab6d3f7..9b4ab3e0843c 100644 --- a/Marlin/src/lcd/tft/tft_string.cpp +++ b/Marlin/src/lcd/tft/tft_string.cpp @@ -58,7 +58,7 @@ void TFT_String::set_font(const uint8_t *font) { for (glyph = 0; glyph < EXTRA_GLYPHS; glyph++) glyphs_extra[glyph] = nullptr; #endif - DEBUG_ECHOLNPGM("Format: ", ((unifont_t *)font_header)->Format); + DEBUG_ECHOLNPGM("Format: ", ((unifont_t *)font_header)->format); DEBUG_ECHOLNPGM("capitalAHeight: ", ((unifont_t *)font_header)->capitalAHeight); DEBUG_ECHOLNPGM("fontStartEncoding: ", ((unifont_t *)font_header)->fontStartEncoding); DEBUG_ECHOLNPGM("fontEndEncoding: ", ((unifont_t *)font_header)->fontEndEncoding); @@ -129,7 +129,7 @@ glyph_t *TFT_String::glyph(uint16_t character) { #if EXTRA_GLYPHS if (font_header_extra == nullptr || character < font_header_extra->fontStartEncoding || character > font_header_extra->fontEndEncoding) return glyphs['?']; - if ((font_header_extra->Format & 0xF0) == FONT_MARLIN_GLYPHS) { + if ((font_header_extra->format & 0xF0) == FONT_MARLIN_GLYPHS) { if (glyphs_extra[character - font_header_extra->fontStartEncoding]) return (glyph_t *)glyphs_extra[character - font_header_extra->fontStartEncoding]; } From 273cbc6871491a3c1c5eff017c3ccc5ce56bb123 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 5 Oct 2023 06:06:14 +0000 Subject: [PATCH 063/268] [cron] Bump distribution date (2023-10-05) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index c3647885d3ab..85e84ad0bc28 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-04" +//#define STRING_DISTRIBUTION_DATE "2023-10-05" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index bee6129524bb..9d6f31219014 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-04" + #define STRING_DISTRIBUTION_DATE "2023-10-05" #endif /** From 91ab18d1d2825b85cbd17e8ef1eb0675754a4043 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Oct 2023 16:08:30 -0500 Subject: [PATCH 064/268] =?UTF-8?q?=F0=9F=93=9D=20Some=20settings=20units?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/Configuration_adv.h | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c00e59b5cd5d..6111f482f14d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -665,7 +665,7 @@ //#define MPCTEMP // ** EXPERIMENTAL ** See https://marlinfw.org/docs/features/model_predictive_control.html #define PID_MAX 255 // Limit hotend current while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current -#define PID_K1 0.95 // Smoothing factor within any PID loop +#define PID_K1 0.95 // Smoothing factor within any PID loop #if ENABLED(PIDTEMP) //#define PID_DEBUG // Print PID debug data to the serial port. Use 'M303 D' to toggle activation. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index b95b0c49e0c4..f07602dbe9ea 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -304,8 +304,8 @@ * THERMAL_PROTECTION_HYSTERESIS and/or THERMAL_PROTECTION_PERIOD */ #if ENABLED(THERMAL_PROTECTION_HOTENDS) - #define THERMAL_PROTECTION_PERIOD 40 // Seconds - #define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius + #define THERMAL_PROTECTION_PERIOD 40 // (seconds) + #define THERMAL_PROTECTION_HYSTERESIS 4 // (°C) //#define ADAPTIVE_FAN_SLOWING // Slow down the part-cooling fan if the temperature drops #if ENABLED(ADAPTIVE_FAN_SLOWING) @@ -327,50 +327,50 @@ * and/or decrease WATCH_TEMP_INCREASE. WATCH_TEMP_INCREASE should not be set * below 2. */ - #define WATCH_TEMP_PERIOD 40 // Seconds - #define WATCH_TEMP_INCREASE 2 // Degrees Celsius + #define WATCH_TEMP_PERIOD 40 // (seconds) + #define WATCH_TEMP_INCREASE 2 // (°C) #endif /** * 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_HYSTERESIS 2 // Degrees Celsius + #define THERMAL_PROTECTION_BED_PERIOD 20 // (seconds) + #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // (°C) /** * As described above, except for the bed (M140/M190/M303). */ - #define WATCH_BED_TEMP_PERIOD 60 // Seconds - #define WATCH_BED_TEMP_INCREASE 2 // Degrees Celsius + #define WATCH_BED_TEMP_PERIOD 60 // (seconds) + #define WATCH_BED_TEMP_INCREASE 2 // (°C) #endif /** * Thermal Protection parameters for the heated chamber. */ #if ENABLED(THERMAL_PROTECTION_CHAMBER) - #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds - #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius + #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // (seconds) + #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // (°C) /** * Heated chamber watch settings (M141/M191). */ - #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds - #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius + #define WATCH_CHAMBER_TEMP_PERIOD 60 // (seconds) + #define WATCH_CHAMBER_TEMP_INCREASE 2 // (°C) #endif /** * Thermal Protection parameters for the laser cooler. */ #if ENABLED(THERMAL_PROTECTION_COOLER) - #define THERMAL_PROTECTION_COOLER_PERIOD 10 // Seconds - #define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 // Degrees Celsius + #define THERMAL_PROTECTION_COOLER_PERIOD 10 // (seconds) + #define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 // (°C) /** * Laser cooling watch settings (M143/M193). */ - #define WATCH_COOLER_TEMP_PERIOD 60 // Seconds - #define WATCH_COOLER_TEMP_INCREASE 3 // Degrees Celsius + #define WATCH_COOLER_TEMP_PERIOD 60 // (seconds) + #define WATCH_COOLER_TEMP_INCREASE 3 // (°C) #endif #if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER) @@ -2413,7 +2413,7 @@ // Height above Z=0.0 to raise the nozzle. Lowering this can help the probe to heat faster. // Note: The Z=0.0 offset is determined by the probe Z offset (e.g., as set with M851 Z). - #define PTC_PROBE_HEATING_OFFSET 0.5 + #define PTC_PROBE_HEATING_OFFSET 0.5 // (mm) #endif #endif // PTC_PROBE || PTC_BED || PTC_HOTEND @@ -2611,7 +2611,7 @@ // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. // This "wait" is only sent when the buffer is empty. 1 second is a good value here. -//#define NO_TIMEOUTS 1000 // Milliseconds +//#define NO_TIMEOUTS 1000 // (ms) // Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK From bbb5aacc48db7bc875f3099018455cb07ae74f61 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Oct 2023 16:12:23 -0500 Subject: [PATCH 065/268] =?UTF-8?q?=F0=9F=93=9D=20Update=20config=20sectio?= =?UTF-8?q?ns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f07602dbe9ea..203825e76b41 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -564,6 +564,8 @@ #define TEMP_SENSOR_AD8495_OFFSET 0.0 #define TEMP_SENSOR_AD8495_GAIN 1.0 +// @section fans + /** * Controller Fan * To cool down the stepper drivers and MOSFETs. @@ -667,8 +669,6 @@ //#define NUM_REDUNDANT_FANS 1 // Number of sequential fans to synchronize with Fan 0 #endif -// @section extruder - /** * Extruder cooling fans * @@ -745,6 +745,7 @@ #define FANMUX2_PIN -1 /** + * @section caselight * M355 Case Light on-off / brightness */ //#define CASE_LIGHT_ENABLE @@ -767,7 +768,7 @@ #endif #endif -// @section homing +// @section endstops // If you want endstops to stay on (by default) even when not homing // enable this option. Override at any time with M120, M121. @@ -784,6 +785,8 @@ //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1 #endif +// @section idex + /** * Dual X Carriage * @@ -833,6 +836,8 @@ //#define EVENT_GCODE_IDEX_AFTER_MODECHANGE "G28X" #endif +// @section multi stepper + /** * Multi-Stepper / Multi-Endstop * @@ -904,6 +909,8 @@ //#define INVERT_E1_VS_E0_DIR // E direction signals are opposites #endif +// @section extruder + // Activate a solenoid on the active extruder with M380. Disable all with M381. // Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. //#define EXT_SOLENOID @@ -2351,6 +2358,8 @@ #endif +// @section probes + /** * Thermal Probe Compensation * @@ -2468,6 +2477,8 @@ #define G38_MINIMUM_MOVE 0.0275 // (mm) Minimum distance that will produce a move. #endif +// @section motion + // Moves (or segments) with fewer steps than this will be joined with the next move #define MIN_STEPS_PER_SEGMENT 6 @@ -2523,7 +2534,7 @@ //================================= Buffers ================================= //=========================================================================== -// @section motion +// @section gcode // The number of linear moves that can be in the planner at once. #if ALL(HAS_MEDIA, DIRECT_STEPPING) @@ -2643,6 +2654,8 @@ */ //#define EXTRA_FAN_SPEED +// @section gcode + /** * Firmware-based and LCD-controlled retract * @@ -2677,6 +2690,8 @@ #endif #endif +// @section tool change + /** * Universal tool change settings. * Applies to all types of extruders except where explicitly noted. From db98f0611004efd6e042c4cf53c881d7b1f3c10c Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:09:58 -0700 Subject: [PATCH 066/268] =?UTF-8?q?=F0=9F=9A=B8=20Warning=20alerts=20for?= =?UTF-8?q?=20non-fatal=20errors=20(#26306)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/core/debug_out.h | 4 ++++ Marlin/src/core/serial.cpp | 1 + Marlin/src/core/serial.h | 2 ++ Marlin/src/module/settings.cpp | 10 +++++----- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Marlin/src/core/debug_out.h b/Marlin/src/core/debug_out.h index 92ee233e0358..c4873b3730c2 100644 --- a/Marlin/src/core/debug_out.h +++ b/Marlin/src/core/debug_out.h @@ -52,6 +52,7 @@ #define DEBUG_ECHO_START SERIAL_ECHO_START #define DEBUG_ERROR_START SERIAL_ERROR_START + #define DEBUG_WARN_START SERIAL_WARN_START #define DEBUG_CHAR SERIAL_CHAR #define DEBUG_ECHO SERIAL_ECHO #define DEBUG_ECHOLN SERIAL_ECHOLN @@ -63,6 +64,7 @@ #define DEBUG_ECHOLNPGM_P SERIAL_ECHOLNPGM_P #define DEBUG_ECHO_MSG SERIAL_ECHO_MSG #define DEBUG_ERROR_MSG SERIAL_ERROR_MSG + #define DEBUG_WARN_MSG SERIAL_WARN_MSG #define DEBUG_EOL SERIAL_EOL #define DEBUG_FLUSH SERIAL_FLUSH #define DEBUG_POS SERIAL_POS @@ -75,6 +77,7 @@ #define DEBUG_SECTION(...) NOOP #define DEBUG_ECHO_START() NOOP #define DEBUG_ERROR_START() NOOP + #define DEBUG_WARN_START() NOOP #define DEBUG_CHAR(...) NOOP #define DEBUG_ECHO(...) NOOP #define DEBUG_ECHOLN(...) NOOP @@ -84,6 +87,7 @@ #define DEBUG_ECHOLNPGM_P(...) NOOP #define DEBUG_ECHO_MSG(...) NOOP #define DEBUG_ERROR_MSG(...) NOOP + #define DEBUG_WARN_MSG(...) NOOP #define DEBUG_EOL() NOOP #define DEBUG_FLUSH() NOOP #define DEBUG_POS(...) NOOP diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index addd01388ef7..a41740f25ffd 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -92,6 +92,7 @@ void SERIAL_ECHOLN_P(PGM_P pstr) { SERIAL_ECHO_P(pstr); SERIAL_EOL(); } void SERIAL_ECHO_START() { SERIAL_ECHO(F("echo:")); } void SERIAL_ERROR_START() { SERIAL_ECHO(F("Error:")); } +void SERIAL_WARN_START() { SERIAL_ECHO(F("Warning:")); } void SERIAL_ECHO_SP(uint8_t count) { count *= (PROPORTIONAL_FONT_RATIO); while (count--) SERIAL_CHAR(' '); } diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index 96cff02508e3..6b91371170f6 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -161,6 +161,7 @@ void SERIAL_FLUSHTX(); // Start an echo: or error: output void SERIAL_ECHO_START(); void SERIAL_ERROR_START(); +void SERIAL_WARN_START(); // Serial end-of-line void SERIAL_EOL(); @@ -227,6 +228,7 @@ void SERIAL_ECHOLN(T arg1, Args ... args) { SERIAL_ECHO(arg1); SERIAL_ECHO(args #define SERIAL_ECHO_MSG(V...) do{ SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(V); }while(0) #define SERIAL_ERROR_MSG(V...) do{ SERIAL_ERROR_START(); SERIAL_ECHOLNPGM(V); }while(0) +#define SERIAL_WARN_MSG(V...) do{ SERIAL_WARN_START(); SERIAL_ECHOLNPGM(V); }while(0) // Print a prefix, conditional string, and suffix void serial_ternary(FSTR_P const pre, const bool onoff, FSTR_P const on, FSTR_P const off, FSTR_P const post=nullptr); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index c125577f5ce9..a4820ae900af 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -758,7 +758,7 @@ void MarlinSettings::postprocess() { #if ENABLED(EEPROM_SETTINGS) - #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_MSG(ERR); eeprom_error = ERR_EEPROM_SIZE; } }while(0) + #define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_WARN_MSG(ERR); eeprom_error = ERR_EEPROM_SIZE; } }while(0) #define TWO_BYTE_HASH(A,B) uint16_t((uint16_t(A ^ 0xC3) << 4) ^ (uint16_t(B ^ 0xC3) << 12)) @@ -796,7 +796,7 @@ void MarlinSettings::postprocess() { EEPROM_Error MarlinSettings::size_error(const uint16_t size) { if (size != datasize()) { - DEBUG_ERROR_MSG("EEPROM datasize error." + DEBUG_WARN_MSG("EEPROM datasize error." #if ENABLED(MARLIN_DEV_MODE) " (Actual:", size, " Expected:", datasize(), ")" #endif @@ -2865,10 +2865,10 @@ void MarlinSettings::postprocess() { DEBUG_ECHO_MSG("Index: ", eeprom_index - (EEPROM_OFFSET), " Size: ", datasize()); break; case ERR_EEPROM_CORRUPT: - DEBUG_ERROR_MSG(STR_ERR_EEPROM_CORRUPT); + DEBUG_WARN_MSG(STR_ERR_EEPROM_CORRUPT); break; case ERR_EEPROM_CRC: - DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); + DEBUG_WARN_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!"); TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC))); break; default: break; @@ -3048,7 +3048,7 @@ void MarlinSettings::postprocess() { #else // !EEPROM_SETTINGS bool MarlinSettings::save() { - DEBUG_ERROR_MSG("EEPROM disabled"); + DEBUG_WARN_MSG("EEPROM disabled"); return false; } From f085e2ca9352840bb62ce1dc5a6228406ee61996 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Oct 2023 17:20:08 -0500 Subject: [PATCH 067/268] =?UTF-8?q?=F0=9F=A9=B9=20Remove=20extraneous=20'i?= =?UTF-8?q?nline'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See #26085 --- Marlin/src/HAL/STM32F1/MarlinSerial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp index 568fc05d4185..8c68a2de7f29 100644 --- a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp +++ b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp @@ -28,7 +28,7 @@ // Copied from ~/.platformio/packages/framework-arduinoststm32-maple/STM32F1/system/libmaple/usart_private.h // Changed to handle Emergency Parser -static inline __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart_reg_map *regs, MSerialT &serial) { +static __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart_reg_map *regs, MSerialT &serial) { /* Handle RXNEIE and TXEIE interrupts. * RXNE signifies availability of a byte in DR. * From 229ea71421debe36fe77a371bab3c4b40ce38fe8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Oct 2023 19:02:34 -0500 Subject: [PATCH 068/268] =?UTF-8?q?=F0=9F=93=9D=20Update=20dgus=5Fe3s1pro?= =?UTF-8?q?=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp index 530ce9bcf0e0..4916c0b59e38 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp @@ -21,7 +21,7 @@ */ /** - * lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp + * lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp */ #include "../../../inc/MarlinConfigPre.h" diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 68e405776e9d..3434bdf8c366 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -21,7 +21,7 @@ */ /** - * lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp + * lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp */ #include "../../../inc/MarlinConfigPre.h" From 31bf73b89bc92a385c8c51bdd804471b84c251f5 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 7 Oct 2023 00:19:28 +0000 Subject: [PATCH 069/268] [cron] Bump distribution date (2023-10-07) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 85e84ad0bc28..df53c52eea83 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-05" +//#define STRING_DISTRIBUTION_DATE "2023-10-07" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9d6f31219014..fab9b008d55b 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-05" + #define STRING_DISTRIBUTION_DATE "2023-10-07" #endif /** From 821ba43131a5d3c1c291f6a6086f66e83d44384d Mon Sep 17 00:00:00 2001 From: Piotr Piatkowski Date: Sat, 7 Oct 2023 02:56:10 +0200 Subject: [PATCH 070/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Endstop=20Test=20d?= =?UTF-8?q?ebug=20menu=20(#26326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_configuration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index edbf78ed7643..328bbe24eb0a 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -104,8 +104,8 @@ void menu_advanced_settings(); #define __STOP_ITEM(F,S) PSTRING_ITEM_F_P(F, TEST(stops, S) ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN), SS_FULL); #define _STOP_ITEM(L,S) __STOP_ITEM(F(L), S) - #define STOP_ITEM(A,I,M,L) TERN(HAS_##A##I##_##M_STATE, _STOP_ITEM, _IF_1_ELSE)(STRINGIFY(A) STRINGIFY(I) " " STRINGIFY(L), A##I##_##M) - #define STOP_MINMAX(A,I) STOP_ITEM(A,,MIN,"Min") STOP_ITEM(A,,MAX,"Max") + #define STOP_ITEM(A,I,M,L) TERN(HAS_##A##I##_##M##_STATE, _STOP_ITEM, _IF_1_ELSE)(STRINGIFY(A) STRINGIFY(I) " " STRINGIFY(L), A##I##_##M) + #define STOP_MINMAX(A,I) STOP_ITEM(A,I,MIN,"Min") STOP_ITEM(A,I,MAX,"Max") #define FIL_ITEM(N) PSTRING_ITEM_N_P(N-1, MSG_FILAMENT_EN, (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) ? PSTR("PRESENT") : PSTR("out"), SS_FULL); static void endstop_test() { From b3b6f23320d9ad8b8891a71d1ff289ccaf329edf Mon Sep 17 00:00:00 2001 From: Vovodroid Date: Sat, 7 Oct 2023 04:03:02 +0300 Subject: [PATCH 071/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Twe?= =?UTF-8?q?ak=20an=20'if'=20block=20(#26300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_media.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 26f7a0517d31..daa396601f2d 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -126,16 +126,18 @@ void menu_media_filelist() { else if (card.isMounted()) ACTION_ITEM_F(F(LCD_STR_FOLDER " .."), lcd_sd_updir); - if (ui.should_draw()) for (int16_t i = 0; i < fileCnt; i++) { - if (_menuLineNr == _thisItemNr) { - card.selectFileByIndexSorted(i); - if (card.flag.filenameIsDir) - MENU_ITEM(sdfolder, MSG_MEDIA_MENU, card); - else - MENU_ITEM(sdfile, MSG_MEDIA_MENU, card); + if (ui.should_draw()) { + for (int16_t i = 0; i < fileCnt; i++) { + if (_menuLineNr != _thisItemNr) + SKIP_ITEM(); + else { + card.selectFileByIndexSorted(i); + if (card.flag.filenameIsDir) + MENU_ITEM(sdfolder, MSG_MEDIA_MENU, card); + else + MENU_ITEM(sdfile, MSG_MEDIA_MENU, card); + } } - else - SKIP_ITEM(); } END_MENU(); } From 03cf2b577be63a8f630c2ad9547d0e2ab3b73e00 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 6 Oct 2023 19:15:28 -0500 Subject: [PATCH 072/268] misc. formatting, grid condition --- Marlin/src/core/utility.h | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 891a4e43836b..c3324443bab9 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -33,7 +33,7 @@ void safe_delay(millis_t ms); // Delay ensuring that temperatures are inline void serial_delay(const millis_t) {} #endif -#if (GRID_MAX_POINTS_X) && (GRID_MAX_POINTS_Y) +#if GRID_MAX_POINTS // 16x16 bit arrays template diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index e6768e1ef457..343252df4c7e 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4480,7 +4480,7 @@ void JyersDWIN::printScreenControl() { #endif TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan); planner.synchronize(); - TERN_(HAS_MEDIA, queue.inject(F("M24"))); + TERN_(HAS_MEDIA, queue.inject(FPSTR(M24_STR))); #endif } else { diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp index 37c52d86cdf4..94c881f3842f 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp @@ -107,8 +107,7 @@ void DGUSScreenHandler::loop() { } #if ENABLED(POWER_LOSS_RECOVERY) - if (booted && powerLossRecoveryAvailable) - { + if (booted && powerLossRecoveryAvailable) { triggerScreenChange(DGUS_ScreenID::POWERCONTINUE); powerLossRecoveryAvailable = false; } @@ -355,11 +354,8 @@ void DGUSScreenHandler::addCurrentPageStringLength(size_t stringLength, size_t t void DGUSScreenHandler::sdCardRemoved() { sdPrintFilename = noFileSelected; - - if (getCurrentScreen() >= DGUS_ScreenID::FILE1 - && getCurrentScreen() <= DGUS_ScreenID::FILE4) { + if (WITHIN(getCurrentScreen(), DGUS_ScreenID::FILE1, DGUS_ScreenID::FILE4)) triggerTempScreenChange(DGUS_ScreenID::SDCARDCHECK, DGUS_ScreenID::HOME); - } } void DGUSScreenHandler::sdCardError() {} From f3851408fe599a97a3f1a2337b3eda92c1aeeccf Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sat, 7 Oct 2023 07:44:27 +0300 Subject: [PATCH 073/268] =?UTF-8?q?=F0=9F=94=A7=20No=20TMC=5FHOME=5FPHASE?= =?UTF-8?q?=20on=20tandem=20steppers=20(#26310)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/SanityCheck.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 361bd5b27ee3..8afd1ae2e251 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3017,6 +3017,25 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA." #endif +// H-Bot kinematic axes can't use homing phases +#if ANY(IS_CORE, MARKFORGED_XY, MARKFORGED_YX) && defined(TMC_HOME_PHASE) + constexpr float _phases[] = TMC_HOME_PHASE, _vphase[9] = TMC_HOME_PHASE; + constexpr int _nphase = COUNT(_phases); + static_assert(_nphase == NUM_AXES, "TMC_HOME_PHASE must have exactly " _NUM_AXES_STR " elements."); + static_assert(_nphase < 0 || _vphase[0] == -1 || NORMAL_AXIS == 0, "TMC_HOME_PHASE.x must be -1 for the selected kinematics."); + static_assert(_nphase < 1 || _vphase[1] == -1 || NORMAL_AXIS == 1, "TMC_HOME_PHASE.y must be -1 for the selected kinematics."); + static_assert(_nphase < 2 || _vphase[2] == -1 || NORMAL_AXIS == 2, "TMC_HOME_PHASE.z must be -1 for the selected kinematics."); + static_assert(_nphase < 0 || WITHIN(_vphase[0], -1, 1023), "TMC_HOME_PHASE.x must be between -1 and 1023."); + static_assert(_nphase < 1 || WITHIN(_vphase[1], -1, 1023), "TMC_HOME_PHASE.y must be between -1 and 1023."); + static_assert(_nphase < 2 || WITHIN(_vphase[2], -1, 1023), "TMC_HOME_PHASE.z must be between -1 and 1023."); + static_assert(_nphase < 3 || WITHIN(_vphase[3], -1, 1023), "TMC_HOME_PHASE.i must be between -1 and 1023."); + static_assert(_nphase < 4 || WITHIN(_vphase[4], -1, 1023), "TMC_HOME_PHASE.j must be between -1 and 1023."); + static_assert(_nphase < 5 || WITHIN(_vphase[5], -1, 1023), "TMC_HOME_PHASE.k must be between -1 and 1023."); + static_assert(_nphase < 6 || WITHIN(_vphase[6], -1, 1023), "TMC_HOME_PHASE.u must be between -1 and 1023."); + static_assert(_nphase < 7 || WITHIN(_vphase[7], -1, 1023), "TMC_HOME_PHASE.v must be between -1 and 1023."); + static_assert(_nphase < 8 || WITHIN(_vphase[8], -1, 1023), "TMC_HOME_PHASE.w must be between -1 and 1023."); +#endif + #if ENABLED(SENSORLESS_HOMING) // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop // is necessary in order to reset the stallGuard indication between the initial movement of all three From b799f7d1f3447b5431c29c1a92323febcfa57eda Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Fri, 6 Oct 2023 23:45:32 -0500 Subject: [PATCH 074/268] =?UTF-8?q?=F0=9F=94=A7=20Forbid=20UBL=20Hilbert?= =?UTF-8?q?=20Curve=20on=20DELTA=20(#26296)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/SanityCheck.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 8afd1ae2e251..67862cf93192 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1517,6 +1517,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #error "AUTO_BED_LEVELING_UBL requires EEPROM_SETTINGS." #elif !WITHIN(GRID_MAX_POINTS_X, 3, 255) || !WITHIN(GRID_MAX_POINTS_Y, 3, 255) #error "GRID_MAX_POINTS_[XY] must be between 3 and 255." + #elif ALL(UBL_HILBERT_CURVE, DELTA) + #error "UBL_HILBERT_CURVE can only be used with a square / rectangular printable area." #endif #elif ENABLED(MESH_BED_LEVELING) #if ENABLED(DELTA) From f7a3172c20cfed3178ab9ab099ff386f61560ad9 Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Fri, 6 Oct 2023 23:53:52 -0500 Subject: [PATCH 075/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20DELTA=20Z=20when?= =?UTF-8?q?=20not=20using=20probe=20for=20homing=20(#26297)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/delta.cpp | 2 +- Marlin/src/module/motion.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index cfa134860b86..18eff415a370 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -242,7 +242,7 @@ void home_delta() { #endif // Move all carriages together linearly until an endstop is hit. - current_position.z = DIFF_TERN(HAS_BED_PROBE, delta_height + 10, probe.offset.z); + current_position.z = DIFF_TERN(USE_PROBE_FOR_Z_HOMING, delta_height + 10, probe.offset.z); line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); TERN_(HAS_DELTA_SENSORLESS_PROBING, endstops.report_states()); diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 272b16c9ac0f..d091e67e0495 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -892,7 +892,7 @@ void restore_feedrate_and_scaling() { #elif ENABLED(DELTA) soft_endstop.min[axis] = base_min_pos(axis); - soft_endstop.max[axis] = (axis == Z_AXIS) ? DIFF_TERN(HAS_BED_PROBE, delta_height, probe.offset.z) : base_max_pos(axis); + soft_endstop.max[axis] = (axis == Z_AXIS) ? DIFF_TERN(USE_PROBE_FOR_Z_HOMING, delta_height, probe.offset.z) : base_home_pos(axis); switch (axis) { case X_AXIS: @@ -2468,7 +2468,7 @@ void set_axis_is_at_home(const AxisEnum axis) { #if ANY(MORGAN_SCARA, AXEL_TPARA) scara_set_axis_is_at_home(axis); #elif ENABLED(DELTA) - current_position[axis] = (axis == Z_AXIS) ? DIFF_TERN(HAS_BED_PROBE, delta_height, probe.offset.z) : base_home_pos(axis); + current_position[axis] = (axis == Z_AXIS) ? DIFF_TERN(USE_PROBE_FOR_Z_HOMING, delta_height, probe.offset.z) : base_home_pos(axis); #else current_position[axis] = SUM_TERN(HAS_HOME_OFFSET, base_home_pos(axis), home_offset[axis]); #endif From 014609ad87d3556b44a00fef4c4983894f9d4354 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Oct 2023 00:29:34 -0500 Subject: [PATCH 076/268] =?UTF-8?q?=F0=9F=94=A7=20Move=20some=20config=20o?= =?UTF-8?q?ptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 6111f482f14d..bdd69d958ee8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1418,6 +1418,15 @@ //#define TOUCH_MI_MANUAL_DEPLOY // For manual deploy (LCD menu) #endif +/** + * Bed Distance Sensor + * + * Measures the distance from bed to nozzle with accuracy of 0.01mm. + * For information about this sensor https://github.com/markniu/Bed_Distance_sensor + * Uses I2C port, so it requires I2C library markyue/Panda_SoftMasterI2C. + */ +//#define BD_SENSOR + // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE @@ -1996,6 +2005,12 @@ //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING +/** + * Commands to execute at the end of G29 probing. + * Useful to retract or move the Z probe out of the way. + */ +//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" + /** * Normally G28 leaves leveling disabled on completion. Enable one of * these options to restore the prior leveling state or to always enable @@ -2013,15 +2028,6 @@ #define LEVELING_BED_TEMP 50 #endif -/** - * Bed Distance Sensor - * - * Measures the distance from bed to nozzle with accuracy of 0.01mm. - * For information about this sensor https://github.com/markniu/Bed_Distance_sensor - * Uses I2C port, so it requires I2C library markyue/Panda_SoftMasterI2C. - */ -//#define BD_SENSOR - /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. @@ -2201,12 +2207,6 @@ #define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB } #endif -/** - * Commands to execute at the end of G29 probing. - * Useful to retract or move the Z probe out of the way. - */ -//#define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" - // @section homing // The center of the bed is at (X=0, Y=0) From 4cab75115fe559e702ebe7a8dc040ebe0d6d4d0b Mon Sep 17 00:00:00 2001 From: Orel <37673727+0r31@users.noreply.github.com> Date: Sat, 7 Oct 2023 08:10:22 +0200 Subject: [PATCH 077/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20G33=20output=20(#2?= =?UTF-8?q?6299)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/calibrate/G33.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index 23753e077fdc..0cddf484eb6b 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -459,9 +459,8 @@ void GcodeSuite::G33() { SERIAL_ECHOLNPGM("G33 Auto Calibrate"); // Report settings - PGM_P const checkingac = PSTR("Checking... AC"); - SERIAL_ECHOPGM_P(checkingac); - SERIAL_ECHOPGM(" at radius:", dcr); + FSTR_P const checkingac = F("Checking... AC"); + SERIAL_ECHO(checkingac, F(" at radius:"), dcr); if (verbose_level == 0) SERIAL_ECHOPGM(" (DRY-RUN)"); SERIAL_EOL(); ui.set_status(checkingac); From 6c0f4bbafd4b95d770c4aacf7d9d9df4be50b892 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 6 Oct 2023 23:21:41 -0700 Subject: [PATCH 078/268] =?UTF-8?q?=E2=9C=85=20CI=20test=20for=20STM32G0?= =?UTF-8?q?=20(#26327)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 3 +++ buildroot/tests/STM32G0B1RE_btt | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 buildroot/tests/STM32G0B1RE_btt diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 7ebbcd006698..ff4e7ee648b9 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -133,6 +133,9 @@ jobs: #- STM32F103RC_btt_maple #- STM32F103RE_creality_maple + # STM32G0 + - STM32G0B1RE_btt + # LPC176x - Lengthy tests - LPC1768 - LPC1769 diff --git a/buildroot/tests/STM32G0B1RE_btt b/buildroot/tests/STM32G0B1RE_btt new file mode 100755 index 000000000000..35ccf0f93688 --- /dev/null +++ b/buildroot/tests/STM32G0B1RE_btt @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Build tests for STM32G0B1RE_btt / Ender-3 with SKR Mini E3 V3.0 (STM32G0) +# + +# exit on first failure +set -e + +# +# Build with the default configurations +# +use_example_configs "Creality/Ender-3/BigTreeTech SKR Mini E3 3.0" +exec_test $1 $2 "Creality/Ender-3/BigTreeTech SKR Mini E3 3.0" "$3" + +# clean up +restore_configs From 375e724deebac8a71a3c37c84b6f1170922e302a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 8 Oct 2023 00:21:49 +0000 Subject: [PATCH 079/268] [cron] Bump distribution date (2023-10-08) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index df53c52eea83..d7385ac18f1e 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-07" +//#define STRING_DISTRIBUTION_DATE "2023-10-08" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index fab9b008d55b..80859e8ba57a 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-07" + #define STRING_DISTRIBUTION_DATE "2023-10-08" #endif /** From 7fa643a11eb97907eb23fb72ffd86100c7630e39 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Mon, 9 Oct 2023 09:16:28 +1300 Subject: [PATCH 080/268] =?UTF-8?q?=F0=9F=94=A8=20Specify=20LPC=20toolchai?= =?UTF-8?q?n=201.100301.220327=20(#26249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/lpc176x.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/ini/lpc176x.ini b/ini/lpc176x.ini index 548baaa4107a..8d5d2fd157f5 100644 --- a/ini/lpc176x.ini +++ b/ini/lpc176x.ini @@ -15,6 +15,7 @@ [common_LPC] platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip platform_packages = framework-arduino-lpc176x@^0.2.8 + toolchain-gccarmnoneeabi@1.100301.220327 board = nxp_lpc1768 lib_ldf_mode = off lib_compat_mode = strict From e68320ee2b10ae5c7bf3bf816e80c3621a20fcd2 Mon Sep 17 00:00:00 2001 From: Erkan Ozgur Yilmaz Date: Sun, 8 Oct 2023 21:39:46 +0100 Subject: [PATCH 081/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MMU=20late=20init?= =?UTF-8?q?=20(#26331)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/mmu/mmu2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp index 19aae7b7d747..dbf8171a276e 100644 --- a/Marlin/src/feature/mmu/mmu2.cpp +++ b/Marlin/src/feature/mmu/mmu2.cpp @@ -160,7 +160,7 @@ void MMU2::mmu_loop() { MMU2_SEND("S1"); // Read Version state = -2; } - else if (millis() > 30000) { // 30sec after reset disable MMU + else if (ELAPSED(millis(), prev_request + 30000)) { // 30sec after reset disable MMU SERIAL_ECHOLNPGM("MMU not responding - DISABLED"); state = 0; } From 414b1f83271e5dbc85568c3ac8f9d2beabdbc1c4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 8 Oct 2023 15:10:18 -0500 Subject: [PATCH 082/268] =?UTF-8?q?=F0=9F=A9=B9=20Serial=20warning=20follo?= =?UTF-8?q?wup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #26306 --- Marlin/src/core/debug_out.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/core/debug_out.h b/Marlin/src/core/debug_out.h index c4873b3730c2..6dd358997612 100644 --- a/Marlin/src/core/debug_out.h +++ b/Marlin/src/core/debug_out.h @@ -29,6 +29,7 @@ #undef DEBUG_SECTION #undef DEBUG_ECHO_START #undef DEBUG_ERROR_START +#undef DEBUG_WARN_START #undef DEBUG_CHAR #undef DEBUG_ECHO #undef DEBUG_ECHOLN @@ -38,6 +39,7 @@ #undef DEBUG_ECHOLNPGM_P #undef DEBUG_ECHO_MSG #undef DEBUG_ERROR_MSG +#undef DEBUG_WARN_MSG #undef DEBUG_EOL #undef DEBUG_FLUSH #undef DEBUG_POS From f0ad1e9b70210f7f3713cc09e471367875a44c49 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 8 Oct 2023 15:11:19 -0500 Subject: [PATCH 083/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Upd?= =?UTF-8?q?ate=20dev=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/pins_set | 5 +++-- buildroot/share/git/mfhelp | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/buildroot/bin/pins_set b/buildroot/bin/pins_set index 31b4480449a5..216eabc07686 100755 --- a/buildroot/bin/pins_set +++ b/buildroot/bin/pins_set @@ -9,7 +9,8 @@ SED=$(which gsed sed | head -n1) shift while [[ $# > 1 ]]; do PIN=$1 ; VAL=$2 - eval "${SED} -i '/^[[:blank:]]*\(\/\/\)*[[:blank:]]*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/$DIR/pins_${NAM}.h" || - (echo "ERROR: pins_set Can't find ${PIN}" >&2 && exit 9) + FOUT="${DIR}/pins_${NAM}.h" + eval "${SED} -i '/^[[:blank:]]*\(\/\/\)*[[:blank:]]*\(#define \+${PIN}\b\).*$/{s//\2 ${VAL}/;h};\${x;/./{x;q0};x;q9}' Marlin/src/pins/${FOUT}" || + (echo "ERROR: pins_set Can't find ${PIN} in ${FOUT}" >&2 && exit 9) shift 2 done diff --git a/buildroot/share/git/mfhelp b/buildroot/share/git/mfhelp index 1afc4c686b81..46a0ebfc5333 100755 --- a/buildroot/share/git/mfhelp +++ b/buildroot/share/git/mfhelp @@ -8,7 +8,7 @@ Marlin Firmware Commands: firstpush ... Push and set-upstream the current branch to 'origin' ghpc ........ Push the current branch to its upstream branch - ghtp ........ Set the transfer protolcol for all your remotes + ghtp ........ Set the transfer protocol for all your remotes mfadd ....... Fetch a remote branch from any Marlin fork mfclean ..... Attempt to clean up merged and deleted branches mfdoc ....... Build the website, serve locally, and browse @@ -25,4 +25,22 @@ Marlin Firmware Commands: Enter [command] --help for more information. +Build / Test Commands: + + mftest ............... Run a platform test locally with PlatformIO + build_all_examples ... Build all configurations of a branch, stop on error + +Modify Configuration.h / Configuration_adv.h: + + opt_add .............. Add a configuration option (to the top of Configuration.h) + opt_disable .......... Disable a configuration option (modifies ) + opt_enable ........... Enable a configuration option + opt_set .............. Set the value of a configuration option + use_example_configs .. Download configs from a remote branch on GitHub + +Modify pins files: + + pins_set ............. Set the value of a pin in a pins file + pinsformat.js ........ Node.js script to format pins files + THIS From 9cd341c2c3b2ea4e38852325bec98c349addf7f8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 8 Oct 2023 18:09:49 -0500 Subject: [PATCH 084/268] =?UTF-8?q?=F0=9F=A9=B9=20Patches=20for=20MSC=20SD?= =?UTF-8?q?=20(#26332)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/msc_sd.cpp | 6 +++--- Marlin/src/lcd/dogm/u8g_fontutf8.cpp | 4 ++-- buildroot/tests/STM32F103RE_btt_USB | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/HAL/STM32/msc_sd.cpp b/Marlin/src/HAL/STM32/msc_sd.cpp index f03f533a7195..d7652abdc2ea 100644 --- a/Marlin/src/HAL/STM32/msc_sd.cpp +++ b/Marlin/src/HAL/STM32/msc_sd.cpp @@ -71,9 +71,9 @@ class Sd2CardUSBMscHandler : public USBMscHandler { bool done = false; for (uint16_t rcount = SD_MULTIBLOCK_RETRY_CNT; !done && rcount--;) { uint8_t *cBuf = pBuf; - sd2card->writeStart(blkAddr); + sd2card->writeStart(blkAddr, blkLen); bool okay = true; // Assume success - for (uint32 i = blkLen; i--;) { + for (uint32_t i = blkLen; i--;) { hal.watchdog_refresh(); if (!sd2card->writeData(cBuf)) { // Write. Did it fail? sd2card->writeStop(); // writeStop for new writeStart @@ -103,7 +103,7 @@ class Sd2CardUSBMscHandler : public USBMscHandler { uint8_t *cBuf = pBuf; sd2card->readStart(blkAddr); bool okay = true; // Assume success - for (uint32 i = blkLen; i--;) { + for (uint32_t i = blkLen; i--;) { hal.watchdog_refresh(); if (!sd2card->readData(cBuf)) { // Read. Did it fail? sd2card->readStop(); // readStop for new readStart diff --git a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp index 79fabfd80547..5d9ef627c985 100644 --- a/Marlin/src/lcd/dogm/u8g_fontutf8.cpp +++ b/Marlin/src/lcd/dogm/u8g_fontutf8.cpp @@ -121,8 +121,8 @@ static font_group_t g_fontgroup_root = { nullptr, 0 }; */ static inline bool uxg_Utf8FontIsInited() { return flag_fontgroup_was_inited; } -int uxg_SetUtf8Fonts (const uxg_fontinfo_t * fntinfo, int number) { - flag_fontgroup_was_inited = 1; +int uxg_SetUtf8Fonts(const uxg_fontinfo_t *fntinfo, int number) { + flag_fontgroup_was_inited = true; return fontgroup_init(&g_fontgroup_root, fntinfo, number); } diff --git a/buildroot/tests/STM32F103RE_btt_USB b/buildroot/tests/STM32F103RE_btt_USB index 7b264ea28312..0bf5f616e4f3 100755 --- a/buildroot/tests/STM32F103RE_btt_USB +++ b/buildroot/tests/STM32F103RE_btt_USB @@ -11,11 +11,12 @@ set -e # restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_E3_DIP SERIAL_PORT 1 SERIAL_PORT_2 -1 +opt_enable SDSUPPORT EMERGENCY_PARSER exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_CR6 SERIAL_PORT -1 SERIAL_PORT_2 2 TEMP_SENSOR_BED 1 -opt_enable CR10_STOCKDISPLAY FAN_SOFT_PWM \ +opt_enable CR10_STOCKDISPLAY SDSUPPORT EMERGENCY_PARSER FAN_SOFT_PWM \ NOZZLE_AS_PROBE Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN Z_SAFE_HOMING \ PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE \ PROBING_HEATERS_OFF PREHEAT_BEFORE_PROBING From c81e217334222aa18c23d02d34f1a78ac7ed23fa Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 9 Oct 2023 00:20:31 +0000 Subject: [PATCH 085/268] [cron] Bump distribution date (2023-10-09) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index d7385ac18f1e..83c6680a3045 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-08" +//#define STRING_DISTRIBUTION_DATE "2023-10-09" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 80859e8ba57a..ecd8f62ddc77 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-08" + #define STRING_DISTRIBUTION_DATE "2023-10-09" #endif /** From 047bce0cdd8599d3ea9b85d173f8d79a0802adf1 Mon Sep 17 00:00:00 2001 From: "Dipl.-Ing. Raoul Rubien, BSc" Date: Mon, 9 Oct 2023 02:22:40 +0200 Subject: [PATCH 086/268] =?UTF-8?q?=F0=9F=94=A7=20More=20angles=20for=202x?= =?UTF-8?q?=20Servo=20Switching=20Nozzle=20(#26303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 3 ++- Marlin/src/gcode/config/M281.cpp | 3 +++ Marlin/src/module/servo.h | 27 +++++++++++++++++++-------- Marlin/src/module/tool_change.cpp | 3 +-- buildroot/tests/LPC1768 | 2 +- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index bdd69d958ee8..238688909507 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -244,7 +244,8 @@ #if ENABLED(SWITCHING_NOZZLE) #define SWITCHING_NOZZLE_SERVO_NR 0 //#define SWITCHING_NOZZLE_E1_SERVO_NR 1 // If two servos are used, the index of the second - #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // Angles for E0, E1 (single servo) or lowered/raised (dual servo) + #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } // A pair of angles for { E0, E1 }. + // For Dual Servo use two pairs: { { lower, raise }, { lower, raise } } #define SWITCHING_NOZZLE_SERVO_DWELL 2500 // Dwell time to wait for servo to make physical move #endif diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index 2e7f08fe8659..038a5d615ada 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -66,6 +66,9 @@ void GcodeSuite::M281_report(const bool forReplay/*=true*/) { #endif #elif ENABLED(SWITCHING_NOZZLE) case SWITCHING_NOZZLE_SERVO_NR: + #if ENABLED(SWITCHING_NOZZLE_TWO_SERVOS) + case SWITCHING_NOZZLE_E1_SERVO_NR: + #endif #elif ENABLED(BLTOUCH) || (HAS_Z_SERVO_PROBE && defined(Z_SERVO_ANGLES)) case Z_PROBE_SERVO_NR: #endif diff --git a/Marlin/src/module/servo.h b/Marlin/src/module/servo.h index 2ed992aa03f7..40cfcee3c690 100644 --- a/Marlin/src/module/servo.h +++ b/Marlin/src/module/servo.h @@ -44,8 +44,13 @@ #endif #if ENABLED(SWITCHING_NOZZLE) - constexpr uint16_t sasn[] = SWITCHING_NOZZLE_SERVO_ANGLES; - static_assert(COUNT(sasn) == 2, "SWITCHING_NOZZLE_SERVO_ANGLES needs 2 angles."); + #if SWITCHING_NOZZLE_TWO_SERVOS + constexpr uint16_t sasn[][2] = SWITCHING_NOZZLE_SERVO_ANGLES; + static_assert(COUNT(sasn) == 2, "SWITCHING_NOZZLE_SERVO_ANGLES (with SWITCHING_NOZZLE_E1_SERVO_NR) needs 2 sets of angles: { { lower, raise }, { lower, raise } }."); + #else + constexpr uint16_t sasn[] = SWITCHING_NOZZLE_SERVO_ANGLES; + static_assert(COUNT(sasn) == 2, "SWITCHING_NOZZLE_SERVO_ANGLES needs two angles: { E0, E1 }."); + #endif #else constexpr uint16_t sasn[2] = { 0 }; #endif @@ -75,12 +80,15 @@ #define Z_PROBE_SERVO_NR -1 #endif - #define ASRC(N,I) ( \ - N == SWITCHING_EXTRUDER_SERVO_NR ? sase[I] \ - : N == SWITCHING_EXTRUDER_E23_SERVO_NR ? sase[I+2] \ - : N == SWITCHING_NOZZLE_SERVO_NR ? sasn[I] \ - : N == Z_PROBE_SERVO_NR ? sazp[I] \ - : 0 ) + #define SASN(J,I) TERN(SWITCHING_NOZZLE_TWO_SERVOS, sasn[J][I], sasn[I]) + + #define ASRC(N,I) ( \ + N == SWITCHING_EXTRUDER_SERVO_NR ? sase[I] \ + : N == SWITCHING_EXTRUDER_E23_SERVO_NR ? sase[I+2] \ + : N == SWITCHING_NOZZLE_SERVO_NR ? SASN(0,I) \ + TERN_(SWITCHING_NOZZLE_TWO_SERVOS, : N == SWITCHING_NOZZLE_E1_SERVO_NR ? SASN(1,I)) \ + : N == Z_PROBE_SERVO_NR ? sazp[I] \ + : 0 ) #if ENABLED(EDITABLE_SERVO_ANGLES) extern uint16_t servo_angles[NUM_SERVOS][2]; @@ -97,6 +105,9 @@ , { ASRC(2,0), ASRC(2,1) } #if NUM_SERVOS > 3 , { ASRC(3,0), ASRC(3,1) } + #if NUM_SERVOS > 4 + , { ASRC(4,0), ASRC(4,1) } + #endif #endif #endif #endif diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 4c286c81a0ad..622877667d43 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -127,9 +127,8 @@ inline void _move_nozzle_servo(const uint8_t e, const uint8_t angle_index) { constexpr int8_t sns_index[2] = { SWITCHING_NOZZLE_SERVO_NR, SWITCHING_NOZZLE_E1_SERVO_NR }; - constexpr int16_t sns_angles[2] = SWITCHING_NOZZLE_SERVO_ANGLES; planner.synchronize(); - servo[sns_index[e]].move(sns_angles[angle_index]); + servo[sns_index[e]].move(servo_angles[sns_index[e]][angle_index]); safe_delay(SWITCHING_NOZZLE_SERVO_DWELL); } diff --git a/buildroot/tests/LPC1768 b/buildroot/tests/LPC1768 index 53fc6f6d7fdc..403e2d134511 100755 --- a/buildroot/tests/LPC1768 +++ b/buildroot/tests/LPC1768 @@ -27,7 +27,7 @@ exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), N restore_configs opt_set MOTHERBOARD BOARD_MKS_SBASE \ EXTRUDERS 2 TEMP_SENSOR_1 1 \ - NUM_SERVOS 2 SERVO_DELAY '{ 300, 300 }' + NUM_SERVOS 2 SERVO_DELAY '{ 300, 300 }' SWITCHING_NOZZLE_SERVO_ANGLES '{ { 0, 90 }, { 90, 0 } }' opt_enable SWITCHING_NOZZLE SWITCHING_NOZZLE_E1_SERVO_NR EDITABLE_SERVO_ANGLES SERVO_DETACH_GCODE \ ULTIMAKERCONTROLLER REALTIME_REPORTING_COMMANDS FULL_REPORT_TO_HOST_FEATURE exec_test $1 $2 "MKS SBASE with SWITCHING_NOZZLE, Grbl Realtime Report" "$3" From b58d5dabf8939658334db3e0d98c03b1b934df7c Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 8 Oct 2023 18:07:09 -0700 Subject: [PATCH 087/268] =?UTF-8?q?=F0=9F=94=A7=20BTT=5FMINI=5F12864=5FV1?= =?UTF-8?q?=20=3D>=20BTT=5FMINI=5F12864=20(#26160)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 6 +++--- Marlin/src/inc/Changes.h | 2 ++ Marlin/src/inc/Conditionals_LCD.h | 4 ++-- Marlin/src/inc/SanityCheck.h | 4 ++-- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 2 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 2 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h | 6 +++--- Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h | 2 +- Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h | 4 ++-- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 238688909507..2fddb8ae3126 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2988,10 +2988,10 @@ //#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight. // -// BigTreeTech Mini 12864 V1.0 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight. -// https://github.com/bigtreetech/MINI-12864/tree/master/mini12864_v1.0 +// BigTreeTech Mini 12864 V1.0 / V2.0 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight. +// https://github.com/bigtreetech/MINI-12864 // -//#define BTT_MINI_12864_V1 +//#define BTT_MINI_12864 // // Factory display for Creality CR-10 / CR-7 / Ender-3 diff --git a/Marlin/src/inc/Changes.h b/Marlin/src/inc/Changes.h index 942c5303d1fd..40116bc5a498 100644 --- a/Marlin/src/inc/Changes.h +++ b/Marlin/src/inc/Changes.h @@ -663,6 +663,8 @@ #error "INTEGRATED_BABYSTEPPING is no longer needed and should be removed." #elif defined(FOLDER_SORTING) #error "FOLDER_SORTING is now SDSORT_FOLDERS." +#elif defined(BTT_MINI_12864_V1) + #error "BTT_MINI_12864_V1 is now BTT_MINI_12864." #endif // L64xx stepper drivers have been removed diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 2e51e3db6add..9693ed4c4339 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -35,8 +35,8 @@ #define MKS_MINI_12864 #endif -// MKS_MINI_12864_V3 and BTT_MINI_12864_V1 are identical to FYSETC_MINI_12864_2_1 -#if ANY(MKS_MINI_12864_V3, BTT_MINI_12864_V1) +// MKS_MINI_12864_V3 and BTT_MINI_12864 have identical pinouts to FYSETC_MINI_12864_2_1 +#if ANY(MKS_MINI_12864_V3, BTT_MINI_12864) #define FYSETC_MINI_12864_2_1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 67862cf93192..b31d10b06877 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2563,8 +2563,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L + (ENABLED(U8GLIB_SSD1306) && DISABLED(IS_U8GLIB_SSD1306)) \ + (ENABLED(MINIPANEL) && NONE(MKS_MINI_12864, ENDER2_STOCKDISPLAY)) \ + (ENABLED(MKS_MINI_12864) && NONE(MKS_LCD12864A, MKS_LCD12864B)) \ - + (ENABLED(FYSETC_MINI_12864_2_1) && NONE(MKS_MINI_12864_V3, BTT_MINI_12864_V1)) \ - + COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864_V1) \ + + (ENABLED(FYSETC_MINI_12864_2_1) && NONE(MKS_MINI_12864_V3, BTT_MINI_12864)) \ + + COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864) \ + (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \ + (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \ + (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \ diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 2dea1edacc59..60ed800ba690 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -169,7 +169,7 @@ #define DOGLCD_A0 EXP1_07_PIN #define LCD_RESET_PIN -1 #elif ENABLED(FYSETC_MINI_12864_2_1) - // MKS_MINI_12864_V3, BTT_MINI_12864_V1, FYSETC_MINI_12864_2_1 + // MKS_MINI_12864_V3, BTT_MINI_12864, FYSETC_MINI_12864_2_1 #define DOGLCD_CS EXP1_03_PIN #define DOGLCD_A0 EXP1_04_PIN #define LCD_RESET_PIN EXP1_05_PIN diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index 8be66eedb570..f752350cc6a9 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -238,7 +238,7 @@ #endif /** - * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 display pinout + * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 display pinout * * Board Display * ------ ------ diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index c86e2f750452..4f8fa7937cf0 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -275,11 +275,11 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" + #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" #endif /** - * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864_V1 display pinout + * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 display pinout * * Board Display * ------ ------ @@ -337,7 +337,7 @@ #define FORCE_SOFT_SPI #else - #error "Only CR10_STOCKDISPLAY, LCD_FOR_MELZI, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, TFTGLCD_PANEL_(SPI|I2C), FYSETC_MINI_12864_2_1, MKS_MINI_12864_V3, and BTT_MINI_12864_V1 are currently supported on the BIGTREE_SKR_MINI_E3." + #error "Only CR10_STOCKDISPLAY, LCD_FOR_MELZI, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, TFTGLCD_PANEL_(SPI|I2C), FYSETC_MINI_12864_2_1, MKS_MINI_12864_V3, and BTT_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3." #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index d88dccc57964..a51676846271 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -338,7 +338,7 @@ * Neopixel EXP2 * * Needs custom cable. Connect EN2-EN2, LCD_CS-LCD_CS and so on. - * Note: The RESET line is connected to 3 pins. + * Note: The RESET line is connected to 3 pins. * * Check the index/notch position twice!!! * On BTT boards pins from IDC10 connector are numbered in unusual order. diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h index ded9ec4e8913..b0890036ee7b 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h @@ -406,7 +406,7 @@ // LCDs and Controllers // -#if ENABLED(BTT_MINI_12864_V1) // BTT Mini 12864 V2.0 connected via 18-pin FCP cable +#if ENABLED(BTT_MINI_12864) // BTT Mini 12864 V2.0 connected via 18-pin FPC cable #define BEEPER_PIN EXP1_01_PIN #define BTN_ENC EXP1_02_PIN @@ -435,7 +435,7 @@ #define NEOPIXEL_PIN EXP1_06_PIN #elif HAS_WIRED_LCD - #error "Only BTT_MINI_12864_V1 is currently supported on the BIGTREE_OCTOPUS_MAX_EZ." + #error "Only BTT_MINI_12864 (BTT Mini 12864 V2.0 with FPC cable) is currently supported on the BIGTREE_OCTOPUS_MAX_EZ." #endif // From e97d82f77beadf7001e569dc7e683ba287afa56e Mon Sep 17 00:00:00 2001 From: Marcella Cavalcanti Date: Mon, 9 Oct 2023 22:52:59 +0100 Subject: [PATCH 088/268] =?UTF-8?q?=E2=9C=A8=20FYSETC=20Cheetah=20v3.0=20(?= =?UTF-8?q?#26314)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/pins/pins.h | 2 + .../pins/stm32f4/pins_FYSETC_CHEETAH_V30.h | 319 ++++++++++++++++++ .../boards/marlin_FYSETC_CHEETAH_V30.json | 35 ++ ini/stm32f4.ini | 11 + 5 files changed, 368 insertions(+) create mode 100644 Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h create mode 100644 buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V30.json diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 020907fe875e..629ae734317e 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -460,6 +460,7 @@ #define BOARD_BLACKPILL_CUSTOM 5246 // Custom board based on STM32F401CDU6. #define BOARD_I3DBEEZ9_V1 5247 // I3DBEEZ9 V1 (STM32F407ZG) #define BOARD_MELLOW_FLY_E3_V2 5248 // Mellow Fly E3 V2 (STM32F407VG) +#define BOARD_FYSETC_CHEETAH_V30 5249 // FYSETC Cheetah V3.0 (STM32F446RC) // // ARM Cortex-M7 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 5737f3eea0f8..d3f30e0e3f7a 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -774,6 +774,8 @@ #include "stm32f4/pins_ANET_ET4P.h" // STM32F4 env:Anet_ET4_no_bootloader env:Anet_ET4_OpenBLT #elif MB(FYSETC_CHEETAH_V20) #include "stm32f4/pins_FYSETC_CHEETAH_V20.h" // STM32F4 env:FYSETC_CHEETAH_V20 +#elif MB(FYSETC_CHEETAH_V30) + #include "stm32f4/pins_FYSETC_CHEETAH_V30.h" // STM32F4 env:FYSETC_CHEETAH_V30 #elif MB(MKS_MONSTER8_V1) #include "stm32f4/pins_MKS_MONSTER8_V1.h" // STM32F4 env:mks_monster8 env:mks_monster8_usb_flash_drive env:mks_monster8_usb_flash_drive_msc #elif MB(MKS_MONSTER8_V2) diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h new file mode 100644 index 000000000000..1b74fcbd860e --- /dev/null +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h @@ -0,0 +1,319 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include "env_validate.h" + +#define BOARD_INFO_NAME "FYSETC Cheetah V3.0" +#define BOARD_WEBSITE_URL "fysetc.com" + +// USB Flash Drive support +//#define HAS_OTG_USB_HOST_SUPPORT + +// Ignore temp readings during development. +//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000 + +#if ANY(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define FLASH_EEPROM_LEVELING + +#endif + +// +// Z Probe +// +//#if ENABLED(BLTOUCH) +// #error "You need to set jumper to 5V for BLTouch, then comment out this line to proceed." +// #define SERVO0_PIN PA0 +//#elif !defined(Z_MIN_PROBE_PIN) +// #define Z_MIN_PROBE_PIN PA0 +//#endif + +// +// Limit Switches +// +#define X_STOP_PIN PA2 +#define Y_STOP_PIN PA3 +#define Z_STOP_PIN PC4 + +#if 1 +#define TEST_IO1 PA0 // PROBE +#define TEST_IO2 PA1 // FIL-D +//#define TEST_IO3 PA9 +//#define TEST_IO4 PA10 +#endif + +// +// Filament runout +// +//#define FIL_RUNOUT_PIN PA1 + +// +// Steppers +// +#define X_STEP_PIN PC0 +#define X_DIR_PIN PC1 +#define X_ENABLE_PIN PC3 + +#define Y_STEP_PIN PC14 +#define Y_DIR_PIN PC13 +#define Y_ENABLE_PIN PC15 + +#define Z_STEP_PIN PB4 +#define Z_DIR_PIN PB5 +#define Z_ENABLE_PIN PC2 + +#define E0_STEP_PIN PB2 +#define E0_DIR_PIN PA15 +#define E0_ENABLE_PIN PD2 + +#if HAS_TMC_UART + #if 1 + #ifndef X_SERIAL_TX_PIN + #define X_SERIAL_TX_PIN PB3 + #endif + #ifndef X_SERIAL_RX_PIN + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + #endif + + #ifndef Y_SERIAL_TX_PIN + #define Y_SERIAL_TX_PIN PB3 + #endif + #ifndef Y_SERIAL_RX_PIN + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + #endif + + #ifndef Z_SERIAL_TX_PIN + #define Z_SERIAL_TX_PIN PB3 + #endif + #ifndef Z_SERIAL_RX_PIN + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #endif + #ifndef E0_SERIAL_TX_PIN + #define E0_SERIAL_TX_PIN PB3 + #endif + #ifndef E0_SERIAL_RX_PIN + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + #endif + + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 2 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 1 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + #else + #define X_HARDWARE_SERIAL Serial2 + #define Y_HARDWARE_SERIAL Serial2 + #define Z_HARDWARE_SERIAL Serial2 + #define E0_HARDWARE_SERIAL Serial2 + + // Default TMC slave addresses + #ifndef X_SLAVE_ADDRESS + #define X_SLAVE_ADDRESS 0 + #endif + #ifndef Y_SLAVE_ADDRESS + #define Y_SLAVE_ADDRESS 2 + #endif + #ifndef Z_SLAVE_ADDRESS + #define Z_SLAVE_ADDRESS 1 + #endif + #ifndef E0_SLAVE_ADDRESS + #define E0_SLAVE_ADDRESS 3 + #endif + #endif +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN PC7 // PWM +#define HEATER_BED_PIN PC8 // PWM + +#ifndef FAN0_PIN + #define FAN0_PIN PA14 +#endif +#define FAN1_PIN PA13 +#define FAN2_PIN PA8 + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC5 // Analog Input T0 ADC +#define TEMP_BED_PIN PB1 // Analog Input ADC +#define TEMP_CHAMBER_PIN PB0 // Analog Input T1 ADC + +// +// Misc. Functions +// +#if 0 + #define SDSS PA4 + #define SD_DETECT_PIN PC3 +#endif + +#ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PB0 +#endif +#ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PB7 +#endif +#ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PB6 +#endif + +/** + * ----- ----- + * (KILL?) 5V | 1 2 | GND 5V | 1 2 | GND + * (RST) RESET | 3 4 | PC12 ((SD_DET?)CD) (LCD_D7 BLUE) PB7 | 3 4 | PB6 (LCD_D6 GREEN) + * ((SD?)MOSI PA7 | 5 6 | PC11 (BTN_EN2) (LCD_D5 RED DIN) PB14 | 5 6 | PB13 (LCD_D4 LCD_RST) + * ((SD?)SS) PA4 | 7 8 | PC10 (BTN_EN1) (LCD_RS LCD_A0) PB12 | 7 8 | PB15 (LCD_EN LCD CS) + * ((SD?)SCK) PA5 | 9 10| PA6 ((SD?)MISO) (BTN_ENC) PC6 | 9 10| PB10 (BEEPER) + * ----- ----- + * EXP2 EXP1 + */ + +/** + * ----- + * (BEEPER) PC9 | 1 2 | PC12 (BTN_ENC) + * (BTN_EN1) PC10 | 3 4 | PB14 (LCD_D5/MISO) + * (BTN_EN2) PC11 5 6 | PB13 (LCD_D4/SCK) + * (LCD_RS) PB12 | 7 8 | PB15 (LCD_EN/MOSI) + * GND | 9 10| 5V + * ----- + * EXP3 + */ + +#define EXP1_03_PIN PB7 +#define EXP1_04_PIN PB6 +#define EXP1_05_PIN PB14 +#define EXP1_06_PIN PB13 +#define EXP1_07_PIN PB12 +#define EXP1_08_PIN PB15 +#define EXP1_09_PIN PC6 +#define EXP1_10_PIN PB10 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN PC12 +#define EXP2_05_PIN PA7 +#define EXP2_06_PIN PC11 +#define EXP2_07_PIN PA4 +#define EXP2_08_PIN PC10 +#define EXP2_09_PIN PA5 +#define EXP2_10_PIN PA6 + +// +// SPI / SD Card +// +#define SD_SCK_PIN EXP2_09_PIN +#define SD_MISO_PIN EXP2_10_PIN +#define SD_MOSI_PIN EXP2_05_PIN + +#define SDSS EXP2_07_PIN +#define SD_DETECT_PIN EXP2_04_PIN + +#if HAS_WIRED_LCD + + #define BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN + + #else + + #define LCD_PINS_RS EXP1_07_PIN + + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + + #define LCD_PINS_EN EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN EXP1_05_PIN + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN EXP1_04_PIN + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN EXP1_03_PIN + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN EXP1_05_PIN + #endif + #endif // !FYSETC_MINI_12864 + + #if IS_ULTIPANEL + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + #endif + + #endif + +#endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 96 + #define BOARD_ST7920_DELAY_2 48 + #define BOARD_ST7920_DELAY_3 600 +#endif + +#if ENABLED(TOUCH_UI_FTDI_EVE) + #define BEEPER_PIN EXP1_10_PIN + #define CLCD_MOD_RESET EXP2_08_PIN + #define CLCD_SPI_CS EXP2_06_PIN +#endif + +#define NEOPIXEL2_PIN PC9 diff --git a/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V30.json b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V30.json new file mode 100644 index 000000000000..8c46404f3812 --- /dev/null +++ b/buildroot/share/PlatformIO/boards/marlin_FYSETC_CHEETAH_V30.json @@ -0,0 +1,35 @@ +{ + "build": { + "cpu": "cortex-m4", + "extra_flags": "-DSTM32F446xx", + "f_cpu": "180000000L", + "mcu": "stm32f446ret6", + "variant": "MARLIN_F446VE" + }, + "connectivity": [ + "can" + ], + "debug": { + "jlink_device": "STM32F446RE", + "openocd_target": "stm32f4x", + "svd_path": "STM32F446x.svd" + }, + "frameworks": [ + "arduino", + "stm32cube" + ], + "name": "3D Printer control board", + "upload": { + "maximum_ram_size": 131072, + "maximum_size": 524288, + "protocol": "stlink", + "protocols": [ + "jlink", + "stlink", + "blackmagic", + "serial" + ] + }, + "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html", + "vendor": "FYSETC" +} diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 454337295d29..20009c89439f 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -38,6 +38,17 @@ board_build.offset = 0x8000 build_flags = ${stm32_variant.build_flags} -DSTM32F401xC upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" +# +# STM32F446RC nobootloader +# +[env:FYSETC_CHEETAH_V30] +extends = stm32_variant +board = marlin_FYSETC_CHEETAH_V30 +build_flags = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED +debug_tool = stlink +upload_protocol = dfu +upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE" + # # FLYF407ZG # From 61591fd23369a03063a42f57a174c51f995c7efb Mon Sep 17 00:00:00 2001 From: studiodyne <42887851+studiodyne@users.noreply.github.com> Date: Tue, 10 Oct 2023 00:50:09 +0200 Subject: [PATCH 089/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20tool-change=20E=20?= =?UTF-8?q?prime=20(#26237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/module/tool_change.cpp | 35 +++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 622877667d43..b33b642966ae 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -940,19 +940,20 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. * sync_plan_position_e(); */ void extruder_cutting_recover(const_float_t e) { - if (!too_cold(active_extruder)) { - const float dist = toolchange_settings.extra_resume + toolchange_settings.wipe_retract; - FS_DEBUG("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s"); - unscaled_e_move(dist, MMM_TO_MMS(toolchange_settings.unretract_speed)); - planner.synchronize(); - FS_DEBUG("Set position to: ", e); - current_position.e = e; - sync_plan_position_e(); // Resume new E Position - } + if (too_cold(active_extruder)) return; + + const float dist = toolchange_settings.extra_resume + toolchange_settings.wipe_retract; + FS_DEBUG("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s"); + unscaled_e_move(dist, MMM_TO_MMS(toolchange_settings.unretract_speed)); + + FS_DEBUG("Set E position: ", e); + current_position.e = e; + sync_plan_position_e(); // Resume new E Position } /** * Prime the currently selected extruder (Filament loading only) + * Leave the E position unchanged so subsequent extrusion works properly. * * If too_cold(toolID) returns TRUE -> returns without moving extruder. * Extruders filament = swap_length + extra prime, then performs cutting retraction if enabled. @@ -966,6 +967,8 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. feedRate_t fr_mm_s = MMM_TO_MMS(toolchange_settings.unretract_speed); // Set default speed for unretract + const float resume_current_e = current_position.e; + #if ENABLED(TOOLCHANGE_FS_SLOW_FIRST_PRIME) /** * Perform first unretract movement at the slower Prime_Speed to avoid breakage on first prime @@ -1010,6 +1013,10 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. unscaled_e_move(-toolchange_settings.wipe_retract, MMM_TO_MMS(toolchange_settings.retract_speed)); #endif + // Leave E unchanged when priming + current_position.e = resume_current_e; + sync_plan_position_e(); + // Cool down with fan filament_swap_cooling(); } @@ -1061,17 +1068,19 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. } #endif + // Prime without changing E extruder_prime(); // Move back #if ENABLED(TOOLCHANGE_PARK) if (ok) { #if ENABLED(TOOLCHANGE_NO_RETURN) - const float temp = destination.z; - destination = current_position; - destination.z = temp; + destination.x = current_position.x; + destination.y = current_position.y; #endif - prepare_internal_move_to_destination(TERN(TOOLCHANGE_NO_RETURN, planner.settings.max_feedrate_mm_s[Z_AXIS], MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE))); + do_blocking_move_to_xy(destination, MMM_TO_MMS(TOOLCHANGE_PARK_XY_FEEDRATE)); + do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); + planner.synchronize(); } #endif From 6d301a282ebb38cee2a7d526adad27467b2bd55f Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 10 Oct 2023 00:19:51 +0000 Subject: [PATCH 090/268] [cron] Bump distribution date (2023-10-10) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 83c6680a3045..5cd9c6f808b3 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-09" +//#define STRING_DISTRIBUTION_DATE "2023-10-10" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ecd8f62ddc77..afc774bbcf6c 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-09" + #define STRING_DISTRIBUTION_DATE "2023-10-10" #endif /** From e9b9d634c4ef5d48791de84545ef86d46909fec0 Mon Sep 17 00:00:00 2001 From: Andrew Bortz Date: Tue, 10 Oct 2023 20:24:48 -0700 Subject: [PATCH 091/268] =?UTF-8?q?=E2=9C=A8=20Nonlinear=20Extrusion=20Con?= =?UTF-8?q?trol=20(M592)=20(#26127)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 8 +++ Marlin/src/core/language.h | 1 + Marlin/src/gcode/feature/nonlinear/M592.cpp | 51 +++++++++++++++++++ Marlin/src/gcode/gcode.cpp | 4 ++ Marlin/src/gcode/gcode.h | 6 +++ Marlin/src/inc/SanityCheck.h | 13 +++++ Marlin/src/module/planner.cpp | 2 +- Marlin/src/module/settings.cpp | 36 ++++++++++++-- Marlin/src/module/stepper.cpp | 55 ++++++++++++++++++++- Marlin/src/module/stepper.h | 19 +++++++ buildroot/tests/STM32F103RC_btt | 2 +- ini/features.ini | 1 + 12 files changed, 190 insertions(+), 8 deletions(-) create mode 100644 Marlin/src/gcode/feature/nonlinear/M592.cpp diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 203825e76b41..4d6ed12e99d5 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2275,6 +2275,14 @@ //#define EXPERIMENTAL_I2S_LA // Allow I2S_STEPPER_STREAM to be used with LA. Performance degrades as the LA step rate reaches ~20kHz. #endif +/** + * Nonlinear Extrusion Control + * + * Control extrusion rate based on instantaneous extruder velocity. Can be used to correct for + * underextrusion at high extruder speeds that are otherwise well-behaved (i.e., not skipping). + */ +//#define NONLINEAR_EXTRUSION + // @section leveling /** diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 9fc7e99bf565..645725237b44 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -301,6 +301,7 @@ #define STR_CHAMBER_PID "Chamber PID" #define STR_STEPS_PER_UNIT "Steps per unit" #define STR_LINEAR_ADVANCE "Linear Advance" +#define STR_NONLINEAR_EXTRUSION "Nonlinear Extrusion" #define STR_CONTROLLER_FAN "Controller Fan" #define STR_STEPPER_MOTOR_CURRENTS "Stepper motor currents" #define STR_RETRACT_S_F_Z "Retract (S F Z)" diff --git a/Marlin/src/gcode/feature/nonlinear/M592.cpp b/Marlin/src/gcode/feature/nonlinear/M592.cpp new file mode 100644 index 000000000000..dc8c1e1e588e --- /dev/null +++ b/Marlin/src/gcode/feature/nonlinear/M592.cpp @@ -0,0 +1,51 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if ENABLED(NONLINEAR_EXTRUSION) + +#include "../../gcode.h" +#include "../../../module/stepper.h" + +void GcodeSuite::M592_report(const bool forReplay/*=true*/) { + report_heading(forReplay, F(STR_NONLINEAR_EXTRUSION)); + SERIAL_ECHOLNPGM(" M593 A", stepper.ne.A, " B", stepper.ne.B, " C", stepper.ne.C); +} + +/** + * M592: Get or set nonlinear extrusion parameters + * A Linear coefficient (default 0.0) + * B Quadratic coefficient (default 0.0) + * C Constant coefficient (default 1.0) + * + * Adjusts the amount of extrusion based on the instantaneous velocity of extrusion, as a multiplier. + * The amount of extrusion is multiplied by max(C, C + A*v + B*v^2) where v is extruder velocity in mm/s. + * Only adjusts forward extrusions, since those are the ones affected by backpressure. + */ +void GcodeSuite::M592() { + if (parser.seenval('A')) stepper.ne.A = parser.value_float(); + if (parser.seenval('B')) stepper.ne.B = parser.value_float(); + if (parser.seenval('C')) stepper.ne.C = parser.value_float(); +} + +#endif // NONLINEAR_EXTRUSION diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index fd2a78d1fd26..4902cebde2eb 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -935,6 +935,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 575: M575(); break; // M575: Set serial baudrate #endif + #if ENABLED(NONLINEAR_EXTRUSION) + case 592: M592(); break; // M592: Nonlinear Extrusion control + #endif + #if HAS_ZV_SHAPING case 593: M593(); break; // M593: Input Shaping control #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index f9ee81f2eb0c..5e6e400cf1d4 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -259,6 +259,7 @@ * M554 - Get or set IP gateway. (Requires enabled Ethernet port) * M569 - Enable stealthChop on an axis. (Requires at least one _DRIVER_TYPE to be TMC2130/2160/2208/2209/5130/5160) * M575 - Change the serial baud rate. (Requires BAUD_RATE_GCODE) + * M592 - Get or set nonlinear extrusion parameters. (Requires NONLINEAR_EXTRUSION) * M593 - Get or set input shaping parameters. (Requires INPUT_SHAPING_[XY]) * M600 - Pause for filament change: "M600 X Y Z E L". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) @@ -1106,6 +1107,11 @@ class GcodeSuite { static void M575(); #endif + #if ENABLED(NONLINEAR_EXTRUSION) + static void M592(); + static void M592_report(const bool forReplay=true); + #endif + #if HAS_ZV_SHAPING static void M593(); static void M593_report(const bool forReplay=true); diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index b31d10b06877..0e9ef07eb3fb 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -858,6 +858,19 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif #endif +/** + * Nonlinear Extrusion requirements + */ +#if ENABLED(NONLINEAR_EXTRUSION) + #if DISABLED(ADAPTIVE_STEP_SMOOTHING) + #error "ADAPTIVE_STEP_SMOOTHING is required for NONLINEAR_EXTRUSION." + #elif HAS_MULTI_EXTRUDER + #error "NONLINEAR_EXTRUSION doesn't currently support multi-extruder setups." + #elif DISABLED(CPU_32_BIT) + #error "NONLINEAR_EXTRUSION requires a 32-bit CPU." + #endif +#endif + /** * Special tool-changing options */ diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 6b645fa1337e..9b8b26892704 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2005,7 +2005,7 @@ bool Planner::_populate_block( #if HAS_EXTRUDERS dm.e = (dist.e > 0); const float esteps_float = dist.e * e_factor[extruder]; - const uint32_t esteps = ABS(esteps_float) + 0.5f; + const uint32_t esteps = ABS(esteps_float); #else constexpr uint32_t esteps = 0; #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index a4820ae900af..7abe276561d2 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -36,7 +36,7 @@ */ // Change EEPROM version if the structure changes -#define EEPROM_VERSION "V88" +#define EEPROM_VERSION "V89" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -634,6 +634,13 @@ typedef struct SettingsDataStruct { hotend_idle_settings_t hotend_idle_config; // M86 S T E B #endif + // + // Nonlinear Extrusion + // + #if ENABLED(NONLINEAR_EXTRUSION) + ne_coeff_t stepper_ne; // M592 A B C + #endif + } SettingsData; //static_assert(sizeof(SettingsData) <= MARLIN_EEPROM_SIZE, "EEPROM too small to contain SettingsData!"); @@ -1729,6 +1736,13 @@ void MarlinSettings::postprocess() { EEPROM_WRITE(hotend_idle.cfg); #endif + // + // Nonlinear Extrusion + // + #if ENABLED(NONLINEAR_EXTRUSION) + EEPROM_WRITE(stepper.ne); + #endif + // // Report final CRC and Data Size // @@ -2803,6 +2817,13 @@ void MarlinSettings::postprocess() { EEPROM_READ(hotend_idle.cfg); #endif + // + // Nonlinear Extrusion + // + #if ENABLED(NONLINEAR_EXTRUSION) + EEPROM_READ(stepper.ne); + #endif + // // Validate Final Size and CRC // @@ -3396,7 +3417,6 @@ void MarlinSettings::reset() { // // Heated Bed PID // - #if ENABLED(PIDTEMPBED) thermalManager.temp_bed.pid.set(DEFAULT_bedKp, DEFAULT_bedKi, DEFAULT_bedKd); #endif @@ -3404,7 +3424,6 @@ void MarlinSettings::reset() { // // Heated Chamber PID // - #if ENABLED(PIDTEMPCHAMBER) thermalManager.temp_chamber.pid.set(DEFAULT_chamberKp, DEFAULT_chamberKi, DEFAULT_chamberKd); #endif @@ -3456,7 +3475,6 @@ void MarlinSettings::reset() { // // Volumetric & Filament Size // - #if DISABLED(NO_VOLUMETRICS) parser.volumetric_enabled = ENABLED(VOLUMETRIC_DEFAULT_ON); for (uint8_t q = 0; q < COUNT(planner.filament_size); ++q) @@ -3598,6 +3616,11 @@ void MarlinSettings::reset() { // TERN_(FT_MOTION, fxdTiCtrl.set_defaults()); + // + // Nonlinear Extrusion + // + TERN_(NONLINEAR_EXTRUSION, stepper.ne.reset()); + // // Input Shaping // @@ -3867,6 +3890,11 @@ void MarlinSettings::reset() { // TERN_(FT_MOTION, gcode.M493_report(forReplay)); + // + // Nonlinear Extrusion + // + TERN_(NONLINEAR_EXTRUSION, gcode.M592_report(forReplay)); + // // Input Shaping // diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 9bafe7443db1..6077154cd266 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -245,6 +245,13 @@ uint32_t Stepper::advance_divisor = 0, bool Stepper::la_active = false; #endif +#if ENABLED(NONLINEAR_EXTRUSION) + ne_coeff_t Stepper::ne; + ne_fix_t Stepper::ne_fix; + int32_t Stepper::ne_edividend; + uint32_t Stepper::ne_scale; +#endif + #if HAS_ZV_SHAPING shaping_time_t ShapingQueue::now = 0; #if ANY(MCU_LPC1768, MCU_LPC1769) && DISABLED(NO_LPC_ETHERNET_BUFFER) @@ -2191,6 +2198,16 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) { #endif // !CPU_32_BIT } +#if ENABLED(NONLINEAR_EXTRUSION) + void Stepper::calc_nonlinear_e(uint32_t step_rate) { + const uint32_t velocity = ne_scale * step_rate; // Scale step_rate first so all intermediate values stay in range of 8.24 fixed point math + int32_t vd = (((int64_t)ne_fix.A * velocity) >> 24) + (((((int64_t)ne_fix.B * velocity) >> 24) * velocity) >> 24); + NOLESS(vd, 0); + + advance_dividend.e = (uint64_t(ne_fix.C + vd) * ne_edividend) >> 24; + } +#endif + // Get the timer interval and the number of loops to perform per tick hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) { @@ -2318,6 +2335,10 @@ hal_timer_t Stepper::block_phase_isr() { interval = calc_multistep_timer_interval(acc_step_rate << oversampling_factor); acceleration_time += interval; + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(acc_step_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) { const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0; @@ -2388,6 +2409,10 @@ hal_timer_t Stepper::block_phase_isr() { interval = calc_multistep_timer_interval(step_rate << oversampling_factor); deceleration_time += interval; + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(step_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) { const uint32_t la_step_rate = la_advance_steps > current_block->final_adv_steps ? current_block->la_advance_rate : 0; @@ -2436,6 +2461,10 @@ hal_timer_t Stepper::block_phase_isr() { // step_rate to timer interval and loops for the nominal speed ticks_nominal = calc_multistep_timer_interval(current_block->nominal_rate << oversampling_factor); + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(current_block->nominal_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) la_interval = calc_timer_interval(current_block->nominal_rate >> current_block->la_scaling); @@ -2636,10 +2665,13 @@ hal_timer_t Stepper::block_phase_isr() { acceleration_time = deceleration_time = 0; #if ENABLED(ADAPTIVE_STEP_SMOOTHING) - oversampling_factor = 0; // Assume no axis smoothing (via oversampling) + // Nonlinear Extrusion needs at least 2x oversampling to permit increase of E step rate + // Otherwise assume no axis smoothing (via oversampling) + oversampling_factor = TERN(NONLINEAR_EXTRUSION, 1, 0); + // Decide if axis smoothing is possible - uint32_t max_rate = current_block->nominal_rate; // Get the step event rate if (TERN1(DWIN_LCD_PROUI, hmiData.adaptiveStepSmoothing)) { + uint32_t max_rate = current_block->nominal_rate; // Get the step event rate while (max_rate < MIN_STEP_ISR_FREQUENCY) { // As long as more ISRs are possible... max_rate <<= 1; // Try to double the rate if (max_rate < MIN_STEP_ISR_FREQUENCY) // Don't exceed the estimated ISR limit @@ -2755,10 +2787,29 @@ hal_timer_t Stepper::block_phase_isr() { acc_step_rate = current_block->initial_rate; #endif + #if ENABLED(NONLINEAR_EXTRUSION) + ne_edividend = advance_dividend.e; + const float scale = (float(ne_edividend) / advance_divisor) * planner.mm_per_step[E_AXIS_N(current_block->extruder)]; + ne_scale = (1L << 24) * scale; + if (current_block->direction_bits.e) { + ne_fix.A = (1L << 24) * ne.A; + ne_fix.B = (1L << 24) * ne.B; + ne_fix.C = (1L << 24) * ne.C; + } + else { + ne_fix.A = ne_fix.B = 0; + ne_fix.C = (1L << 24); + } + #endif + // Calculate the initial timer interval interval = calc_multistep_timer_interval(current_block->initial_rate << oversampling_factor); acceleration_time += interval; + #if ENABLED(NONLINEAR_EXTRUSION) + calc_nonlinear_e(current_block->initial_rate << oversampling_factor); + #endif + #if ENABLED(LIN_ADVANCE) if (la_active) { const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0; diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 7dbb6b8b5a1d..4312cfaa8b00 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -284,6 +284,11 @@ constexpr ena_mask_t enable_overlap[] = { #endif // HAS_ZV_SHAPING +#if ENABLED(NONLINEAR_EXTRUSION) + typedef struct { float A, B, C; void reset() { A = B = 0.0f; C = 1.0f; } } ne_coeff_t; + typedef struct { int32_t A, B, C; } ne_fix_t; +#endif + // // Stepper class definition // @@ -326,6 +331,10 @@ class Stepper { static bool frozen; // Set this flag to instantly freeze motion #endif + #if ENABLED(NONLINEAR_EXTRUSION) + static ne_coeff_t ne; + #endif + private: static block_t* current_block; // A pointer to the block currently being traced @@ -416,6 +425,12 @@ class Stepper { static bool la_active; // Whether linear advance is used on the present segment. #endif + #if ENABLED(NONLINEAR_EXTRUSION) + static int32_t ne_edividend; + static uint32_t ne_scale; + static ne_fix_t ne_fix; + #endif + #if ENABLED(BABYSTEPPING) static constexpr hal_timer_t BABYSTEP_NEVER = HAL_TIMER_TYPE_MAX; static hal_timer_t nextBabystepISR; @@ -660,6 +675,10 @@ class Stepper { // Calculate timing interval and steps-per-ISR for the given step rate static hal_timer_t calc_multistep_timer_interval(uint32_t step_rate); + #if ENABLED(NONLINEAR_EXTRUSION) + static void calc_nonlinear_e(uint32_t step_rate); + #endif + #if ENABLED(S_CURVE_ACCELERATION) static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av); static int32_t _eval_bezier_curve(const uint32_t curr_step); diff --git a/buildroot/tests/STM32F103RC_btt b/buildroot/tests/STM32F103RC_btt index 8df20740c49c..b9fff2b6c533 100755 --- a/buildroot/tests/STM32F103RC_btt +++ b/buildroot/tests/STM32F103RC_btt @@ -12,7 +12,7 @@ set -e restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_MINI_E3_V1_0 SERIAL_PORT 1 SERIAL_PORT_2 -1 \ X_DRIVER_TYPE TMC2209 Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2209 E0_DRIVER_TYPE TMC2209 -opt_enable CR10_STOCKDISPLAY PINS_DEBUGGING Z_IDLE_HEIGHT FT_MOTION FT_MOTION_MENU +opt_enable CR10_STOCKDISPLAY PINS_DEBUGGING Z_IDLE_HEIGHT FT_MOTION FT_MOTION_MENU ADAPTIVE_STEP_SMOOTHING NONLINEAR_EXTRUSION exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - TMC2209 HW Serial, FT_MOTION" "$3" # clean up diff --git a/ini/features.ini b/ini/features.ini index 1a3546e575fd..c89f2fea417f 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -312,6 +312,7 @@ CONTROLLER_FAN_EDITABLE = build_src_filter=+ GCODE_MACROS = build_src_filter=+ GRADIENT_MIX = build_src_filter=+ +NONLINEAR_EXTRUSION = build_src_filter=+ OTA_FIRMWARE_UPDATE = build_src_filter=+ HAS_SAVED_POSITIONS = build_src_filter=+ + PARK_HEAD_ON_PAUSE = build_src_filter=+ From 6f68da5be4dcc56cc6577f3727f0e240e4086785 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 11 Oct 2023 06:06:33 +0000 Subject: [PATCH 092/268] [cron] Bump distribution date (2023-10-11) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 5cd9c6f808b3..bf65ebaffd81 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-10" +//#define STRING_DISTRIBUTION_DATE "2023-10-11" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index afc774bbcf6c..6a5ab0d909ec 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-10" + #define STRING_DISTRIBUTION_DATE "2023-10-11" #endif /** From a7a3abb9bf04c0dd6edfadb4f1c3c80ed7dd627c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 Oct 2023 09:21:00 -0500 Subject: [PATCH 093/268] =?UTF-8?q?=F0=9F=93=9D=20Macro=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/macros.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index bb2bea2e3028..bc0df357ca22 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -178,16 +178,18 @@ #define _DO_N(W,C,N,V...) __DO_N(W,C,N,V) #define DO(W,C,V...) (_DO_N(W,C,NUM_ARGS(V),V)) -// Macros to support option testing +// Concatenate symbol names, without or with pre-expansion #define _CAT(a,V...) a##V #define CAT(a,V...) _CAT(a,V) +// Recognize "true" values: blank, 1, 0x1, true #define _ISENA_ ~,1 #define _ISENA_1 ~,1 #define _ISENA_0x1 ~,1 #define _ISENA_true ~,1 #define _ISENA(V...) IS_PROBE(V) +// Macros to evaluate simple option switches #define _ENA_1(O) _ISENA(CAT(_IS,CAT(ENA_, O))) #define _DIS_1(O) NOT(_ENA_1(O)) #define ENABLED(V...) DO(ENA,&&,V) @@ -198,6 +200,7 @@ #define COUNT_ENABLED(V...) DO(ENA,+,V) #define MANY(V...) (COUNT_ENABLED(V) > 1) +// Ternary pre-compiler macros conceal non-emitted content from the compiler #define TERN(O,A,B) _TERN(_ENA_1(O),B,A) // OPTION ? 'A' : 'B' #define TERN0(O,A) _TERN(_ENA_1(O),0,A) // OPTION ? 'A' : '0' #define TERN1(O,A) _TERN(_ENA_1(O),1,A) // OPTION ? 'A' : '1' @@ -205,7 +208,9 @@ #define _TERN(E,V...) __TERN(_CAT(T_,E),V) // Prepend 'T_' to get 'T_0' or 'T_1' #define __TERN(T,V...) ___TERN(_CAT(_NO,T),V) // Prepend '_NO' to get '_NOT_0' or '_NOT_1' #define ___TERN(P,V...) THIRD(P,V) // If first argument has a comma, A. Else B. +#define IF_DISABLED(O,A) TERN(O,,A) +// Macros to conditionally emit array items and function arguments #define _OPTITEM(A...) A, #define OPTITEM(O,A...) TERN_(O,DEFER4(_OPTITEM)(A)) #define _OPTARG(A...) , A @@ -220,8 +225,6 @@ #define SUM_TERN(O,B,A) ((B) PLUS_TERN0(O,A)) // ((B) (OPTION ? '+ (A)' : '')) #define DIFF_TERN(O,B,A) ((B) MINUS_TERN0(O,A)) // ((B) (OPTION ? '- (A)' : '')) -#define IF_DISABLED(O,A) TERN(O,,A) - // Macros to support pins/buttons exist testing #define PIN_EXISTS(PN) (defined(PN##_PIN) && PN##_PIN >= 0) #define _PINEX_1 PIN_EXISTS @@ -233,6 +236,7 @@ #define BUTTONS_EXIST(V...) DO(BTNEX,&&,V) #define ANY_BUTTON(V...) DO(BTNEX,||,V) +// Value helper macros #define WITHIN(N,L,H) ((N) >= (L) && (N) <= (H)) #define ISEOL(C) ((C) == '\n' || (C) == '\r') #define NUMERIC(a) WITHIN(a, '0', '9') @@ -240,6 +244,8 @@ #define HEXCHR(a) (NUMERIC(a) ? (a) - '0' : WITHIN(a, 'a', 'f') ? ((a) - 'a' + 10) : WITHIN(a, 'A', 'F') ? ((a) - 'A' + 10) : -1) #define NUMERIC_SIGNED(a) (NUMERIC(a) || (a) == '-' || (a) == '+') #define DECIMAL_SIGNED(a) (DECIMAL(a) || (a) == '-' || (a) == '+') + +// Array shorthand #define COUNT(a) (sizeof(a)/sizeof(*a)) #define ZERO(a) memset((void*)a,0,sizeof(a)) #define COPY(a,b) do{ \ @@ -247,6 +253,7 @@ memcpy(&a[0],&b[0],_MIN(sizeof(a),sizeof(b))); \ }while(0) +// Expansion of some code #define CODE_16( A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N; O; P #define CODE_15( A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N; O #define CODE_14( A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A; B; C; D; E; F; G; H; I; J; K; L; M; N @@ -267,6 +274,7 @@ #define _CODE_N(N,V...) CODE_##N(V) #define CODE_N(N,V...) _CODE_N(N,V) +// Expansion of some non-delimited content #define GANG_16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,...) A B C D E F G H I J K L M N O P #define GANG_15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,...) A B C D E F G H I J K L M N O #define GANG_14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,...) A B C D E F G H I J K L M N @@ -288,7 +296,7 @@ #define GANG_N(N,V...) _GANG_N(N,V) #define GANG_N_1(N,K) _GANG_N(N,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K,K) -// Macros for initializing arrays +// Expansion of some list items #define LIST_26(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z #define LIST_25(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y #define LIST_24(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,...) A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X From e7e77d9612253cf7106cfc9e69f69e52f4083294 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 Oct 2023 09:44:46 -0500 Subject: [PATCH 094/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fxd?= =?UTF-8?q?TiCtrl=20=3D>=20FTMotion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 4 +- Marlin/src/gcode/feature/ft_motion/M493.cpp | 66 +++++----- Marlin/src/lcd/menu/menu_motion.cpp | 24 ++-- Marlin/src/module/ft_motion.cpp | 137 ++++++++++---------- Marlin/src/module/ft_motion.h | 15 ++- Marlin/src/module/ft_types.h | 12 +- Marlin/src/module/motion.cpp | 8 +- Marlin/src/module/planner.cpp | 14 +- Marlin/src/module/planner.h | 4 - Marlin/src/module/settings.cpp | 12 +- Marlin/src/module/stepper.cpp | 91 ++++++------- Marlin/src/module/stepper.h | 10 +- 12 files changed, 189 insertions(+), 208 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 43a3cf04a870..312e6c2cee92 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -862,7 +862,7 @@ void idle(const bool no_stepper_sleep/*=false*/) { TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER()); // Manage Fixed-time Motion Control - TERN_(FT_MOTION, fxdTiCtrl.loop()); + TERN_(FT_MOTION, ftMotion.loop()); IDLE_DONE: TERN_(MARLIN_DEV_MODE, idle_depth--); @@ -1632,7 +1632,7 @@ void setup() { #endif #if ENABLED(FT_MOTION) - SETUP_RUN(fxdTiCtrl.init()); + SETUP_RUN(ftMotion.init()); #endif marlin_state = MF_RUNNING; diff --git a/Marlin/src/gcode/feature/ft_motion/M493.cpp b/Marlin/src/gcode/feature/ft_motion/M493.cpp index e3231480f330..f6e6a1261d46 100644 --- a/Marlin/src/gcode/feature/ft_motion/M493.cpp +++ b/Marlin/src/gcode/feature/ft_motion/M493.cpp @@ -29,13 +29,13 @@ void say_shaping() { // FT Enabled - SERIAL_ECHO_TERNARY(fxdTiCtrl.cfg.mode, "Fixed-Time Motion ", "en", "dis", "abled"); + SERIAL_ECHO_TERNARY(ftMotion.cfg.mode, "Fixed-Time Motion ", "en", "dis", "abled"); // FT Shaping #if HAS_X_AXIS - if (fxdTiCtrl.cfg.mode > ftMotionMode_ENABLED) { + if (ftMotion.cfg.mode > ftMotionMode_ENABLED) { SERIAL_ECHOPGM(" with "); - switch (fxdTiCtrl.cfg.mode) { + switch (ftMotion.cfg.mode) { default: break; case ftMotionMode_ZV: SERIAL_ECHOPGM("ZV"); break; case ftMotionMode_ZVD: SERIAL_ECHOPGM("ZVD"); break; @@ -51,15 +51,15 @@ void say_shaping() { #endif SERIAL_ECHOLNPGM("."); - const bool z_based = TERN0(HAS_DYNAMIC_FREQ_MM, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_Z_BASED), - g_based = TERN0(HAS_DYNAMIC_FREQ_G, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_MASS_BASED), + const bool z_based = TERN0(HAS_DYNAMIC_FREQ_MM, ftMotion.cfg.dynFreqMode == dynFreqMode_Z_BASED), + g_based = TERN0(HAS_DYNAMIC_FREQ_G, ftMotion.cfg.dynFreqMode == dynFreqMode_MASS_BASED), dynamic = z_based || g_based; // FT Dynamic Frequency Mode - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { #if HAS_DYNAMIC_FREQ SERIAL_ECHOPGM("Dynamic Frequency Mode "); - switch (fxdTiCtrl.cfg.dynFreqMode) { + switch (ftMotion.cfg.dynFreqMode) { default: case dynFreqMode_DISABLED: SERIAL_ECHOPGM("disabled"); break; #if HAS_DYNAMIC_FREQ_MM @@ -74,32 +74,32 @@ void say_shaping() { #if HAS_X_AXIS SERIAL_ECHO_TERNARY(dynamic, "X/A ", "base dynamic", "static", " compensator frequency: "); - SERIAL_ECHO(p_float_t(fxdTiCtrl.cfg.baseFreq[X_AXIS], 2), F("Hz")); + SERIAL_ECHO(p_float_t(ftMotion.cfg.baseFreq[X_AXIS], 2), F("Hz")); #if HAS_DYNAMIC_FREQ - if (dynamic) SERIAL_ECHO(" scaling: ", p_float_t(fxdTiCtrl.cfg.dynFreqK[X_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); + if (dynamic) SERIAL_ECHO(" scaling: ", p_float_t(ftMotion.cfg.dynFreqK[X_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); #endif SERIAL_EOL(); #endif #if HAS_Y_AXIS SERIAL_ECHO_TERNARY(dynamic, "Y/B ", "base dynamic", "static", " compensator frequency: "); - SERIAL_ECHO(p_float_t(fxdTiCtrl.cfg.baseFreq[Y_AXIS], 2), F(" Hz")); + SERIAL_ECHO(p_float_t(ftMotion.cfg.baseFreq[Y_AXIS], 2), F(" Hz")); #if HAS_DYNAMIC_FREQ - if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(fxdTiCtrl.cfg.dynFreqK[Y_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); + if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(ftMotion.cfg.dynFreqK[Y_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); #endif SERIAL_EOL(); #endif } #if HAS_EXTRUDERS - SERIAL_ECHO_TERNARY(fxdTiCtrl.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled"); - SERIAL_ECHOLN(F(". Gain: "), p_float_t(fxdTiCtrl.cfg.linearAdvK, 5)); + SERIAL_ECHO_TERNARY(ftMotion.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled"); + SERIAL_ECHOLN(F(". Gain: "), p_float_t(ftMotion.cfg.linearAdvK, 5)); #endif } void GcodeSuite::M493_report(const bool forReplay/*=true*/) { report_heading_etc(forReplay, F(STR_FT_MOTION)); - const ft_config_t &c = fxdTiCtrl.cfg; + const ft_config_t &c = ftMotion.cfg; SERIAL_ECHOPGM(" M493 S", c.mode); #if HAS_X_AXIS SERIAL_ECHOPGM(" A", c.baseFreq[X_AXIS]); @@ -160,7 +160,7 @@ void GcodeSuite::M493() { // Parse 'S' mode parameter. if (parser.seenval('S')) { - const ftMotionMode_t oldmm = fxdTiCtrl.cfg.mode, + const ftMotionMode_t oldmm = ftMotion.cfg.mode, newmm = (ftMotionMode_t)parser.value_byte(); if (newmm != oldmm) { @@ -179,7 +179,7 @@ void GcodeSuite::M493() { #endif case ftMotionMode_DISABLED: case ftMotionMode_ENABLED: - fxdTiCtrl.cfg.mode = newmm; + ftMotion.cfg.mode = newmm; flag.report_h = true; if (oldmm == ftMotionMode_DISABLED) flag.reset_ft = true; break; @@ -192,7 +192,7 @@ void GcodeSuite::M493() { // Pressure control (linear advance) parameter. if (parser.seen('P')) { const bool val = parser.value_bool(); - fxdTiCtrl.cfg.linearAdvEna = val; + ftMotion.cfg.linearAdvEna = val; SERIAL_ECHO_TERNARY(val, "Linear Advance ", "en", "dis", "abled.\n"); } @@ -200,7 +200,7 @@ void GcodeSuite::M493() { if (parser.seenval('K')) { const float val = parser.value_float(); if (val >= 0.0f) { - fxdTiCtrl.cfg.linearAdvK = val; + ftMotion.cfg.linearAdvK = val; flag.report_h = true; } else // Value out of range. @@ -213,22 +213,22 @@ void GcodeSuite::M493() { // Dynamic frequency mode parameter. if (parser.seenval('D')) { - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { const dynFreqMode_t val = dynFreqMode_t(parser.value_byte()); switch (val) { case dynFreqMode_DISABLED: - fxdTiCtrl.cfg.dynFreqMode = val; + ftMotion.cfg.dynFreqMode = val; flag.report_h = true; break; #if HAS_DYNAMIC_FREQ_MM case dynFreqMode_Z_BASED: - fxdTiCtrl.cfg.dynFreqMode = val; + ftMotion.cfg.dynFreqMode = val; flag.report_h = true; break; #endif #if HAS_DYNAMIC_FREQ_G case dynFreqMode_MASS_BASED: - fxdTiCtrl.cfg.dynFreqMode = val; + ftMotion.cfg.dynFreqMode = val; flag.report_h = true; break; #endif @@ -243,8 +243,8 @@ void GcodeSuite::M493() { } const bool modeUsesDynFreq = ( - TERN0(HAS_DYNAMIC_FREQ_MM, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_Z_BASED) - || TERN0(HAS_DYNAMIC_FREQ_G, fxdTiCtrl.cfg.dynFreqMode == dynFreqMode_MASS_BASED) + TERN0(HAS_DYNAMIC_FREQ_MM, ftMotion.cfg.dynFreqMode == dynFreqMode_Z_BASED) + || TERN0(HAS_DYNAMIC_FREQ_G, ftMotion.cfg.dynFreqMode == dynFreqMode_MASS_BASED) ); #endif // HAS_DYNAMIC_FREQ @@ -253,11 +253,11 @@ void GcodeSuite::M493() { // Parse frequency parameter (X axis). if (parser.seenval('A')) { - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { const float val = parser.value_float(); // TODO: Frequency minimum is dependent on the shaper used; the above check isn't always correct. if (WITHIN(val, FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2)) { - fxdTiCtrl.cfg.baseFreq[X_AXIS] = val; + ftMotion.cfg.baseFreq[X_AXIS] = val; flag.update_n = flag.reset_ft = flag.report_h = true; } else // Frequency out of range. @@ -271,7 +271,7 @@ void GcodeSuite::M493() { // Parse frequency scaling parameter (X axis). if (parser.seenval('F')) { if (modeUsesDynFreq) { - fxdTiCtrl.cfg.dynFreqK[X_AXIS] = parser.value_float(); + ftMotion.cfg.dynFreqK[X_AXIS] = parser.value_float(); flag.report_h = true; } else @@ -285,10 +285,10 @@ void GcodeSuite::M493() { // Parse frequency parameter (Y axis). if (parser.seenval('B')) { - if (fxdTiCtrl.cfg.modeHasShaper()) { + if (ftMotion.cfg.modeHasShaper()) { const float val = parser.value_float(); if (WITHIN(val, FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2)) { - fxdTiCtrl.cfg.baseFreq[Y_AXIS] = val; + ftMotion.cfg.baseFreq[Y_AXIS] = val; flag.update_n = flag.reset_ft = flag.report_h = true; } else // Frequency out of range. @@ -302,7 +302,7 @@ void GcodeSuite::M493() { // Parse frequency scaling parameter (Y axis). if (parser.seenval('H')) { if (modeUsesDynFreq) { - fxdTiCtrl.cfg.dynFreqK[Y_AXIS] = parser.value_float(); + ftMotion.cfg.dynFreqK[Y_AXIS] = parser.value_float(); flag.report_h = true; } else @@ -313,10 +313,10 @@ void GcodeSuite::M493() { #endif // HAS_Y_AXIS #if HAS_X_AXIS - if (flag.update_n) fxdTiCtrl.refreshShapingN(); - if (flag.update_a) fxdTiCtrl.updateShapingA(); + if (flag.update_n) ftMotion.refreshShapingN(); + if (flag.update_a) ftMotion.updateShapingA(); #endif - if (flag.reset_ft) fxdTiCtrl.reset(); + if (flag.reset_ft) ftMotion.reset(); if (flag.report_h) say_shaping(); } diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index dcabb7861e51..97c5b6759847 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -319,13 +319,13 @@ void menu_move() { #include "../../gcode/gcode.h" void ftm_menu_setShaping(const ftMotionMode_t s) { - fxdTiCtrl.cfg.mode = s; - fxdTiCtrl.refreshShapingN(); + ftMotion.cfg.mode = s; + ftMotion.refreshShapingN(); ui.go_back(); } inline void menu_ftm_mode() { - const ftMotionMode_t mode = fxdTiCtrl.cfg.mode; + const ftMotionMode_t mode = ftMotion.cfg.mode; START_MENU(); BACK_ITEM(MSG_FIXED_TIME_MOTION); @@ -349,17 +349,17 @@ void menu_move() { #if HAS_DYNAMIC_FREQ inline void menu_ftm_dyn_mode() { - const dynFreqMode_t dmode = fxdTiCtrl.cfg.dynFreqMode; + const dynFreqMode_t dmode = ftMotion.cfg.dynFreqMode; START_MENU(); BACK_ITEM(MSG_FIXED_TIME_MOTION); - if (dmode != dynFreqMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_DISABLED; ui.go_back(); }); + if (dmode != dynFreqMode_DISABLED) ACTION_ITEM(MSG_LCD_OFF, []{ ftMotion.cfg.dynFreqMode = dynFreqMode_DISABLED; ui.go_back(); }); #if HAS_DYNAMIC_FREQ_MM - if (dmode != dynFreqMode_Z_BASED) ACTION_ITEM(MSG_FTM_Z_BASED, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_Z_BASED; ui.go_back(); }); + if (dmode != dynFreqMode_Z_BASED) ACTION_ITEM(MSG_FTM_Z_BASED, []{ ftMotion.cfg.dynFreqMode = dynFreqMode_Z_BASED; ui.go_back(); }); #endif #if HAS_DYNAMIC_FREQ_G - if (dmode != dynFreqMode_MASS_BASED) ACTION_ITEM(MSG_FTM_MASS_BASED, []{ fxdTiCtrl.cfg.dynFreqMode = dynFreqMode_MASS_BASED; ui.go_back(); }); + if (dmode != dynFreqMode_MASS_BASED) ACTION_ITEM(MSG_FTM_MASS_BASED, []{ ftMotion.cfg.dynFreqMode = dynFreqMode_MASS_BASED; ui.go_back(); }); #endif END_MENU(); @@ -368,7 +368,7 @@ void menu_move() { #endif // HAS_DYNAMIC_FREQ void menu_ft_motion() { - ft_config_t &c = fxdTiCtrl.cfg; + ft_config_t &c = ftMotion.cfg; FSTR_P ftmode; switch (c.mode) { @@ -403,16 +403,16 @@ void menu_move() { if (c.modeHasShaper()) { #if HAS_X_AXIS - EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[X_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[X_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, ftMotion.refreshShapingN); #endif #if HAS_Y_AXIS - EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[Y_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_FTM_BASE_FREQ_N, &c.baseFreq[Y_AXIS], FTM_MIN_SHAPE_FREQ, (FTM_FS) / 2, ftMotion.refreshShapingN); #endif - EDIT_ITEM_FAST(float42_52, MSG_FTM_ZETA, &c.zeta, 0.0f, 1.0f, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST(float42_52, MSG_FTM_ZETA, &c.zeta, 0.0f, 1.0f, ftMotion.refreshShapingN); if (WITHIN(c.mode, ftMotionMode_EI, ftMotionMode_3HEI)) - EDIT_ITEM_FAST(float42_52, MSG_FTM_VTOL, &c.vtol, 0.0f, 1.0f, fxdTiCtrl.refreshShapingN); + EDIT_ITEM_FAST(float42_52, MSG_FTM_VTOL, &c.vtol, 0.0f, 1.0f, ftMotion.refreshShapingN); #if HAS_DYNAMIC_FREQ SUBMENU(MSG_FTM_DYN_MODE, menu_ftm_dyn_mode); diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 385d81622e8c..85ee4ca355d0 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -27,7 +27,7 @@ #include "ft_motion.h" #include "stepper.h" // Access stepper block queue function and abort status. -FxdTiCtrl fxdTiCtrl; +FTMotion ftMotion; #if !HAS_X_AXIS static_assert(FTM_DEFAULT_MODE == ftMotionMode_ZV, "ftMotionMode_ZV requires at least one linear axis."); @@ -50,66 +50,67 @@ FxdTiCtrl fxdTiCtrl; // Public variables. -ft_config_t FxdTiCtrl::cfg; -ft_command_t FxdTiCtrl::stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of stepper commands. -hal_timer_t FxdTiCtrl::stepperCmdBuff_StepRelativeTi[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of the stepper command timing. -uint8_t FxdTiCtrl::stepperCmdBuff_ApplyDir[FTM_STEPPERCMD_DIR_SIZE] = {0U}; // Buffer of whether DIR needs to be updated. -uint32_t FxdTiCtrl::stepperCmdBuff_produceIdx = 0, // Index of next stepper command write to the buffer. - FxdTiCtrl::stepperCmdBuff_consumeIdx = 0; // Index of next stepper command read from the buffer. +ft_config_t FTMotion::cfg; +bool FTMotion::busy; // = false +ft_command_t FTMotion::stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of stepper commands. +hal_timer_t FTMotion::stepperCmdBuff_StepRelativeTi[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Buffer of the stepper command timing. +uint8_t FTMotion::stepperCmdBuff_ApplyDir[FTM_STEPPERCMD_DIR_SIZE] = {0U}; // Buffer of whether DIR needs to be updated. +uint32_t FTMotion::stepperCmdBuff_produceIdx = 0, // Index of next stepper command write to the buffer. + FTMotion::stepperCmdBuff_consumeIdx = 0; // Index of next stepper command read from the buffer. -bool FxdTiCtrl::sts_stepperBusy = false; // The stepper buffer has items and is in use. +bool FTMotion::sts_stepperBusy = false; // The stepper buffer has items and is in use. // Private variables. // NOTE: These are sized for Ulendo FBS use. -xyze_trajectory_t FxdTiCtrl::traj; // = {0.0f} Storage for fixed-time-based trajectory. -xyze_trajectoryMod_t FxdTiCtrl::trajMod; // = {0.0f} Storage for modified fixed-time-based trajectory. - -block_t* FxdTiCtrl::current_block_cpy = nullptr; // Pointer to current block being processed. -bool FxdTiCtrl::blockProcRdy = false, // Indicates a block is ready to be processed. - FxdTiCtrl::blockProcRdy_z1 = false, // Storage for the previous indicator. - FxdTiCtrl::blockProcDn = false; // Indicates current block is done being processed. -bool FxdTiCtrl::batchRdy = false; // Indicates a batch of the fixed time trajectory - // has been generated, is now available in the upper - - // half of traj.x[], y, z ... e vectors, and is ready to be - // post processed, if applicable, then interpolated. -bool FxdTiCtrl::batchRdyForInterp = false; // Indicates the batch is done being post processed, - // if applicable, and is ready to be converted to step commands. -bool FxdTiCtrl::runoutEna = false; // True if runout of the block hasn't been done and is allowed. -bool FxdTiCtrl::runout = false; // Indicates if runout is in progress. +xyze_trajectory_t FTMotion::traj; // = {0.0f} Storage for fixed-time-based trajectory. +xyze_trajectoryMod_t FTMotion::trajMod; // = {0.0f} Storage for modified fixed-time-based trajectory. + +block_t* FTMotion::current_block_cpy = nullptr; // Pointer to current block being processed. +bool FTMotion::blockProcRdy = false, // Indicates a block is ready to be processed. + FTMotion::blockProcRdy_z1 = false, // Storage for the previous indicator. + FTMotion::blockProcDn = false; // Indicates current block is done being processed. +bool FTMotion::batchRdy = false; // Indicates a batch of the fixed time trajectory + // has been generated, is now available in the upper - + // half of traj.x[], y, z ... e vectors, and is ready to be + // post processed, if applicable, then interpolated. +bool FTMotion::batchRdyForInterp = false; // Indicates the batch is done being post processed, + // if applicable, and is ready to be converted to step commands. +bool FTMotion::runoutEna = false; // True if runout of the block hasn't been done and is allowed. +bool FTMotion::runout = false; // Indicates if runout is in progress. // Trapezoid data variables. -xyze_pos_t FxdTiCtrl::startPosn, // (mm) Start position of block - FxdTiCtrl::endPosn_prevBlock = { 0.0f }; // (mm) End position of previous block -xyze_float_t FxdTiCtrl::ratio; // (ratio) Axis move ratio of block -float FxdTiCtrl::accel_P, // Acceleration prime of block. [mm/sec/sec] - FxdTiCtrl::decel_P, // Deceleration prime of block. [mm/sec/sec] - FxdTiCtrl::F_P, // Feedrate prime of block. [mm/sec] - FxdTiCtrl::f_s, // Starting feedrate of block. [mm/sec] - FxdTiCtrl::s_1e, // Position after acceleration phase of block. - FxdTiCtrl::s_2e; // Position after acceleration and coasting phase of block. - -uint32_t FxdTiCtrl::N1, // Number of data points in the acceleration phase. - FxdTiCtrl::N2, // Number of data points in the coasting phase. - FxdTiCtrl::N3; // Number of data points in the deceleration phase. - -uint32_t FxdTiCtrl::max_intervals; // Total number of data points that will be generated from block. +xyze_pos_t FTMotion::startPosn, // (mm) Start position of block + FTMotion::endPosn_prevBlock = { 0.0f }; // (mm) End position of previous block +xyze_float_t FTMotion::ratio; // (ratio) Axis move ratio of block +float FTMotion::accel_P, // Acceleration prime of block. [mm/sec/sec] + FTMotion::decel_P, // Deceleration prime of block. [mm/sec/sec] + FTMotion::F_P, // Feedrate prime of block. [mm/sec] + FTMotion::f_s, // Starting feedrate of block. [mm/sec] + FTMotion::s_1e, // Position after acceleration phase of block. + FTMotion::s_2e; // Position after acceleration and coasting phase of block. + +uint32_t FTMotion::N1, // Number of data points in the acceleration phase. + FTMotion::N2, // Number of data points in the coasting phase. + FTMotion::N3; // Number of data points in the deceleration phase. + +uint32_t FTMotion::max_intervals; // Total number of data points that will be generated from block. // Make vector variables. -uint32_t FxdTiCtrl::makeVector_idx = 0, // Index of fixed time trajectory generation of the overall block. - FxdTiCtrl::makeVector_idx_z1 = 0, // Storage for the previously calculated index above. - FxdTiCtrl::makeVector_batchIdx = FTM_BATCH_SIZE; // Index of fixed time trajectory generation within the batch. +uint32_t FTMotion::makeVector_idx = 0, // Index of fixed time trajectory generation of the overall block. + FTMotion::makeVector_idx_z1 = 0, // Storage for the previously calculated index above. + FTMotion::makeVector_batchIdx = FTM_BATCH_SIZE; // Index of fixed time trajectory generation within the batch. // Interpolation variables. -xyze_long_t FxdTiCtrl::steps = { 0 }; // Step count accumulator. -xyze_stepDir_t FxdTiCtrl::dirState = LOGICAL_AXIS_ARRAY_1(stepDirState_NOT_SET); // Memory of the currently set step direction of the axis. +xyze_long_t FTMotion::steps = { 0 }; // Step count accumulator. +xyze_stepDir_t FTMotion::dirState = LOGICAL_AXIS_ARRAY_1(stepDirState_NOT_SET); // Memory of the currently set step direction of the axis. -uint32_t FxdTiCtrl::interpIdx = 0, // Index of current data point being interpolated. - FxdTiCtrl::interpIdx_z1 = 0; // Storage for the previously calculated index above. -hal_timer_t FxdTiCtrl::nextStepTicks = FTM_MIN_TICKS; // Accumulator for the next step time (in ticks). +uint32_t FTMotion::interpIdx = 0, // Index of current data point being interpolated. + FTMotion::interpIdx_z1 = 0; // Storage for the previously calculated index above. +hal_timer_t FTMotion::nextStepTicks = FTM_MIN_TICKS; // Accumulator for the next step time (in ticks). // Shaping variables. #if HAS_X_AXIS - FxdTiCtrl::shaping_t FxdTiCtrl::shaping = { + FTMotion::shaping_t FTMotion::shaping = { 0, 0, x:{ { 0.0f }, { 0.0f }, { 0 } }, // d_zi, Ai, Ni #if HAS_Y_AXIS @@ -120,8 +121,8 @@ hal_timer_t FxdTiCtrl::nextStepTicks = FTM_MIN_TICKS; // Accumulator for the nex #if HAS_EXTRUDERS // Linear advance variables. - float FxdTiCtrl::e_raw_z1 = 0.0f; // (ms) Unit delay of raw extruder position. - float FxdTiCtrl::e_advanced_z1 = 0.0f; // (ms) Unit delay of advanced extruder position. + float FTMotion::e_raw_z1 = 0.0f; // (ms) Unit delay of raw extruder position. + float FTMotion::e_advanced_z1 = 0.0f; // (ms) Unit delay of advanced extruder position. #endif constexpr uint32_t last_batchIdx = (FTM_WINDOW_SIZE) - (FTM_BATCH_SIZE); @@ -133,15 +134,15 @@ constexpr uint32_t last_batchIdx = (FTM_WINDOW_SIZE) - (FTM_BATCH_SIZE); // Public functions. // Sets controller states to begin processing a block. -void FxdTiCtrl::startBlockProc(block_t * const current_block) { +void FTMotion::startBlockProc(block_t * const current_block) { current_block_cpy = current_block; blockProcRdy = true; blockProcDn = false; runoutEna = true; } -// Moves any free data points to the stepper buffer even if a full batch isn't ready. -void FxdTiCtrl::runoutBlock() { +// Move any free data points to the stepper buffer even if a full batch isn't ready. +void FTMotion::runoutBlock() { if (runoutEna && !batchRdy) { // If the window is full already (block intervals was a multiple of // the batch size), or runout is not enabled, no runout is needed. @@ -170,7 +171,7 @@ void FxdTiCtrl::runoutBlock() { } // Controller main, to be invoked from non-isr task. -void FxdTiCtrl::loop() { +void FTMotion::loop() { if (!cfg.mode) return; @@ -188,7 +189,7 @@ void FxdTiCtrl::loop() { } // Planner processing and block conversion. - if (!blockProcRdy && !runout) stepper.fxdTiCtrl_BlockQueueUpdate(); + if (!blockProcRdy && !runout) stepper.ftMotion_BlockQueueUpdate(); if (blockProcRdy) { if (!blockProcRdy_z1) loadBlockData(current_block_cpy); // One-shot. @@ -264,7 +265,7 @@ void FxdTiCtrl::loop() { } // Report busy status to planner. - planner.fxdTiCtrl_busy = (sts_stepperBusy || ((!blockProcDn && blockProcRdy) || batchRdy || batchRdyForInterp || runoutEna)); + busy = (sts_stepperBusy || ((!blockProcDn && blockProcRdy) || batchRdy || batchRdyForInterp || runoutEna)); blockProcRdy_z1 = blockProcRdy; makeVector_idx_z1 = makeVector_idx; @@ -276,7 +277,7 @@ void FxdTiCtrl::loop() { // Refresh the gains used by shaping functions. // To be called on init or mode or zeta change. - void FxdTiCtrl::Shaping::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { + void FTMotion::Shaping::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { const float K = exp(-zeta * M_PI / sqrt(1.0f - sq(zeta))), K2 = sq(K); @@ -345,14 +346,14 @@ void FxdTiCtrl::loop() { #endif } - void FxdTiCtrl::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { + void FTMotion::updateShapingA(const_float_t zeta/*=cfg.zeta*/, const_float_t vtol/*=cfg.vtol*/) { shaping.updateShapingA(zeta, vtol); } // Refresh the indices used by shaping functions. // To be called when frequencies change. - void FxdTiCtrl::AxisShaping::updateShapingN(const_float_t f, const_float_t df) { + void FTMotion::AxisShaping::updateShapingN(const_float_t f, const_float_t df) { // Protections omitted for DBZ and for index exceeding array length. switch (cfg.mode) { case ftMotionMode_ZV: @@ -382,7 +383,7 @@ void FxdTiCtrl::loop() { } } - void FxdTiCtrl::updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta/*=cfg.zeta*/) { + void FTMotion::updateShapingN(const_float_t xf OPTARG(HAS_Y_AXIS, const_float_t yf), const_float_t zeta/*=cfg.zeta*/) { const float df = sqrt(1.0f - sq(zeta)); shaping.x.updateShapingN(xf, df); TERN_(HAS_Y_AXIS, shaping.y.updateShapingN(yf, df)); @@ -391,12 +392,12 @@ void FxdTiCtrl::loop() { #endif // HAS_X_AXIS // Reset all trajectory processing variables. -void FxdTiCtrl::reset() { +void FTMotion::reset() { stepperCmdBuff_produceIdx = stepperCmdBuff_consumeIdx = 0; - traj.reset(); // Reset trajectory history - trajMod.reset(); // Reset modified trajectory history + traj.reset(); // Reset trajectory history + trajMod.reset(); // Reset modified trajectory history blockProcRdy = blockProcRdy_z1 = blockProcDn = false; batchRdy = batchRdyForInterp = false; @@ -424,13 +425,13 @@ void FxdTiCtrl::reset() { // Private functions. // Auxiliary function to get number of step commands in the buffer. -uint32_t FxdTiCtrl::stepperCmdBuffItems() { +uint32_t FTMotion::stepperCmdBuffItems() { const uint32_t udiff = stepperCmdBuff_produceIdx - stepperCmdBuff_consumeIdx; return stepperCmdBuff_produceIdx < stepperCmdBuff_consumeIdx ? (FTM_STEPPERCMD_BUFF_SIZE) + udiff : udiff; } // Initializes storage variables before startup. -void FxdTiCtrl::init() { +void FTMotion::init() { #if HAS_X_AXIS refreshShapingN(); updateShapingA(); @@ -439,7 +440,7 @@ void FxdTiCtrl::init() { } // Loads / converts block data from planner to fixed-time control variables. -void FxdTiCtrl::loadBlockData(block_t * const current_block) { +void FTMotion::loadBlockData(block_t * const current_block) { const float totalLength = current_block->millimeters, oneOverLength = 1.0f / totalLength; @@ -489,6 +490,7 @@ void FxdTiCtrl::loadBlockData(block_t * const current_block) { const float fdiff = feSqByTwoD - fsSqByTwoA, // (mm) Coasting distance if nominal speed is reached odiff = oneby2a - oneby2d, // (i.e., oneby2a * 2) (mm/s) Change in speed for one second of acceleration ldiff = totalLength - fdiff; // (mm) Distance to travel if nominal speed is reached + float T2 = (1.0f / F_n) * (ldiff - odiff * sq(F_n)); // (s) Coasting duration after nominal speed reached if (T2 < 0.0f) { T2 = 0.0f; @@ -496,7 +498,6 @@ void FxdTiCtrl::loadBlockData(block_t * const current_block) { } const float T1 = (F_n - f_s) / a, // (s) Accel Time = difference in feedrate over acceleration - T3 = (F_n - f_e) / a; // (s) Decel Time = difference in feedrate over acceleration N1 = ceil(T1 * (FTM_FS)); // Accel datapoints based on Hz frequency N2 = ceil(T2 * (FTM_FS)); // Coast @@ -536,7 +537,7 @@ void FxdTiCtrl::loadBlockData(block_t * const current_block) { } // Generate data points of the trajectory. -void FxdTiCtrl::makeVector() { +void FTMotion::makeVector() { float accel_k = 0.0f; // (mm/s^2) Acceleration K factor float tau = (makeVector_idx + 1) * (FTM_TS); // (s) Time since start of block float dist = 0.0f; // (mm) Distance traveled @@ -653,7 +654,7 @@ void FxdTiCtrl::makeVector() { } // Interpolates single data point to stepper commands. -void FxdTiCtrl::convertToSteps(const uint32_t idx) { +void FTMotion::convertToSteps(const uint32_t idx) { xyze_long_t err_P = { 0 }; //#define STEPS_ROUNDING diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index d607ac103038..3f620b2f5419 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -64,12 +64,13 @@ typedef struct FTConfig { #endif } ft_config_t; -class FxdTiCtrl { +class FTMotion { public: // Public variables static ft_config_t cfg; + static bool busy; static void set_defaults() { cfg.mode = FTM_DEFAULT_MODE; @@ -77,8 +78,8 @@ class FxdTiCtrl { TERN_(HAS_X_AXIS, cfg.baseFreq[X_AXIS] = FTM_SHAPING_DEFAULT_X_FREQ); TERN_(HAS_Y_AXIS, cfg.baseFreq[Y_AXIS] = FTM_SHAPING_DEFAULT_Y_FREQ); - cfg.zeta = FTM_SHAPING_ZETA; - cfg.vtol = FTM_SHAPING_V_TOL; + cfg.zeta = FTM_SHAPING_ZETA; // Damping factor + cfg.vtol = FTM_SHAPING_V_TOL; // Vibration Level #if HAS_DYNAMIC_FREQ cfg.dynFreqMode = FTM_DEFAULT_DYNFREQ_MODE; @@ -114,7 +115,6 @@ class FxdTiCtrl { static void runoutBlock(); // Move any free data points to the stepper buffer even if a full batch isn't ready. static void loop(); // Controller main, to be invoked from non-isr task. - #if HAS_X_AXIS // Refresh the gains used by shaping functions. // To be called on init or mode or zeta change. @@ -168,6 +168,7 @@ class FxdTiCtrl { static hal_timer_t nextStepTicks; + // Shaping variables. #if HAS_X_AXIS typedef struct AxisShaping { @@ -202,10 +203,10 @@ class FxdTiCtrl { // Private methods static uint32_t stepperCmdBuffItems(); - static void loadBlockData(block_t * const current_block); + static void loadBlockData(block_t *const current_block); static void makeVector(); static void convertToSteps(const uint32_t idx); -}; // class fxdTiCtrl +}; // class FTMotion -extern FxdTiCtrl fxdTiCtrl; +extern FTMotion ftMotion; diff --git a/Marlin/src/module/ft_types.h b/Marlin/src/module/ft_types.h index a7228d32d6f2..6b708677d19c 100644 --- a/Marlin/src/module/ft_types.h +++ b/Marlin/src/module/ft_types.h @@ -56,15 +56,9 @@ typedef struct XYZEval xyze_stepDir_t; enum { LIST_N(DOUBLE(LOGICAL_AXES), FT_BIT_DIR_E, FT_BIT_STEP_E, - FT_BIT_DIR_X, FT_BIT_STEP_X, - FT_BIT_DIR_Y, FT_BIT_STEP_Y, - FT_BIT_DIR_Z, FT_BIT_STEP_Z, - FT_BIT_DIR_I, FT_BIT_STEP_I, - FT_BIT_DIR_J, FT_BIT_STEP_J, - FT_BIT_DIR_K, FT_BIT_STEP_K, - FT_BIT_DIR_U, FT_BIT_STEP_U, - FT_BIT_DIR_V, FT_BIT_STEP_V, - FT_BIT_DIR_W, FT_BIT_STEP_W + FT_BIT_DIR_X, FT_BIT_STEP_X, FT_BIT_DIR_Y, FT_BIT_STEP_Y, FT_BIT_DIR_Z, FT_BIT_STEP_Z, + FT_BIT_DIR_I, FT_BIT_STEP_I, FT_BIT_DIR_J, FT_BIT_STEP_J, FT_BIT_DIR_K, FT_BIT_STEP_K, + FT_BIT_DIR_U, FT_BIT_STEP_U, FT_BIT_DIR_V, FT_BIT_STEP_V, FT_BIT_DIR_W, FT_BIT_STEP_W ), FT_BIT_COUNT }; diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index d091e67e0495..74ba41ccf699 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -2100,12 +2100,12 @@ void prepare_line_to_destination() { struct OnExit { ftMotionMode_t oldmm; OnExit() { - oldmm = fxdTiCtrl.cfg.mode; - fxdTiCtrl.cfg.mode = ftMotionMode_DISABLED; + oldmm = ftMotion.cfg.mode; + ftMotion.cfg.mode = ftMotionMode_DISABLED; } ~OnExit() { - fxdTiCtrl.cfg.mode = oldmm; - fxdTiCtrl.init(); + ftMotion.cfg.mode = oldmm; + ftMotion.init(); } } on_exit; #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 9b8b26892704..0916ade58158 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -229,10 +229,6 @@ float Planner::previous_nominal_speed; int32_t Planner::xy_freq_min_interval_us = LROUND(1000000.0f / (XY_FREQUENCY_LIMIT)); #endif -#if ENABLED(FT_MOTION) - bool Planner::fxdTiCtrl_busy = false; -#endif - #if ENABLED(LIN_ADVANCE) float Planner::extruder_advance_K[DISTINCT_E]; // Initialized by settings.load() #endif @@ -1692,7 +1688,7 @@ void Planner::quick_stop() { // Restart the block delay for the first movement - As the queue was // forced to empty, there's no risk the ISR will touch this. - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; TERN_(HAS_WIRED_LCD, clear_block_buffer_runtime()); // Clear the accumulated runtime @@ -1738,7 +1734,7 @@ bool Planner::busy() { return (has_blocks_queued() || cleaning_buffer_counter || TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING()) || TERN0(HAS_ZV_SHAPING, stepper.input_shaping_busy()) - || TERN0(FT_MOTION, fxdTiCtrl_busy) + || TERN0(FT_MOTION, ftMotion.busy) ); } @@ -1851,7 +1847,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target // As there are no queued movements, the Stepper ISR will not touch this // variable, so there is no risk setting this here (but it MUST be done // before the following line!!) - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; } // Move buffer head @@ -2924,7 +2920,7 @@ void Planner::buffer_sync_block(const BlockFlagBit sync_flag/*=BLOCK_BIT_SYNC_PO // As there are no queued movements, the Stepper ISR will not touch this // variable, so there is no risk setting this here (but it MUST be done // before the following line!!) - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; } block_buffer_head = next_buffer_head; @@ -3217,7 +3213,7 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s // As there are no queued movements, the Stepper ISR will not touch this // variable, so there is no risk setting this here (but it MUST be done // before the following line!!) - delay_before_delivering = TERN_(FT_MOTION, fxdTiCtrl.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; + delay_before_delivering = TERN_(FT_MOTION, ftMotion.cfg.mode ? BLOCK_DELAY_NONE :) BLOCK_DELAY_FOR_1ST_MOVE; } // Move buffer head diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 238657be7b36..6fde0b2bf38e 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -529,10 +529,6 @@ class Planner { } #endif - #if ENABLED(FT_MOTION) - static bool fxdTiCtrl_busy; - #endif - private: /** diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 7abe276561d2..6f7c4b1ebca5 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -612,7 +612,7 @@ typedef struct SettingsDataStruct { // Fixed-Time Motion // #if ENABLED(FT_MOTION) - ft_config_t fxdTiCtrl_cfg; // M493 + ft_config_t ftMotion_cfg; // M493 #endif // @@ -1711,8 +1711,8 @@ void MarlinSettings::postprocess() { // Fixed-Time Motion // #if ENABLED(FT_MOTION) - _FIELD_TEST(fxdTiCtrl_cfg); - EEPROM_WRITE(fxdTiCtrl.cfg); + _FIELD_TEST(ftMotion_cfg); + EEPROM_WRITE(ftMotion.cfg); #endif // @@ -2785,8 +2785,8 @@ void MarlinSettings::postprocess() { // Fixed-Time Motion // #if ENABLED(FT_MOTION) - _FIELD_TEST(fxdTiCtrl_cfg); - EEPROM_READ(fxdTiCtrl.cfg); + _FIELD_TEST(ftMotion_cfg); + EEPROM_READ(ftMotion.cfg); #endif // @@ -3614,7 +3614,7 @@ void MarlinSettings::reset() { // // Fixed-Time Motion // - TERN_(FT_MOTION, fxdTiCtrl.set_defaults()); + TERN_(FT_MOTION, ftMotion.set_defaults()); // // Nonlinear Extrusion diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 6077154cd266..a6c628e081cc 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1492,11 +1492,14 @@ void Stepper::isr() { uint8_t max_loops = 10; #if ENABLED(FT_MOTION) - static bool fxdTiCtrl_stepCmdRdy = false; // Indicates a step command was loaded from the - // buffers and is ready to be output. - static bool fxdTiCtrl_applyDir = false; // Indicates the DIR output should be set. - static ft_command_t fxdTiCtrl_stepCmd = 0U; // Storage for the step command to be output. - static uint32_t fxdTiCtrl_nextAuxISR = 0U; // Storage for the next ISR of the auxilliary tasks. + static bool ftMotion_stepCmdRdy = false; // Indicates a step command was loaded from the + // buffers and is ready to be output. + static bool ftMotion_applyDir = false; // Indicates the DIR output should be set. + static ft_command_t ftMotion_stepCmd = 0U; // Storage for the step command to be output. + static uint32_t ftMotion_nextAuxISR = 0U; // Storage for the next ISR of the auxilliary tasks. + const bool using_ftMotion = ftMotion.cfg.mode; + #else + constexpr bool using_ftMotion = false; #endif // We need this variable here to be able to use it in the following loop @@ -1509,64 +1512,58 @@ void Stepper::isr() { #if ENABLED(FT_MOTION) - // NOTE STEPPER_TIMER_RATE is equal to 2000000, not what VSCode shows - const bool using_fxtictrl = fxdTiCtrl.cfg.mode; - if (using_fxtictrl) { + if (using_ftMotion) { if (!nextMainISR) { if (abort_current_block) { - fxdTiCtrl_stepCmdRdy = false; // If a command was ready, cancel it. - fxdTiCtrl.sts_stepperBusy = false; // Set busy false to allow a reset. + ftMotion_stepCmdRdy = false; // If a command was ready, cancel it. + ftMotion.sts_stepperBusy = false; // Set busy false to allow a reset. nextMainISR = 0.01f * (STEPPER_TIMER_RATE); // Come back in 10 msec. } else { // !(abort_current_block) - if (fxdTiCtrl_stepCmdRdy) { - fxdTiCtrl_stepper(fxdTiCtrl_applyDir, fxdTiCtrl_stepCmd); - fxdTiCtrl_stepCmdRdy = false; + if (ftMotion_stepCmdRdy) { + ftMotion_stepper(ftMotion_applyDir, ftMotion_stepCmd); + ftMotion_stepCmdRdy = false; } // Check if there is data in the buffers. - if (fxdTiCtrl.stepperCmdBuff_produceIdx != fxdTiCtrl.stepperCmdBuff_consumeIdx) { + if (ftMotion.stepperCmdBuff_produceIdx != ftMotion.stepperCmdBuff_consumeIdx) { - fxdTiCtrl.sts_stepperBusy = true; + ftMotion.sts_stepperBusy = true; // "Pop" one command from the command buffer. - fxdTiCtrl_stepCmd = fxdTiCtrl.stepperCmdBuff[fxdTiCtrl.stepperCmdBuff_consumeIdx]; - const uint8_t dir_index = fxdTiCtrl.stepperCmdBuff_consumeIdx >> 3, - dir_bit = fxdTiCtrl.stepperCmdBuff_consumeIdx & 0x7; - fxdTiCtrl_applyDir = TEST(fxdTiCtrl.stepperCmdBuff_ApplyDir[dir_index], dir_bit); - nextMainISR = fxdTiCtrl.stepperCmdBuff_StepRelativeTi[fxdTiCtrl.stepperCmdBuff_consumeIdx]; - fxdTiCtrl_stepCmdRdy = true; + ftMotion_stepCmd = ftMotion.stepperCmdBuff[ftMotion.stepperCmdBuff_consumeIdx]; + const uint8_t dir_index = ftMotion.stepperCmdBuff_consumeIdx >> 3, + dir_bit = ftMotion.stepperCmdBuff_consumeIdx & 0x7; + ftMotion_applyDir = TEST(ftMotion.stepperCmdBuff_ApplyDir[dir_index], dir_bit); + nextMainISR = ftMotion.stepperCmdBuff_StepRelativeTi[ftMotion.stepperCmdBuff_consumeIdx]; + ftMotion_stepCmdRdy = true; - if (++fxdTiCtrl.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) - fxdTiCtrl.stepperCmdBuff_consumeIdx = 0; + if (++ftMotion.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) + ftMotion.stepperCmdBuff_consumeIdx = 0; } else { // Buffer empty. - fxdTiCtrl.sts_stepperBusy = false; + ftMotion.sts_stepperBusy = false; nextMainISR = 0.01f * (STEPPER_TIMER_RATE); // Come back in 10 msec. } } // !(abort_current_block) } // if (!nextMainISR) - // Define 2.5 msec task for auxilliary functions. - if (!fxdTiCtrl_nextAuxISR) { + // Define 2.5 msec task for auxiliary functions. + if (!ftMotion_nextAuxISR) { endstops.update(); TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr()); - fxdTiCtrl_refreshAxisDidMove(); - fxdTiCtrl_nextAuxISR = 0.0025f * (STEPPER_TIMER_RATE); + ftMotion_refreshAxisDidMove(); + ftMotion_nextAuxISR = 0.0025f * (STEPPER_TIMER_RATE); } - interval = _MIN(nextMainISR, fxdTiCtrl_nextAuxISR); + interval = _MIN(nextMainISR, ftMotion_nextAuxISR); nextMainISR -= interval; - fxdTiCtrl_nextAuxISR -= interval; + ftMotion_nextAuxISR -= interval; } - #else - - constexpr bool using_fxtictrl = false; - #endif - if (!using_fxtictrl) { + if (!using_ftMotion) { TERN_(HAS_ZV_SHAPING, shaping_isr()); // Do Shaper stepping, if needed @@ -3436,12 +3433,8 @@ void Stepper::report_a_position(const xyz_long_t &pos) { TERN(SAYS_A, PSTR(STR_COUNT_A), PSTR(STR_COUNT_X)), pos.x, TERN(SAYS_B, PSTR("B:"), SP_Y_LBL), pos.y, TERN(SAYS_C, PSTR("C:"), SP_Z_LBL), pos.z, - SP_I_LBL, pos.i, - SP_J_LBL, pos.j, - SP_K_LBL, pos.k, - SP_U_LBL, pos.u, - SP_V_LBL, pos.v, - SP_W_LBL, pos.w + SP_I_LBL, pos.i, SP_J_LBL, pos.j, SP_K_LBL, pos.k, + SP_U_LBL, pos.u, SP_V_LBL, pos.v, SP_W_LBL, pos.w ) ); #endif @@ -3466,7 +3459,7 @@ void Stepper::report_positions() { #if ENABLED(FT_MOTION) // Set stepper I/O for fixed time controller. - void Stepper::fxdTiCtrl_stepper(const bool applyDir, const ft_command_t command) { + void Stepper::ftMotion_stepper(const bool applyDir, const ft_command_t command) { USING_TIMED_PULSE(); @@ -3558,13 +3551,13 @@ void Stepper::report_positions() { if (axis_step.w) W_APPLY_STEP(!STEP_STATE_W, false) ); - } // Stepper::fxdTiCtrl_stepper + } // Stepper::ftMotion_stepper - void Stepper::fxdTiCtrl_BlockQueueUpdate() { + void Stepper::ftMotion_BlockQueueUpdate() { if (current_block) { // If the current block is not done processing, return right away - if (!fxdTiCtrl.getBlockProcDn()) return; + if (!ftMotion.getBlockProcDn()) return; axis_did_move.reset(); current_block = nullptr; @@ -3591,21 +3584,21 @@ void Stepper::report_positions() { // update it here, even though it will may be out of sync with step commands last_direction_bits = current_block->direction_bits; - fxdTiCtrl.startBlockProc(current_block); + ftMotion.startBlockProc(current_block); } else { - fxdTiCtrl.runoutBlock(); + ftMotion.runoutBlock(); return; // No queued blocks } } // if (!current_block) - } // Stepper::fxdTiCtrl_BlockQueueUpdate() + } // Stepper::ftMotion_BlockQueueUpdate() // Debounces the axis move indication to account for potential // delay between the block information and the stepper commands - void Stepper::fxdTiCtrl_refreshAxisDidMove() { + void Stepper::ftMotion_refreshAxisDidMove() { // Set the debounce time in seconds. #define AXIS_DID_MOVE_DEB 5 // TODO: The debounce time should be calculated if possible, diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index 4312cfaa8b00..eb84426dc79d 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -294,7 +294,7 @@ constexpr ena_mask_t enable_overlap[] = { // class Stepper { friend class Max7219; - friend class FxdTiCtrl; + friend class FTMotion; friend void stepperTask(void *); public: @@ -535,7 +535,7 @@ class Stepper { if (current_block->is_page()) page_manager.free_page(current_block->page_idx); #endif current_block = nullptr; - axis_did_move = 0; + axis_did_move.reset(); planner.release_current_block(); TERN_(LIN_ADVANCE, la_interval = nextAdvanceISR = LA_ADV_NEVER); } @@ -654,7 +654,7 @@ class Stepper { #if ENABLED(FT_MOTION) // Manage the planner - static void fxdTiCtrl_BlockQueueUpdate(); + static void ftMotion_BlockQueueUpdate(); #endif #if HAS_ZV_SHAPING @@ -693,8 +693,8 @@ class Stepper { #endif #if ENABLED(FT_MOTION) - static void fxdTiCtrl_stepper(const bool applyDir, const ft_command_t command); - static void fxdTiCtrl_refreshAxisDidMove(); + static void ftMotion_stepper(const bool applyDir, const ft_command_t command); + static void ftMotion_refreshAxisDidMove(); #endif }; From 7f887f2342d2da112ba2058177c53492d3c2903f Mon Sep 17 00:00:00 2001 From: Marcio T Date: Thu, 12 Oct 2023 10:14:58 -0600 Subject: [PATCH 095/268] =?UTF-8?q?=F0=9F=9A=B8=20Update=20FTDI=20Eve=20/?= =?UTF-8?q?=20CocoaPress=20UI=20(#26233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cocoa_press/_bootscreen_landscape.h | 134 ++++++++ .../cocoa_press/about_screen.cpp | 116 +++++++ .../cocoa_press/about_screen.h | 33 ++ .../cocoa_press/cocoa_press_bitmap.h | 248 ++++++++++++++ .../cocoa_press/cocoa_press_ui.h | 84 ++--- .../cocoa_press/files_screen.cpp | 16 +- .../cocoa_press/leveling_menu.cpp | 59 ++-- .../cocoa_press/main_menu.cpp | 19 +- .../ftdi_eve_touch_ui/cocoa_press/main_menu.h | 1 + .../cocoa_press/preheat_menu.cpp | 58 +--- .../cocoa_press/preheat_screen.cpp | 32 +- .../ftdi_eve_touch_ui/cocoa_press/screens.h | 8 +- .../cocoa_press/statistics_screen.cpp | 83 +++++ .../cocoa_press/statistics_screen.h | 32 ++ .../cocoa_press/status_screen.cpp | 323 ++++++++++-------- .../cocoa_press/status_screen.h | 20 +- .../cocoa_press/z_offset_screen.cpp | 59 ++++ .../cocoa_press/z_offset_screen.h | 32 ++ .../cocoa_press/z_offset_wizard.cpp | 162 +++++++++ .../cocoa_press/z_offset_wizard.h | 43 +++ .../ftdi_eve_lib/basic/commands.cpp | 8 + .../ftdi_eve_lib/basic/commands.h | 1 + .../ftdi_eve_lib/extended/unicode/unicode.cpp | 8 - .../ftdi_eve_lib/extended/unicode/unicode.h | 1 - .../ftdi_eve_lib/scripts/svg2cpp.py | 116 ++++--- .../generic/bed_mesh_edit_screen.cpp | 6 +- .../generic/bed_mesh_view_screen.cpp | 7 +- .../ftdi_eve_touch_ui/generic/main_menu.cpp | 36 +- .../generic/status_screen.cpp | 8 +- .../generic/temperature_screen.cpp | 2 +- .../ftdi_eve_touch_ui/language/language_en.h | 2 - .../lcd/extui/ftdi_eve_touch_ui/screen_data.h | 2 + .../lcd/extui/ftdi_eve_touch_ui/screens.cpp | 4 + .../extui/ftdi_eve_touch_ui/theme/bitmaps.h | 263 +++++++------- .../extui/ftdi_eve_touch_ui/theme/sounds.cpp | 41 ++- .../pins/stm32f4/pins_FYSETC_CHEETAH_V30.h | 2 +- 36 files changed, 1568 insertions(+), 501 deletions(-) create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/_bootscreen_landscape.h create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.cpp create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.h create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_bitmap.h create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.h create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.cpp create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.h create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.cpp create mode 100644 Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.h mode change 100644 => 100755 Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/_bootscreen_landscape.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/_bootscreen_landscape.h new file mode 100644 index 000000000000..e7b06f7bd397 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/_bootscreen_landscape.h @@ -0,0 +1,134 @@ + +/**************************************************************************** + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +/** + * This file was auto-generated using "svg2cpp.pl" + * + * The encoding consists of x,y pairs with the min and max scaled to + * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the + * start of a new closed path. + */ + +#pragma once + +constexpr float x_min = 0.000000; + +constexpr float x_max = 480.000000; + +constexpr float y_min = 0.000000; + +constexpr float y_max = 272.000000; + +const PROGMEM uint16_t outline[] = { + 0x8278, 0xC8E7, 0x7714, 0xC659, 0x6D20, 0xC0EF, 0x64D1, 0xB8D4, 0x5E5F, 0xAE2F, + 0x5AF5, 0xA493, 0x58F2, 0x99F6, 0x5886, 0x8B4E, 0x590F, 0x7956, 0x5997, 0x69F3, + 0x5B46, 0x5E96, 0x5E92, 0x5430, 0x6363, 0x4AF8, 0x69A4, 0x4327, 0x6F5B, 0x3E4A, + 0x7871, 0x3979, 0x82A1, 0x371E, 0x8CBB, 0x3756, 0x95A1, 0x3997, 0x9D90, 0x3D88, + 0xA50B, 0x43B6, 0xA6BC, 0x46C9, 0xA776, 0x4A42, 0xA669, 0x6D96, 0xA54B, 0x71E5, + 0xA030, 0x7B45, 0x9ECB, 0x7CC5, 0x9B2C, 0x7E1D, 0x9717, 0x7C80, 0x9521, 0x7B11, + 0x8FAD, 0x77D6, 0x8A1D, 0x7607, 0x82E0, 0x7609, 0x7CDD, 0x7812, 0x77F3, 0x7C15, + 0x75EF, 0x7EC5, 0x7830, 0x8278, 0x7D94, 0x8772, 0x847F, 0x8A0B, 0x8B98, 0x89F7, + 0x9127, 0x8806, 0x96AB, 0x849C, 0x9C6D, 0x81F2, 0x9F8E, 0x82E5, 0xA22C, 0x85FF, + 0xA63C, 0x8D9E, 0xA78B, 0x931F, 0xA68F, 0xB5E2, 0xA5D0, 0xB944, 0xA430, 0xBC3E, + 0x9E55, 0xC146, 0x94CA, 0xC660, 0x8A75, 0xC8DB, 0x8278, 0xC8E7, 0x8278, 0xC8E7 +}; + +const PROGMEM uint16_t shadow[] = { + 0x8699, 0x52F4, 0x807A, 0x5409, 0x7A89, 0x576A, 0x7583, 0x5D79, 0x7227, 0x6695, + 0x714B, 0x70C7, 0x71C8, 0x75DB, 0x730A, 0x7A69, 0x7496, 0x7A0E, 0x7601, 0x787F, + 0x78EF, 0x7565, 0x80E9, 0x7178, 0x8924, 0x7108, 0x914E, 0x7393, 0x9914, 0x789A, + 0x9B62, 0x792D, 0x9D8A, 0x7823, 0xA0FE, 0x72DA, 0xA34C, 0x6DC9, 0xA3D7, 0x6766, + 0xA42B, 0x5E98, 0xA3FD, 0x55F8, 0xA279, 0x55CE, 0xA12E, 0x578E, 0x9FE2, 0x59BB, + 0x9E59, 0x5AD8, 0x9AAC, 0x5AE1, 0x9728, 0x58ED, 0x9019, 0x54A3, 0x8699, 0x52F4, + 0x8699, 0x52F4, 0xFFFF, 0x5CA3, 0x849F, 0x5B93, 0x8686, 0x5B52, 0x896F, 0x5B3F, + 0x8FA9, 0x5C60, 0x9D67, 0x6003, 0xA994, 0x6582, 0xB393, 0x6C3B, 0xBAC7, 0x7604, + 0xC0E2, 0x8047, 0xC3D1, 0x8AB3, 0xC3DC, 0x94FB, 0xC14A, 0x9C85, 0xBD52, 0xA35D, + 0xB6C2, 0xA41B, 0xABC2, 0xA460, 0xA092, 0xA416, 0x9C7C, 0xA33E, 0x9B91, 0xA20E, + 0x9C3C, 0x9618, 0xA353, 0x8992, 0xA62E, 0x7CED, 0xA4E9, 0x7097, 0x9FA2, 0x6ADE, + 0x9B4F, 0x65A4, 0x9557, 0x6117, 0x8DDF, 0x5D63, 0x850D, 0x5CA3, 0x849F, 0x5CA3, + 0x849F +}; + +const PROGMEM uint16_t highlight[] = { + 0x861C, 0x5348, 0x8243, 0x53C6, 0x7EBF, 0x5693, 0x7C12, 0x5B55, 0x7ABE, 0x61B3, + 0x7AFC, 0x6656, 0x7C42, 0x6A49, 0x7FB1, 0x7163, 0x862A, 0x7090, 0x8C99, 0x717A, + 0x92E2, 0x740A, 0x98E8, 0x782A, 0x9AB3, 0x7852, 0x9C22, 0x7665, 0x9E0C, 0x7087, + 0x9E69, 0x65BE, 0x9C07, 0x5BDE, 0x9319, 0x568D, 0x8E92, 0x544E, 0x89E2, 0x534D, + 0x861C, 0x5348, 0x861C, 0x5348, 0xFFFF, 0x6B6A, 0x9CA0, 0x69D9, 0x9F11, 0x695E, + 0xA2AD, 0x6A25, 0xAA51, 0x6DB0, 0xBBAA, 0x785A, 0xC170, 0x8372, 0xC3D0, 0x8E9F, + 0xC2E2, 0x9987, 0xBEBD, 0x9CAB, 0xBCE9, 0x9EFE, 0xB9D2, 0x9E63, 0xB379, 0x9CE9, + 0xAD92, 0x98DE, 0xA2B8, 0x8D7F, 0xA5FA, 0x81FE, 0xA636, 0x76A6, 0xA32E, 0x6BC5, + 0x9CA0, 0x6B6A, 0x9CA0, 0x6B6A, 0x9CA0 +}; + +const PROGMEM uint16_t stroke[] = { + 0x8282, 0xC890, 0x7A14, 0xC6FB, 0x7257, 0xC3D9, 0x6B6A, 0xBF38, 0x6569, 0xB928, + 0x5E84, 0xADEC, 0x5B1E, 0xA460, 0x5926, 0x99F8, 0x58A5, 0x90C0, 0x59B6, 0x6B3D, + 0x5B4C, 0x5F6C, 0x5EA3, 0x549E, 0x63A2, 0x4B13, 0x6A2E, 0x430B, 0x71D8, 0x3D0C, + 0x7A7A, 0x3923, 0x83D5, 0x3761, 0x8DAA, 0x37DB, 0x98A8, 0x3B38, 0xA283, 0x4193, + 0xA638, 0x4620, 0xA741, 0x4B64, 0xA6C5, 0x5D20, 0xA613, 0x6E81, 0xA43A, 0x738A, + 0xA01F, 0x7AE8, 0x9DE9, 0x7D0E, 0x9B69, 0x7DBD, 0x9629, 0x7B6D, 0x905C, 0x77C9, + 0x8A94, 0x75BF, 0x8402, 0x7587, 0x7E52, 0x76FE, 0x79CA, 0x79CE, 0x75B1, 0x7EC7, + 0x780B, 0x82C0, 0x7C5E, 0x8702, 0x8193, 0x89A9, 0x8702, 0x8AA4, 0x8C76, 0x8A18, + 0x91F2, 0x8803, 0x977B, 0x8464, 0x9C8C, 0x825E, 0x9EAF, 0x82C4, 0xA0FC, 0x84BC, + 0xA3C6, 0x8965, 0xA6CF, 0x8FEF, 0xA756, 0x9463, 0xA6DA, 0xA612, 0xA5DF, 0xB86B, + 0xA414, 0xBBE7, 0xA03D, 0xBF7C, 0x9648, 0xC56A, 0x8B45, 0xC86E, 0x8282, 0xC890, + 0x8282, 0xC890, 0xFFFF, 0x89EE, 0xC221, 0x9395, 0xBFE8, 0x9C6D, 0xBB4F, 0xA047, + 0xB837, 0xA298, 0xB561, 0xA30A, 0xAA1F, 0xA34B, 0x9D6D, 0xA204, 0x9E54, 0x9820, + 0xA474, 0x960F, 0xA542, 0x886E, 0xA808, 0x803F, 0xA783, 0x785E, 0xA57C, 0x703C, + 0xA168, 0x691E, 0x9BB9, 0x623D, 0x92BA, 0x5D27, 0x8795, 0x5C9D, 0x868D, 0x5C4D, + 0x90BE, 0x5DBC, 0x9E89, 0x6126, 0xA944, 0x6630, 0xB207, 0x6CB0, 0xB914, 0x6E6F, + 0xBA8C, 0x7080, 0xBC05, 0x78E3, 0xC016, 0x8263, 0xC21E, 0x89EE, 0xC221, 0x89EE, + 0xC221, 0xFFFF, 0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0, + 0xA39A, 0x92E9, 0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73, + 0x8FB6, 0x8F97, 0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD, + 0x706D, 0x7C88, 0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0, + 0x76F3, 0x5586, 0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF, + 0x98F7, 0x552D, 0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E, + 0xA381, 0x4A6D, 0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9, + 0x7DFC, 0x3EA4, 0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B, + 0x60B0, 0x5AA7, 0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666, + 0x6620, 0x9016, 0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B, + 0x8CBB, 0xA14B, 0xFFFF, 0x7481, 0x77DA, 0x793F, 0x7317, 0x7EE3, 0x701D, 0x8044, + 0x6FBD, 0x81B4, 0x6F76, 0x846C, 0x6F18, 0x8E1D, 0x7044, 0x97FF, 0x75D2, 0x9B2B, + 0x772F, 0x9DAF, 0x75F3, 0xA26D, 0x6D0E, 0xA2E9, 0x62B8, 0xA33C, 0x583A, 0xA31E, + 0x573E, 0xA252, 0x5871, 0x9FC0, 0x5BDB, 0x9CD5, 0x5D2A, 0x9751, 0x5AEC, 0x914A, + 0x5720, 0x8B83, 0x5519, 0x83E3, 0x5506, 0x7ECB, 0x56B4, 0x7A0F, 0x59E9, 0x765D, + 0x5E9D, 0x73CE, 0x64A3, 0x727C, 0x6BCF, 0x7286, 0x72FD, 0x73A3, 0x78D6, 0x7481, + 0x77DA, 0x7481, 0x77DA +}; + +const PROGMEM uint16_t surface[] = { + 0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0, 0xA39A, 0x92E9, + 0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73, 0x8FB6, 0x8F97, + 0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD, 0x706D, 0x7C88, + 0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0, 0x76F3, 0x5586, + 0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF, 0x98F7, 0x552D, + 0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E, 0xA381, 0x4A6D, + 0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9, 0x7DFC, 0x3EA4, + 0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B, 0x60B0, 0x5AA7, + 0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666, 0x6620, 0x9016, + 0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B, 0x8CBB, 0xA14B +}; + +//#define LOGO_BACKGROUND 0xF05A22 +#define LOGO_BACKGROUND 0xFFFFFF + +#define LOGO_PAINT_PATHS \ + LOGO_PAINT_PATH(0xF27121, surface) \ + LOGO_PAINT_PATH(0x6B2C1B, shadow) \ + LOGO_PAINT_PATH(0xBC3E26, highlight) \ + LOGO_PAINT_PATH(0x3C2215, stroke) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.cpp new file mode 100644 index 000000000000..1de0fbd4a584 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.cpp @@ -0,0 +1,116 @@ +/******************** + * about_screen.cpp * + ********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" + +#ifdef COCOA_ABOUT_SCREEN + +#define GRID_COLS 4 +#define GRID_ROWS 8 + +using namespace FTDI; +using namespace Theme; +using namespace ExtUI; + +void AboutScreen::onEntry() { + BaseScreen::onEntry(); + sound.play(chimes, PLAY_ASYNCHRONOUS); +} + +void AboutScreen::onRedraw(draw_mode_t) { + CommandProcessor cmd; + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + + #define HEADING_POS BTN_POS(1,1), BTN_SIZE(4,2) + #define FW_VERS_POS BTN_POS(1,3), BTN_SIZE(4,1) + #define FW_INFO_POS BTN_POS(1,4), BTN_SIZE(4,1) + #define LICENSE_POS BTN_POS(1,5), BTN_SIZE(4,3) + #define STATS_POS BTN_POS(1,8), BTN_SIZE(2,1) + #define BACK_POS BTN_POS(3,8), BTN_SIZE(2,1) + + char about_str[1 + + strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)) + #ifdef TOOLHEAD_NAME + + strlen_P(TOOLHEAD_NAME) + #endif + ]; + #ifdef TOOLHEAD_NAME + // If MSG_ABOUT_TOUCH_PANEL_2 has %s, substitute in the toolhead name. + // But this is optional, so squelch the compiler warning here. + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wformat-extra-args" + sprintf_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2), TOOLHEAD_NAME); + #pragma GCC diagnostic pop + #else + strcpy_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2)); + #endif + + draw_text_box(cmd, HEADING_POS, + #ifdef MACHINE_NAME + F(MACHINE_NAME) + #else + GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1) + #endif + , OPT_CENTER, font_xlarge + ); + #if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU) + cmd.tag(3); + #endif + draw_text_box(cmd, FW_VERS_POS, + #ifdef TOUCH_UI_VERSION + F(TOUCH_UI_VERSION) + #else + FPSTR(getFirmwareName_str()) + #endif + , OPT_CENTER, font_medium); + cmd.tag(0); + draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium); + draw_text_box(cmd, LICENSE_POS, GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny); + + cmd.font(font_medium); + #if ENABLED(PRINTCOUNTER) + cmd.colors(normal_btn) + .tag(2).button(STATS_POS, GET_TEXT_F(MSG_INFO_STATS_MENU)); + #endif + cmd.colors(action_btn) + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); +} + +bool AboutScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); break; + #if ENABLED(PRINTCOUNTER) + case 2: GOTO_SCREEN(StatisticsScreen); break; + #endif + #if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU) + case 3: GOTO_SCREEN(DeveloperMenu); break; + #endif + default: return false; + } + return true; +} + +#endif // COCOA_ABOUT_SCREEN diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.h new file mode 100644 index 000000000000..2e9bc1827e1a --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/about_screen.h @@ -0,0 +1,33 @@ +/****************** + * about_screen.h * + ******************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_ABOUT_SCREEN +#define COCOA_ABOUT_SCREEN_CLASS AboutScreen + +class AboutScreen : public BaseScreen, public UncachedScreen { + public: + static void onEntry(); + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_bitmap.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_bitmap.h new file mode 100644 index 000000000000..18fbed9a525c --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_bitmap.h @@ -0,0 +1,248 @@ +const unsigned char cocoa_press_ui[2941] PROGMEM = { + 0x78, 0x9C, 0xED, 0xDD, 0x3B, 0x96, 0xA3, 0xC8, 0xB6, 0x00, 0xD0, 0xC9, + 0x68, 0x28, 0x1A, 0x0A, 0x06, 0x3D, 0x8F, 0x34, 0x24, 0x83, 0x59, 0x94, + 0x91, 0x8E, 0x0C, 0x30, 0x34, 0x86, 0x32, 0xCA, 0x2A, 0x03, 0x23, 0x99, + 0x42, 0x8D, 0xE0, 0x62, 0xE8, 0x0A, 0x21, 0x20, 0x22, 0xF8, 0x54, 0xF6, + 0xBA, 0x6F, 0x3D, 0xA5, 0x52, 0x7B, 0x1B, 0xDD, 0x29, 0x50, 0xA0, 0xA0, + 0xD7, 0x39, 0xC4, 0x0F, 0xE8, 0xCB, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, + 0xFF, 0x48, 0x5B, 0xFF, 0x2E, 0xCB, 0xBA, 0x6E, 0x1F, 0x5D, 0x0F, 0xF8, + 0x62, 0xDA, 0xF2, 0xB0, 0xDF, 0xEF, 0x06, 0xFB, 0xBC, 0xA8, 0x1F, 0x5D, + 0x23, 0xF8, 0x2A, 0xCA, 0xEC, 0x96, 0x15, 0xFB, 0x2C, 0x3B, 0x1C, 0xB2, + 0xAC, 0x4F, 0x94, 0xFD, 0x41, 0x8A, 0xC0, 0xE5, 0x72, 0xDA, 0x77, 0xD9, + 0xF0, 0xFE, 0xEB, 0xCF, 0xE4, 0xFD, 0xD0, 0x65, 0xCC, 0xBE, 0x7C, 0x74, + 0xD5, 0xE0, 0xC1, 0xEA, 0x6B, 0x76, 0x64, 0x3F, 0xFF, 0xCC, 0xBD, 0x5F, + 0x77, 0xE4, 0x8F, 0xAE, 0x1D, 0x3C, 0x54, 0x71, 0xCD, 0x8E, 0x5F, 0x0B, + 0xD9, 0x71, 0xCF, 0x90, 0xD3, 0xA3, 0xEB, 0x07, 0x0F, 0x94, 0xEF, 0xF6, + 0xEF, 0x2B, 0xD9, 0xD1, 0x25, 0xC8, 0xEE, 0xB0, 0x5E, 0xB4, 0x29, 0x8F, + 0x79, 0x96, 0xE5, 0xC7, 0x72, 0x71, 0x9C, 0x52, 0x17, 0xC7, 0xEC, 0x3A, + 0x9C, 0x29, 0xAA, 0xD5, 0xD9, 0xB0, 0xA6, 0xDA, 0x2C, 0x7F, 0xEA, 0xF7, + 0xAE, 0x96, 0xAF, 0xCA, 0xAB, 0x8F, 0x8D, 0x53, 0xBB, 0x1D, 0xA5, 0x1C, + 0x54, 0xE9, 0xB4, 0x5C, 0x53, 0x0D, 0x7B, 0x66, 0xBB, 0x2E, 0x6D, 0x55, + 0x06, 0xAA, 0xF4, 0xCC, 0xAE, 0x15, 0xCB, 0x96, 0xAA, 0x5D, 0x75, 0xA7, + 0x9C, 0x6F, 0x9C, 0x32, 0x4F, 0xE6, 0xB0, 0xDB, 0x4F, 0x8D, 0xC7, 0xAF, + 0xF7, 0x6E, 0x6C, 0xBE, 0xCF, 0xDE, 0x86, 0xA1, 0xC8, 0xAF, 0xFD, 0xAE, + 0x58, 0x2B, 0x59, 0x77, 0x41, 0x32, 0xA8, 0xD2, 0xBD, 0x65, 0xB0, 0xF3, + 0xD8, 0xFC, 0xFB, 0xF2, 0xD5, 0x5F, 0xCB, 0x1F, 0xFB, 0x9D, 0xDB, 0x09, + 0x72, 0xCE, 0xB2, 0xD5, 0x03, 0x45, 0xBB, 0x92, 0x1A, 0xC4, 0xFB, 0xB2, + 0xF0, 0x3F, 0xC2, 0x47, 0xBE, 0x56, 0x28, 0x38, 0xE7, 0x42, 0x86, 0x7C, + 0x0B, 0x45, 0x90, 0x1E, 0xEF, 0xD3, 0xF4, 0x6E, 0x37, 0x5C, 0xEF, 0xB6, + 0x5F, 0xB7, 0xAC, 0xE5, 0xC7, 0x31, 0x8E, 0xA0, 0x3C, 0x0A, 0xBD, 0x3A, + 0x89, 0xAF, 0x85, 0x4E, 0xDA, 0x66, 0xF9, 0x8F, 0x8D, 0xF8, 0xBC, 0x6B, + 0xD7, 0x77, 0x05, 0x4E, 0xC9, 0x81, 0x82, 0x80, 0x4E, 0xEB, 0x18, 0x1E, + 0xA8, 0x4D, 0xF6, 0x05, 0x8D, 0x68, 0xB5, 0x5A, 0x28, 0x3E, 0xA3, 0xC5, + 0x9C, 0xE6, 0xB9, 0x7C, 0xEC, 0xA7, 0xF4, 0xD8, 0xDF, 0xE6, 0x77, 0x7F, + 0x74, 0xDE, 0xB2, 0xEE, 0x43, 0x76, 0xE8, 0x12, 0x66, 0x79, 0xFC, 0xD1, + 0x64, 0xA9, 0x70, 0x20, 0x5F, 0xCD, 0xF6, 0x1E, 0x93, 0xF2, 0x6D, 0x3E, + 0xFB, 0x4A, 0xB0, 0xF7, 0xFC, 0xD7, 0xF2, 0xC1, 0x6F, 0x6C, 0x9E, 0x60, + 0x91, 0x1E, 0x68, 0xEA, 0x13, 0xA5, 0xF9, 0x11, 0xC6, 0x7A, 0x9A, 0x1F, + 0xF9, 0x6A, 0xA9, 0xA9, 0x4C, 0x92, 0xF0, 0xDB, 0x79, 0xCB, 0x53, 0xC8, + 0x77, 0xC3, 0xD8, 0xE3, 0xDA, 0x93, 0x1A, 0xB2, 0xA3, 0xD7, 0xA5, 0xC8, + 0x75, 0xD3, 0x6E, 0x71, 0x86, 0x37, 0x8D, 0x9F, 0x38, 0x52, 0x66, 0x91, + 0x37, 0x0F, 0xF0, 0x7F, 0x5D, 0x7E, 0x36, 0x0C, 0x3A, 0xCC, 0x23, 0x7E, + 0xC1, 0x2C, 0x3F, 0xA6, 0x9F, 0x99, 0xFF, 0xCA, 0x74, 0xA4, 0xF4, 0xFC, + 0xA6, 0xDA, 0xA7, 0x79, 0xBD, 0x7A, 0xB8, 0x59, 0x8F, 0x91, 0xA7, 0xD3, + 0xEE, 0xF6, 0x53, 0xEB, 0xB1, 0xCF, 0xB2, 0xB7, 0x1F, 0xA1, 0xB7, 0xEB, + 0x96, 0x95, 0xFC, 0x38, 0x64, 0x33, 0xD3, 0xF7, 0xE6, 0x6D, 0x4B, 0x27, + 0x6A, 0x87, 0x8E, 0x5B, 0xFB, 0x97, 0x92, 0x6F, 0x76, 0x3D, 0x6E, 0xD7, + 0x76, 0xC4, 0xE6, 0xF9, 0x31, 0xC6, 0xED, 0x3C, 0x3F, 0xA6, 0x23, 0xA5, + 0x55, 0xA8, 0xD7, 0x0A, 0x4D, 0x59, 0x90, 0x9E, 0xD2, 0x56, 0xAD, 0x78, + 0x0E, 0xC5, 0xD8, 0x7C, 0xBC, 0x77, 0xE9, 0x91, 0xFD, 0x88, 0xBD, 0x75, + 0xF9, 0xF1, 0x7B, 0xA1, 0xDC, 0xD0, 0xB7, 0xC9, 0x6F, 0x13, 0x35, 0x75, + 0x11, 0xC7, 0xC3, 0x10, 0x29, 0xC7, 0x2E, 0xAA, 0x9A, 0x71, 0xD0, 0xDA, + 0xFC, 0x8F, 0xE5, 0xE3, 0x81, 0x78, 0xD0, 0x85, 0xDB, 0x3C, 0xC3, 0x31, + 0xF0, 0xDB, 0xFB, 0x81, 0xC6, 0xAE, 0x52, 0x3D, 0x96, 0x6E, 0xAB, 0xF4, + 0x48, 0xED, 0xDA, 0x91, 0x4F, 0x63, 0xBE, 0xB4, 0xE7, 0x3C, 0xFA, 0xC6, + 0x3D, 0xC5, 0xAE, 0x27, 0xD4, 0x14, 0x99, 0xE6, 0xE3, 0x5B, 0xC8, 0x76, + 0x51, 0xF3, 0x91, 0xE6, 0xC7, 0x8F, 0x2E, 0x3F, 0x96, 0xBA, 0x2F, 0xF7, + 0x70, 0x1A, 0x2F, 0xF9, 0x4D, 0x11, 0xCC, 0x0C, 0x0D, 0x97, 0xD8, 0x21, + 0x42, 0x86, 0xA1, 0x46, 0x31, 0x2B, 0x3F, 0x6E, 0x69, 0x8B, 0xE0, 0x56, + 0x96, 0x66, 0xA5, 0x7C, 0xDC, 0x43, 0xBB, 0x25, 0x51, 0x35, 0x04, 0xEB, + 0xAA, 0x22, 0xA8, 0x68, 0x19, 0x07, 0x7D, 0x1D, 0x7C, 0xBC, 0x27, 0xC8, + 0x38, 0xE9, 0xB4, 0x9A, 0x1F, 0xC7, 0xB0, 0x6A, 0x75, 0x39, 0x9D, 0x75, + 0x5C, 0xA2, 0x92, 0x1E, 0xDF, 0xC1, 0x7E, 0xEC, 0x5E, 0xDD, 0xD2, 0x23, + 0xE9, 0x5F, 0xAD, 0xE6, 0x47, 0x35, 0x0B, 0xF8, 0xD0, 0x31, 0x0E, 0xEF, + 0xCB, 0x98, 0x0E, 0x63, 0xF4, 0x9D, 0x37, 0xCB, 0x17, 0x6B, 0xE5, 0xC3, + 0x19, 0xA1, 0x3E, 0x1C, 0x3F, 0x8E, 0x1B, 0xC7, 0x09, 0x0E, 0x76, 0x0A, + 0xCA, 0x8C, 0x87, 0x09, 0xF3, 0x23, 0xD9, 0xF5, 0xB7, 0xFC, 0x58, 0xE8, + 0x73, 0x36, 0x6B, 0x25, 0x78, 0x5A, 0xF5, 0x2E, 0xBB, 0xA7, 0xC7, 0xCF, + 0x3E, 0x3F, 0xD2, 0x06, 0xA4, 0xCB, 0x8F, 0x85, 0x89, 0xFC, 0xE3, 0x66, + 0x2C, 0xCC, 0xAF, 0xF6, 0x75, 0x12, 0xF1, 0xC5, 0x27, 0xCA, 0x87, 0xD3, + 0x61, 0x69, 0xF9, 0xCB, 0x90, 0xA2, 0xC3, 0xBF, 0xD6, 0x85, 0xF9, 0x71, + 0x3F, 0xF2, 0x90, 0xF0, 0x61, 0x7E, 0x5C, 0x3E, 0x9B, 0x1F, 0x45, 0x7C, + 0x8C, 0x49, 0x3B, 0x3F, 0x6D, 0x9E, 0xDC, 0xEF, 0x31, 0x3F, 0xDE, 0xEF, + 0xF9, 0xD1, 0xFF, 0x73, 0x6C, 0x47, 0xAE, 0xE9, 0xB1, 0x5F, 0x28, 0x97, + 0xAD, 0x5D, 0x44, 0x3B, 0xF5, 0x42, 0x04, 0x25, 0xED, 0xC5, 0x66, 0xF3, + 0xF1, 0xB1, 0x50, 0x3E, 0x9F, 0xC5, 0xDE, 0xB1, 0xDF, 0x50, 0xAF, 0x44, + 0xEB, 0x68, 0x21, 0x3F, 0x86, 0x71, 0x4C, 0x98, 0x1F, 0x51, 0xAE, 0x5C, + 0x36, 0xF2, 0x63, 0x18, 0xA9, 0x14, 0xB3, 0xE5, 0x8D, 0xFB, 0x0E, 0x03, + 0x8F, 0xEF, 0xA3, 0x8C, 0xDB, 0x8F, 0xE0, 0xF1, 0x8F, 0xDD, 0x6D, 0xAA, + 0xB7, 0x9B, 0xE2, 0x5D, 0x88, 0xBD, 0x66, 0xED, 0x1A, 0x7A, 0x53, 0x2D, + 0x84, 0x56, 0xDC, 0x60, 0xB4, 0x9B, 0xE5, 0xCF, 0x0B, 0xE5, 0xCB, 0xD9, + 0xB6, 0x21, 0x43, 0xB7, 0x32, 0x6D, 0xFA, 0xE5, 0x53, 0x78, 0xE4, 0xA1, + 0x41, 0x0C, 0x73, 0xA2, 0x6F, 0x11, 0xA7, 0x36, 0x2B, 0x9E, 0xBF, 0x0A, + 0x6B, 0x3A, 0x6E, 0x3C, 0x26, 0xF5, 0x9F, 0x26, 0x0C, 0x4A, 0x6B, 0xE7, + 0xDF, 0xC3, 0x69, 0x9A, 0xDE, 0xDD, 0xED, 0x6E, 0x4B, 0x82, 0xF9, 0xA9, + 0xAA, 0xEB, 0xDF, 0xE5, 0xF1, 0xB6, 0xF6, 0xD1, 0x6D, 0x59, 0x6A, 0x24, + 0xD2, 0x8B, 0x6D, 0xAC, 0x4C, 0x42, 0xAD, 0x13, 0xE7, 0x4C, 0x13, 0xC7, + 0x69, 0x62, 0x29, 0xBF, 0x66, 0xBF, 0x38, 0x0E, 0xCC, 0x8F, 0x5B, 0x55, + 0xB9, 0x44, 0xF9, 0x31, 0x8C, 0xFB, 0x93, 0x83, 0xD6, 0x75, 0x5D, 0xE5, + 0xE9, 0xA5, 0x3F, 0xCE, 0x8F, 0xB0, 0xE1, 0x0A, 0x96, 0x2E, 0xF3, 0x38, + 0x43, 0x82, 0x39, 0x6F, 0x6B, 0x83, 0xDF, 0xC2, 0x69, 0x17, 0xCC, 0x5F, + 0xC5, 0x0F, 0x7B, 0x34, 0xC5, 0xAD, 0x31, 0x59, 0x5C, 0x3C, 0xDF, 0xCE, + 0x8F, 0x62, 0x16, 0x52, 0x69, 0x89, 0xED, 0xF2, 0xA7, 0x85, 0xFC, 0x9A, + 0x95, 0x18, 0xD3, 0xA2, 0x4F, 0x94, 0xF5, 0x7B, 0xB0, 0xFA, 0xDA, 0xE4, + 0x45, 0x51, 0x0C, 0xB3, 0xC6, 0x63, 0xEC, 0xCE, 0xD7, 0x3F, 0xA6, 0x62, + 0x71, 0x7E, 0x44, 0x95, 0x09, 0xEF, 0x0D, 0x88, 0xF3, 0x20, 0x5C, 0x3A, + 0xF4, 0x64, 0xD9, 0x37, 0x50, 0xEC, 0x82, 0xF5, 0x8F, 0xD9, 0x93, 0x1E, + 0x75, 0x51, 0x2C, 0xC7, 0xDD, 0x67, 0xE2, 0x3B, 0x5E, 0xEE, 0x8E, 0xFB, + 0x4C, 0xF7, 0xF2, 0x2B, 0xED, 0xC7, 0xBC, 0x2F, 0xB5, 0xF0, 0x8B, 0x63, + 0x74, 0xF6, 0x8D, 0xC2, 0xFA, 0x3D, 0xF8, 0xF3, 0xF5, 0xC1, 0x71, 0xE0, + 0x30, 0xCB, 0x8F, 0x20, 0xA6, 0x37, 0xF2, 0x23, 0x2A, 0x17, 0xEF, 0x09, + 0x7F, 0xCC, 0x30, 0xE4, 0xF9, 0x1D, 0x76, 0xE3, 0x00, 0xE4, 0x4F, 0xB6, + 0xDB, 0xA7, 0x43, 0xCE, 0xBA, 0xFE, 0xCF, 0x62, 0xB1, 0x8F, 0x24, 0xD0, + 0x62, 0x4B, 0xFD, 0xA3, 0x38, 0xE6, 0xFF, 0xFD, 0xF8, 0x25, 0xDD, 0x76, + 0x9E, 0x42, 0x70, 0x33, 0x57, 0x17, 0xF2, 0x63, 0x4A, 0xA5, 0x34, 0x3F, + 0xCE, 0x41, 0xB1, 0x38, 0x3F, 0xD2, 0xEE, 0x52, 0xB5, 0xB6, 0xAB, 0x09, + 0x16, 0xD1, 0xDD, 0x9F, 0xF8, 0xF4, 0x8E, 0xBB, 0xA9, 0x01, 0xE9, 0x56, + 0x08, 0xC3, 0xC1, 0x46, 0x7B, 0xEB, 0x60, 0x2D, 0x3E, 0x3D, 0xD8, 0x6E, + 0x5E, 0x21, 0xCF, 0x0B, 0xE1, 0xD1, 0x87, 0xCD, 0xD8, 0xA6, 0x6C, 0x96, + 0xAF, 0x17, 0xCA, 0x17, 0xC9, 0xC5, 0xBA, 0x3F, 0x5E, 0xD1, 0x3D, 0x9A, + 0xF1, 0x97, 0x60, 0x4C, 0xF3, 0x23, 0xE8, 0xF7, 0x25, 0xF9, 0x11, 0x45, + 0xFA, 0xFD, 0x14, 0xCB, 0xEA, 0x66, 0x7E, 0xD8, 0x29, 0x43, 0x92, 0x5F, + 0x6E, 0x8A, 0x85, 0x5F, 0xE2, 0x39, 0xFD, 0xB3, 0xDB, 0x4F, 0x23, 0xF4, + 0x3F, 0xD7, 0xD6, 0x64, 0x7F, 0xAC, 0xBA, 0x26, 0xA3, 0xAD, 0x4F, 0xDD, + 0xC3, 0xE7, 0xDD, 0xFD, 0xBB, 0x8B, 0x09, 0x92, 0xC5, 0xE1, 0x1E, 0x1B, + 0x42, 0x6B, 0x63, 0x53, 0x96, 0x84, 0xFB, 0xD2, 0xD1, 0x4F, 0xF3, 0x4D, + 0x45, 0xF2, 0x39, 0xB0, 0xFA, 0x98, 0x7C, 0x92, 0x1F, 0xE1, 0x51, 0xD3, + 0xF6, 0x23, 0xEC, 0xEF, 0xAD, 0xCE, 0xEF, 0x8E, 0x86, 0x0C, 0x99, 0x25, + 0x4F, 0x3B, 0xFC, 0xE4, 0x46, 0x61, 0x9E, 0x42, 0xDE, 0xDD, 0x9F, 0x3B, + 0x25, 0xC8, 0xAF, 0x6C, 0xE1, 0xF9, 0x8F, 0xA5, 0x28, 0x5E, 0x5D, 0x24, + 0xEB, 0x8F, 0x3A, 0x0B, 0x8F, 0xF4, 0xFB, 0xF7, 0xCF, 0xE7, 0x85, 0xC2, + 0x97, 0x71, 0x1E, 0x28, 0x08, 0xD7, 0xB4, 0xFC, 0xC2, 0xFD, 0xBD, 0x6B, + 0xA7, 0x18, 0xE6, 0x47, 0xF2, 0x24, 0xE2, 0x30, 0x0C, 0x6A, 0x9B, 0x34, + 0xFD, 0x3E, 0x93, 0x1F, 0xC3, 0x57, 0x16, 0xA6, 0xAA, 0xFE, 0xD6, 0xA6, + 0xF1, 0x24, 0xF2, 0xDB, 0x1C, 0xEE, 0x94, 0x20, 0x7F, 0x7E, 0xBD, 0xBF, + 0x75, 0xCF, 0x0F, 0xEE, 0xB3, 0xC3, 0xCF, 0xF1, 0xAE, 0xF7, 0x85, 0x4B, + 0xF3, 0x10, 0x9F, 0x53, 0xB8, 0xB5, 0xC5, 0x74, 0x1D, 0xBD, 0x87, 0xC7, + 0xD4, 0xBF, 0x18, 0xA6, 0x44, 0x67, 0xE5, 0x83, 0xBB, 0x97, 0x4E, 0x53, + 0xF9, 0x2A, 0x2D, 0x5F, 0xA7, 0xE5, 0xE7, 0x83, 0xEE, 0xD5, 0x60, 0x8C, + 0xD6, 0x07, 0x17, 0xCF, 0x62, 0xFA, 0xC5, 0x60, 0x36, 0x62, 0x23, 0x3F, + 0xEA, 0xE1, 0xA7, 0xCA, 0x34, 0x3F, 0xC6, 0xFC, 0x9D, 0x1D, 0x8E, 0xA7, + 0xF4, 0xCF, 0x6D, 0x55, 0x30, 0x7C, 0xC0, 0x76, 0xE6, 0x7D, 0xB1, 0x01, + 0x19, 0x66, 0x32, 0x87, 0x88, 0xE8, 0x42, 0x65, 0x0A, 0xF0, 0xE1, 0x72, + 0x7D, 0x4F, 0x9F, 0x85, 0x9E, 0xC8, 0x21, 0x29, 0xDF, 0x7D, 0xA5, 0x4C, + 0xCB, 0x1F, 0x56, 0xCB, 0xCF, 0xD3, 0x63, 0xB5, 0x83, 0xF5, 0xA9, 0xFC, + 0x98, 0xDF, 0x12, 0xB3, 0x9E, 0x1F, 0xE5, 0xF8, 0x94, 0xEE, 0x74, 0x6B, + 0xF0, 0x58, 0xAB, 0x2A, 0x2C, 0x6C, 0x95, 0xF0, 0xD9, 0x1D, 0x6F, 0x77, + 0x95, 0x5C, 0xC7, 0xE1, 0x87, 0xB5, 0xF4, 0xF8, 0xB9, 0xDC, 0xC1, 0x1A, + 0x17, 0xC9, 0x0E, 0x55, 0x5D, 0x9F, 0x8B, 0x24, 0x1E, 0xC6, 0x3B, 0xD2, + 0x8B, 0x73, 0x5D, 0x97, 0xE3, 0xAA, 0x40, 0x50, 0x7E, 0xEC, 0x20, 0xE5, + 0x41, 0xF9, 0xB1, 0x09, 0xA8, 0xFE, 0x52, 0xBE, 0x2F, 0x9D, 0xDF, 0xDF, + 0x9D, 0x90, 0x8E, 0xDD, 0x63, 0x9F, 0xCB, 0x8F, 0x2A, 0x4E, 0xD7, 0x31, + 0xC4, 0xAF, 0xBF, 0xDF, 0x1B, 0x77, 0xF4, 0x7D, 0xB1, 0xE3, 0xB5, 0xDA, + 0xE9, 0x6D, 0x94, 0xF7, 0x5F, 0x3A, 0xD7, 0xB3, 0x9B, 0xE5, 0x79, 0x52, + 0x55, 0x7F, 0xD7, 0xD5, 0x7E, 0x18, 0x6D, 0xCC, 0x1A, 0x8F, 0x6E, 0x0A, + 0xEB, 0x9F, 0xA5, 0x92, 0x0B, 0x3D, 0x9C, 0x20, 0x08, 0x17, 0x9E, 0x7E, + 0x5A, 0x9C, 0x90, 0x8A, 0x15, 0xDB, 0xE5, 0xEB, 0xA4, 0xF0, 0x18, 0x98, + 0x0B, 0x87, 0x4F, 0x7F, 0xE8, 0xAF, 0xCB, 0x9C, 0xFD, 0x9F, 0xD3, 0x8C, + 0xC3, 0xEC, 0x11, 0xAD, 0x61, 0xC7, 0xEC, 0xC1, 0xB0, 0xE4, 0x6E, 0x95, + 0xA5, 0xD3, 0xE1, 0x49, 0xB5, 0xF7, 0xBB, 0x12, 0x6F, 0x77, 0x5E, 0xED, + 0x0F, 0xD1, 0x6B, 0x7E, 0x7E, 0xBE, 0xDF, 0xF2, 0x66, 0xBF, 0x5B, 0x9E, + 0xA7, 0x9C, 0x3F, 0x3E, 0x1E, 0x06, 0xE1, 0x42, 0x78, 0x27, 0xF3, 0x3C, + 0x0B, 0x0F, 0x20, 0x16, 0x9B, 0x47, 0x9F, 0xDD, 0xEE, 0x3E, 0x26, 0x44, + 0x91, 0xEE, 0x0F, 0x7D, 0x32, 0x3F, 0xD2, 0x06, 0x64, 0x96, 0x1F, 0xF5, + 0xCA, 0xF6, 0xB1, 0xD2, 0xE9, 0x8B, 0x20, 0x0C, 0xCF, 0xBF, 0x81, 0xFD, + 0x78, 0x5B, 0x7B, 0xD6, 0xBF, 0x71, 0x37, 0xCB, 0xDE, 0x0E, 0xB7, 0x17, + 0xF0, 0xEE, 0xEE, 0xAF, 0xE3, 0x5D, 0x7D, 0xBF, 0xCF, 0xEC, 0x1A, 0x1F, + 0xE5, 0xD1, 0x2C, 0xC0, 0x67, 0x73, 0x5D, 0xB3, 0xF2, 0x87, 0xCD, 0xBD, + 0xF3, 0xF7, 0x8E, 0x8C, 0x9F, 0xFB, 0xD8, 0x5E, 0xE9, 0x60, 0x7D, 0x32, + 0x3F, 0xD2, 0x29, 0xE7, 0xB5, 0xFC, 0x98, 0xBD, 0x75, 0x65, 0x3C, 0x5A, + 0xFA, 0xC6, 0x15, 0xEB, 0xE7, 0xDF, 0x40, 0x15, 0x3C, 0xF6, 0xF1, 0x36, + 0x64, 0xC5, 0x90, 0x1A, 0x37, 0xEB, 0xEF, 0xBF, 0x2A, 0x37, 0xE3, 0x21, + 0xEE, 0x40, 0x1D, 0x16, 0x2E, 0xA6, 0x49, 0xF9, 0x64, 0x80, 0x1D, 0x5F, + 0x8E, 0xA3, 0x3B, 0x01, 0xD3, 0x79, 0xA3, 0xCD, 0xB9, 0xD8, 0x72, 0xE9, + 0xE0, 0xBD, 0x8F, 0x30, 0xC2, 0xD3, 0x06, 0x64, 0x2D, 0x3F, 0xE2, 0x8A, + 0xE5, 0xC1, 0x18, 0xBC, 0x89, 0xAE, 0x09, 0xDE, 0x5B, 0xFC, 0x2D, 0xDC, + 0x1B, 0x90, 0xE9, 0x89, 0xF3, 0xBB, 0xFB, 0xD3, 0x51, 0xAB, 0xEF, 0x67, + 0xE8, 0xB4, 0xC5, 0x56, 0x38, 0x04, 0x7B, 0xD3, 0x3B, 0xC1, 0x07, 0xA7, + 0x4F, 0x96, 0x3F, 0xC4, 0xB9, 0xD7, 0x5F, 0xF7, 0x83, 0xC8, 0x3C, 0x05, + 0x71, 0x9E, 0xEA, 0xC7, 0xD3, 0xCB, 0x7D, 0x9D, 0x5B, 0x40, 0x0F, 0xC7, + 0x3E, 0xC6, 0x5F, 0x5C, 0x6D, 0x27, 0x2E, 0xED, 0x54, 0xED, 0xA4, 0xD6, + 0xF5, 0x58, 0xC8, 0x8B, 0xEF, 0xBF, 0x89, 0xBA, 0x4F, 0x90, 0xF4, 0xB9, + 0xDA, 0xF1, 0xF1, 0xC1, 0x6B, 0x7E, 0x6C, 0x75, 0x14, 0x9A, 0xAA, 0x2C, + 0x8A, 0x53, 0xB5, 0xD2, 0xD5, 0xAE, 0xAF, 0x7B, 0x4F, 0xD5, 0x56, 0xA8, + 0x6C, 0x97, 0xFF, 0xE8, 0xCB, 0xCF, 0xE7, 0x49, 0x9B, 0x26, 0x2E, 0xD1, + 0xA6, 0x1B, 0xB6, 0xBE, 0x1C, 0xEF, 0x0A, 0x96, 0x70, 0xE2, 0x2F, 0x36, + 0x91, 0x85, 0x6A, 0x2F, 0xBE, 0x14, 0xB5, 0xAE, 0x4E, 0xEB, 0xE7, 0xC3, + 0xF3, 0x29, 0x76, 0x8B, 0x2F, 0x66, 0xF8, 0x64, 0x7E, 0xC0, 0x37, 0xD7, + 0x27, 0xC8, 0x72, 0x7E, 0xBC, 0xAD, 0xBD, 0xBF, 0x04, 0x5E, 0x45, 0x97, + 0x20, 0xFB, 0xB5, 0x0E, 0xD6, 0x75, 0xC4, 0xFE, 0xE8, 0xFA, 0xC1, 0x43, + 0x75, 0xFF, 0x7B, 0x9C, 0xE5, 0x04, 0xC9, 0x36, 0x5E, 0x4F, 0x0D, 0xAF, + 0xA2, 0xB8, 0xBD, 0x8D, 0x3A, 0x4E, 0x91, 0xB7, 0xFE, 0xFD, 0xBB, 0x46, + 0x1F, 0x70, 0xE9, 0x9F, 0x36, 0x1F, 0x16, 0x3D, 0xEE, 0x2B, 0x21, 0xFB, + 0xDC, 0xD8, 0x03, 0x6E, 0x9A, 0x22, 0x0F, 0xFF, 0xF7, 0x1F, 0xBB, 0xFD, + 0x3F, 0x9A, 0x0E, 0x88, 0xD4, 0x65, 0x51, 0x1C, 0x8B, 0xA2, 0xD8, 0x5C, + 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xBE, 0x8A, 0xB6, 0x69, 0xDA, 0x47, 0xD7, 0x01, 0xBE, 0xA2, 0xB6, + 0x3A, 0x66, 0x37, 0x87, 0xB2, 0x79, 0x74, 0x5D, 0xE0, 0x6B, 0x69, 0x8B, + 0x2C, 0x3B, 0x56, 0xF5, 0x55, 0xD5, 0xFD, 0xA5, 0x15, 0x81, 0x49, 0x99, + 0x65, 0xD5, 0xF4, 0xE9, 0x9C, 0x65, 0xA7, 0xC7, 0xD5, 0x05, 0xBE, 0x98, + 0x63, 0x56, 0xC6, 0x1B, 0xAA, 0xEC, 0xF8, 0x98, 0x9A, 0xC0, 0x97, 0x73, + 0xC8, 0xEA, 0x74, 0x53, 0x93, 0xE5, 0xFA, 0x58, 0x70, 0xE9, 0x5A, 0x8F, + 0x71, 0x40, 0x7E, 0xCE, 0xF3, 0x7B, 0xC3, 0xD1, 0xE6, 0x87, 0x47, 0xD5, + 0x07, 0xBE, 0x90, 0x32, 0x68, 0x3D, 0xBA, 0xF9, 0xAB, 0xA2, 0xFF, 0xB3, + 0x19, 0xFE, 0x80, 0x17, 0xD6, 0x04, 0x23, 0xF3, 0xFA, 0x36, 0xBF, 0x7B, + 0xFF, 0x70, 0x9E, 0xF7, 0xBA, 0xE0, 0xD5, 0x1C, 0xF3, 0xE9, 0xEF, 0xA6, + 0xCB, 0x8F, 0x71, 0x64, 0x7E, 0xD4, 0xC3, 0xE2, 0xD5, 0x7D, 0x44, 0xAD, + 0x44, 0x91, 0x05, 0xE3, 0xF2, 0x0F, 0x0D, 0x08, 0xAF, 0xAE, 0xC8, 0xA3, + 0x8F, 0x4D, 0x98, 0x12, 0x47, 0x23, 0x10, 0x5E, 0x5C, 0xBA, 0xF2, 0x11, + 0xAA, 0xB2, 0xFF, 0xBF, 0x7A, 0xC0, 0x17, 0xD4, 0x64, 0x1F, 0xD3, 0xDF, + 0x1F, 0x75, 0x5D, 0x55, 0x55, 0xB8, 0x53, 0x07, 0x8B, 0x97, 0x76, 0x9E, + 0x9A, 0x88, 0xA6, 0xBF, 0x3D, 0x31, 0x5C, 0x38, 0x0F, 0x6F, 0x3A, 0x81, + 0xD7, 0x53, 0x4E, 0xC3, 0x8F, 0x2A, 0xCF, 0xBB, 0xFC, 0x08, 0x53, 0xC2, + 0x00, 0x84, 0xD7, 0x76, 0x0A, 0x9B, 0x8B, 0x8F, 0x2E, 0x3F, 0xC2, 0xDB, + 0x4A, 0x0A, 0xF9, 0xC1, 0x4B, 0x2B, 0xC2, 0xFC, 0x28, 0xAF, 0xE9, 0x11, + 0x4D, 0x67, 0xC9, 0x0F, 0x5E, 0x5B, 0x19, 0xE6, 0xC3, 0x61, 0xBA, 0xBB, + 0xA4, 0xA7, 0x7F, 0xC5, 0x6B, 0x8B, 0xA6, 0x70, 0xBB, 0xF1, 0x47, 0x34, + 0x63, 0xB5, 0x35, 0xF9, 0x0B, 0xDF, 0x5F, 0x1D, 0x8C, 0x37, 0xEA, 0xB4, + 0x7B, 0x75, 0x31, 0xBF, 0xCB, 0x8B, 0x0B, 0xE6, 0xAB, 0x8A, 0xE0, 0xE6, + 0xC4, 0x9B, 0xDA, 0xFA, 0x20, 0x2F, 0xEE, 0x38, 0x0D, 0xD0, 0xBB, 0xEE, + 0x55, 0x79, 0x39, 0x4F, 0x0B, 0x86, 0x85, 0x87, 0x08, 0x79, 0x71, 0xE7, + 0xB1, 0x83, 0xD5, 0x76, 0xB3, 0xBB, 0xCD, 0x25, 0x9B, 0x1A, 0x0D, 0xCB, + 0x83, 0xBC, 0xBC, 0x71, 0xC6, 0xAA, 0x1F, 0x7E, 0x04, 0x8F, 0xA2, 0x9F, + 0x74, 0xAF, 0x78, 0x79, 0xE7, 0xE1, 0xE9, 0xDA, 0x6E, 0xF5, 0xE3, 0x50, + 0x4C, 0x23, 0xF4, 0x56, 0xF3, 0x01, 0x97, 0xC3, 0x3D, 0x23, 0xAA, 0xDB, + 0xED, 0x57, 0xF9, 0x6C, 0x3B, 0xBC, 0xB2, 0x76, 0xB8, 0x25, 0xB1, 0x1B, + 0x9F, 0x1F, 0xC6, 0xE9, 0xDE, 0x22, 0xF3, 0x1A, 0x45, 0xE8, 0x06, 0x1E, + 0x7D, 0x82, 0xB4, 0xA7, 0x62, 0x5A, 0xEF, 0x28, 0xAC, 0x7D, 0xC0, 0x4D, + 0x9D, 0xE5, 0x49, 0x5B, 0xD1, 0x1E, 0xA5, 0x07, 0xDC, 0x35, 0x79, 0xFC, + 0x42, 0xD1, 0x32, 0xD3, 0xB9, 0x82, 0xC9, 0x75, 0x70, 0x3E, 0x74, 0xAE, + 0xEA, 0x22, 0x73, 0xDF, 0x15, 0xC4, 0xCA, 0x6C, 0x54, 0x7A, 0xB5, 0x28, + 0xA4, 0xDA, 0xBA, 0x3A, 0x9D, 0xCA, 0x5A, 0xCF, 0x0A, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x57, 0xF4, 0x5F, 0xC3, 0x54, 0x94, + 0x5A +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h index 5704371131c6..6219f825dbe3 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/cocoa_press_ui.h @@ -1,52 +1,32 @@ -/**************************************************************************** - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * To view a copy of the GNU General Public License, go to the following * - * location: . * - ****************************************************************************/ - -/** - * This file was auto-generated using "svg2cpp.py" - * - * The encoding consists of x,y pairs with the min and max scaled to - * 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the - * start of a new closed path. - */ -#pragma once - -constexpr float x_min = 0.000000; -constexpr float x_max = 480.000000; -constexpr float y_min = 0.000000; -constexpr float y_max = 272.000000; - -const PROGMEM uint16_t menu_btn[] = {0x0AAA, 0x0E1E, 0x6D54, 0x0E1E, 0x6D54, 0x2F0E, 0x0AAA, 0x2F0E, 0x0AAA, 0x0E1E}; -const PROGMEM uint16_t print_btn[] = {0x47FF, 0xCF0D, 0x7FFF, 0xCF0D, 0x7FFF, 0xEFFE, 0x47FF, 0xEFFE, 0x47FF, 0xCF0D}; -const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAA, 0x3878, 0x6D54, 0x3878, 0x6D54, 0x5968, 0x0AAA, 0x5968, 0x0AAA, 0x3878}; -const PROGMEM uint16_t extrude_btn[] = {0x0AAA, 0x5E1D, 0x6D54, 0x5E1D, 0x6D54, 0x7F0E, 0x0AAA, 0x7F0E, 0x0AAA, 0x5E1D}; -const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAA, 0x83C2, 0x6D54, 0x83C2, 0x6D54, 0xA4B3, 0x0AAA, 0xA4B3, 0x0AAA, 0x83C2}; -const PROGMEM uint16_t media_btn[] = {0x0AAA, 0xCF0D, 0x42AA, 0xCF0D, 0x42AA, 0xEFFE, 0x0AAA, 0xEFFE, 0x0AAA, 0xCF0D}; -const PROGMEM uint16_t pause_btn[] = {0x8554, 0xCF0D, 0xBD53, 0xCF0D, 0xBD53, 0xEFFE, 0x8554, 0xEFFE, 0x8554, 0xCF0D}; -const PROGMEM uint16_t print_time_hms[] = {0xC59E, 0xAEA0, 0xF510, 0xAEA0, 0xF510, 0xC52D, 0xC59E, 0xC52D, 0xC59E, 0xAEA0}; -const PROGMEM uint16_t file_name[] = {0x0B0E, 0xAECD, 0xBCEF, 0xAECD, 0xBCEF, 0xC4AB, 0x0B0E, 0xC4AB, 0x0B0E, 0xAECD}; -const PROGMEM uint16_t chocolate_label[] = {0x75C1, 0x1369, 0xF4FE, 0x1369, 0xF4FE, 0x2AB1, 0x75C1, 0x2AB1, 0x75C1, 0x1369}; -const PROGMEM uint16_t h0_label[] = {0x8304, 0x4BEB, 0xB271, 0x4BEB, 0xB271, 0x63B0, 0x8304, 0x63B0, 0x8304, 0x4BEB}; -const PROGMEM uint16_t h0_temp[] = {0x8304, 0x7190, 0xB271, 0x7190, 0xB271, 0x8955, 0x8304, 0x8955, 0x8304, 0x7190}; -const PROGMEM uint16_t h1_label[] = {0xBB04, 0x4BEB, 0xEA71, 0x4BEB, 0xEA71, 0x63B0, 0xBB04, 0x63B0, 0xBB04, 0x4BEB}; -const PROGMEM uint16_t h1_temp[] = {0xBB04, 0x7190, 0xEA71, 0x7190, 0xEA71, 0x8956, 0xBB04, 0x8956, 0xBB04, 0x7190}; -const PROGMEM uint16_t stop_btn[] = {0xC2A9, 0xCF0D, 0xF553, 0xCF0D, 0xF553, 0xEFFE, 0xC2A9, 0xEFFE, 0xC2A9, 0xCF0D}; -const PROGMEM uint16_t load_screen_extrude[] = {0x382C, 0x8B02, 0x4188, 0x8B02, 0x4188, 0xAC4A, 0x4637, 0xAC4A, 0x3CDA, 0xBCEE, 0x337D, 0xAC4A, 0x382C, 0xAC4A, 0x382C, 0x8B02}; -const PROGMEM uint16_t load_screen_retract[] = {0x382C, 0x7A5D, 0x4188, 0x7A5D, 0x4188, 0x5915, 0x4637, 0x5915, 0x3CDA, 0x4871, 0x337E, 0x5915, 0x382C, 0x5915, 0x382C, 0x7A5D}; -const PROGMEM uint16_t load_screen_back_btn[] = {0x1555, 0xCA58, 0xEAA8, 0xCA58, 0xEAA8, 0xEFFE, 0x1555, 0xEFFE, 0x1555, 0xCA58}; -const PROGMEM uint16_t load_screen_unload_btn[] = {0x67FF, 0x70F0, 0xEAA8, 0x70F0, 0xEAA8, 0x9695, 0x67FF, 0x9695, 0x67FF, 0x70F0}; -const PROGMEM uint16_t load_screen_start_stop_btn[] = {0x67FF, 0x9B4A, 0xEAA8, 0x9B4A, 0xEAA8, 0xC0EF, 0x67FF, 0xC0EF, 0x67FF, 0x9B4A}; -const PROGMEM uint16_t load_screen_load_btn[] = {0x67FF, 0x4696, 0xEAA8, 0x4696, 0xEAA8, 0x6C3B, 0x67FF, 0x6C3B, 0x67FF, 0x4696}; -const PROGMEM uint16_t load_screen_continuous[] = {0x67FF, 0x1787, 0xEAA8, 0x1787, 0xEAA8, 0x3D2C, 0x67FF, 0x3D2C, 0x67FF, 0x1787}; -const PROGMEM uint16_t load_screen_increment[] = {0x1555, 0x1787, 0x62A9, 0x1787, 0x62A9, 0x3D2C, 0x1555, 0x3D2C, 0x1555, 0x1787}; +const PROGMEM uint16_t menu_btn[] = {0x0AAC, 0x0DF3, 0x6D54, 0x0DF3, 0x6D54, 0x2E89, 0x0AAC, 0x2E89, 0x0AAC, 0x0DF3}; +const PROGMEM uint16_t print_btn[] = {0x4800, 0xCCCC, 0x7FFF, 0xCCCC, 0x7FFF, 0xED62, 0x4800, 0xED62, 0x4800, 0xCCCC}; +const PROGMEM uint16_t load_chocolate_btn[] = {0x0AAC, 0x37D8, 0x6D54, 0x37D8, 0x6D54, 0x586E, 0x0AAC, 0x586E, 0x0AAC, 0x37D8}; +const PROGMEM uint16_t preheat_chocolate_btn[] = {0x0AAC, 0x5D15, 0x6D54, 0x5D15, 0x6D54, 0x7DAB, 0x0AAC, 0x7DAB, 0x0AAC, 0x5D15}; +const PROGMEM uint16_t extrude_btn[] = {0x0AAC, 0x8252, 0x6D54, 0x8252, 0x6D54, 0xA2E8, 0x0AAC, 0xA2E8, 0x0AAC, 0x8252}; +const PROGMEM uint16_t media_btn[] = {0x0AAC, 0xCCCC, 0x42AA, 0xCCCC, 0x42AA, 0xED62, 0x0AAC, 0xED62, 0x0AAC, 0xCCCC}; +const PROGMEM uint16_t pause_btn[] = {0x8554, 0xCCCC, 0xBD53, 0xCCCC, 0xBD53, 0xED62, 0x8554, 0xED62, 0x8554, 0xCCCC}; +const PROGMEM uint16_t print_time_hms[] = {0xAB02, 0x82EE, 0xE4F8, 0x82EE, 0xE4F8, 0xA24C, 0xAB02, 0xA24C, 0xAB02, 0x82EE}; +const PROGMEM uint16_t print_time_pct[] = {0x7386, 0x82E2, 0xA500, 0x82E2, 0xA500, 0xA258, 0x7386, 0xA258, 0x7386, 0x82E2}; +const PROGMEM uint16_t file_name[] = {0x0B08, 0xA830, 0xF4F5, 0xA830, 0xF4F5, 0xC784, 0x0B08, 0xC784, 0x0B08, 0xA830}; +const PROGMEM uint16_t h0_label[] = {0x85B6, 0x3884, 0xAF9B, 0x3884, 0xAF9B, 0x57C1, 0x85B6, 0x57C1, 0x85B6, 0x3884}; +const PROGMEM uint16_t h0_temp[] = {0x85B6, 0x5DC1, 0xAF9B, 0x5DC1, 0xAF9B, 0x7CFF, 0x85B6, 0x7CFF, 0x85B6, 0x5DC1}; +const PROGMEM uint16_t h1_label[] = {0xBB0B, 0x3884, 0xE4EF, 0x3884, 0xE4EF, 0x57C1, 0xBB0B, 0x57C1, 0xBB0B, 0x3884}; +const PROGMEM uint16_t h1_temp[] = {0xBB0B, 0x5DC1, 0xE4EF, 0x5DC1, 0xE4EF, 0x7CFF, 0xBB0B, 0x7CFF, 0xBB0B, 0x5DC1}; +const PROGMEM uint16_t stop_btn[] = {0xC2A8, 0xCCCC, 0xF551, 0xCCCC, 0xF551, 0xED62, 0xC2A8, 0xED62, 0xC2A8, 0xCCCC}; +const PROGMEM uint16_t z_wizard_heading[] = {0x5332, 0x0FFF, 0xB331, 0x0FFF, 0xB331, 0x2AAA, 0x5332, 0x2AAA, 0x5332, 0x0FFF}; +const PROGMEM uint16_t z_wizard_plus_btn[] = {0x9CCB, 0x3AAA, 0xAFFE, 0x3AAA, 0xAFFE, 0x5554, 0x9CCB, 0x5554, 0x9CCB, 0x3AAA}; +const PROGMEM uint16_t z_wizard_edit_box[] = {0x0CCC, 0x9FFE, 0x5332, 0x9FFE, 0x5332, 0xC553, 0x0CCC, 0xC553, 0x0CCC, 0x9FFE}; +const PROGMEM uint16_t z_wizard_inc1_btn[] = {0x5998, 0xA016, 0x8998, 0xA016, 0x8998, 0xC553, 0x5998, 0xC553, 0x5998, 0xA016}; +const PROGMEM uint16_t z_wizard_inc2_btn[] = {0x8FFE, 0xA016, 0xBFFE, 0xA016, 0xBFFE, 0xC553, 0x8FFE, 0xC553, 0x8FFE, 0xA016}; +const PROGMEM uint16_t z_wizard_inc3_btn[] = {0xC664, 0xA016, 0xF664, 0xA016, 0xF664, 0xC553, 0xC664, 0xC553, 0xC664, 0xA016}; +const PROGMEM uint16_t z_wizard_done_btn[] = {0xBFFE, 0xCFFE, 0xF664, 0xCFFE, 0xF664, 0xF553, 0xBFFE, 0xF553, 0xBFFE, 0xCFFE}; +const PROGMEM uint16_t z_wizard_neg_btn[] = {0x9CCB, 0x5FFF, 0xAFFE, 0x5FFF, 0xAFFE, 0x7AA9, 0x9CCB, 0x7AA9, 0x9CCB, 0x5FFF}; +const PROGMEM uint16_t z_wizard_diagram[] = {0x6D65, 0x4DBE, 0x6D65, 0x6015, 0x7ADB, 0x6015, 0x7F1F, 0x6C6A, 0x8303, 0x6C6A, 0x8747, 0x6015, 0x94BE, 0x6015, 0x94BE, 0x4DBE, 0x6D65, 0x4DBE, 0xFFFF, 0x0D06, 0x8527, 0x0D06, 0x9554, 0xF664, 0x9554, 0xF664, 0x8527, 0x0D06, 0x8527}; +const PROGMEM uint16_t load_screen_extrude[] = {0x382D, 0x897E, 0x4189, 0x897E, 0x4189, 0xAA6A, 0x4638, 0xAA6A, 0x3CDB, 0xBAE0, 0x337F, 0xAA6A, 0x382D, 0xAA6A, 0x382D, 0x897E}; +const PROGMEM uint16_t load_screen_retract[] = {0x382D, 0x7908, 0x4189, 0x7908, 0x4189, 0x581C, 0x4638, 0x581C, 0x3CDB, 0x47A6, 0x337F, 0x581C, 0x382D, 0x581C, 0x382D, 0x7908}; +const PROGMEM uint16_t load_screen_back_btn[] = {0x1556, 0xC825, 0xEAA7, 0xC825, 0xEAA7, 0xED62, 0x1556, 0xED62, 0x1556, 0xC825}; +const PROGMEM uint16_t load_screen_unload_btn[] = {0x67FF, 0x6FB4, 0xEAA7, 0x6FB4, 0xEAA7, 0x94F1, 0x67FF, 0x94F1, 0x67FF, 0x6FB4}; +const PROGMEM uint16_t load_screen_start_stop_btn[] = {0x67FF, 0x9998, 0xEAA7, 0x9998, 0xEAA7, 0xBED6, 0x67FF, 0xBED6, 0x67FF, 0x9998}; +const PROGMEM uint16_t load_screen_load_btn[] = {0x67FF, 0x45CF, 0xEAA7, 0x45CF, 0xEAA7, 0x6B0C, 0x67FF, 0x6B0C, 0x67FF, 0x45CF}; +const PROGMEM uint16_t load_screen_continuous[] = {0x67FF, 0x1743, 0xEAA7, 0x1743, 0xEAA7, 0x3C80, 0x67FF, 0x3C80, 0x67FF, 0x1743}; +const PROGMEM uint16_t load_screen_increment[] = {0x1556, 0x1743, 0x62AA, 0x1743, 0x62AA, 0x3C80, 0x1556, 0x3C80, 0x1556, 0x1743}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp index f058b40e035d..f7c7035761fd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/files_screen.cpp @@ -171,13 +171,10 @@ void FilesScreen::drawFooter() { cmd.colors(normal_btn) .font(font_medium) .colors(normal_btn) - .enabled(!mydata.flags.is_root) - .tag(245).button(BTN2_POS, F("Up Dir")) + .tag(mydata.flags.is_root ? 240 : 245).button(BTN2_POS, F("Back")) .colors(action_btn); - if (mydata.flags.is_empty) - cmd.tag(240).button(BTN1_POS, GET_TEXT_F(MSG_BUTTON_DONE)); - else if (has_selection && mydata.flags.is_dir) + if (has_selection && mydata.flags.is_dir) cmd.tag(244).button(BTN1_POS, GET_TEXT_F(MSG_BUTTON_OPEN)); else cmd.tag(241).enabled(has_selection).button(BTN1_POS, F("Select")); @@ -214,12 +211,9 @@ void FilesScreen::gotoPage(uint8_t page) { bool FilesScreen::onTouchEnd(uint8_t tag) { switch (tag) { - case 240: // Done button, always select first file - { - FileList files; - files.seek(0); - GOTO_PREVIOUS(); - } + case 240: // Back button + card.filename[0] = card.longFilename[0] = '\0'; // Clear file selection + GOTO_PREVIOUS(); return true; case 241: // Select highlighted file GOTO_PREVIOUS(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp index fa31ce155332..820594acaba8 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/leveling_menu.cpp @@ -25,24 +25,31 @@ #if ENABLED(COCOA_LEVELING_MENU) -#if ALL(HAS_BED_PROBE, BLTOUCH) - #include "../../../../feature/bltouch.h" -#endif - using namespace FTDI; using namespace ExtUI; using namespace Theme; -#define GRID_COLS 3 -#define GRID_ROWS 5 -#define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) -#define PROBE_BED_POS BTN_POS(1,2), BTN_SIZE(1,1) -#define SHOW_MESH_POS BTN_POS(2,2), BTN_SIZE(1,1) -#define EDIT_MESH_POS BTN_POS(3,2), BTN_SIZE(1,1) -#define BLTOUCH_TITLE_POS BTN_POS(1,3), BTN_SIZE(3,1) -#define BLTOUCH_RESET_POS BTN_POS(1,4), BTN_SIZE(1,1) -#define BLTOUCH_TEST_POS BTN_POS(2,4), BTN_SIZE(1,1) -#define BACK_POS BTN_POS(1,5), BTN_SIZE(3,1) +#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + #define GRID_COLS 3 + #define GRID_ROWS 6 + #define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(3,1) + #define WARNING_POS BTN_POS(1,2), BTN_SIZE(3,2) + #define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1) + #define SHOW_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1) + #define EDIT_MESH_POS BTN_POS(3,4), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,6), BTN_SIZE(3,1) +#else + #define GRID_COLS 2 + #define GRID_ROWS 6 + #define BED_MESH_TITLE_POS BTN_POS(1,1), BTN_SIZE(2,1) + #define WARNING_POS BTN_POS(1,2), BTN_SIZE(2,2) + #define PROBE_BED_POS BTN_POS(1,4), BTN_SIZE(1,1) + #define SHOW_MESH_POS BTN_POS(2,4), BTN_SIZE(1,1) + #define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1) + + // Hide the editor button if motion to grid point not supported + #define EDIT_MESH_POS BTN_POS(4,7), BTN_SIZE(1,1) +#endif void LevelingMenu::onRedraw(draw_mode_t what) { if (what & BACKGROUND) { @@ -57,38 +64,26 @@ void LevelingMenu::onRedraw(draw_mode_t what) { cmd.font(font_large) .cmd(COLOR_RGB(bg_text_enabled)) .text(BED_MESH_TITLE_POS, GET_TEXT_F(MSG_BED_LEVELING)) - #if ENABLED(BLTOUCH) - .text(BLTOUCH_TITLE_POS, GET_TEXT_F(MSG_BLTOUCH)) - #endif .font(font_medium).colors(normal_btn) .tag(2).button(PROBE_BED_POS, GET_TEXT_F(MSG_PROBE_BED)) .enabled(ENABLED(HAS_MESH)) .tag(3).button(SHOW_MESH_POS, GET_TEXT_F(MSG_MESH_VIEW)) .enabled(ENABLED(HAS_MESH)) .tag(4).button(EDIT_MESH_POS, GET_TEXT_F(MSG_EDIT_MESH)) - #undef GRID_COLS - #define GRID_COLS 2 - #if ENABLED(BLTOUCH) - .tag(5).button(BLTOUCH_RESET_POS, GET_TEXT_F(MSG_BLTOUCH_RESET)) - .tag(6).button(BLTOUCH_TEST_POS, GET_TEXT_F(MSG_BLTOUCH_SELFTEST)) - #endif - #undef GRID_COLS - #define GRID_COLS 3 .colors(action_btn) - .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); + .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0); + draw_text_box(cmd, WARNING_POS, F("Remove chocolate cartridge before probing. This reduces the possibility of damaging a part."), OPT_CENTER, font_medium); } } bool LevelingMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); break; - case 2: BedMeshViewScreen::doProbe(); break; + case 2: SaveSettingsDialogBox::settingsChanged(); injectCommands(F(BED_LEVELING_COMMANDS)); break; case 3: BedMeshViewScreen::show(); break; - case 4: BedMeshEditScreen::show(); break; - #if ENABLED(BLTOUCH) - case 5: injectCommands(F("M280 P0 S60")); break; - case 6: SpinnerDialogBox::enqueueAndWait(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break; - #endif + case 4: SaveSettingsDialogBox::settingsChanged(); BedMeshEditScreen::show(); break; default: return false; } return true; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp index 2f231278f2d8..14dc8c533fa7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.cpp @@ -23,6 +23,7 @@ #include "../config.h" #include "../screens.h" +#include "../../../../module/stepper.h" #ifdef COCOA_MAIN_MENU @@ -34,13 +35,13 @@ using namespace Theme; #define ZPROBE_ZOFFSET_POS BTN_POS(1,1), BTN_SIZE(1,1) #define MOVE_XYZ_POS BTN_POS(1,2), BTN_SIZE(1,1) -#define TEMPERATURE_POS BTN_POS(2,1), BTN_SIZE(1,1) +#define LEVELING_POS BTN_POS(2,1), BTN_SIZE(1,1) #define MOVE_E_POS BTN_POS(2,2), BTN_SIZE(1,1) #define SPEED_POS BTN_POS(1,3), BTN_SIZE(1,1) #define FLOW_POS BTN_POS(2,3), BTN_SIZE(1,1) -#define ADVANCED_SETTINGS_POS BTN_POS(1,4), BTN_SIZE(1,1) +#define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(1,1) #define DISABLE_STEPPERS_POS BTN_POS(2,4), BTN_SIZE(1,1) -#define LEVELING_POS BTN_POS(1,5), BTN_SIZE(1,1) +#define ADVANCED_SETTINGS_POS BTN_POS(1,5), BTN_SIZE(1,1) #define ABOUT_PRINTER_POS BTN_POS(2,5), BTN_SIZE(1,1) #define BACK_POS BTN_POS(1,6), BTN_SIZE(2,1) @@ -63,6 +64,10 @@ void MainMenu::onRedraw(draw_mode_t what) { .tag( 6).button(SPEED_POS, GET_TEXT_F(MSG_PRINT_SPEED)) .tag( 7).button(FLOW_POS, GET_TEXT_F(MSG_FLOW)) .tag( 8).button(ADVANCED_SETTINGS_POS, GET_TEXT_F(MSG_ADVANCED_SETTINGS)) + .enabled(stepper.axis_is_enabled(X_AXIS) || + stepper.axis_is_enabled(Y_AXIS) || + stepper.axis_is_enabled(Z_AXIS) || + stepper.axis_is_enabled(E0_AXIS)) .tag( 9).button(DISABLE_STEPPERS_POS, GET_TEXT_F(MSG_DISABLE_STEPPERS)) .enabled(ENABLED(HAS_LEVELING)) .tag(10).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) @@ -97,4 +102,12 @@ bool MainMenu::onTouchEnd(uint8_t tag) { return true; } +void MainMenu::onIdle() { + if (refresh_timer.elapsed(STATUS_UPDATE_INTERVAL)) { + if (!EventLoop::is_touch_held()) + onRefresh(); + refresh_timer.start(); + } +} + #endif // COCOA_MAIN_MENU diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h index 460bb4b81a70..85dcbd07e6a5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/main_menu.h @@ -30,4 +30,5 @@ class MainMenu : public BaseScreen, public CachedScreen { public: static void onRedraw(draw_mode_t); static bool onTouchEnd(uint8_t tag); + static void onIdle(); }; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp index 2fabb81ee4db..ff11b6e0d9a8 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_menu.cpp @@ -32,40 +32,24 @@ using namespace Theme; #define GRID_ROWS 5 void PreheatMenu::onRedraw(draw_mode_t what) { - const int16_t w = TERN0(COCOA_PRESS_EXTRA_HEATER, has_extra_heater()) ? BTN_W(1) : BTN_W(2); - const int16_t h = BTN_H(1); - if (what & BACKGROUND) { CommandProcessor cmd; cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) .cmd(CLEAR(true,true,true)) - .tag(0) .cmd(COLOR_RGB(bg_text_enabled)) .font(Theme::font_medium) - .text( BTN_POS(1,1), w, h, GET_TEXT_F(MSG_SELECT_CHOCOLATE_TYPE)); - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - cmd.text( BTN_POS(2,1), w, h, GET_TEXT_F(MSG_EXTERNAL)); - } - #endif + .tag(0).text( BTN_POS(1,1), BTN_SIZE(2,1), GET_TEXT_F(MSG_SELECT_CHOCOLATE_TYPE)); } if (what & FOREGROUND) { CommandProcessor cmd; cmd.font(Theme::font_medium) .colors(normal_btn) - .tag(2).button(BTN_POS(1,2), w, h, F("Dark Chocolate")) - .tag(3).button(BTN_POS(1,3), w, h, F("Milk Chocolate")) - .tag(4).button(BTN_POS(1,4), w, h, F("White Chocolate")); - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - cmd.tag(5).button(BTN_POS(2,2), w, h, F("Dark Chocolate")) - .tag(6).button(BTN_POS(2,3), w, h, F("Milk Chocolate")) - .tag(7).button(BTN_POS(2,4), w, h, F("White Chocolate")); - } - #endif - cmd.colors(action_btn) - .tag(1) .button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); + .tag(2).button(BTN_POS(1,2), BTN_SIZE(2,1), F("Dark Chocolate")) + .tag(3).button(BTN_POS(1,3), BTN_SIZE(2,1), F("Milk Chocolate")) + .tag(4).button(BTN_POS(1,4), BTN_SIZE(2,1), F("White Chocolate")) + .colors(action_btn) + .tag(1).button(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_BUTTON_DONE)); } } @@ -73,38 +57,20 @@ bool PreheatMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: GOTO_PREVIOUS(); break; case 2: - #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_INT_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT + injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; case 3: - #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_INT_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT + injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; case 4: - #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_INT_SCRIPT)); - #endif - GOTO_SCREEN(PreheatTimerScreen); - break; - case 5: - #ifdef COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_DARK_CHOCOLATE_EXT_SCRIPT)); - #endif - GOTO_SCREEN(PreheatTimerScreen); - break; - case 6: - #ifdef COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_MILK_CHOCOLATE_EXT_SCRIPT)); - #endif - GOTO_SCREEN(PreheatTimerScreen); - break; - case 7: - #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT - injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_EXT_SCRIPT)); + #ifdef COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT + injectCommands(F(COCOA_PRESS_PREHEAT_WHITE_CHOCOLATE_SCRIPT)); #endif GOTO_SCREEN(PreheatTimerScreen); break; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp index c4e9d971f6a7..9641b1f9c6a4 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/preheat_screen.cpp @@ -89,20 +89,20 @@ void PreheatTimerScreen::draw_adjuster(draw_mode_t what, uint8_t tag, FSTR_P lab cmd.tag(0) .font(font_small); if (what & BACKGROUND) { - cmd.text( SUB_POS(1,1), SUB_SIZE(9,1), label) - .button(SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT); + cmd.text( SUB_POS(1,1), SUB_SIZE(9,1), label) + .button(SUB_POS(1,2), SUB_SIZE(5,1), F(""), OPT_FLAT); } if (what & FOREGROUND) { - char str[32]; - dtostrf(value, 5, 1, str); - strcat_P(str, PSTR(" ")); - strcat_P(str, (const char*) GET_TEXT_F(MSG_UNITS_C)); - - cmd.text(SUB_POS(1,2), SUB_SIZE(5,1), str) - .font(font_medium) - .tag(tag ).button(SUB_POS(6,2), SUB_SIZE(2,1), F("-")) - .tag(tag+1).button(SUB_POS(8,2), SUB_SIZE(2,1), F("+")); + char str[32]; + dtostrf(value, 5, 1, str); + strcat_P(str, PSTR(" ")); + strcat_P(str, (const char*) GET_TEXT_F(MSG_UNITS_C)); + + cmd.text(SUB_POS(1,2), SUB_SIZE(5,1), str) + .font(font_medium) + .tag(tag ).button(SUB_POS(6,2), SUB_SIZE(2,1), F("-")) + .tag(tag+1).button(SUB_POS(8,2), SUB_SIZE(2,1), F("+")); } } @@ -116,7 +116,9 @@ void PreheatTimerScreen::onRedraw(draw_mode_t what) { draw_interaction_buttons(what); draw_adjuster(what, 2, GET_TEXT_F(MSG_NOZZLE), getTargetTemp_celsius(E0), NOZZLE_ADJ_POS); draw_adjuster(what, 4, GET_TEXT_F(MSG_BODY), getTargetTemp_celsius(E1), BODY_ADJ_POS); - draw_adjuster(what, 6, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS); + #if HAS_HEATED_CHAMBER + draw_adjuster(what, 6, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER), CHAMBER_ADJ_POS); + #endif } bool PreheatTimerScreen::onTouchHeld(uint8_t tag) { @@ -126,8 +128,10 @@ bool PreheatTimerScreen::onTouchHeld(uint8_t tag) { case 3: UI_INCREMENT(TargetTemp_celsius, E0); break; case 4: UI_DECREMENT(TargetTemp_celsius, E1); break; case 5: UI_INCREMENT(TargetTemp_celsius, E1); break; - case 6: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; - case 7: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; + #if HAS_HEATED_CHAMBER + case 6: UI_DECREMENT(TargetTemp_celsius, CHAMBER); break; + case 7: UI_INCREMENT(TargetTemp_celsius, CHAMBER); break; + #endif default: return false; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h index 5276f64f4429..3e2b5546e918 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h @@ -84,7 +84,6 @@ enum { #include "../generic/base_numeric_adjustment_screen.h" #include "../generic/dialog_box_base_class.h" #include "../generic/boot_screen.h" -#include "../generic/about_screen.h" #include "../generic/kill_screen.h" #include "../generic/alert_dialog_box.h" #include "../generic/spinner_dialog_box.h" @@ -105,13 +104,10 @@ enum { #include "../generic/lock_screen.h" #include "../generic/endstop_state_screen.h" #include "../generic/display_tuning_screen.h" -#include "../generic/statistics_screen.h" #include "../generic/stepper_current_screen.h" -#include "../generic/z_offset_screen.h" #include "../generic/bed_mesh_base.h" #include "../generic/bed_mesh_view_screen.h" #include "../generic/bed_mesh_edit_screen.h" -#include "../generic/case_light_screen.h" #include "../generic/linear_advance_screen.h" #include "../generic/move_axis_screen.h" #include "../generic/flow_percent_screen.h" @@ -132,3 +128,7 @@ enum { #include "move_e_screen.h" #include "files_screen.h" #include "confirm_start_print_dialog_box.h" +#include "z_offset_screen.h" +#include "z_offset_wizard.h" +#include "about_screen.h" +#include "statistics_screen.h" diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp new file mode 100644 index 000000000000..fd73ca0a4bf1 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp @@ -0,0 +1,83 @@ +/************************* + * statistics_screen.cpp * + *************************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" + +#ifdef COCOA_STATISTICS_SCREEN + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define GRID_COLS 4 +#define GRID_ROWS 7 + +void StatisticsScreen::onRedraw(draw_mode_t what) { + CommandProcessor cmd; + + if (what & BACKGROUND) { + char buffer[21]; + + + cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color)) + .cmd(CLEAR(true,true,true)) + .cmd(COLOR_RGB(bg_text_enabled)) + .tag(0) + + .font(Theme::font_medium) + .text(BTN_POS(1,1), BTN_SIZE(4,1), GET_TEXT_F(MSG_INFO_STATS_MENU)) + .font(Theme::font_small) + .tag(0) + .text(BTN_POS(1,2), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_COUNT), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,3), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_COMPLETED_PRINTS), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,4), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_TIME), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,5), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_LONGEST), OPT_RIGHTX | OPT_CENTERY) + .text(BTN_POS(1,6), BTN_SIZE(2,1), GET_TEXT_F(MSG_INFO_PRINT_FILAMENT), OPT_RIGHTX | OPT_CENTERY); + // Don't chain the following, it causes strange issues with evaluation ordering! + cmd.text(BTN_POS(3,2), BTN_SIZE(2,1), getTotalPrints_str(buffer)); + cmd.text(BTN_POS(3,3), BTN_SIZE(2,1), getFinishedPrints_str(buffer)); + cmd.text(BTN_POS(3,4), BTN_SIZE(2,1), getTotalPrintTime_str(buffer)); + cmd.text(BTN_POS(3,5), BTN_SIZE(2,1), getLongestPrint_str(buffer)); + + // Express in grams of chocolate rather than mm + const printStatistics stats = print_job_timer.getStats(); + const long gramsChocolate = stats.filamentUsed * 0.53; // 1mm of extrusion is 0.53g + sprintf_P(buffer, PSTR("%ldg"), gramsChocolate); + cmd.text(BTN_POS(3,6), BTN_SIZE(2,1), buffer); + } + + if (what & FOREGROUND) { + cmd.font(Theme::font_medium) + .colors(action_btn) + .tag(1).button(BTN_POS(1,7), BTN_SIZE(4,1), GET_TEXT_F(MSG_BUTTON_DONE)); + } +} + +bool StatisticsScreen::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: GOTO_PREVIOUS(); return true; + default: return false; + } +} + +#endif // COCOA_STATISTICS_SCREEN diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.h new file mode 100644 index 000000000000..9e533570318d --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.h @@ -0,0 +1,32 @@ +/*********************** + * statistics_screen.h * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_STATISTICS_SCREEN +#define COCOA_STATISTICS_SCREEN_CLASS StatisticsScreen + +class StatisticsScreen : public BaseScreen, public UncachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchEnd(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp index 1312d022c350..421d90bf7ffa 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.cpp @@ -23,22 +23,30 @@ #include "../config.h" #include "../screens.h" +#include "../screen_data.h" #ifdef COCOA_STATUS_SCREEN #include "cocoa_press_ui.h" +#include "cocoa_press_bitmap.h" #define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) #define ICON_POS(x,y,w,h) x, y, h, h #define TEXT_POS(x,y,w,h) x + h, y, w - h, h -const uint8_t shadow_depth = 5; - using namespace FTDI; using namespace Theme; using namespace ExtUI; -float StatusScreen::increment; +const uint8_t shadow_depth = 5; + +constexpr static StatusScreenData &mydata = screen_data.StatusScreen; + +// Format for background image + +constexpr uint8_t format = RGB332; +constexpr uint16_t bitmap_w = 800; +constexpr uint16_t bitmap_h = 480; void StatusScreen::_format_time(char *outstr, uint32_t time) { const uint8_t hrs = time / 3600, @@ -69,6 +77,64 @@ void StatusScreen::loadBitmaps() { #endif } +void StatusScreen::draw_bkgnd(draw_mode_t what) { + if (what & BACKGROUND) { + constexpr float scale_w = float(FTDI::display_width)/bitmap_w; + constexpr float scale_h = float(FTDI::display_height)/bitmap_h; + uint16_t linestride; + uint32_t color; + switch (format) { + case RGB565: linestride = bitmap_w * 2; color = 0xFFFFFF; break; + case RGB332: linestride = bitmap_w ; color = 0xFFFFFF; break; + case L1: linestride = bitmap_w/8 ; color = 0x000000; break; + case L2: linestride = bitmap_w/4 ; color = 0x000000; break; + case L4: linestride = bitmap_w/2 ; color = 0x000000; break; + case L8: linestride = bitmap_w ; color = 0x000000; break; + } + CommandProcessor cmd; + cmd.cmd(COLOR_RGB(color)) + .cmd(BITMAP_SOURCE(BACKGROUND_OFFSET)) + .tag(0) + .bitmap_layout(format, linestride, bitmap_h) + .bitmap_size(NEAREST, BORDER, BORDER, bitmap_w*scale_w, bitmap_h*scale_h) + .cmd(BITMAP_TRANSFORM_A(uint32_t(float(256)/scale_w))) + .cmd(BITMAP_TRANSFORM_E(uint32_t(float(256)/scale_h))) + .cmd(BEGIN(BITMAPS)) + .cmd(VERTEX2II(0, 0, 0, 0)) + .cmd(BITMAP_TRANSFORM_A(256)) + .cmd(BITMAP_TRANSFORM_E(256)) + .cmd(COLOR_RGB(bg_text_enabled)); + } +} + +void StatusScreen::send_buffer(CommandProcessor &cmd, const void *data, uint16_t len) { + const char *ptr = (const char*) data; + constexpr uint16_t block_size = 512; + char block[block_size]; + for (;len > 0;) { + const uint16_t nBytes = min(len, block_size); + memcpy_P(block, ptr, nBytes); + cmd.write((const void*)block, nBytes); + cmd.execute(); + if(cmd.has_fault()) { + SERIAL_ECHOLNPGM("Recovering from fault: "); + cmd.reset(); + delay(1000); + return; + } + ptr += nBytes; + len -= nBytes; + } +} + +void StatusScreen::load_background(const void *data, uint16_t len) { + CommandProcessor cmd; + cmd.inflate(BACKGROUND_OFFSET) + .execute(); + send_buffer(cmd, data, len); + cmd.wait(); +} + void StatusScreen::draw_time(draw_mode_t what) { CommandProcessor cmd; PolyUI ui(cmd, what); @@ -96,23 +162,27 @@ void StatusScreen::draw_time(draw_mode_t what) { } } - -void StatusScreen::draw_progress(draw_mode_t what) { +void StatusScreen::draw_percent(draw_mode_t what) { CommandProcessor cmd; PolyUI ui(cmd, what); int16_t x, y, w, h; - - cmd.cmd(COLOR_RGB(accent_color_1)); - cmd.font(font_medium); + ui.bounds(POLY(print_time_pct), x, y, w, h); if (what & FOREGROUND) { - // Draw progress bar - ui.bounds(POLY(file_name), x, y, w, h); - const uint16_t bar_width = w * getProgress_percent() / 100; - cmd.tag(8) - .cmd(COLOR_RGB(accent_color_5)) - .rectangle(x, y, bar_width, h); + const uint16_t current_progress = TERN(HAS_PRINT_PROGRESS_PERMYRIAD, getProgress_permyriad(), getProgress_percent() * 100); + char progress_str[10]; + sprintf_P(progress_str, + #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) + PSTR("%3d.%02d%%"), uint8_t(current_progress / 100), current_progress % 100 + #else + PSTR("%3d%%"), uint8_t(current_progress / 100) + #endif + ); + + cmd.font(font_medium) + .cmd(COLOR_RGB(bg_text_enabled)) + .text(TEXT_POS(x, y, w, h), progress_str); } } @@ -123,17 +193,8 @@ void StatusScreen::draw_temperature(draw_mode_t what) { int16_t x, y, w, h; if (what & BACKGROUND) { - cmd.cmd(COLOR_RGB(fluid_rgb)); - cmd.font(font_medium).tag(10); - - /*ui.bounds(POLY(temp_lbl), x, y, w, h); - cmd.text(x, y, w, h, F("Temp")); - - ui.bounds(POLY(set_lbl), x, y, w, h); - cmd.text(x, y, w, h, F("Set"));*/ - - ui.bounds(POLY(chocolate_label), x, y, w, h); - cmd.text(x, y, w, h, F("Cocoa Press")); + cmd.cmd(COLOR_RGB(bg_text_enabled)); + cmd.font(font_medium).tag(0); ui.bounds(POLY(h0_label), x, y, w, h); cmd.text(x, y, w, h, GET_TEXT_F(MSG_NOZZLE)); @@ -141,18 +202,6 @@ void StatusScreen::draw_temperature(draw_mode_t what) { ui.bounds(POLY(h1_label), x, y, w, h); cmd.text(x, y, w, h, GET_TEXT_F(MSG_BODY)); - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - ui.bounds(POLY(h2_label), x, y, w, h); - cmd.text(x, y, w, h, GET_TEXT_F(MSG_EXTERNAL)); - } - #endif - - #if ENABLED(COCOA_PRESS_CHAMBER_COOLER) - ui.bounds(POLY(h3_label), x, y, w, h); - cmd.text(x, y, w, h, GET_TEXT_F(MSG_CHAMBER)); - #endif - #if ENABLED(TOUCH_UI_USE_UTF8) load_utf8_bitmaps(cmd); // Restore font bitmap handles #endif @@ -160,116 +209,80 @@ void StatusScreen::draw_temperature(draw_mode_t what) { if (what & FOREGROUND) { char str[15]; - cmd.cmd(COLOR_RGB(fluid_rgb)); - - cmd.font(font_large).tag(10); + cmd.font(font_medium).colors(normal_btn).tag(10); // Show the actual temperatures format_temp(str, getActualTemp_celsius(E0)); ui.bounds(POLY(h0_temp), x, y, w, h); - cmd.text(x, y, w, h, str); + cmd.button(x, y, w, h, str); format_temp(str, getActualTemp_celsius(E1)); ui.bounds(POLY(h1_temp), x, y, w, h); - cmd.text(x, y, w, h, str); - - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - format_temp(str, getActualTemp_celsius(E2)); - ui.bounds(POLY(h2_temp), x, y, w, h); - cmd.text(x, y, w, h, str); - } - #endif - - #if ENABLED(COCOA_PRESS_CHAMBER_COOLER) - format_temp(str, getActualTemp_celsius(CHAMBER)); - ui.bounds(POLY(h3_temp), x, y, w, h); - cmd.text(x, y, w, h, str); - #endif - - /*// Show the set temperatures - format_temp(str, getTargetTemp_celsius(E0)); - ui.bounds(POLY(h0_set), x, y, w, h); - cmd.text(x, y, w, h, str); - - format_temp(str, getTargetTemp_celsius(E1)); - ui.bounds(POLY(h1_set), x, y, w, h); - cmd.text(x, y, w, h, str); - - #if ENABLED(COCOA_PRESS_EXTRA_HEATER) - if (has_extra_heater()) { - format_temp(str, getTargetTemp_celsius(E2)); - ui.bounds(POLY(h2_set), x, y, w, h); - cmd.text(x, y, w, h, str); - } - #endif - - #if ENABLED(COCOA_PRESS_CHAMBER_COOLER) - format_temp(str, getTargetTemp_celsius(CHAMBER)); - ui.bounds(POLY(h3_set), x, y, w, h); - cmd.text(x, y, w, h, str); - #endif*/ + cmd.button(x, y, w, h, str); } } void StatusScreen::draw_buttons(draw_mode_t what) { - int16_t x, y, w, h; + if (what & FOREGROUND) { + int16_t x, y, w, h; - const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected(); - const bool can_select = !isPrinting() && isMediaInserted(); - const bool sdOrHostPrinting = ExtUI::isPrinting(); - const bool sdOrHostPaused = ExtUI::isPrintingPaused(); + const bool can_print = !isPrinting() && isMediaInserted() && isFileSelected(); + const bool can_select = !isPrinting() && isMediaInserted(); + const bool sdOrHostPrinting = ExtUI::isPrinting(); + const bool sdOrHostPaused = ExtUI::isPrintingPaused(); - CommandProcessor cmd; - PolyUI ui(cmd, what); + CommandProcessor cmd; + PolyUI ui(cmd, what); - cmd.font(font_medium).colors(normal_btn); + cmd.font(font_medium).colors(normal_btn); - ui.bounds(POLY(load_chocolate_btn), x, y, w, h); - cmd.tag(1).button(x, y, w, h, GET_TEXT_F(MSG_LOAD_UNLOAD)); + ui.bounds(POLY(load_chocolate_btn), x, y, w, h); + cmd.tag(1).button(x, y, w, h, GET_TEXT_F(MSG_LOAD_UNLOAD)); - ui.bounds(POLY(extrude_btn), x, y, w, h); - cmd.tag(2).button(x, y, w, h, GET_TEXT_F(MSG_EXTRUDE)); + ui.bounds(POLY(extrude_btn), x, y, w, h); + cmd.tag(2).button(x, y, w, h, GET_TEXT_F(MSG_EXTRUDE)); - ui.bounds(POLY(preheat_chocolate_btn), x, y, w, h); - cmd.tag(3).button(x, y, w, h, GET_TEXT_F(MSG_PREHEAT_CHOCOLATE)); + ui.bounds(POLY(preheat_chocolate_btn), x, y, w, h); + cmd.tag(3).button(x, y, w, h, GET_TEXT_F(MSG_PREHEAT_CHOCOLATE)); - ui.bounds(POLY(menu_btn), x, y, w, h); - cmd.tag(4).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MENU)); + ui.bounds(POLY(menu_btn), x, y, w, h); + cmd.tag(4).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MENU)); - ui.bounds(POLY(media_btn), x, y, w, h); - cmd.tag(5).enabled(can_select).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MEDIA)); + ui.bounds(POLY(media_btn), x, y, w, h); + cmd.tag(5).enabled(can_select).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_MEDIA)); - ui.bounds(POLY(print_btn), x, y, w, h); - cmd.tag(6).colors(action_btn).enabled(can_print).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_PRINT)); + ui.bounds(POLY(print_btn), x, y, w, h); + cmd.tag(6).colors(action_btn).enabled(can_print).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_PRINT)); - ui.bounds(POLY(pause_btn), x, y, w, h); - cmd.tag(sdOrHostPaused ? 8 : 7).enabled(sdOrHostPrinting).button(x, y, w, h, sdOrHostPaused ? GET_TEXT_F(MSG_BUTTON_RESUME) : GET_TEXT_F(MSG_BUTTON_PAUSE)); + ui.bounds(POLY(pause_btn), x, y, w, h); + cmd.tag(sdOrHostPaused ? 8 : 7).enabled(sdOrHostPrinting).button(x, y, w, h, sdOrHostPaused ? GET_TEXT_F(MSG_BUTTON_RESUME) : GET_TEXT_F(MSG_BUTTON_PAUSE)); - ui.bounds(POLY(stop_btn), x, y, w, h); - cmd.tag(9).enabled(sdOrHostPrinting).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_STOP)); + ui.bounds(POLY(stop_btn), x, y, w, h); + cmd.tag(9).enabled(sdOrHostPrinting).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_STOP)); + } } +// When visible, the file name occupies the same space as the status +// message and must be drawn opaque. void StatusScreen::draw_file(draw_mode_t what) { - int16_t x, y, w, h; + if (mydata.gotMessage) return; - CommandProcessor cmd; - PolyUI ui(cmd, what); + if (what & FOREGROUND) { + int16_t x, y, w, h; - ui.bounds(POLY(file_name), x, y, w, h); + CommandProcessor cmd; + PolyUI ui(cmd, what); + ui.bounds(POLY(file_name), x, y, w, h); - if (what & BACKGROUND) { cmd.tag(5) - .cmd(COLOR_RGB(bg_text_enabled)) + .cmd (COLOR_RGB(bg_color)) + .rectangle(x, y, w, h) + .cmd (COLOR_RGB(bg_text_enabled)) .cmd (BITMAP_SOURCE(File_Icon_Info)) .cmd (BITMAP_LAYOUT(File_Icon_Info)) .cmd (BITMAP_SIZE (File_Icon_Info)) .icon(ICON_POS(x, y, w, h), File_Icon_Info, icon_scale); - } - - if (what & FOREGROUND) { - cmd.cmd(COLOR_RGB(bg_text_enabled)); if (!isMediaInserted()) draw_text_with_ellipsis(cmd, TEXT_POS(x, y, w, h), F("No media present"), OPT_CENTERY, font_small); @@ -282,6 +295,21 @@ void StatusScreen::draw_file(draw_mode_t what) { } } +// The message will be drawn on the background and may be obscured by +// the filename. +void StatusScreen::draw_message(draw_mode_t what, const char *message) { + if (what & BACKGROUND) { + int16_t x, y, w, h; + + CommandProcessor cmd; + PolyUI ui(cmd, what); + ui.bounds(POLY(file_name), x, y, w, h); + + cmd.cmd(COLOR_RGB(bg_text_enabled)); + draw_text_box(cmd, TEXT_POS(x, y, w, h), message, OPT_CENTERY, font_small); + } +} + bool StatusScreen::isFileSelected() { if (!isMediaInserted()) return false; FileList list; @@ -292,23 +320,14 @@ bool StatusScreen::isFileSelected() { } void StatusScreen::onRedraw(draw_mode_t what) { - if (what & BACKGROUND) { - CommandProcessor cmd; - cmd.cmd(CLEAR_COLOR_RGB(bg_color)) - .cmd(CLEAR(true,true,true)) - .tag(0); + if (what & FOREGROUND) { + draw_bkgnd(what); + draw_file(what); + draw_time(what); + draw_percent(what); + draw_temperature(what); + draw_buttons(what); } - - draw_file(what); - draw_time(what); - draw_progress(what); - draw_temperature(what); - draw_buttons(what); -} - -bool StatusScreen::onTouchStart(uint8_t) { - increment = 0; - return true; } bool StatusScreen::onTouchEnd(uint8_t tag) { @@ -353,17 +372,55 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { bool StatusScreen::onTouchHeld(uint8_t tag) { if (tag == 2 && !ExtUI::isMoving()) { - LoadChocolateScreen::setManualFeedrateAndIncrement(1, increment); + float increment; + LoadChocolateScreen::setManualFeedrateAndIncrement(0.25, increment); UI_INCREMENT(AxisPosition_mm, E0); - current_screen.onRefresh(); } return false; } -void StatusScreen::setStatusMessage(FSTR_P) { +void StatusScreen::setStatusMessage(FSTR_P message) { + char buff[strlen_P((const char * const)message)+1]; + strcpy_P(buff, (const char * const) message); + setStatusMessage((const char *) buff); +} + +void StatusScreen::setStatusMessage(const char * const message) { + if (CommandProcessor::is_processing()) { + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("Cannot update status message, command processor busy"); + #endif + return; + } + + CommandProcessor cmd; + cmd.cmd(CMD_DLSTART) + .cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)); + + const draw_mode_t what = BACKGROUND; + draw_bkgnd(what); + draw_message(what, message); + draw_time(what); + draw_percent(what); + draw_temperature(what); + draw_buttons(what); + + storeBackground(); + + #if ENABLED(TOUCH_UI_DEBUG) + SERIAL_ECHO_MSG("New status message: ", message); + #endif + + mydata.gotMessage = true; + + if (AT_SCREEN(StatusScreen)) + current_screen.onRefresh(); } -void StatusScreen::setStatusMessage(const char * const) { +void StatusScreen::onEntry() { + mydata.gotMessage = false; + load_background(cocoa_press_ui, sizeof(cocoa_press_ui)); } void StatusScreen::onIdle() { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h index 05f99e953d6c..57cf2308ab42 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/status_screen.h @@ -26,31 +26,35 @@ #define COCOA_STATUS_SCREEN #define COCOA_STATUS_SCREEN_CLASS StatusScreen -class StatusScreen : public BaseScreen, public CachedScreen { +struct StatusScreenData { + bool gotMessage; +}; + +class StatusScreen : public BaseScreen, public CachedScreen { private: static void _format_time(char *outstr, uint32_t time); - static float increment; - static bool jog_xy; - static bool fine_motion; - static void draw_time(draw_mode_t what); - static void draw_progress(draw_mode_t what); + static void draw_percent(draw_mode_t what); static void draw_temperature(draw_mode_t what); static void draw_buttons(draw_mode_t what); static void draw_file(draw_mode_t what); + static void draw_message(draw_mode_t what, const char *message); + static void draw_bkgnd(draw_mode_t what); + + static void send_buffer(CommandProcessor &cmd, const void *data, uint16_t len); + static void load_background(const void *data, uint16_t len); static bool isFileSelected(); public: static void loadBitmaps(); - static void unlockMotors(); static void setStatusMessage(const char *); static void setStatusMessage(FSTR_P); static void onRedraw(draw_mode_t); - static bool onTouchStart(uint8_t tag); + static void onEntry(); static bool onTouchHeld(uint8_t tag); static bool onTouchEnd(uint8_t tag); static void onIdle(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.cpp new file mode 100644 index 000000000000..aeff0d95f8f0 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.cpp @@ -0,0 +1,59 @@ +/*********************** + * z_offset_screen.cpp * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" +#include "../screen_data.h" + +#ifdef COCOA_Z_OFFSET_SCREEN + +#include "z_offset_wizard.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +void ZOffsetScreen::onRedraw(draw_mode_t what) { + widgets_t w(what); + w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM)); + + w.heading( GET_TEXT_F(MSG_ZPROBE_ZOFFSET)); + w.color(z_axis).adjuster(4, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), getZOffset_mm()); + w.increments(); + w.button(2, GET_TEXT_F(MSG_PROBE_WIZARD), !isPrinting()); +} + +bool ZOffsetScreen::onTouchHeld(uint8_t tag) { + const int16_t steps = TERN(BABYSTEPPING, mmToWholeSteps(getIncrement(), Z), 0); + const float increment = TERN(BABYSTEPPING, mmFromWholeSteps(steps, Z), getIncrement()); + switch (tag) { + case 2: ZOffsetWizard::runWizard(); break; + case 4: UI_DECREMENT(ZOffset_mm); TERN(BABYSTEPPING, babystepAxis_steps(-steps, Z), UNUSED(steps)); break; + case 5: UI_INCREMENT(ZOffset_mm); TERN(BABYSTEPPING, babystepAxis_steps( steps, Z), UNUSED(steps)); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // COCOA_Z_OFFSET_SCREEN diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.h new file mode 100644 index 000000000000..93a364c109c6 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_screen.h @@ -0,0 +1,32 @@ +/*********************** + * z_offset_screen.h * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_Z_OFFSET_SCREEN +#define COCOA_Z_OFFSET_SCREEN_CLASS ZOffsetScreen + +class ZOffsetScreen : public BaseNumericAdjustmentScreen, public CachedScreen { + public: + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.cpp new file mode 100644 index 000000000000..9672e048d233 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.cpp @@ -0,0 +1,162 @@ +/*********************** + * z_offset_screen.cpp * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#include "../config.h" +#include "../screens.h" +#include "../screen_data.h" + +#ifdef COCOA_Z_OFFSET_WIZARD + +#include "cocoa_press_ui.h" + +using namespace FTDI; +using namespace ExtUI; +using namespace Theme; + +#define POLY(A) PolyUI::poly_reader_t(A, sizeof(A)/sizeof(A[0])) +#define SHEET_THICKNESS 0.1 + +constexpr static ZOffsetWizardData &mydata = screen_data.ZOffsetWizard; + +void ZOffsetWizard::onEntry() { + mydata.increment = 242; + mydata.softEndstopState = getSoftEndstopState(); + BaseNumericAdjustmentScreen::onEntry(); + setSoftEndstopState(false); +} + +void ZOffsetWizard::onExit() { + setSoftEndstopState(mydata.softEndstopState); +} + +void ZOffsetWizard::onRedraw(draw_mode_t what) { + int16_t x, y, w, h; + + CommandProcessor cmd; + PolyUI ui(cmd, what); + + cmd.cmd(CLEAR_COLOR_RGB(bg_color)) + .cmd(CLEAR(true,true,true)) + .tag(0) + .font(font_medium).colors(normal_btn); + + char b[32]; + dtostrf(getZOffset_mm(), 5, 2, b); + strcat_P(b, PSTR(" mm")); + ui.bounds(POLY(z_wizard_edit_box), x, y, w, h); + cmd.tag(0).fgcolor(z_axis).button(x, y, w, h, b); + + #define PREAMBLE(TAG) cmd.tag(TAG).colors(mydata.increment == TAG ? action_btn : normal_btn) + ui.bounds(POLY(z_wizard_inc1_btn), x, y, w, h); + PREAMBLE(241).button(x, y, w, h, F("0.01")); + + ui.bounds(POLY(z_wizard_inc2_btn), x, y, w, h); + PREAMBLE(242).button(x, y, w, h, F("0.1")); + + ui.bounds(POLY(z_wizard_inc3_btn), x, y, w, h); + PREAMBLE(243).button(x, y, w, h, F("1.0")); + + ui.bounds(POLY(z_wizard_neg_btn), x, y, w, h); + cmd.tag(4).colors(action_btn).button(x, y, w, h, F("")); + drawArrow(x, y, w, h, DOWN); + + ui.bounds(POLY(z_wizard_plus_btn), x, y, w, h); + cmd.tag(5).colors(action_btn).button(x, y, w, h, F("")); + drawArrow(x, y, w, h, UP); + + ui.bounds(POLY(z_wizard_done_btn), x, y, w, h); + cmd.tag(1).colors(action_btn).button(x, y, w, h, GET_TEXT_F(MSG_BUTTON_DONE)); + + cmd.tag(0); + ui.color(bg_text_enabled); + ui.fill(POLY(z_wizard_diagram)); + + ui.bounds(POLY(z_wizard_heading), x, y, w, h); + cmd.font(font_large) + .text(x, y, w, h, F("Z Probe Wizard")); +} + +float ZOffsetWizard::getIncrement() { + switch (mydata.increment) { + case 241: return 0.01; + case 242: return 0.1; + case 243: return 1.0; + default: return 0.0; + } +} + +void ZOffsetWizard::runWizard() { + // Restore the default Z offset + constexpr float offset[] = NOZZLE_TO_PROBE_OFFSET; + setZOffset_mm(offset[Z_AXIS]); + // Move above probe point + char cmd[64], str[10]; + strcpy_P(cmd, PSTR("G28 Z\nG0 F1000 X")); + dtostrf(TERN(Z_SAFE_HOMING,Z_SAFE_HOMING_X_POINT,X_CENTER), 3, 1, str); + strcat(cmd, str); + strcat_P(cmd, PSTR("Y")); + dtostrf(TERN(Z_SAFE_HOMING,Z_SAFE_HOMING_Y_POINT,Y_CENTER), 3, 1, str); + strcat(cmd, str); + strcat_P(cmd, PSTR("Z")); + dtostrf(SHEET_THICKNESS, 3, 1, str); + strcat(cmd, str); + injectCommands(cmd); + // Show instructions for user. + AlertDialogBox::show(F("\nOn the next screen, adjust the Z Offset so that a sheet of paper can pass between the nozzle and bed with slight resistance.\n\nOnce the printer stops moving, press Okay to begin.\n")); + // Set the destination screen after the dialog box. + current_screen.forget(); + PUSH_SCREEN(ZOffsetWizard); +} + +bool ZOffsetWizard::onTouchEnd(uint8_t tag) { + switch (tag) { + case 1: + GOTO_PREVIOUS(); + break; + case 4: + case 5: + return onTouchHeld(tag); + case 241 ... 243: + mydata.increment = tag; + break; + default: + return false; + } + return true; +} + +bool ZOffsetWizard::onTouchHeld(uint8_t tag) { + const float increment = TERN(BABYSTEPPING, + mmFromWholeSteps(mmToWholeSteps(getIncrement(), Z), Z), // Round increment to nearest steps + getIncrement() + ); + switch (tag) { + case 4: UI_DECREMENT(ZOffset_mm); UI_DECREMENT(AxisPosition_mm, Z); break; + case 5: UI_INCREMENT(ZOffset_mm); UI_INCREMENT(AxisPosition_mm, Z); break; + default: + return false; + } + SaveSettingsDialogBox::settingsChanged(); + return true; +} + +#endif // COCOA_Z_OFFSET_WIZARD diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.h new file mode 100644 index 000000000000..5c02f9803b73 --- /dev/null +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/z_offset_wizard.h @@ -0,0 +1,43 @@ +/*********************** + * z_offset_screen.h * + ***********************/ + +/**************************************************************************** + * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * + * Written By Marcio Teixeira 2018 - Aleph Objects, Inc. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * To view a copy of the GNU General Public License, go to the following * + * location: . * + ****************************************************************************/ + +#pragma once + +#define COCOA_Z_OFFSET_WIZARD +#define COCOA_Z_OFFSET_WIZARD_CLASS ZOffsetWizard + +struct ZOffsetWizardData : public BaseNumericAdjustmentScreenData { + uint8_t increment; + bool softEndstopState; +}; + +class ZOffsetWizard : public BaseScreen, public UncachedScreen { + private: + static float getIncrement(); + public: + static void runWizard(); + static void onEntry(); + static void onExit(); + static void onRedraw(draw_mode_t); + static bool onTouchHeld(uint8_t tag); + static bool onTouchEnd(uint8_t tag); +}; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index a796c8edcf5f..24d99d7b45b5 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -177,6 +177,14 @@ void CLCD::mem_write_pgm(uint32_t reg_address, const void *data, uint16_t len, u spi_ftdi_deselect(); } +// Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images) +void CLCD::mem_write_xbm(uint32_t reg_address, const void *data, uint16_t len, uint8_t padding) { + spi_ftdi_select(); + spi_write_addr(reg_address); + spi_write_bulk(data, len, padding); + spi_ftdi_deselect(); +} + // Write 3-Byte Address, Multiple Bytes, plus padding bytes, from PROGMEM, reversing bytes (suitable for loading XBM images) void CLCD::mem_write_xbm(uint32_t reg_address, FSTR_P data, uint16_t len, uint8_t padding) { spi_ftdi_select(); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h index 2e2657a83eec..80a2cece1792 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.h @@ -118,6 +118,7 @@ class CLCD { static void mem_write_fill (uint32_t reg_address, uint8_t w_data, uint16_t len); static void mem_write_bulk (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_pgm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); + static void mem_write_xbm (uint32_t reg_address, const void *data, uint16_t len, uint8_t padding = 0); static void mem_write_bulk (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0); static void mem_write_xbm (uint32_t reg_address, FSTR_P str, uint16_t len, uint8_t padding = 0); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp index d7f4d31bdc12..c05d6577d04b 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.cpp @@ -66,14 +66,6 @@ * character (this is not the unicode codepoint) */ - utf8_char_t FTDI::get_utf8_char_and_inc(char *&c) { - utf8_char_t val = *(uint8_t*)c++; - if ((val & 0xC0) == 0xC0) - while ((*c & 0xC0) == 0x80) - val = (val << 8) | *(uint8_t*)c++; - return val; - } - utf8_char_t FTDI::get_utf8_char_and_inc(const char *&c) { utf8_char_t val = *(uint8_t*)c++; if ((val & 0xC0) == 0xC0) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h index 7818957fcc2d..83ab56df579e 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/unicode.h @@ -47,7 +47,6 @@ namespace FTDI { * pointer to the next character */ utf8_char_t get_utf8_char_and_inc(const char *&c); - utf8_char_t get_utf8_char_and_inc(char *&c); /* Returns the next character in a UTF8 string, without incrementing */ diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py old mode 100644 new mode 100755 index f6e4a3e39abe..0f39932c6a92 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/scripts/svg2cpp.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Written By Marcio Teixeira 2018 - Aleph Objects, Inc. # @@ -18,6 +18,8 @@ from __future__ import print_function import argparse,re,sys +from html.parser import HTMLParser + usage = ''' This program extracts line segments from a SVG file and writes them as coordinates in a C array. The x and y values will be @@ -107,19 +109,16 @@ def write(self): print("constexpr float y_max = %f;" % self.y_max) print() - def from_svg_view_box(self, svg): - s = re.search(']+>', svg); - if s: - m = re.search('viewBox="([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)"', svg) - if m: - self.x_min = float(m[1]) - self.y_min = float(m[2]) - self.x_max = float(m[3]) - self.y_max = float(m[4]) - return True + def from_svg_view_box(self, viewbox): + m = re.search('([0-9-.]+) ([0-9-.]+) ([0-9-.]+) ([0-9-.]+)', viewbox) + if m: + self.x_min = float(m[1]) + self.y_min = float(m[2]) + self.x_max = float(m[3]) + self.y_max = float(m[4]) + return True return False -# op class WriteDataStructure: def __init__(self, bounding_box): self.bounds = bounding_box @@ -143,19 +142,29 @@ def path_finished(self, id): print("const PROGMEM uint16_t", id + "[] = {" + ", ".join (self.hex_words) + "};") self.hex_words = [] -class Parser: - def __init__(self, op): +class SVGParser(HTMLParser): + def __init__(self, args): + super().__init__() + self.args = args + self.tags = [] + self.groups = [] + self.op = None + self.restart() + + def set_consumer(self, op): self.op = op - self.reset() + if self.op: + self.op.reset() - def reset(self): + def restart(self): self.last_x = 0 self.last_y = 0 self.initial_x = 0 self.initial_y = 0 def process_svg_path_L_or_M(self, cmd, x, y): - self.op.command(cmd, x, y) + if self.op: + self.op.command(cmd, x, y) self.last_x = x self.last_y = y if cmd == "M": @@ -239,42 +248,71 @@ def process_svg_path_data(self, id, d): print("Syntax error:", d, "in path", id, "\n", file=sys.stderr) quit() - def process_svg_paths(self, svg): - self.op.reset() - for path in re.findall(']+>', svg): - id = "" - m = re.search(' id="(.*)"', path) - if m: - id = m[1] + def find_attr(attrs, what): + for attr, value in attrs: + if attr == what: + return value - m = re.search(' transform="(.*)"', path) - if m: + def layer_matches(self): + """ Are we in the correct layer?""" + if not self.args.layer: + return True + for l in self.groups: + if l and l.find(self.args.layer) != -1: + return True + return False + + def handle_starttag(self, tag, attrs): + self.tags.append(tag) + if tag == 'svg': + self.viewbox = SVGParser.find_attr(attrs, 'viewbox') + if tag == 'g': + label = SVGParser.find_attr(attrs, 'inkscape:label') + self.groups.append(label) + if label and self.layer_matches(): + print("Reading layer:", label, file=sys.stderr) + if tag == 'path' and self.layer_matches(): + id = SVGParser.find_attr(attrs, 'id') + transform = SVGParser.find_attr(attrs, 'transform') + if transform: print("Found transform in path", id, "! Cannot process file!", file=sys.stderr) quit() - - m = re.search(' d="(.*)"', path) - if m: - self.process_svg_path_data(id, m[1]) - self.op.path_finished(id) - self.reset() + d = SVGParser.find_attr(attrs, 'd') + if d: + self.process_svg_path_data(id, d) + if self.op: + self.op.path_finished(id) + self.restart() + + def handle_endtag(self, tag): + if tag == 'g': + self.groups.pop() + if tag != self.tags.pop(): + print("Error popping tag off list") if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("filename") + parser.add_argument('--layer', help='only include layers which have this string in their names') args = parser.parse_args() f = open(args.filename, "r") data = f.read() - print(header) + # First pass to grab viewbox + p = SVGParser(args) + p.feed(data) b = ComputeBoundingBox() - if not b.from_svg_view_box(data): + if not b.from_svg_view_box(p.viewbox): # Can't find the view box, so use the bounding box of the elements themselves. - p = Parser(b) - p.process_svg_paths(data) - b.write() + p = SVGParser(args) + p.set_consumer(b) + p.feed(data) + b.write() + # Last pass to process paths w = WriteDataStructure(b) - p = Parser(w) - p.process_svg_paths(data) + p = SVGParser(args) + p.set_consumer(w) + p.feed(data) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp index ab6d8a89024d..c894d017ebcd 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_edit_screen.cpp @@ -174,11 +174,11 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) { case 1: // On Cancel, reload saved mesh, discarding changes GOTO_PREVIOUS(); - injectCommands(F("G29 L1")); + injectCommands(F(TERN(AUTO_BED_LEVELING_UBL, "G29 L1", "M501"))); return true; case 2: saveAdjustedHighlightedValue(); - injectCommands(F("G29 S1")); + injectCommands(F(TERN(AUTO_BED_LEVELING_UBL, "G29 S1", "M500"))); mydata.needSave = false; return true; case 3: @@ -191,7 +191,7 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) { void BedMeshEditScreen::show() { // On entry, always home (to account for possible Z offset changes) and save current mesh - SpinnerDialogBox::enqueueAndWait(F("G28\nG29 S1")); + SpinnerDialogBox::enqueueAndWait(F("G28\n" TERN(AUTO_BED_LEVELING_UBL, "G29 S1", "M500"))); // After the spinner, go to this screen. current_screen.forget(); PUSH_SCREEN(BedMeshEditScreen); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp index 86eab54d85b1..c42d83420f2c 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp @@ -53,10 +53,7 @@ constexpr static float gaugeThickness = 0.25; #endif static float meshGetter(uint8_t x, uint8_t y, void*) { - xy_uint8_t pos; - pos.x = x; - pos.y = y; - return ExtUI::getMeshPoint(pos); + return ExtUI::getMeshPoint(xy_uint8_t(x, y)); } void BedMeshViewScreen::onEntry() { @@ -158,7 +155,7 @@ void BedMeshViewScreen::doProbe() { } void BedMeshViewScreen::show() { - injectCommands(F("G29 L1")); + TERN_(AUTO_BED_LEVELING_UBL, injectCommands(F("G29 L1"))); GOTO_SCREEN(BedMeshViewScreen); } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp index 001f97490b1d..dcf4789593b7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/main_menu.cpp @@ -43,7 +43,7 @@ void MainMenu::onRedraw(draw_mode_t what) { #define ADVANCED_SETTINGS_POS BTN_POS(1,2), BTN_SIZE(2,1) #if ENABLED(CUSTOM_MENU_MAIN) #define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(1,1) - #define CUSTOM_MENU_POS BTN_POS(2,3), BTN_SIZE(1,1) + #define CUSTOM_MENU_POS BTN_POS(2,3), BTN_SIZE(1,1) #else #define FILAMENTCHANGE_POS BTN_POS(1,3), BTN_SIZE(2,1) #endif @@ -66,7 +66,7 @@ void MainMenu::onRedraw(draw_mode_t what) { #if ENABLED(CUSTOM_MENU_MAIN) #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(2,1) #define FILAMENTCHANGE_POS BTN_POS(3,4), BTN_SIZE(2,1) - #define CUSTOM_MENU_POS BTN_POS(5,4), BTN_SIZE(2,1) + #define CUSTOM_MENU_POS BTN_POS(5,4), BTN_SIZE(2,1) #else #define TEMPERATURE_POS BTN_POS(1,4), BTN_SIZE(3,1) #define FILAMENTCHANGE_POS BTN_POS(4,4), BTN_SIZE(3,1) @@ -92,7 +92,7 @@ void MainMenu::onRedraw(draw_mode_t what) { .tag( 9).button(LEVELING_POS, GET_TEXT_F(MSG_LEVELING)) .tag(10).button(ABOUT_PRINTER_POS, GET_TEXT_F(MSG_INFO_MENU)) #if ENABLED(CUSTOM_MENU_MAIN) - .tag(11).button(CUSTOM_MENU_POS, GET_TEXT_F(MSG_CUSTOM_COMMANDS)) + .tag(11).button(CUSTOM_MENU_POS, GET_TEXT_F(MSG_CUSTOM_COMMANDS)) #endif .colors(action_btn) .tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE)); @@ -103,22 +103,30 @@ bool MainMenu::onTouchEnd(uint8_t tag) { using namespace ExtUI; switch (tag) { - case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; - case 2: SpinnerDialogBox::enqueueAndWait(F("G28")); break; + case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; + case 2: SpinnerDialogBox::enqueueAndWait(F("G28")); break; #if ENABLED(NOZZLE_CLEAN_FEATURE) - case 3: injectCommands(F("G12")); GOTO_SCREEN(StatusScreen); break; + case 3: + injectCommands(F("G12")); + GOTO_SCREEN(StatusScreen); break; #endif - case 4: GOTO_SCREEN(MoveAxisScreen); break; - case 5: injectCommands(F("M84")); break; - case 6: GOTO_SCREEN(TemperatureScreen); break; - case 7: GOTO_SCREEN(ChangeFilamentScreen); break; - case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; + case 4: GOTO_SCREEN(MoveAxisScreen); break; + case 5: + injectCommands(F("M84 E" + TERN_(DISABLE_INACTIVE_X, " X") + TERN_(DISABLE_INACTIVE_Y, " Y") + TERN_(DISABLE_INACTIVE_Z, " Z") + )); + break; + case 6: GOTO_SCREEN(TemperatureScreen); break; + case 7: GOTO_SCREEN(ChangeFilamentScreen); break; + case 8: GOTO_SCREEN(AdvancedSettingsMenu); break; #if HAS_LEVELING - case 9: GOTO_SCREEN(LevelingMenu); break; + case 9: GOTO_SCREEN(LevelingMenu); break; #endif - case 10: GOTO_SCREEN(AboutScreen); break; + case 10: GOTO_SCREEN(AboutScreen); break; #if ENABLED(CUSTOM_MENU_MAIN) - case 11: GOTO_SCREEN(CustomUserMenus); break; + case 11: GOTO_SCREEN(CustomUserMenus); break; #endif default: diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp index 738d8ee64f2e..ea484344bd40 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp @@ -376,10 +376,10 @@ void StatusScreen::loadBitmaps() { // Load the bitmaps for the status screen using namespace Theme; constexpr uint32_t base = ftdi_memory_map::RAM_G; - CLCD::mem_write_pgm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon)); - CLCD::mem_write_pgm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon)); - CLCD::mem_write_pgm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); - CLCD::mem_write_pgm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); + CLCD::mem_write_xbm(base + TD_Icon_Info.RAMG_offset, TD_Icon, sizeof(TD_Icon)); + CLCD::mem_write_xbm(base + Extruder_Icon_Info.RAMG_offset, Extruder_Icon, sizeof(Extruder_Icon)); + CLCD::mem_write_xbm(base + Bed_Heat_Icon_Info.RAMG_offset, Bed_Heat_Icon, sizeof(Bed_Heat_Icon)); + CLCD::mem_write_xbm(base + Fan_Icon_Info.RAMG_offset, Fan_Icon, sizeof(Fan_Icon)); // Load fonts for internationalization #if ENABLED(TOUCH_UI_USE_UTF8) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp index 2dbf2d9f06a7..04eb2acec6bc 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/temperature_screen.cpp @@ -66,7 +66,7 @@ void TemperatureScreen::onRedraw(draw_mode_t what) { #if HAS_HEATED_CHAMBER w.adjuster( 22, GET_TEXT_F(MSG_CHAMBER), getTargetTemp_celsius(CHAMBER)); #endif - #if HAS_FAN + #if HAS_FAN0 w.color(fan_speed).units(GET_TEXT_F(MSG_UNITS_PERCENT)); w.adjuster( 10, GET_TEXT_F(MSG_FAN_SPEED), getTargetFan_percent(FAN0)); #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h index db37ccfd22e4..6deb5b47587e 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language_en.h @@ -171,8 +171,6 @@ namespace Language_en { LSTR MSG_PREHEAT_CHOCOLATE = u8"Preheat Chocolate"; LSTR MSG_PREHEAT_FINISHED = u8"Preheat finished"; LSTR MSG_PREHEAT = u8"Preheat"; - LSTR MSG_BUTTON_PAUSE = u8"Pause"; - LSTR MSG_BUTTON_RESUME = u8"Resume"; LSTR MSG_ELAPSED_PRINT = u8"Elapsed Print"; LSTR MSG_XYZ_MOVE = u8"XYZ Move"; LSTR MSG_E_MOVE = u8"Extrusion Move"; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h index 48a0c1a96440..7b0a0d25e9aa 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screen_data.h @@ -62,9 +62,11 @@ union screen_data_t { DECL_DATA_IF_INCLUDED(FTDI_Z_OFFSET_SCREEN) DECL_DATA_IF_INCLUDED(FTDI_BASE_NUMERIC_ADJ_SCREEN) DECL_DATA_IF_INCLUDED(FTDI_ALERT_DIALOG_BOX) + DECL_DATA_IF_INCLUDED(COCOA_STATUS_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_PREHEAT_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_LOAD_CHOCOLATE_SCREEN) DECL_DATA_IF_INCLUDED(COCOA_FILES_SCREEN) + DECL_DATA_IF_INCLUDED(COCOA_Z_OFFSET_WIZARD) }; extern screen_data_t screen_data; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp index ed210369c4f2..c7607f71d071 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp @@ -118,6 +118,10 @@ SCREEN_TABLE { DECL_SCREEN_IF_INCLUDED(COCOA_MOVE_E_SCREEN) DECL_SCREEN_IF_INCLUDED(COCOA_CONFIRM_START_PRINT) DECL_SCREEN_IF_INCLUDED(COCOA_FILES_SCREEN) + DECL_SCREEN_IF_INCLUDED(COCOA_Z_OFFSET_SCREEN) + DECL_SCREEN_IF_INCLUDED(COCOA_Z_OFFSET_WIZARD) + DECL_SCREEN_IF_INCLUDED(COCOA_ABOUT_SCREEN) + DECL_SCREEN_IF_INCLUDED(COCOA_STATISTICS_SCREEN) }; SCREEN_TABLE_POST diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h index c194225d99ae..a2729979c6bf 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/bitmaps.h @@ -37,25 +37,25 @@ namespace Theme { }; constexpr PROGMEM unsigned char Extruder_Icon[69] = { - 0x3F, 0xFF, 0xFC, - 0x7F, 0xFF, 0xFE, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0x7F, 0xFF, 0xFE, - 0x3F, 0xFF, 0xFC, - 0x3F, 0xFF, 0xFC, - 0x7F, 0xFF, 0xFE, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0xC0, 0x00, 0x03, - 0x7F, 0xFF, 0xFE, - 0x7F, 0xFF, 0xFE, - 0x07, 0xFF, 0xE0, - 0x03, 0xFF, 0xC0, - 0x01, 0x81, 0x80, + 0xFC, 0xFF, 0x3F, + 0xFE, 0xFF, 0x7F, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0xFE, 0xFF, 0x7F, + 0xFC, 0xFF, 0x3F, + 0xFC, 0xFF, 0x3F, + 0xFE, 0xFF, 0x7F, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0x03, 0x00, 0xC0, + 0xFE, 0xFF, 0x7F, + 0xFE, 0xFF, 0x7F, + 0xE0, 0xFF, 0x07, + 0xC0, 0xFF, 0x03, + 0x80, 0x81, 0x01, 0x00, 0xC3, 0x00, 0x00, 0x66, 0x00, 0x00, 0x3C, 0x00, @@ -74,28 +74,28 @@ namespace Theme { }; constexpr PROGMEM unsigned char Bed_Heat_Icon[92] = { - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0x60, 0x60, 0x60, - 0x00, 0x60, 0x60, 0x60, - 0x00, 0xC0, 0xC0, 0xC0, - 0x00, 0xC0, 0xC0, 0xC0, - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, - 0x03, 0x03, 0x03, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x06, 0x06, 0x06, 0x00, - 0x06, 0x06, 0x06, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x03, 0x03, 0x03, 0x00, - 0x01, 0x81, 0x81, 0x80, - 0x01, 0x81, 0x81, 0x80, + 0x80, 0x81, 0x81, 0x01, + 0x80, 0x81, 0x81, 0x01, + 0x00, 0x03, 0x03, 0x03, + 0x00, 0x03, 0x03, 0x03, + 0x00, 0x06, 0x06, 0x06, + 0x00, 0x06, 0x06, 0x06, + 0x00, 0x03, 0x03, 0x03, + 0x00, 0x03, 0x03, 0x03, + 0x80, 0x81, 0x81, 0x01, + 0x80, 0x81, 0x81, 0x01, + 0xC0, 0xC0, 0xC0, 0x00, + 0xC0, 0xC0, 0xC0, 0x00, + 0x60, 0x60, 0x60, 0x00, + 0x60, 0x60, 0x60, 0x00, + 0xC0, 0xC0, 0xC0, 0x00, + 0xC0, 0xC0, 0xC0, 0x00, + 0x80, 0x81, 0x81, 0x01, + 0x80, 0x81, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xC0, 0x00, 0x00, 0x03, + 0x03, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF }; @@ -113,34 +113,34 @@ namespace Theme { constexpr PROGMEM unsigned char Fan_Icon[128] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xF8, 0x00, 0x00, 0x1F, - 0xF0, 0x03, 0xF8, 0x0F, - 0xE0, 0x07, 0xF0, 0x07, - 0xC0, 0x0F, 0xE0, 0x03, - 0xC0, 0x1F, 0xE0, 0x03, - 0xC0, 0x1F, 0xE0, 0x03, - 0xC0, 0x0F, 0xE0, 0x03, - 0xC0, 0x07, 0xE0, 0x03, - 0xC0, 0x03, 0xC0, 0x03, - 0xD0, 0x00, 0x00, 0xC3, - 0xD8, 0x03, 0xC1, 0xE3, - 0xDF, 0xC7, 0xE3, 0xF3, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xDF, 0xEF, 0xF7, 0xFB, - 0xCF, 0xC7, 0xE3, 0xFB, - 0xC7, 0x83, 0xC0, 0x1B, - 0xC3, 0x00, 0x00, 0x0B, - 0xC0, 0x03, 0xC0, 0x03, - 0xC0, 0x07, 0xE0, 0x03, - 0xC0, 0x07, 0xF0, 0x03, - 0xC0, 0x07, 0xF8, 0x03, - 0xC0, 0x07, 0xF8, 0x03, - 0xC0, 0x07, 0xF0, 0x03, - 0xE0, 0x0F, 0xE0, 0x07, - 0xF0, 0x1F, 0xC0, 0x0F, - 0xF8, 0x00, 0x00, 0x1F, + 0x1F, 0x00, 0x00, 0xF8, + 0x0F, 0xC0, 0x1F, 0xF0, + 0x07, 0xE0, 0x0F, 0xE0, + 0x03, 0xF0, 0x07, 0xC0, + 0x03, 0xF8, 0x07, 0xC0, + 0x03, 0xF8, 0x07, 0xC0, + 0x03, 0xF0, 0x07, 0xC0, + 0x03, 0xE0, 0x07, 0xC0, + 0x03, 0xC0, 0x03, 0xC0, + 0x0B, 0x00, 0x00, 0xC3, + 0x1B, 0xC0, 0x83, 0xC7, + 0xFB, 0xE3, 0xC7, 0xCF, + 0xFB, 0xF7, 0xEF, 0xDF, + 0xFB, 0xF7, 0xEF, 0xDF, + 0xFB, 0xF7, 0xEF, 0xDF, + 0xFB, 0xF7, 0xEF, 0xDF, + 0xF3, 0xE3, 0xC7, 0xDF, + 0xE3, 0xC1, 0x03, 0xD8, + 0xC3, 0x00, 0x00, 0xD0, + 0x03, 0xC0, 0x03, 0xC0, + 0x03, 0xE0, 0x07, 0xC0, + 0x03, 0xE0, 0x0F, 0xC0, + 0x03, 0xE0, 0x1F, 0xC0, + 0x03, 0xE0, 0x1F, 0xC0, + 0x03, 0xE0, 0x0F, 0xC0, + 0x07, 0xF0, 0x07, 0xE0, + 0x0F, 0xF8, 0x03, 0xF0, + 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; @@ -157,26 +157,26 @@ namespace Theme { }; constexpr PROGMEM unsigned char TD_Icon[140] = { - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, // Thumb Drive Widget - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xC0, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0xC0, - 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x80, - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, - 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFC, 0x00 + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, // Thumb Drive Widget + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x01, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x01, + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, + 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F, 0x00 }; constexpr PROGMEM bitmap_info_t File_Icon_Info = { @@ -191,17 +191,17 @@ namespace Theme { }; const unsigned char File_Icon[128] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, - 0x40, 0x02, 0x80, 0x00, 0x40, 0x02, 0x40, 0x00, 0x40, 0x02, 0x20, 0x00, - 0x40, 0x02, 0x10, 0x00, 0x40, 0x02, 0x08, 0x00, 0x40, 0x02, 0x04, 0x00, - 0x40, 0x02, 0x02, 0x00, 0x40, 0x03, 0xFF, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, 0x40, 0x00, 0x01, 0x00, - 0x7F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0xFE, 0x7F, 0x00, 0x00, 0x02, 0xC0, 0x00, 0x00, + 0x02, 0x40, 0x01, 0x00, 0x02, 0x40, 0x02, 0x00, 0x02, 0x40, 0x04, 0x00, + 0x02, 0x40, 0x08, 0x00, 0x02, 0x40, 0x10, 0x00, 0x02, 0x40, 0x20, 0x00, + 0x02, 0x40, 0x40, 0x00, 0x02, 0xC0, 0xFF, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0x00, + 0xFE, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 }; constexpr PROGMEM bitmap_info_t Clock_Icon_Info = { @@ -216,17 +216,17 @@ namespace Theme { }; const unsigned char Clock_Icon[128] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x7E, 0x7E, 0x00, - 0x00, 0xE0, 0x07, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x07, 0x01, 0x00, 0xE0, - 0x0C, 0x01, 0x80, 0x70, 0x0C, 0x01, 0x80, 0x30, 0x18, 0x01, 0x80, 0x18, - 0x30, 0x01, 0x80, 0x08, 0x30, 0x01, 0x80, 0x0C, 0x20, 0x01, 0x80, 0x0C, - 0x60, 0x01, 0x80, 0x04, 0x60, 0x01, 0x80, 0x06, 0x60, 0x01, 0x80, 0x06, - 0x60, 0x01, 0xFF, 0x06, 0x60, 0x01, 0xFF, 0x06, 0x60, 0x00, 0x00, 0x06, - 0x60, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x0C, - 0x30, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x08, 0x18, 0x00, 0x00, 0x18, - 0x0C, 0x00, 0x00, 0x30, 0x0E, 0x00, 0x00, 0x70, 0x07, 0x00, 0x00, 0xE0, - 0x03, 0x80, 0x01, 0xC0, 0x00, 0xE0, 0x07, 0x00, 0x00, 0x7F, 0xFE, 0x00, - 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x7E, 0x7E, 0x00, + 0x00, 0x07, 0xE0, 0x00, 0xC0, 0x01, 0x80, 0x03, 0xE0, 0x80, 0x00, 0x07, + 0x30, 0x80, 0x01, 0x0E, 0x30, 0x80, 0x01, 0x0C, 0x18, 0x80, 0x01, 0x18, + 0x0C, 0x80, 0x01, 0x10, 0x0C, 0x80, 0x01, 0x30, 0x04, 0x80, 0x01, 0x30, + 0x06, 0x80, 0x01, 0x20, 0x06, 0x80, 0x01, 0x60, 0x06, 0x80, 0x01, 0x60, + 0x06, 0x80, 0xFF, 0x60, 0x06, 0x80, 0xFF, 0x60, 0x06, 0x00, 0x00, 0x60, + 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x20, 0x04, 0x00, 0x00, 0x30, + 0x0C, 0x00, 0x00, 0x30, 0x0C, 0x00, 0x00, 0x10, 0x18, 0x00, 0x00, 0x18, + 0x30, 0x00, 0x00, 0x0C, 0x70, 0x00, 0x00, 0x0E, 0xE0, 0x00, 0x00, 0x07, + 0xC0, 0x01, 0x80, 0x03, 0x00, 0x07, 0xE0, 0x00, 0x00, 0xFE, 0x7F, 0x00, + 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00 }; constexpr PROGMEM bitmap_info_t Light_Bulb_Info = { @@ -241,17 +241,42 @@ namespace Theme { }; const unsigned char Light_Bulb[128] PROGMEM = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x40, - 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00, 0x80, 0x02, 0x00, - 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x36, 0x18, 0x00, - 0x00, 0x2C, 0x08, 0x00, 0x00, 0x58, 0x04, 0x00, 0x00, 0x50, 0x04, 0x00, - 0x7C, 0x50, 0x04, 0x7C, 0x00, 0x40, 0x04, 0x00, 0x00, 0x40, 0x04, 0x00, - 0x00, 0x60, 0x0C, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x10, 0x10, 0x00, - 0x00, 0x10, 0x10, 0x00, 0x00, 0x88, 0x22, 0x00, 0x01, 0x08, 0x21, 0x00, - 0x02, 0x08, 0x20, 0x80, 0x04, 0x0F, 0xE0, 0x40, 0x00, 0x07, 0xC0, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, + 0x40, 0x00, 0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 0x00, 0x01, 0x40, 0x00, + 0x00, 0xF0, 0x07, 0x00, 0x00, 0x18, 0x0C, 0x00, 0x00, 0x6C, 0x18, 0x00, + 0x00, 0x34, 0x10, 0x00, 0x00, 0x1A, 0x20, 0x00, 0x00, 0x0A, 0x20, 0x00, + 0x3E, 0x0A, 0x20, 0x3E, 0x00, 0x02, 0x20, 0x00, 0x00, 0x02, 0x20, 0x00, + 0x00, 0x06, 0x30, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, + 0x00, 0x08, 0x08, 0x00, 0x00, 0x11, 0x44, 0x00, 0x80, 0x10, 0x84, 0x00, + 0x40, 0x10, 0x04, 0x01, 0x20, 0xF0, 0x07, 0x02, 0x00, 0xE0, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xC0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + constexpr PROGMEM bitmap_info_t Chamber_Icon_Info = { + .format = L1, + .linestride = 4, + .filter = BILINEAR, + .wrapx = BORDER, + .wrapy = BORDER, + .RAMG_offset = 8813, + .width = 32, + .height = 32, + }; + + const unsigned char Chamber_Icon[128] PROGMEM = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, + 0x0F, 0x00, 0x00, 0xF0, 0x07, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0xC0, + 0x03, 0x00, 0x00, 0xC0, 0x83, 0x81, 0x81, 0xC1, 0x83, 0x81, 0x81, 0xC1, + 0x03, 0x03, 0x03, 0xC3, 0x03, 0x03, 0x03, 0xC3, 0x03, 0x06, 0x06, 0xC6, + 0x03, 0x06, 0x06, 0xC6, 0x03, 0x03, 0x03, 0xC3, 0x03, 0x03, 0x03, 0xC3, + 0x83, 0x81, 0x81, 0xC1, 0x83, 0x81, 0x81, 0xC1, 0xC3, 0xC0, 0xC0, 0xC0, + 0xC3, 0xC0, 0xC0, 0xC0, 0x63, 0x60, 0x60, 0xC0, 0x63, 0x60, 0x60, 0xC0, + 0xC3, 0xC0, 0xC0, 0xC0, 0xC3, 0xC0, 0xC0, 0xC0, 0x83, 0x81, 0x81, 0xC1, + 0x83, 0x81, 0x81, 0xC1, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC0, + 0x07, 0x00, 0x00, 0xE0, 0x0F, 0x00, 0x00, 0xF0, 0x1F, 0x00, 0x00, 0xF8, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; constexpr PROGMEM uint32_t UTF8_FONT_OFFSET = 10000; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp index efeed1920114..d8407406a1eb 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp @@ -300,6 +300,44 @@ namespace Theme { {SILENCE, END_SONG, 0} }; + const PROGMEM SoundPlayer::sound_t flagpole[] = { + {TRIANGLE_WAVE, NOTE_G3, 2}, + {TRIANGLE_WAVE, NOTE_C4, 2}, + {TRIANGLE_WAVE, NOTE_E4, 2}, + {TRIANGLE_WAVE, NOTE_G4, 2}, + {TRIANGLE_WAVE, NOTE_C5, 2}, + {TRIANGLE_WAVE, NOTE_E5, 2}, + {TRIANGLE_WAVE, NOTE_G5, 5}, + {TRIANGLE_WAVE, NOTE_E5, 2}, + + {TRIANGLE_WAVE, NOTE_G3S, 2}, + {TRIANGLE_WAVE, NOTE_C4, 2}, + {TRIANGLE_WAVE, NOTE_D4S, 2}, + {TRIANGLE_WAVE, NOTE_G4S, 2}, + {TRIANGLE_WAVE, NOTE_C5, 2}, + {TRIANGLE_WAVE, NOTE_D5S, 2}, + {TRIANGLE_WAVE, NOTE_G5S, 5}, + {TRIANGLE_WAVE, NOTE_D5S, 5}, + + {TRIANGLE_WAVE, NOTE_A3S, 2}, + {TRIANGLE_WAVE, NOTE_D4, 2}, + {TRIANGLE_WAVE, NOTE_F4, 2}, + {TRIANGLE_WAVE, NOTE_A4S, 2}, + {TRIANGLE_WAVE, NOTE_D5, 2}, + {TRIANGLE_WAVE, NOTE_F5, 2}, + {TRIANGLE_WAVE, NOTE_A5S, 5}, + + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 1}, + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 1}, + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 1}, + {SILENCE, REST, 1}, + {TRIANGLE_WAVE, NOTE_A5S, 8}, + {SILENCE, END_SONG, 0} + }; + const PROGMEM SoundPlayer::sound_t big_band[] = { {XYLOPHONE, NOTE_F4, 3}, {XYLOPHONE, NOTE_G4, 3}, @@ -402,7 +440,8 @@ const SoundList::list_t SoundList::list[] = { {"Carousel", Theme::carousel}, {"Beats", Theme::beats}, {"Bach Joy", Theme::js_bach_joy}, - {"Bach Toccata", Theme::js_bach_toccata} + {"Bach Toccata", Theme::js_bach_toccata}, + {"Flagpole", Theme::flagpole} }; const uint8_t SoundList::n = N_ELEMENTS(SoundList::list); diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h index 1b74fcbd860e..70a9bf9de20d 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h @@ -126,7 +126,7 @@ #endif #ifndef E0_SLAVE_ADDRESS #define E0_SLAVE_ADDRESS 3 - #endif + #endif #else #define X_HARDWARE_SERIAL Serial2 #define Y_HARDWARE_SERIAL Serial2 From 5bd39ba73f5a704ccaf370bc98201c10b380d20d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 Oct 2023 12:14:26 -0500 Subject: [PATCH 096/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Fxd?= =?UTF-8?q?TiCtrl=20=3D>=20FTMotion=20redux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/ft_motion.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 85ee4ca355d0..ad37e8a9b3da 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -498,6 +498,7 @@ void FTMotion::loadBlockData(block_t * const current_block) { } const float T1 = (F_n - f_s) / a, // (s) Accel Time = difference in feedrate over acceleration + T3 = (F_n - f_e) / a; // (s) Decel Time = difference in feedrate over acceleration N1 = ceil(T1 * (FTM_FS)); // Accel datapoints based on Hz frequency N2 = ceil(T2 * (FTM_FS)); // Coast From 4744997c164931f8c1f8753ba4112e466b7c83a7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 Oct 2023 12:14:57 -0500 Subject: [PATCH 097/268] =?UTF-8?q?=F0=9F=93=9D=20GCode=20=3D>=20G-Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32F1/MarlinSerial.cpp | 2 +- Marlin/src/gcode/calibrate/G28.cpp | 2 +- Marlin/src/gcode/control/M42.cpp | 2 +- Marlin/src/gcode/feature/mixing/M163-M165.cpp | 2 +- Marlin/src/gcode/gcode.cpp | 6 +++--- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/gcode/parser.cpp | 8 ++++---- Marlin/src/gcode/parser.h | 10 +++++----- Marlin/src/gcode/queue.h | 4 ++-- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 2 +- docs/Queue.md | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp index 8c68a2de7f29..8c468e9609f8 100644 --- a/Marlin/src/HAL/STM32F1/MarlinSerial.cpp +++ b/Marlin/src/HAL/STM32F1/MarlinSerial.cpp @@ -75,7 +75,7 @@ static __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart } // Not every MarlinSerial port should handle emergency parsing. -// It would not make sense to parse GCode from TMC responses, for example. +// It would not make sense to parse G-Code from TMC responses, for example. constexpr bool serial_handles_emergency(int port) { return (false #ifdef SERIAL_PORT diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index fd034f0ba6a4..531dc5b558b0 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -536,7 +536,7 @@ void GcodeSuite::G28() { /** * Preserve DXC mode across a G28 for IDEX printers in DXC_DUPLICATION_MODE. * This is important because it lets a user use the LCD Panel to set an IDEX Duplication mode, and - * then print a standard GCode file that contains a single print that does a G28 and has no other + * then print a standard G-Code file that contains a single print that does a G28 and has no other * IDEX specific commands in it. */ #if ENABLED(DUAL_X_CARRIAGE) diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 6e75ffd4e75c..13965cb72c22 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -44,7 +44,7 @@ void protected_pin_err() { } /** - * M42: Change pin status via GCode + * M42: Change pin status via G-Code * * P Pin number (LED if omitted) * For LPC1768 specify pin P1_02 as M42 P102, diff --git a/Marlin/src/gcode/feature/mixing/M163-M165.cpp b/Marlin/src/gcode/feature/mixing/M163-M165.cpp index a4cb64e7d62c..f4ea52df0a47 100644 --- a/Marlin/src/gcode/feature/mixing/M163-M165.cpp +++ b/Marlin/src/gcode/feature/mixing/M163-M165.cpp @@ -76,7 +76,7 @@ void GcodeSuite::M164() { * I[factor] Mix factor for extruder stepper 6 */ void GcodeSuite::M165() { - // Get mixing parameters from the GCode + // Get mixing parameters from the G-Code // The total "must" be 1.0 (but it will be normalized) // If no mix factors are given, the old mix is preserved const char mixing_codes[] = { LIST_N(MIXING_STEPPERS, 'A', 'B', 'C', 'D', 'H', 'I') }; diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 4902cebde2eb..d519bd4e2941 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -153,7 +153,7 @@ int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) { } /** - * Set XYZ...E destination and feedrate from the current GCode command + * Set XYZ...E destination and feedrate from the current G-Code command * * - Set destination from included axis codes * - Set to current for missing axis codes @@ -459,7 +459,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // G800: GCode Parser Test for G + case 800: parser.debug(); break; // G800: G-Code Parser Test for G #endif default: parser.unknown_command_warning(); break; @@ -1035,7 +1035,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #if ENABLED(DEBUG_GCODE_PARSER) - case 800: parser.debug(); break; // M800: GCode Parser Test for M + case 800: parser.debug(); break; // M800: G-Code Parser Test for M #endif #if ENABLED(GCODE_REPEAT_MARKERS) diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 5e6e400cf1d4..61ff0b047cac 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -462,7 +462,7 @@ class GcodeSuite { */ enum MarlinBusyState : char { NOT_BUSY, // Not in a handler - IN_HANDLER, // Processing a GCode + IN_HANDLER, // Processing a G-Code IN_PROCESS, // Known to be blocking command input (as in G29) PAUSED_FOR_USER, // Blocking pending any input PAUSED_FOR_INPUT // Blocking pending text input (concept) diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index f2835f58918a..646e362517a3 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -21,7 +21,7 @@ */ /** - * parser.cpp - Parser for a GCode line, providing a parameter interface. + * parser.cpp - Parser for a G-Code line, providing a parameter interface. */ #include "parser.h" @@ -66,7 +66,7 @@ uint16_t GCodeParser::codenum; char *GCodeParser::command_args; // start of parameters #endif -// Create a global instance of the GCode parser singleton +// Create a global instance of the G-Code parser singleton GCodeParser parser; /** @@ -108,7 +108,7 @@ void GCodeParser::reset() { /** * Populate the command line state (command_letter, codenum, subcode, and string_arg) - * by parsing a single line of GCode. 58 bytes of SRAM are used to speed up seen/value. + * by parsing a single line of G-Code. 58 bytes of SRAM are used to speed up seen/value. */ void GCodeParser::parse(char *p) { @@ -317,7 +317,7 @@ void GCodeParser::parse(char *p) { #endif #if ENABLED(FASTER_GCODE_PARSER) - // Arguments MUST be uppercase for fast GCode parsing + // Arguments MUST be uppercase for fast G-Code parsing #define PARAM_OK(P) WITHIN((P), 'A', 'Z') #else #define PARAM_OK(P) true diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index c05d6f32c521..5d162c0a41c0 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -22,8 +22,8 @@ #pragma once /** - * parser.h - Parser for a GCode line, providing a parameter interface. - * Codes like M149 control the way the GCode parser behaves, + * parser.h - Parser for a G-Code line, providing a parameter interface. + * Codes like M149 control the way the G-Code parser behaves, * so settings for these codes are located in this class. */ @@ -43,7 +43,7 @@ #endif /** - * GCode parser + * G-Code parser * * - Parse a single G-code line for its letter, code, subcode, and parameters * - FASTER_GCODE_PARSER: @@ -68,7 +68,7 @@ class GCodeParser { public: - // Global states for GCode-level units features + // Global states for G-Code-level units features static bool volumetric_enabled; @@ -233,7 +233,7 @@ class GCodeParser { FORCE_INLINE static char* unescape_string(char* &src) { return src; } #endif - // Populate all fields by parsing a single line of GCode + // Populate all fields by parsing a single line of G-Code // This uses 54 bytes of SRAM to speed up seen/value static void parse(char * p); diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 25b9f5cf9b21..aa7ef99f479e 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -35,7 +35,7 @@ class GCodeQueue { */ struct SerialState { /** - * GCode line number handling. Hosts may include line numbers when sending + * G-Code line number handling. Hosts may include line numbers when sending * commands to Marlin, and lines will be checked for sequentiality. * M110 N sets the current line number. */ @@ -48,7 +48,7 @@ class GCodeQueue { static SerialState serial_state[NUM_SERIAL]; //!< Serial states for each serial port /** - * GCode Command Queue + * G-Code Command Queue * A simple (circular) ring buffer of BUFSIZE command strings. * * Commands are copied into this buffer by the command injectors diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 343252df4c7e..0b3c979d9e7d 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -4201,7 +4201,7 @@ void JyersDWIN::popupHandler(const PopupID popupid, const bool option/*=false*/) case Popup_PIDWait: drawPopup(F("PID Autotune"), F("in process"), F("Please wait until done."), Proc_Wait, ICON_BLTouch); break; case Popup_MPCWait: drawPopup(F("MPC Autotune"), F("in process"), F("Please wait until done."), Proc_Wait, ICON_BLTouch); break; case Popup_Resuming: drawPopup(F("Resuming Print"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; - case Popup_Custom: drawPopup(F("Running Custom GCode"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; + case Popup_Custom: drawPopup(F("Running Custom G-Code"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; default: break; } } diff --git a/docs/Queue.md b/docs/Queue.md index bce68b0551a7..6d4fb9d041db 100644 --- a/docs/Queue.md +++ b/docs/Queue.md @@ -19,7 +19,7 @@ Here's a basic flowchart of Marlin command processing: | Host | | SerialState RingBuffer | | | | | Marlin | NUM_SERIAL BUF_SIZE | | Marlin | +--+---+ R/TX_BUFFER_SIZE | +---+ +------------------+ | | | - | +------------+ | | | | | | | GCode | + | +------------+ | | | | | | | G-Code | | | | | | | | MAX_CMD_SIZE +-+-----> processor | | | Platform | | | | On EOL | +--------------+ | r_pos | | +-------------> serial's +-----------> +--------> | G-code | | | +-----------+ From d695e5f7bc409bc3d8ede798db5205c2c6a162f1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 12 Oct 2023 12:56:44 -0500 Subject: [PATCH 098/268] =?UTF-8?q?=F0=9F=94=A7=20Misc.=20probe=20opts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 14 +++++------ Marlin/src/inc/Conditionals_LCD.h | 29 ++++++++++++++++++++-- Marlin/src/inc/Conditionals_post.h | 9 +++---- Marlin/src/lcd/menu/menu_configuration.cpp | 6 ++--- 4 files changed, 40 insertions(+), 18 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 2fddb8ae3126..821f34cf4cda 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1633,16 +1633,16 @@ * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. */ -#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow -#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points -#define Z_CLEARANCE_MULTI_PROBE 5 // Z Clearance between multiple probes -//#define Z_AFTER_PROBING 5 // Z position after probing is done +#define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow +#define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points +#define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes +//#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done -#define Z_PROBE_LOW_POINT -2 // Farthest distance below the trigger-point to go before stopping +#define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping // For M851 give a range for adjusting the Z probe offset -#define Z_PROBE_OFFSET_RANGE_MIN -20 -#define Z_PROBE_OFFSET_RANGE_MAX 20 +#define Z_PROBE_OFFSET_RANGE_MIN -20 // (mm) +#define Z_PROBE_OFFSET_RANGE_MAX 20 // (mm) // Enable the M48 repeatability test to test probe accuracy //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 9693ed4c4339..6d45a6c3091e 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1439,8 +1439,11 @@ #if ANY(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE) #define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe #endif - #ifndef Z_PROBE_LOW_POINT - #define Z_PROBE_LOW_POINT -5 + #ifndef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_BETWEEN_PROBES 5 + #endif + #ifndef Z_CLEARANCE_MULTI_PROBE + #define Z_CLEARANCE_MULTI_PROBE 5 #endif #if MULTIPLE_PROBING > 1 #if EXTRA_PROBING > 0 @@ -1454,6 +1457,28 @@ #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN #undef USE_PROBE_FOR_Z_HOMING #undef Z_MIN_PROBE_REPEATABILITY_TEST + #undef HOMING_Z_WITH_PROBE + #undef Z_CLEARANCE_MULTI_PROBE + #undef MULTIPLE_PROBING + #undef EXTRA_PROBING + #undef Z_CLEARANCE_DEPLOY_PROBE + #undef Z_PROBE_OFFSET_RANGE_MIN + #undef Z_PROBE_OFFSET_RANGE_MAX + #undef PAUSE_BEFORE_DEPLOY_STOW + #undef PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED + #undef PROBING_HEATERS_OFF + #undef WAIT_FOR_BED_HEATER + #undef WAIT_FOR_HOTEND + #undef PROBING_STEPPERS_OFF + #undef DELAY_BEFORE_PROBING + #undef PREHEAT_BEFORE_PROBING + #undef PROBING_NOZZLE_TEMP + #undef PROBING_BED_TEMP + #undef NOZZLE_TO_PROBE_OFFSET +#endif + +#ifndef Z_PROBE_LOW_POINT + #define Z_PROBE_LOW_POINT -5 #endif #if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 33b42e851195..ab3da7325942 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2960,9 +2960,6 @@ #ifndef NOZZLE_TO_PROBE_OFFSET #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } #endif -#else - #undef NOZZLE_TO_PROBE_OFFSET - #undef PROBING_STEPPERS_OFF #endif /** @@ -3217,10 +3214,10 @@ #endif #endif +#ifndef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_BETWEEN_PROBES Z_CLEARANCE_FOR_HOMING +#endif #if PROBE_SELECTED - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES Z_CLEARANCE_FOR_HOMING - #endif #if Z_CLEARANCE_BETWEEN_PROBES > Z_CLEARANCE_FOR_HOMING #define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_BETWEEN_PROBES #else diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 328bbe24eb0a..4677d63b696c 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -235,10 +235,10 @@ void menu_advanced_settings(); #if ENABLED(DUAL_X_CARRIAGE) EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, float(X2_HOME_POS - 25), float(X2_HOME_POS + 25), _recalc_offsets); #else - EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, -99.0, 99.0, _recalc_offsets); + EDIT_ITEM_FAST_N(float42_52, X_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].x, -99.0f, 99.0f, _recalc_offsets); #endif - EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].y, -99.0, 99.0, _recalc_offsets); - EDIT_ITEM_FAST_N(float42_52, Z_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].z, Z_PROBE_LOW_POINT, 10.0, _recalc_offsets); + EDIT_ITEM_FAST_N(float42_52, Y_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].y, -99.0f, 99.0f, _recalc_offsets); + EDIT_ITEM_FAST_N(float42_52, Z_AXIS, MSG_HOTEND_OFFSET_A, &hotend_offset[1].z, -10.0f, 10.0f, _recalc_offsets); #if ENABLED(EEPROM_SETTINGS) ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); #endif From 251a84b741c7232a84a744d8fdcb0e1f8d6951c6 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 12 Oct 2023 18:20:54 +0000 Subject: [PATCH 099/268] [cron] Bump distribution date (2023-10-12) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index bf65ebaffd81..be4d22c407c4 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-11" +//#define STRING_DISTRIBUTION_DATE "2023-10-12" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 6a5ab0d909ec..57a8104666eb 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-11" + #define STRING_DISTRIBUTION_DATE "2023-10-12" #endif /** From 7944628400273d1b78eab3ffc71aa7c07ffaaaac Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Oct 2023 09:48:14 -0500 Subject: [PATCH 100/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20IA?= =?UTF-8?q?=20Creality=20optional=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lcd/extui/ia_creality/ia_creality_rts.cpp | 214 ++++++++++-------- 1 file changed, 116 insertions(+), 98 deletions(-) diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 6246b9f00291..fdb068d32f38 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -688,7 +688,9 @@ void RTS::handleData() { return; } - constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB; + #if ENABLED(LCD_BED_TRAMMING) + constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB; + #endif switch (Checkkey) { case Printfile: @@ -785,26 +787,30 @@ void RTS::handleData() { } break; - case Zoffset: - float tmp_zprobe_offset; - if (recdat.data[0] >= 32768) - tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; - else - tmp_zprobe_offset = float(recdat.data[0]) / 100; - if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z)); - if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; - smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); - char zOffs[20], tmp1[11]; - sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); - onStatusChanged(zOffs); - } - else { - onStatusChanged(F("Requested Offset Beyond Limits")); - } + #if HAS_BED_PROBE - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - break; + case Zoffset: + float tmp_zprobe_offset; + if (recdat.data[0] >= 32768) + tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; + else + tmp_zprobe_offset = float(recdat.data[0]) / 100; + if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z)); + if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; + smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); + char zOffs[20], tmp1[11]; + sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); + onStatusChanged(zOffs); + } + else { + onStatusChanged(F("Requested Offset Beyond Limits")); + } + + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + break; + + #endif // HAS_BED_PROBE case TempControl: if (recdat.data[0] == 0) { @@ -1106,29 +1112,31 @@ void RTS::handleData() { sendData(getZOffset_mm() * 100, ProbeOffset_Z); break; } - case 2: { // Z-axis to Up - if (WITHIN((getZOffset_mm() + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); - //setZOffset_mm(getZOffset_mm() + 0.1); - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - char zOffs[20], tmp1[11]; - sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); - onStatusChanged(zOffs); + + #if HAS_BED_PROBE + + case 2: { // Z-axis to Up + if (WITHIN((getZOffset_mm() + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); + //setZOffset_mm(getZOffset_mm() + 0.1); + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3))); + } + break; } - break; - } - case 3: { // Z-axis to Down - if (WITHIN((getZOffset_mm() - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { - smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); - //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); - //setZOffset_mm(getZOffset_mm() - 0.1); - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - char zOffs[20], tmp1[11]; - sprintf_P(zOffs, PSTR("Z Offset : %s"), dtostrf(getZOffset_mm(), 1, 3, tmp1)); - onStatusChanged(zOffs); + case 3: { // Z-axis to Down + if (WITHIN((getZOffset_mm() - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); + //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); + //setZOffset_mm(getZOffset_mm() - 0.1); + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3))); + } + break; } - break; - } + + #endif // HAS_BED_PROBE + case 4: { // Assistant Level TERN_(HAS_MESH, setLevelingActive(false)); injectCommands(isPositionKnown() ? F("G1 F1000 Z0.0") : F("G28\nG1 F1000 Z0.0")); @@ -1140,7 +1148,7 @@ void RTS::handleData() { #if ENABLED(MESH_BED_LEVELING) sendData(ExchangePageBase + 93, ExchangepageAddr); #else - waitway = 3; // only for prohibiting to receive massage + waitway = 3; // Only for prohibiting to receive message sendData(3, AutolevelIcon); uint8_t abl_probe_index = 0; while (abl_probe_index < 25) { @@ -1153,65 +1161,74 @@ void RTS::handleData() { break; } - case 6: { // Assitant Level , Centre 1 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); - setAxisPosition_mm(X_CENTER, axis_t(X)); - setAxisPosition_mm(Y_CENTER, axis_t(Y)); - waitway = 6; - break; - } - case 7: { // Assitant Level , Front Left 2 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); - setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); - setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); - waitway = 6; - break; - } - case 8: { // Assitant Level , Front Right 3 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); - setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); - setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); - waitway = 6; - break; - } - case 9: { // Assitant Level , Back Right 4 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); - setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); - setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); - waitway = 6; - break; - } - case 10: { // Assitant Level , Back Left 5 - setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); - setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); - setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); - waitway = 6; - break; - } + #if ENABLED(LCD_BED_TRAMMING) + case 6: { // Bed Tramming, Centre 1 + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_CENTER, axis_t(X)); + setAxisPosition_mm(Y_CENTER, axis_t(Y)); + waitway = 6; + break; + } + case 7: { // Bed Tramming, Front Left 2 + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); + setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); + waitway = 6; + break; + } + case 8: { // Bed Tramming, Front Right 3 + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); + setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y)); + waitway = 6; + break; + } + case 9: { // Bed Tramming, Back Right 4 + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X)); + setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); + waitway = 6; + break; + } + case 10: { // Bed Tramming, Back Left 5 + setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z)); + setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X)); + setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y)); + waitway = 6; + break; + } + #endif // LCD_BED_TRAMMING + case 11: { // Autolevel switch #if HAS_MESH const bool gla = !getLevelingActive(); setLevelingActive(gla); sendData(gla ? 3 : 2, AutoLevelIcon); #endif - sendData(getZOffset_mm() * 100, ProbeOffset_Z); - break; - } - case 12: { - injectCommands(F("G26R255")); - onStatusChanged(F("Beginning G26.. Heating")); - break; - } - case 13: { - injectCommands(F("G29S1")); - onStatusChanged(F("Begin Manual Mesh")); - break; - } - case 14: { - injectCommands(F("G29S2")); - onStatusChanged(F("Moving to Next Mesh Point")); + #if HAS_BED_PROBE + sendData(getZOffset_mm() * 100, ProbeOffset_Z); + #endif break; } + #if ENABLED(G26_MESH_VALIDATION) + case 12: { + injectCommands(F("G26R255")); + onStatusChanged(F("Beginning G26.. Heating")); + break; + } + #endif + #if ENABLED(MESH_BED_LEVELING) + case 13: { + injectCommands(F("G29S1")); + onStatusChanged(F("Begin Manual Mesh")); + break; + } + case 14: { + injectCommands(F("G29S2")); + onStatusChanged(F("Moving to Next Mesh Point")); + break; + } + #endif case 15: { injectCommands(F("M211S0\nG91\nG1Z-0.025\nG90\nM211S1")); onStatusChanged(F("Moved down 0.025")); @@ -1422,13 +1439,14 @@ void RTS::handleData() { break; } - case 5: { - #if ENABLED(PIDTEMPBED) + #if ENABLED(PIDTEMPBED) + case 5: { onStatusChanged(F("Bed PID Started")); startBedPIDTune(static_cast(pid_bedAutoTemp)); - #endif - break; - } + break; + } + #endif + case 6: { injectCommands(F("M500")); break; From 87de4c134b7e9eb8a845987e666fbf4589a2a92a Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 13 Oct 2023 18:06:12 +0000 Subject: [PATCH 101/268] [cron] Bump distribution date (2023-10-13) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index be4d22c407c4..13c0d819a434 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-12" +//#define STRING_DISTRIBUTION_DATE "2023-10-13" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 57a8104666eb..00bbffd7c54c 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-12" + #define STRING_DISTRIBUTION_DATE "2023-10-13" #endif /** From 6a35ab6557f8450845379c90724dc14b55be4b0c Mon Sep 17 00:00:00 2001 From: Marcio T Date: Sat, 14 Oct 2023 22:54:54 -0600 Subject: [PATCH 102/268] =?UTF-8?q?=E2=9C=A8=20Z=5FPROBE=5FERROR=5FTOLERAN?= =?UTF-8?q?CE=20(expose)=20(#26229)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 1 + Marlin/src/inc/Conditionals_LCD.h | 8 +++++++- Marlin/src/module/probe.cpp | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 821f34cf4cda..33810011cfbf 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1636,6 +1636,7 @@ #define Z_CLEARANCE_DEPLOY_PROBE 10 // (mm) Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // (mm) Z Clearance between probe points #define Z_CLEARANCE_MULTI_PROBE 5 // (mm) Z Clearance between multiple probes +#define Z_PROBE_ERROR_TOLERANCE 3 // (mm) Tolerance for early trigger (<= -probe.offset.z + ZPET) //#define Z_AFTER_PROBING 5 // (mm) Z position after probing is done #define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 6d45a6c3091e..2706ca507084 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1445,6 +1445,9 @@ #ifndef Z_CLEARANCE_MULTI_PROBE #define Z_CLEARANCE_MULTI_PROBE 5 #endif + #ifndef Z_PROBE_ERROR_TOLERANCE + #define Z_PROBE_ERROR_TOLERANCE Z_CLEARANCE_MULTI_PROBE + #endif #if MULTIPLE_PROBING > 1 #if EXTRA_PROBING > 0 #define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING) @@ -1459,9 +1462,9 @@ #undef Z_MIN_PROBE_REPEATABILITY_TEST #undef HOMING_Z_WITH_PROBE #undef Z_CLEARANCE_MULTI_PROBE + #undef Z_PROBE_ERROR_TOLERANCE #undef MULTIPLE_PROBING #undef EXTRA_PROBING - #undef Z_CLEARANCE_DEPLOY_PROBE #undef Z_PROBE_OFFSET_RANGE_MIN #undef Z_PROBE_OFFSET_RANGE_MAX #undef PAUSE_BEFORE_DEPLOY_STOW @@ -1477,6 +1480,9 @@ #undef NOZZLE_TO_PROBE_OFFSET #endif +#ifndef Z_CLEARANCE_DEPLOY_PROBE + #define Z_CLEARANCE_DEPLOY_PROBE 10 +#endif #ifndef Z_PROBE_LOW_POINT #define Z_PROBE_LOW_POINT -5 #endif diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index 989965d6d884..deeb53942ba3 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -735,7 +735,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) { * * @param sanity_check Flag to compare the probe result with the expected result * based on the probe Z offset. If the result is too far away - * (more than 2mm too early) then consider it an error. + * (more than Z_PROBE_ERROR_TOLERANCE too early) then throw an error. * @param z_min_point Override the minimum probing height (-2mm), to allow deeper probing. * @param z_clearance Z clearance to apply on probe failure. * @@ -747,7 +747,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/, const_float_t z_min_p const float zoffs = SUM_TERN(HAS_HOTEND_OFFSET, -offset.z, hotend_offset[active_extruder].z); auto try_to_probe = [&](PGM_P const plbl, const_float_t z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck) -> bool { - constexpr float error_tolerance = 2.0f; + constexpr float error_tolerance = Z_PROBE_ERROR_TOLERANCE; if (DEBUGGING(LEVELING)) { DEBUG_ECHOPGM_P(plbl); DEBUG_ECHOLNPGM("> try_to_probe(..., ", z_probe_low_point, ", ", fr_mm_s, ", ...)"); From caca5636cec69ba3afe28353abecc218dd8c05fa Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 15 Oct 2023 06:05:56 +0000 Subject: [PATCH 103/268] [cron] Bump distribution date (2023-10-15) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 13c0d819a434..39b7f540a818 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-13" +//#define STRING_DISTRIBUTION_DATE "2023-10-15" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 00bbffd7c54c..1ce568402db3 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-13" + #define STRING_DISTRIBUTION_DATE "2023-10-15" #endif /** From cacbe005b53dd833a5300c1e6636d917583d7fd3 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Thu, 19 Oct 2023 19:01:43 -0400 Subject: [PATCH 104/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ProUI=20G-code=20p?= =?UTF-8?q?review=20(#26213)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/gcode_preview.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp index 30c6f9f1f6c2..e6e8384d9065 100644 --- a/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp +++ b/Marlin/src/lcd/e3v2/proui/gcode_preview.cpp @@ -63,14 +63,14 @@ typedef struct { } 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; + name[0] = '\0'; + thumbstart = 0; + thumbsize = 0; + thumbheight = thumbwidth = 0; + time = 0; + filament = 0; + layer = 0; + height = width = length = 0; } } fileprop_t; From 6156050024d1edfa59c1d6e1955c50706396b589 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 20 Oct 2023 00:20:00 +0000 Subject: [PATCH 105/268] [cron] Bump distribution date (2023-10-20) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 39b7f540a818..eb6dce0bfd8d 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-15" +//#define STRING_DISTRIBUTION_DATE "2023-10-20" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 1ce568402db3..c7200e2ebc23 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-15" + #define STRING_DISTRIBUTION_DATE "2023-10-20" #endif /** From 0f27e38eb92396b49a60f9d51cf0afa9527f3518 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:34:22 +1300 Subject: [PATCH 106/268] =?UTF-8?q?=F0=9F=8E=A8=20Update=20GT2560=20V41b?= =?UTF-8?q?=20(#26351)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 2 +- Marlin/src/pins/mega/pins_GT2560_V41b.h | 59 ++++++++++++------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 629ae734317e..8715b49fc0bb 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -396,7 +396,7 @@ #define BOARD_ZONESTAR_ZM3E4V2 5064 // Zonestar ZM3E4 V2 (STM32F103VC) #define BOARD_ERYONE_ERY32_MINI 5065 // Eryone Ery32 mini (STM32F103VE) #define BOARD_PANDA_PI_V29 5066 // Panda Pi V2.9 - Standalone (STM32F103RC) -#define BOARD_SOVOL_V131 5067 // Sovol V1.3.1 (GD32F103RET6) +#define BOARD_SOVOL_V131 5067 // Sovol V1.3.1 (GD32F103RE) #define BOARD_TRIGORILLA_V006 5068 // Trigorilla V0.0.6 (GD32F103RE) #define BOARD_KEDI_CONTROLLER_V1_2 5069 // EDUTRONICS Kedi Controller V1.2 (STM32F103RC) diff --git a/Marlin/src/pins/mega/pins_GT2560_V41b.h b/Marlin/src/pins/mega/pins_GT2560_V41b.h index 03a82ca2f224..449f246b19b9 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V41b.h +++ b/Marlin/src/pins/mega/pins_GT2560_V41b.h @@ -204,45 +204,44 @@ * (LCM_D5) 21 | 5 6 | GND * (LCM_D4) 16 | 7 8 | 17 (LCM_EN) * (EC_PRESS) 19 | 9 10 | GND - * (RESET) |11 12 | 19 (BEEP) + * (RESET) |11 12 | 18 (BEEP) * ------ * H2 */ -#define LCM_D4 16 // Used as BTN_EN1 for YHCB2004 LCD Module -#define LCM_D5 21 // YHCB2004_SCK_PIN -#define LCM_D6 5 // YHCB2004_SS_PIN -#define LCM_D7 36 // YHCB2004_MOSI_PIN -#define LCM_EN 17 // BTN_EN2 -#define EC_PRESS 19 // BTN_ENC -#define BEEP 18 +//#define H2_01_PIN 5V +//#define H2_02_PIN GND +#define H2_03_PIN 36 // LCM_D7 +#define H2_04_PIN 5 // LCM_D6 +#define H2_05_PIN 21 // LCM_D5 +//#define H2_06_PIN GND +#define H2_07_PIN 16 // LCM_D4 +#define H2_08_PIN 17 // LCM_EN +#define H2_09_PIN 19 // EC_PRESS +//#define H2_10_PIN GND +//#define H2_11_PIN RESET +#define H2_12_PIN 18 // BEEP -#define BEEPER_PIN BEEP #define LCM_RS 20 // Pin named and connected to 10k pull-up resistor but unused #if ENABLED(YHCB2004) - #define YHCB2004_SS_PIN LCM_D6 - #define YHCB2004_SCK_PIN LCM_D5 - #define YHCB2004_MOSI_PIN LCM_D7 + #define YHCB2004_SS_PIN H2_04_PIN + #define YHCB2004_SCK_PIN H2_05_PIN + #define YHCB2004_MOSI_PIN H2_03_PIN #define YHCB2004_MISO_PIN LCM_RS // Unused on V4.1b board + #define BTN_EN1 H2_07_PIN + #define BTN_EN2 H2_08_PIN + #define BTN_ENC H2_09_PIN + #define BEEPER_PIN H2_12_PIN +#elif ENABLED(CR10_STOCKDISPLAY) // Firmware compatible with stock GT 128x64 12pin LCD for the V41b + #define LCD_PINS_RS H2_04_PIN // DOGLCD_CS + #define LCD_PINS_D4 H2_05_PIN // DOGLCD_SCK + #define LCD_PINS_EN H2_03_PIN // DOGLCD_MOSI + #define BTN_EN1 H2_07_PIN + #define BTN_EN2 H2_08_PIN + #define BTN_ENC H2_09_PIN + #define BEEPER_PIN H2_12_PIN #elif HAS_WIRED_LCD #error "GT2560 V4.1b requires an adapter for common LCDs." - /* Cannot use because V4.1b board has not LCD_PINS_RS wired to display connector - #define LCD_PINS_RS 20 - #define LCD_PINS_EN 17 - #define LCD_PINS_D4 16 - #define LCD_PINS_D5 21 - #define LCD_PINS_D6 5 - #define LCD_PINS_D7 36 - //*/ -#endif - -#if ENABLED(YHCB2004) - #define BTN_EN1 LCM_D4 - #define BTN_EN2 LCM_EN - #define BTN_ENC EC_PRESS -#elif IS_NEWPANEL - #define BTN_EN1 42 - #define BTN_EN2 40 - #define BTN_ENC 19 + /* Cannot use because V4.1b board has not LCD_PINS_RS wired to display connector */ #endif From 6d3122d4e8525dea64cf83a98354a95f2a1d9a29 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Thu, 19 Oct 2023 21:22:04 -0400 Subject: [PATCH 107/268] =?UTF-8?q?=F0=9F=9A=B8=20Misc.=20JyersUI=20tweaks?= =?UTF-8?q?=20(#26228)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/lcd/e3v2/common/dwin_set.h | 6 + Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 717 +++++++++++++++----------- Marlin/src/lcd/e3v2/jyersui/dwin.h | 5 +- Marlin/src/lcd/e3v2/proui/dwinui.h | 6 - Marlin/src/lcd/language/language_en.h | 1 + 5 files changed, 427 insertions(+), 308 deletions(-) diff --git a/Marlin/src/lcd/e3v2/common/dwin_set.h b/Marlin/src/lcd/e3v2/common/dwin_set.h index 7f4438695478..3601f58e133e 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_set.h +++ b/Marlin/src/lcd/e3v2/common/dwin_set.h @@ -145,3 +145,9 @@ #define ICON_ProbeOffsetZ ICON_StepZ #define ICON_PIDNozzle ICON_SetEndTemp #define ICON_PIDbed ICON_SetBedTemp +#define ICON_FWRetract ICON_StepE +#define ICON_FWRetLength ICON_StepE +#define ICON_FWRetSpeed ICON_Setspeed +#define ICON_FWRetZRaise ICON_MoveZ +#define ICON_FWRecSpeed ICON_Setspeed +#define ICON_FWRecExtra ICON_StepE diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 0b3c979d9e7d..d945db8e588c 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -91,7 +91,7 @@ #define MENU_CHAR_LIMIT 24 #define STATUS_Y 352 -#define MAX_PRINT_SPEED 500 +#define MAX_PRINT_SPEED 999 #define MIN_PRINT_SPEED 10 #if HAS_FAN @@ -111,7 +111,7 @@ #endif #if HAS_HOTEND - #define MAX_FLOW_RATE 200 + #define MAX_FLOW_RATE 299 #define MIN_FLOW_RATE 10 #define MAX_E_TEMP (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT) @@ -119,7 +119,7 @@ #endif #if HAS_HEATED_BED - #define MAX_BED_TEMP BED_MAXTEMP + #define MAX_BED_TEMP BED_MAX_TARGET #define MIN_BED_TEMP 0 #endif @@ -400,7 +400,7 @@ class TextScroller { else 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 - 3 * msg.length() - 2; - if (!(GRID_MAX_POINTS_X < 10)) + if (GRID_MAX_POINTS_X >= 10) dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px - 2 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, F(".")); dwinDrawString(false, font6x12, COLOR_WHITE, COLOR_BG_BLUE, start_x_px + 1 + offset_x, start_y_px + offset_y /*+ square / 2 - 6*/, msg); } @@ -427,7 +427,7 @@ class TextScroller { 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(GET_TEXT_F(MSG_COLORS_RED), ' ', p_float_t(v1, 3) , F("..0.."), p_float_t(v2, 3), ' ', GET_TEXT_F(MSG_COLORS_GREEN))); drawing_mesh = false; } @@ -580,49 +580,49 @@ void JyersDWIN::mainMenuIcons() { if (selection == 0) { dwinIconShow(ICON, ICON_Print_1, 17, 130); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 17, 130, 126, 229); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 52, 200, F("Print")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 52, 200, GET_TEXT_F(MSG_BUTTON_PRINT)); } else { dwinIconShow(ICON, ICON_Print_0, 17, 130); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 52, 200, F("Print")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 52, 200, GET_TEXT_F(MSG_BUTTON_PRINT)); } if (selection == 1) { dwinIconShow(ICON, ICON_Prepare_1, 145, 130); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 145, 130, 254, 229); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 170, 200, F("Prepare")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 170, 200, GET_TEXT_F(MSG_PREPARE)); } else { dwinIconShow(ICON, ICON_Prepare_0, 145, 130); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 170, 200, F("Prepare")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 170, 200, GET_TEXT_F(MSG_PREPARE)); } if (selection == 2) { dwinIconShow(ICON, ICON_Control_1, 17, 246); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 17, 246, 126, 345); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 43, 317, F("Control")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 43, 317, GET_TEXT_F(MSG_CONTROL)); } else { dwinIconShow(ICON, ICON_Control_0, 17, 246); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 43, 317, F("Control")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 43, 317, GET_TEXT_F(MSG_CONTROL)); } #if HAS_ABL_OR_UBL if (selection == 3) { dwinIconShow(ICON, ICON_Leveling_1, 145, 246); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 145, 246, 254, 345); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 179, 317, F("Level")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 179, 317, GET_TEXT_F(MSG_BUTTON_LEVEL)); } else { dwinIconShow(ICON, ICON_Leveling_0, 145, 246); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 179, 317, F("Level")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 179, 317, GET_TEXT_F(MSG_BUTTON_LEVEL)); } #else if (selection == 3) { dwinIconShow(ICON, ICON_Info_1, 145, 246); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 145, 246, 254, 345); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 181, 317, F("Info")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 181, 317, GET_TEXT_F(MSG_BUTTON_INFO)); } else { dwinIconShow(ICON, ICON_Info_0, 145, 246); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 181, 317, F("Info")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 181, 317, GET_TEXT_F(MSG_BUTTON_INFO)); } #endif } @@ -642,41 +642,41 @@ void JyersDWIN::printScreenIcons() { if (selection == 0) { dwinIconShow(ICON, ICON_Setup_1, 8, 252); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 8, 252, 87, 351); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 30, 322, F("Tune")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 30, 322, GET_TEXT_F(MSG_TUNE)); } else { dwinIconShow(ICON, ICON_Setup_0, 8, 252); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 30, 322, F("Tune")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 30, 322, GET_TEXT_F(MSG_TUNE)); } if (selection == 2) { dwinIconShow(ICON, ICON_Stop_1, 184, 252); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 184, 252, 263, 351); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 205, 322, F("Stop")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 205, 322, GET_TEXT_F(MSG_BUTTON_STOP)); } else { dwinIconShow(ICON, ICON_Stop_0, 184, 252); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 205, 322, F("Stop")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 205, 322, GET_TEXT_F(MSG_BUTTON_STOP)); } if (paused) { if (selection == 1) { dwinIconShow(ICON, ICON_Continue_1, 96, 252); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 96, 252, 175, 351); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, F("Print")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, GET_TEXT_F(MSG_BUTTON_PRINT)); } else { dwinIconShow(ICON, ICON_Continue_0, 96, 252); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, F("Print")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, GET_TEXT_F(MSG_BUTTON_PRINT)); } } else { if (selection == 1) { dwinIconShow(ICON, ICON_Pause_1, 96, 252); dwinDrawRectangle(0, getColor(eeprom_settings.highlight_box, COLOR_WHITE), 96, 252, 175, 351); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, F("Pause")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, GET_TEXT_F(MSG_BUTTON_PAUSE)); } else { dwinIconShow(ICON, ICON_Pause_0, 96, 252); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, F("Pause")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLUE, 114, 322, GET_TEXT_F(MSG_BUTTON_PAUSE)); } } } @@ -686,12 +686,12 @@ void JyersDWIN::drawPrintScreen() { selection = 0; clearScreen(); dwinDrawRectangle(1, COLOR_BG_BLACK, 8, 352, DWIN_WIDTH - 8, 376); - drawTitle("Printing..."); + drawTitle(GET_TEXT_F(MSG_PRINTING)); printScreenIcons(); dwinIconShow(ICON, ICON_PrintTime, 14, 171); dwinIconShow(ICON, ICON_RemainTime, 147, 169); dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLACK, 41, 163, F("Elapsed")); - dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLACK, 176, 163, F("Remaining")); + dwinDrawString(false, DWIN_FONT_MENU, COLOR_WHITE, COLOR_BG_BLACK, 176, 163, GET_TEXT_F(MSG_REMAINING_TIME)); updateStatusBar(true); drawPrintProgressBar(); drawPrintProgressElapsed(); @@ -761,7 +761,7 @@ void JyersDWIN::drawPrintConfirm() { void JyersDWIN::drawSDItem(const uint8_t item, const uint8_t row) { if (item == 0) - drawMenuItem(0, ICON_Back, card.flag.workDirIsRoot ? F("Back") : F("..")); + drawMenuItem(0, ICON_Back, card.flag.workDirIsRoot ? GET_TEXT_F(MSG_BACK) : F("..")); else { card.selectFileByIndexSorted(item - 1); char * const filename = card.longest_filename(); @@ -782,7 +782,7 @@ void JyersDWIN::drawSDItem(const uint8_t item, const uint8_t row) { void JyersDWIN::drawSDList(const bool removed/*=false*/) { clearScreen(); - drawTitle("Select File"); + drawTitle(GET_TEXT_F(MSG_MEDIA_MENU)); selection = 0; scrollpos = 0; process = Proc_File; @@ -791,9 +791,9 @@ void JyersDWIN::drawSDList(const bool removed/*=false*/) { drawSDItem(i, i); } else { - drawMenuItem(0, ICON_Back, F("Back")); + drawMenuItem(0, ICON_Back, GET_TEXT_F(MSG_BACK)); dwinDrawRectangle(1, COLOR_BG_RED, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4)); - dwinDrawString(false, font16x32, COLOR_YELLOW, COLOR_BG_RED, ((DWIN_WIDTH) - 8 * 16) / 2, MBASE(3), F("No Media")); + dwinDrawString(false, font16x32, COLOR_YELLOW, COLOR_BG_RED, ((DWIN_WIDTH) - 8 * 16) / 2, MBASE(3), GET_TEXT_F(MSG_NO_MEDIA)); } dwinDrawRectangle(1, getColor(eeprom_settings.cursor_color, COLOR_RECTANGLE), 0, MBASE(0) - 18, 14, MBASE(0) + 33); } @@ -942,13 +942,13 @@ void JyersDWIN::drawPopup(FSTR_P const line1, FSTR_P const line2, FSTR_P const l selection = 0; dwinDrawRectangle(1, COLOR_CONFIRM, 26, 280, 125, 317); dwinDrawRectangle(1, COLOR_CANCEL, 146, 280, 245, 317); - dwinDrawString(false, DWIN_FONT_STAT, COLOR_WHITE, COLOR_BG_WINDOW, 39, 290, F("Confirm")); - dwinDrawString(false, DWIN_FONT_STAT, COLOR_WHITE, COLOR_BG_WINDOW, 165, 290, F("Cancel")); + dwinDrawString(false, DWIN_FONT_STAT, COLOR_WHITE, COLOR_BG_WINDOW, 39, 290, GET_TEXT_F(MSG_BUTTON_CONFIRM)); + dwinDrawString(false, DWIN_FONT_STAT, COLOR_WHITE, COLOR_BG_WINDOW, 165, 290, GET_TEXT_F(MSG_BUTTON_CANCEL)); popupSelect(); } else if (mode == Proc_Confirm) { dwinDrawRectangle(1, COLOR_CONFIRM, 87, 280, 186, 317); - dwinDrawString(false, DWIN_FONT_STAT, COLOR_WHITE, COLOR_BG_WINDOW, 96, 290, F("Continue")); + dwinDrawString(false, DWIN_FONT_STAT, COLOR_WHITE, COLOR_BG_WINDOW, 96, 290, GET_TEXT_F(MSG_BUTTON_CONTINUE)); } } @@ -1015,14 +1015,14 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case PREHEAT_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_TempMenu, sel); break; #if HAS_HOTEND case PREHEAT_SUBMENU_HOTEND: if (draw) { - drawMenuItem(row, ICON_SetEndTemp, F("Hotend")); + drawMenuItem(row, ICON_SetEndTemp, GET_TEXT_F(MSG_NOZZLE)); drawFloat(ui.material_preset[index].hotend_temp, row, false, 1); } else @@ -1032,7 +1032,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HEATED_BED case PREHEAT_SUBMENU_BED: if (draw) { - drawMenuItem(row, ICON_SetBedTemp, F("Bed")); + drawMenuItem(row, ICON_SetBedTemp, GET_TEXT_F(MSG_BED)); drawFloat(ui.material_preset[index].bed_temp, row, false, 1); } else @@ -1042,7 +1042,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_FAN case PREHEAT_SUBMENU_FAN: if (draw) { - drawMenuItem(row, ICON_FanSpeed, F("Fan")); + drawMenuItem(row, ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED)); drawFloat(ui.material_preset[index].fan_speed, row, false, 1); } else @@ -1067,30 +1067,31 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #define PREPARE_COOLDOWN (PREPARE_PREHEAT + ANY(HAS_HOTEND, HAS_HEATED_BED)) #define PREPARE_CHANGEFIL (PREPARE_COOLDOWN + ENABLED(ADVANCED_PAUSE_FEATURE)) #define PREPARE_CUSTOM_MENU (PREPARE_CHANGEFIL + ENABLED(HAS_CUSTOM_MENU)) - #define PREPARE_TOTAL PREPARE_CUSTOM_MENU + #define PREPARE_FWRETRACT (PREPARE_CUSTOM_MENU + ENABLED(FWRETRACT)) + #define PREPARE_TOTAL PREPARE_FWRETRACT switch (item) { case PREPARE_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMainMenu(1); break; case PREPARE_MOVE: if (draw) - drawMenuItem(row, ICON_Axis, F("Move"), nullptr, true); + drawMenuItem(row, ICON_Axis, GET_TEXT_F(MSG_MOVE_AXIS), nullptr, true); else drawMenu(ID_Move); break; case PREPARE_DISABLE: if (draw) - drawMenuItem(row, ICON_CloseMotor, F("Disable Stepper")); + drawMenuItem(row, ICON_CloseMotor, GET_TEXT_F(MSG_DISABLE_STEPPERS)); else queue.inject(F("M84")); break; case PREPARE_HOME: if (draw) - drawMenuItem(row, ICON_SetHome, F("Homing"), nullptr, true); + drawMenuItem(row, ICON_SetHome, GET_TEXT_F(MSG_HOMING), nullptr, true); else drawMenu(ID_HomeMenu); break; @@ -1136,7 +1137,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HOTEND || HAS_HEATED_BED case PREPARE_COOLDOWN: if (draw) - drawMenuItem(row, ICON_Cool, F("Cooldown")); + drawMenuItem(row, ICON_Cool, GET_TEXT_F(MSG_COOLDOWN)); else thermalManager.cooldown(); break; @@ -1181,6 +1182,15 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra } break; #endif + + #if ENABLED(FWRETRACT) + case PREPARE_FWRETRACT: + if (draw) + drawMenuItem(row, ICON_SetHome, GET_TEXT_F(MSG_FWRETRACT), nullptr, true); + else + drawMenu(ID_FWMenu); + break; + #endif } break; @@ -1197,13 +1207,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case HOME_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Prepare, PREPARE_HOME); break; case HOME_ALL: if (draw) - drawMenuItem(row, ICON_Homing, F("Home All")); + drawMenuItem(row, ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME)); else { popupHandler(Popup_Home); gcode.home_all_axes(true); @@ -1212,37 +1222,37 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case HOME_X: if (draw) - drawMenuItem(row, ICON_MoveX, F("Home X")); + drawMenuItem(row, ICON_MoveX, GET_TEXT_F(MSG_AUTO_HOME_X)); else { popupHandler(Popup_Home); - gcode.process_subcommands_now(F("G28 X")); + gcode.process_subcommands_now(F("G28X")); planner.synchronize(); redrawMenu(); } break; case HOME_Y: if (draw) - drawMenuItem(row, ICON_MoveY, F("Home Y")); + drawMenuItem(row, ICON_MoveY, GET_TEXT_F(MSG_AUTO_HOME_X)); else { popupHandler(Popup_Home); - gcode.process_subcommands_now(F("G28 Y")); + gcode.process_subcommands_now(F("G28Y")); planner.synchronize(); redrawMenu(); } break; case HOME_Z: if (draw) - drawMenuItem(row, ICON_MoveZ, F("Home Z")); + drawMenuItem(row, ICON_MoveZ, GET_TEXT_F(MSG_AUTO_HOME_X)); else { popupHandler(Popup_Home); - gcode.process_subcommands_now(F("G28 Z")); + gcode.process_subcommands_now(F("G28Z")); planner.synchronize(); redrawMenu(); } break; case HOME_SET: if (draw) - drawMenuItem(row, ICON_SetHome, F("Set Home Position")); + drawMenuItem(row, ICON_SetHome, F("Set Home Here")); else { gcode.process_subcommands_now(F("G92X0Y0Z0")); audioFeedback(); @@ -1265,7 +1275,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case MOVE_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else { #if HAS_BED_PROBE probe_deployed = false; @@ -1276,7 +1286,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case MOVE_X: if (draw) { - drawMenuItem(row, ICON_MoveX, F("Move X")); + drawMenuItem(row, ICON_MoveX, GET_TEXT_F(MSG_MOVE_X)); drawFloat(current_position.x, row, false); } else @@ -1284,7 +1294,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case MOVE_Y: if (draw) { - drawMenuItem(row, ICON_MoveY, F("Move Y")); + drawMenuItem(row, ICON_MoveY, GET_TEXT_F(MSG_MOVE_Y)); drawFloat(current_position.y, row); } else @@ -1292,7 +1302,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case MOVE_Z: if (draw) { - drawMenuItem(row, ICON_MoveZ, F("Move Z")); + drawMenuItem(row, ICON_MoveZ, GET_TEXT_F(MSG_MOVE_Z)); drawFloat(current_position.z, row); } else @@ -1302,7 +1312,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HOTEND case MOVE_E: if (draw) { - drawMenuItem(row, ICON_Extruder, F("Extruder")); + drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_MOVE_E)); current_position.e = 0; sync_plan_position(); drawFloat(current_position.e, row); @@ -1341,7 +1351,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case MOVE_LIVE: if (draw) { - drawMenuItem(row, ICON_Axis, F("Live Movement")); + drawMenuItem(row, ICON_Axis, GET_TEXT_F(MSG_LIVE_MOVE)); drawCheckbox(row, livemove); } else { @@ -1376,7 +1386,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case MLEVEL_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else { TERN_(HAS_LEVELING, set_bed_leveling_enabled(level_state)); drawMenu(ID_Prepare, PREPARE_MANUALLEVEL); @@ -1507,7 +1517,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case MLEVEL_C: if (draw) - drawMenuItem(row, ICON_AxisC, F("Center")); + drawMenuItem(row, ICON_AxisC, GET_TEXT_F(MSG_TRAM_C)); else { popupHandler(Popup_MoveWait); if (use_probe) { @@ -1555,7 +1565,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case ZOFFSET_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else { liveadjust = false; TERN_(HAS_LEVELING, set_bed_leveling_enabled(level_state)); @@ -1564,7 +1574,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case ZOFFSET_HOME: if (draw) - drawMenuItem(row, ICON_Homing, F("Home Z Axis")); + drawMenuItem(row, ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME_Z)); else { popupHandler(Popup_Home); gcode.process_subcommands_now(F("G28Z")); @@ -1620,7 +1630,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case ZOFFSET_UP: if (draw) - drawMenuItem(row, ICON_Axis, F("Microstep Up")); + drawMenuItem(row, ICON_Axis, F("+0.01mm Up")); else { if (zoffsetvalue < MAX_Z_OFFSET) { if (liveadjust) { @@ -1634,7 +1644,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case ZOFFSET_DOWN: if (draw) - drawMenuItem(row, ICON_AxisD, F("Microstep Down")); + drawMenuItem(row, ICON_AxisD, F("-0.01mm Down")); else { if (zoffsetvalue > MIN_Z_OFFSET) { if (liveadjust) { @@ -1649,7 +1659,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(EEPROM_SETTINGS) case ZOFFSET_SAVE: if (draw) - drawMenuItem(row, ICON_WriteEEPROM, F("Save")); + drawMenuItem(row, ICON_WriteEEPROM, GET_TEXT_F(MSG_BUTTON_SAVE)); else audioFeedback(settings.save()); break; @@ -1677,11 +1687,10 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case PREHEAT_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Prepare, PREPARE_PREHEAT); break; - case PREHEAT_MODE: if (draw) { drawMenuItem(row, ICON_Homing, F("Preheat Mode")); @@ -1714,7 +1723,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case CHANGEFIL_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Prepare, PREPARE_CHANGEFIL); break; @@ -1776,7 +1785,6 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #endif // FILAMENT_LOAD_UNLOAD_GCODES #if HAS_CUSTOM_MENU - case ID_MenuCustom: #define CUSTOM_MENU_BACK 0 @@ -1790,7 +1798,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case CUSTOM_MENU_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Prepare, PREPARE_CUSTOM_MENU); break; @@ -1892,7 +1900,6 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #endif // Custom Menu } break; - #endif // HAS_CUSTOM_MENU case ID_Control: @@ -1903,27 +1910,27 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #define CONTROL_VISUAL (CONTROL_MOTION + 1) #define CONTROL_ADVANCED (CONTROL_VISUAL + 1) #define CONTROL_SAVE (CONTROL_ADVANCED + ENABLED(EEPROM_SETTINGS)) - #define CONTROL_RESTORE (CONTROL_SAVE + ENABLED(EEPROM_SETTINGS)) - #define CONTROL_RESET (CONTROL_RESTORE + ENABLED(EEPROM_SETTINGS)) + #define CONTROL_LOAD (CONTROL_SAVE + ENABLED(EEPROM_SETTINGS)) + #define CONTROL_RESET (CONTROL_LOAD + ENABLED(EEPROM_SETTINGS)) #define CONTROL_INFO (CONTROL_RESET + 1) #define CONTROL_TOTAL CONTROL_INFO switch (item) { case CONTROL_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMainMenu(2); break; case CONTROL_TEMP: if (draw) - drawMenuItem(row, ICON_Temperature, F("Temperature"), nullptr, true); + drawMenuItem(row, ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), nullptr, true); else drawMenu(ID_TempMenu); break; case CONTROL_MOTION: if (draw) - drawMenuItem(row, ICON_Motion, F("Motion"), nullptr, true); + drawMenuItem(row, ICON_Motion, GET_TEXT_F(MSG_MOTION), nullptr, true); else drawMenu(ID_Motion); break; @@ -1935,26 +1942,26 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case CONTROL_ADVANCED: if (draw) - drawMenuItem(row, ICON_Version, F("Advanced"), nullptr, true); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_ADVANCED_SETTINGS), nullptr, true); else drawMenu(ID_Advanced); break; #if ENABLED(EEPROM_SETTINGS) case CONTROL_SAVE: if (draw) - drawMenuItem(row, ICON_WriteEEPROM, F("Store Settings")); + drawMenuItem(row, ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM)); else audioFeedback(settings.save()); break; - case CONTROL_RESTORE: + case CONTROL_LOAD: if (draw) - drawMenuItem(row, ICON_ReadEEPROM, F("Restore Settings")); + drawMenuItem(row, ICON_ReadEEPROM, GET_TEXT_F(MSG_LOAD_EEPROM)); else audioFeedback(settings.load()); break; case CONTROL_RESET: if (draw) - drawMenuItem(row, ICON_Temperature, F("Reset to Defaults")); + drawMenuItem(row, ICON_Temperature, GET_TEXT_F(MSG_RESTORE_DEFAULTS)); else { settings.reset(); audioFeedback(); @@ -1963,7 +1970,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #endif case CONTROL_INFO: if (draw) - drawMenuItem(row, ICON_Info, F("Info")); + drawMenuItem(row, ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN)); else drawMenu(ID_Info); break; @@ -1988,14 +1995,14 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case TEMP_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Control, CONTROL_TEMP); break; #if HAS_HOTEND case TEMP_HOTEND: if (draw) { - drawMenuItem(row, ICON_SetEndTemp, F("Hotend")); + drawMenuItem(row, ICON_SetEndTemp, GET_TEXT_F(MSG_NOZZLE)); drawFloat(thermalManager.degTargetHotend(0), row, false, 1); } else @@ -2005,7 +2012,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HEATED_BED case TEMP_BED: if (draw) { - drawMenuItem(row, ICON_SetBedTemp, F("Bed")); + drawMenuItem(row, ICON_SetBedTemp, GET_TEXT_F(MSG_BED)); drawFloat(thermalManager.degTargetBed(), row, false, 1); } else @@ -2015,7 +2022,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_FAN case TEMP_FAN: if (draw) { - drawMenuItem(row, ICON_FanSpeed, F("Fan")); + drawMenuItem(row, ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED)); drawFloat(thermalManager.fan_speed[0], row, false, 1); } else @@ -2063,14 +2070,14 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case PID_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_TempMenu, TEMP_PID); break; #if ENABLED(PIDTEMP) case PID_HOTEND: if (draw) - drawMenuItem(row, ICON_HotendTemp, F("Hotend"), nullptr, true); + drawMenuItem(row, ICON_HotendTemp, GET_TEXT_F(MSG_NOZZLE), nullptr, true); else drawMenu(ID_HotendPID); break; @@ -2078,7 +2085,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(PIDTEMPBED) case PID_BED: if (draw) - drawMenuItem(row, ICON_BedTemp, F("Bed"), nullptr, true); + drawMenuItem(row, ICON_BedTemp, GET_TEXT_F(MSG_BED), nullptr, true); else drawMenu(ID_BedPID); break; @@ -2111,13 +2118,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case HOTENDPID_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_PID, PID_HOTEND); break; case HOTENDPID_TUNE: if (draw) - drawMenuItem(row, ICON_HotendTemp, F("Autotune")); + drawMenuItem(row, ICON_HotendTemp, GET_TEXT_F(MSG_PID_AUTOTUNE)); else { popupHandler(Popup_PIDWait); gcode.process_subcommands_now(TS(F("M303E0C"), PID_cycles, 'S', PID_e_temp, 'U')); @@ -2127,7 +2134,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case HOTENDPID_TEMP: if (draw) { - drawMenuItem(row, ICON_Temperature, F("Temperature")); + drawMenuItem(row, ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE)); drawFloat(PID_e_temp, row, false, 1); } else @@ -2135,7 +2142,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case HOTENDPID_KP: if (draw) { - drawMenuItem(row, ICON_Version, F("Kp Value")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_PID_P)); drawFloat(thermalManager.temp_hotend[0].pid.p(), row, false, 100); } else @@ -2143,7 +2150,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case HOTENDPID_KI: if (draw) { - drawMenuItem(row, ICON_Version, F("Ki Value")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_PID_I)); drawFloat(thermalManager.temp_hotend[0].pid.i(), row, false, 100); } else @@ -2151,7 +2158,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case HOTENDPID_KD: if (draw) { - drawMenuItem(row, ICON_Version, F("Kd Value")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_PID_D)); drawFloat(thermalManager.temp_hotend[0].pid.d(), row, false, 100); } else @@ -2177,13 +2184,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case BEDPID_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_PID, PID_BED); break; case BEDPID_TUNE: if (draw) - drawMenuItem(row, ICON_HotendTemp, F("Autotune")); + drawMenuItem(row, ICON_HotendTemp, GET_TEXT_F(MSG_PID_AUTOTUNE)); else { popupHandler(Popup_PIDWait); gcode.process_subcommands_now(TS(F("M303E-1C"), PID_cycles, 'S', PID_bed_temp, 'U')); @@ -2193,7 +2200,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case BEDPID_TEMP: if (draw) { - drawMenuItem(row, ICON_Temperature, F("Temperature")); + drawMenuItem(row, ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE)); drawFloat(PID_bed_temp, row, false, 1); } else @@ -2201,7 +2208,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case BEDPID_KP: if (draw) { - drawMenuItem(row, ICON_Version, F("Kp Value")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_PID_P)); drawFloat(thermalManager.temp_bed.pid.p(), row, false, 100); } else @@ -2209,7 +2216,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case BEDPID_KI: if (draw) { - drawMenuItem(row, ICON_Version, F("Ki Value")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_PID_I)); drawFloat(thermalManager.temp_bed.pid.i(), row, false, 100); } else @@ -2217,7 +2224,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case BEDPID_KD: if (draw) { - drawMenuItem(row, ICON_Version, F("Kd Value")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_PID_D)); drawFloat(thermalManager.temp_bed.pid.d(), row, false, 100); } else @@ -2242,7 +2249,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case MPCMENU_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_TempMenu, TEMP_MPC); break; @@ -2250,7 +2257,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(MPC_AUTOTUNE_MENU) case MPCMENU_AUTOTUNE: if (draw) - drawMenuItem(row, ICON_HotendTemp, F("Autotune")); + drawMenuItem(row, ICON_HotendTemp, GET_TEXT_F(MSG_PID_AUTOTUNE)); else { popupHandler(Popup_MPCWait); thermalManager.MPC_autotune(active_extruder, Temperature::MPCTuningType::AUTO); @@ -2262,7 +2269,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(MPC_EDIT_MENU) case MPCMENU_HEATER_POWER: if (draw) { - drawMenuItem(row, ICON_Version, F("Heater Power")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_MPC_POWER)); drawFloat(thermalManager.temp_hotend[0].mpc.heater_power, row, false, 1); } else @@ -2271,7 +2278,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case MPCMENU_BLOCK_HEAT_CAPACITY: if (draw) { - drawMenuItem(row, ICON_Version, F("Block Heat Cap.")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_MPC_BLOCK_HEAT_CAPACITY)); drawFloat(thermalManager.temp_hotend[0].mpc.block_heat_capacity, row, false, 100); } else @@ -2280,7 +2287,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case MPCMENU_SENSOR_RESPONSIVENESS: if (draw) { - drawMenuItem(row, ICON_Version, F("Sensor Resp.")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_SENSOR_RESPONSIVENESS)); drawFloat(thermalManager.temp_hotend[0].mpc.sensor_responsiveness, row, false, 10000); } else @@ -2289,7 +2296,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case MPCMENU_AMBIENT_XFER_COEFF: if (draw) { - drawMenuItem(row, ICON_Version, F("Amb. xfer coeff")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_MPC_AMBIENT_XFER_COEFF)); drawFloat(thermalManager.temp_hotend[0].mpc.ambient_xfer_coeff_fan0, row, false, 10000); } else @@ -2300,7 +2307,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case MPCMENU_AMBIENT_XFER_COEFF_FAN: { static float fan255_adjustment; if (draw) { - drawMenuItem(row, ICON_Version, F("Amb. xfer adj.")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_MPC_AMBIENT_XFER_COEFF_FAN)); fan255_adjustment = thermalManager.temp_hotend[0].fanCoefficient(); drawFloat(fan255_adjustment, row, false, 10000); } @@ -2329,57 +2336,68 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #define MOTION_JERK (MOTION_ACCEL + ENABLED(HAS_CLASSIC_JERK)) #define MOTION_STEPS (MOTION_JERK + 1) #define MOTION_FLOW (MOTION_STEPS + ENABLED(HAS_HOTEND)) - #define MOTION_TOTAL MOTION_FLOW + #define MOTION_LA (MOTION_FLOW + ENABLED(LIN_ADVANCE)) + #define MOTION_TOTAL MOTION_LA switch (item) { case MOTION_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Control, CONTROL_MOTION); break; case MOTION_HOMEOFFSETS: if (draw) - drawMenuItem(row, ICON_SetHome, F("Home Offsets"), nullptr, true); + drawMenuItem(row, ICON_SetHome, GET_TEXT_F(MSG_SET_HOME_OFFSETS), nullptr, true); else drawMenu(ID_HomeOffsets); break; case MOTION_SPEED: if (draw) - drawMenuItem(row, ICON_MaxSpeed, F("Max Speed"), nullptr, true); + drawMenuItem(row, ICON_MaxSpeed, GET_TEXT_F(MSG_MAX_SPEED), nullptr, true); else drawMenu(ID_MaxSpeed); break; case MOTION_ACCEL: if (draw) - drawMenuItem(row, ICON_MaxAccelerated, F("Max Acceleration"), nullptr, true); + drawMenuItem(row, ICON_MaxAccelerated, GET_TEXT_F(MSG_ACCELERATION), nullptr, true); else drawMenu(ID_MaxAcceleration); break; #if HAS_CLASSIC_JERK case MOTION_JERK: if (draw) - drawMenuItem(row, ICON_MaxJerk, F("Max Jerk"), nullptr, true); + drawMenuItem(row, ICON_MaxJerk, GET_TEXT_F(MSG_JERK), nullptr, true); else drawMenu(ID_MaxJerk); break; #endif case MOTION_STEPS: if (draw) - drawMenuItem(row, ICON_Step, F("Steps/mm"), nullptr, true); + drawMenuItem(row, ICON_Step, GET_TEXT_F(MSG_STEPS_PER_MM), nullptr, true); else drawMenu(ID_Steps); break; #if HAS_HOTEND case MOTION_FLOW: if (draw) { - drawMenuItem(row, ICON_Speed, F("Flow Rate")); + drawMenuItem(row, ICON_Speed, GET_TEXT_F(MSG_FLOW)); drawFloat(planner.flow_percentage[0], row, false, 1); } else modifyValue(planner.flow_percentage[0], MIN_FLOW_RATE, MAX_FLOW_RATE, 1, []{ planner.refresh_e_factor(0); }); break; #endif + #if ENABLED(LIN_ADVANCE) + case MOTION_LA: + if (draw) { + drawMenuItem(row, ICON_MaxAccelerated, GET_TEXT_F(MSG_ADVANCE_K)); + drawFloat(planner.extruder_advance_K[0], row, false, 100); + } + else + modifyValue(planner.extruder_advance_K[0], 0, 10, 100); + break; + #endif } break; @@ -2393,13 +2411,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case HOMEOFFSETS_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Motion, MOTION_HOMEOFFSETS); break; case HOMEOFFSETS_XOFFSET: if (draw) { - drawMenuItem(row, ICON_StepX, F("X Offset")); + drawMenuItem(row, ICON_StepX, GET_TEXT_F(MSG_HOME_OFFSET_X)); drawFloat(home_offset.x, row, false, 100); } else @@ -2407,7 +2425,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case HOMEOFFSETS_YOFFSET: if (draw) { - drawMenuItem(row, ICON_StepY, F("Y Offset")); + drawMenuItem(row, ICON_StepY, GET_TEXT_F(MSG_HOME_OFFSET_Y)); drawFloat(home_offset.y, row, false, 100); } else @@ -2427,14 +2445,14 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case SPEED_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Motion, MOTION_SPEED); break; #if HAS_X_AXIS case SPEED_X: if (draw) { - drawMenuItem(row, ICON_MaxSpeedX, F("X Axis")); + drawMenuItem(row, ICON_MaxSpeedX, GET_TEXT_F(MSG_VMAX_A)); drawFloat(planner.settings.max_feedrate_mm_s[X_AXIS], row, false, FEEDRATE_UNIT); } else @@ -2445,7 +2463,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_Y_AXIS case SPEED_Y: if (draw) { - drawMenuItem(row, ICON_MaxSpeedY, F("Y Axis")); + drawMenuItem(row, ICON_MaxSpeedY, GET_TEXT_F(MSG_VMAX_B)); drawFloat(planner.settings.max_feedrate_mm_s[Y_AXIS], row, false, FEEDRATE_UNIT); } else @@ -2456,7 +2474,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_Z_AXIS case SPEED_Z: if (draw) { - drawMenuItem(row, ICON_MaxSpeedZ, F("Z Axis")); + drawMenuItem(row, ICON_MaxSpeedZ, GET_TEXT_F(MSG_VMAX_C)); drawFloat(planner.settings.max_feedrate_mm_s[Z_AXIS], row, false, FEEDRATE_UNIT); } else @@ -2467,7 +2485,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HOTEND case SPEED_E: if (draw) { - drawMenuItem(row, ICON_MaxSpeedE, F("Extruder")); + drawMenuItem(row, ICON_MaxSpeedE, GET_TEXT_F(MSG_VMAX_E)); drawFloat(planner.settings.max_feedrate_mm_s[E_AXIS], row, false, FEEDRATE_UNIT); } else @@ -2480,47 +2498,53 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case ID_MaxAcceleration: #define ACCEL_BACK 0 - #define ACCEL_X (ACCEL_BACK + 1) - #define ACCEL_Y (ACCEL_X + 1) - #define ACCEL_Z (ACCEL_Y + 1) + #define ACCEL_X (ACCEL_BACK + ENABLED(HAS_X_AXIS)) + #define ACCEL_Y (ACCEL_X + ENABLED(HAS_Y_AXIS)) + #define ACCEL_Z (ACCEL_Y + ENABLED(HAS_Z_AXIS)) #define ACCEL_E (ACCEL_Z + ENABLED(HAS_HOTEND)) #define ACCEL_TOTAL ACCEL_E switch (item) { case ACCEL_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Motion, MOTION_ACCEL); break; - case ACCEL_X: - if (draw) { - drawMenuItem(row, ICON_MaxAccX, F("X Axis")); - drawFloat(planner.settings.max_acceleration_mm_per_s2[X_AXIS], row, false, ACCELERATION_UNIT); - } - else - modifyValue(planner.settings.max_acceleration_mm_per_s2[X_AXIS], min_acceleration_edit_values.x, max_acceleration_edit_values.x, ACCELERATION_UNIT); - break; - case ACCEL_Y: - if (draw) { - drawMenuItem(row, ICON_MaxAccY, F("Y Axis")); - drawFloat(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], row, false, ACCELERATION_UNIT); - } - else - modifyValue(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], min_acceleration_edit_values.y, max_acceleration_edit_values.y, ACCELERATION_UNIT); - break; - case ACCEL_Z: - if (draw) { - drawMenuItem(row, ICON_MaxAccZ, F("Z Axis")); - drawFloat(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], row, false, ACCELERATION_UNIT); - } - else - modifyValue(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], min_acceleration_edit_values.z, max_acceleration_edit_values.z, ACCELERATION_UNIT); - break; + #if HAS_X_AXIS + case ACCEL_X: + if (draw) { + drawMenuItem(row, ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A)); + drawFloat(planner.settings.max_acceleration_mm_per_s2[X_AXIS], row, false, ACCELERATION_UNIT); + } + else + modifyValue(planner.settings.max_acceleration_mm_per_s2[X_AXIS], min_acceleration_edit_values.x, max_acceleration_edit_values.x, ACCELERATION_UNIT); + break; + #endif + #if HAS_Y_AXIS + case ACCEL_Y: + if (draw) { + drawMenuItem(row, ICON_MaxAccY, GET_TEXT_F(MSG_AMAX_B)); + drawFloat(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], row, false, ACCELERATION_UNIT); + } + else + modifyValue(planner.settings.max_acceleration_mm_per_s2[Y_AXIS], min_acceleration_edit_values.y, max_acceleration_edit_values.y, ACCELERATION_UNIT); + break; + #endif + #if HAS_Z_AXIS + case ACCEL_Z: + if (draw) { + drawMenuItem(row, ICON_MaxAccZ, GET_TEXT_F(MSG_AMAX_C)); + drawFloat(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], row, false, ACCELERATION_UNIT); + } + else + modifyValue(planner.settings.max_acceleration_mm_per_s2[Z_AXIS], min_acceleration_edit_values.z, max_acceleration_edit_values.z, ACCELERATION_UNIT); + break; + #endif #if HAS_HOTEND case ACCEL_E: if (draw) { - drawMenuItem(row, ICON_MaxAccE, F("Extruder")); + drawMenuItem(row, ICON_MaxAccE, GET_TEXT_F(MSG_AMAX_E)); drawFloat(planner.settings.max_acceleration_mm_per_s2[E_AXIS], row, false, ACCELERATION_UNIT); } else @@ -2533,23 +2557,23 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case ID_MaxJerk: #define JERK_BACK 0 - #define JERK_X (JERK_BACK + 1) - #define JERK_Y (JERK_X + 1) - #define JERK_Z (JERK_Y + 1) + #define JERK_X (JERK_BACK + ENABLED(HAS_X_AXIS)) + #define JERK_Y (JERK_X + ENABLED(HAS_Y_AXIS)) + #define JERK_Z (JERK_Y + ENABLED(HAS_Z_AXIS)) #define JERK_E (JERK_Z + ENABLED(HAS_HOTEND)) #define JERK_TOTAL JERK_E switch (item) { case JERK_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Motion, MOTION_JERK); break; #if HAS_X_AXIS case JERK_X: if (draw) { - drawMenuItem(row, ICON_MaxSpeedJerkX, F("X Axis")); + drawMenuItem(row, ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK)); drawFloat(planner.max_jerk.x, row, false, JERK_UNIT); } else @@ -2559,7 +2583,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_Y_AXIS case JERK_Y: if (draw) { - drawMenuItem(row, ICON_MaxSpeedJerkY, F("Y Axis")); + drawMenuItem(row, ICON_MaxSpeedJerkY, GET_TEXT_F(MSG_VB_JERK)); drawFloat(planner.max_jerk.y, row, false, JERK_UNIT); } else @@ -2569,7 +2593,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_Z_AXIS case JERK_Z: if (draw) { - drawMenuItem(row, ICON_MaxSpeedJerkZ, F("Z Axis")); + drawMenuItem(row, ICON_MaxSpeedJerkZ, GET_TEXT_F(MSG_VC_JERK)); drawFloat(planner.max_jerk.z, row, false, JERK_UNIT); } else @@ -2579,7 +2603,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HOTEND case JERK_E: if (draw) { - drawMenuItem(row, ICON_MaxSpeedJerkE, F("Extruder")); + drawMenuItem(row, ICON_MaxSpeedJerkE, GET_TEXT_F(MSG_VE_JERK)); drawFloat(planner.max_jerk.e, row, false, JERK_UNIT); } else @@ -2592,23 +2616,23 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case ID_Steps: #define STEPS_BACK 0 - #define STEPS_X (STEPS_BACK + 1) - #define STEPS_Y (STEPS_X + 1) - #define STEPS_Z (STEPS_Y + 1) + #define STEPS_X (STEPS_BACK + ENABLED(HAS_X_AXIS)) + #define STEPS_Y (STEPS_X + ENABLED(HAS_Y_AXIS)) + #define STEPS_Z (STEPS_Y + ENABLED(HAS_Z_AXIS)) #define STEPS_E (STEPS_Z + ENABLED(HAS_HOTEND)) #define STEPS_TOTAL STEPS_E switch (item) { case STEPS_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Motion, MOTION_STEPS); break; #if HAS_X_AXIS case STEPS_X: if (draw) { - drawMenuItem(row, ICON_StepX, F("X Axis")); + drawMenuItem(row, ICON_StepX, GET_TEXT_F(MSG_A_STEPS)); drawFloat(planner.settings.axis_steps_per_mm[X_AXIS], row, false, STEPS_UNIT); } else @@ -2618,7 +2642,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_Y_AXIS case STEPS_Y: if (draw) { - drawMenuItem(row, ICON_StepY, F("Y Axis")); + drawMenuItem(row, ICON_StepY, GET_TEXT_F(MSG_B_STEPS)); drawFloat(planner.settings.axis_steps_per_mm[Y_AXIS], row, false, STEPS_UNIT); } else @@ -2628,7 +2652,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_Z_AXIS case STEPS_Z: if (draw) { - drawMenuItem(row, ICON_StepZ, F("Z Axis")); + drawMenuItem(row, ICON_StepZ, GET_TEXT_F(MSG_C_STEPS)); drawFloat(planner.settings.axis_steps_per_mm[Z_AXIS], row, false, STEPS_UNIT); } else @@ -2638,7 +2662,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HOTEND case STEPS_E: if (draw) { - drawMenuItem(row, ICON_StepE, F("Extruder")); + drawMenuItem(row, ICON_StepE, GET_TEXT_F(MSG_E_STEPS)); drawFloat(planner.settings.axis_steps_per_mm[E_AXIS], row, false, STEPS_UNIT); } else @@ -2660,19 +2684,19 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case VISUAL_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Control, CONTROL_VISUAL); break; case VISUAL_BACKLIGHT: if (draw) - drawMenuItem(row, ICON_Brightness, F("Display Off")); + drawMenuItem(row, ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS_OFF)); else ui.set_brightness(0); break; case VISUAL_BRIGHTNESS: if (draw) { - drawMenuItem(row, ICON_Brightness, F("LCD Brightness")); + drawMenuItem(row, ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS)); drawFloat(ui.brightness, row, false, 1); } else @@ -2716,7 +2740,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case COLORSETTINGS_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Visual, VISUAL_COLOR_THEMES); break; @@ -2830,7 +2854,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case ADVANCED_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Control, CONTROL_ADVANCED); break; @@ -2838,7 +2862,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(SOUND_MENU_ITEM) case ADVANCED_BEEPER: if (draw) { - drawMenuItem(row, ICON_Version, F("LCD Beeper")); + drawMenuItem(row, ICON_Version, GET_TEXT_F(MSG_SOUND)); drawCheckbox(row, ui.sound_on); } else { @@ -2878,7 +2902,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(LIN_ADVANCE) case ADVANCED_LA: if (draw) { - drawMenuItem(row, ICON_MaxAccelerated, F("Lin Advance K")); + drawMenuItem(row, ICON_MaxAccelerated, GET_TEXT_F(MSG_ADVANCE_K)); drawFloat(planner.extruder_advance_K[0], row, false, 100); } else @@ -2921,7 +2945,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(FILAMENT_RUNOUT_SENSOR) case ADVANCED_FILSENSORENABLED: if (draw) { - drawMenuItem(row, ICON_Extruder, F("Filament Sensor")); + drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR)); drawCheckbox(row, runout.enabled); } else { @@ -2933,7 +2957,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE) case ADVANCED_FILSENSORDISTANCE: if (draw) { - drawMenuItem(row, ICON_MaxAccE, F("Runout Distance")); + drawMenuItem(row, ICON_MaxAccE, GET_TEXT_F(MSG_RUNOUT_DISTANCE_MM)); drawFloat(runout.runout_distance(), row, false, 10); } else @@ -2945,7 +2969,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ENABLED(POWER_LOSS_RECOVERY) case ADVANCED_POWER_LOSS: if (draw) { - drawMenuItem(row, ICON_Motion, F("Power-loss recovery")); + drawMenuItem(row, ICON_Motion, GET_TEXT_F(MSG_OUTAGE_RECOVERY)); drawCheckbox(row, recovery.enabled); } else { @@ -2972,7 +2996,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case PROBE_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Advanced, ADVANCED_PROBE); break; @@ -3028,7 +3052,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TMC_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Advanced, ADVANCED_TMC); break; @@ -3039,7 +3063,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra static float stepper_current_x; if (draw) { - drawMenuItem(row, ICON_StepX, F("Stepper X current")); + drawMenuItem(row, ICON_StepX, GET_TEXT_F(MSG_TMC_ACURRENT)); stepper_current_x = stepperX.getMilliamps(); drawFloat(stepper_current_x, row, false, 1); } @@ -3053,7 +3077,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TMC_STEPPER_CURRENT_Y: static float stepper_current_y; if (draw) { - drawMenuItem(row, ICON_StepY, F("Stepper Y current")); + drawMenuItem(row, ICON_StepY, GET_TEXT_F(MSG_TMC_BCURRENT)); stepper_current_y = stepperY.getMilliamps(); drawFloat(stepper_current_y, row, false, 1); } @@ -3067,7 +3091,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TMC_STEPPER_CURRENT_Z: static float stepper_current_z; if (draw) { - drawMenuItem(row, ICON_StepZ, F("Stepper Z current")); + drawMenuItem(row, ICON_StepZ, GET_TEXT_F(MSG_TMC_CCURRENT)); stepper_current_z = stepperZ.getMilliamps(); drawFloat(stepper_current_z, row, false, 1); } @@ -3081,7 +3105,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TMC_STEPPER_CURRENT_E: static float stepper_current_e; if (draw) { - drawMenuItem(row, ICON_StepE, F("Stepper E current")); + drawMenuItem(row, ICON_StepE, GET_TEXT_F(MSG_TMC_ECURRENT)); stepper_current_e = stepperE0.getMilliamps(); drawFloat(stepper_current_e, row, false, 1); } @@ -3107,7 +3131,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case INFO_BACK: if (draw) { - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); #if ENABLED(PRINTCOUNTER) @@ -3159,13 +3183,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case LEVELING_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMainMenu(3); break; case LEVELING_ACTIVE: if (draw) { - drawMenuItem(row, ICON_StockConfiguration, F("Leveling Active")); + drawMenuItem(row, ICON_StockConfiguration, GET_TEXT_F(MSG_BED_LEVELING)); drawCheckbox(row, planner.leveling_active); } else { @@ -3184,18 +3208,14 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if ALL(HAS_BED_PROBE, AUTO_BED_LEVELING_UBL) case LEVELING_GET_TILT: if (draw) - drawMenuItem(row, ICON_Tilt, F("Autotilt Current Mesh")); + drawMenuItem(row, ICON_Tilt, GET_TEXT_F(MSG_UBL_TILT_MESH)); else { - if (bedlevel.storage_slot < 0) { - popupHandler(Popup_MeshSlot); - break; - } + if (bedlevel.storage_slot < 0) { popupHandler(Popup_MeshSlot); break; } popupHandler(Popup_Home); gcode.home_all_axes(true); popupHandler(Popup_Level); - if (mesh_conf.tilt_grid > 1) { + if (mesh_conf.tilt_grid > 1) gcode.process_subcommands_now(TS(F("G29J"), mesh_conf.tilt_grid)); - } else gcode.process_subcommands_now(F("G29J")); planner.synchronize(); @@ -3307,41 +3327,41 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra drawMenu(ID_LevelSettings); break; #if ENABLED(AUTO_BED_LEVELING_UBL) - case LEVELING_SLOT: - if (draw) { - drawMenuItem(row, ICON_PrintSize, F("Mesh Slot")); - drawFloat(bedlevel.storage_slot, row, false, 1); - } - else - modifyValue(bedlevel.storage_slot, 0, settings.calc_num_meshes() - 1, 1); - break; - case LEVELING_LOAD: - if (draw) - drawMenuItem(row, ICON_ReadEEPROM, F("Load Mesh")); - else { - if (bedlevel.storage_slot < 0) { - popupHandler(Popup_MeshSlot); - break; + case LEVELING_SLOT: + if (draw) { + drawMenuItem(row, ICON_PrintSize, GET_TEXT_F(MSG_UBL_STORAGE_SLOT)); + drawFloat(bedlevel.storage_slot, row, false, 1); } - gcode.process_subcommands_now(F("G29 L")); - planner.synchronize(); - audioFeedback(true); - } - break; - case LEVELING_SAVE: - if (draw) - drawMenuItem(row, ICON_WriteEEPROM, F("Save Mesh")); - else { - if (bedlevel.storage_slot < 0) { - popupHandler(Popup_MeshSlot); - break; + else + modifyValue(bedlevel.storage_slot, 0, settings.calc_num_meshes() - 1, 1); + break; + case LEVELING_LOAD: + if (draw) + drawMenuItem(row, ICON_ReadEEPROM, GET_TEXT_F(MSG_UBL_LOAD_MESH)); + else { + if (bedlevel.storage_slot < 0) { + popupHandler(Popup_MeshSlot); + break; + } + gcode.process_subcommands_now(F("G29 L")); + planner.synchronize(); + audioFeedback(true); } - gcode.process_subcommands_now(F("G29 S")); - planner.synchronize(); - audioFeedback(true); - } - break; - #endif + break; + case LEVELING_SAVE: + if (draw) + drawMenuItem(row, ICON_WriteEEPROM, GET_TEXT_F(MSG_UBL_SAVE_MESH)); + else { + if (bedlevel.storage_slot < 0) { + popupHandler(Popup_MeshSlot); + break; + } + gcode.process_subcommands_now(F("G29 S")); + planner.synchronize(); + audioFeedback(true); + } + break; + #endif // AUTO_BED_LEVELING_UBL } break; @@ -3356,7 +3376,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case LEVELING_VIEW_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Leveling, LEVELING_VIEW); break; @@ -3402,13 +3422,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case LEVELING_SETTINGS_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawMenu(ID_Leveling, LEVELING_SETTINGS); break; case LEVELING_SETTINGS_FADE: if (draw) { - drawMenuItem(row, ICON_Fade, F("Fade Mesh within")); + drawMenuItem(row, ICON_Fade, GET_TEXT_F(MSG_Z_FADE_HEIGHT)); drawFloat(planner.z_fade_height, row, false, 1); } else { @@ -3439,13 +3459,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case LEVELING_SETTINGS_ZERO: if (draw) - drawMenuItem(row, ICON_Mesh, F("Zero Current Mesh")); + drawMenuItem(row, ICON_Mesh, F("Mesh Zero")); else ZERO(bedlevel.z_values); break; case LEVELING_SETTINGS_UNDEF: if (draw) - drawMenuItem(row, ICON_Mesh, F("Clear Current Mesh")); + drawMenuItem(row, ICON_Mesh, GET_TEXT_F(MSG_MESH_RESET)); else bedlevel.invalidate(); break; @@ -3459,7 +3479,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra if (item == MESHVIEW_BACK) { if (draw) { - drawMenuItem(0, ICON_Back, F("Back")); + drawMenuItem(0, ICON_Back, GET_TEXT_F(MSG_BACK)); mesh_conf.drawBedMesh(); mesh_conf.setMeshViewerStatus(); } @@ -3486,7 +3506,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case LEVELING_M_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else { set_bed_leveling_enabled(level_state); TERN_(AUTO_BED_LEVELING_BILINEAR, bedlevel.refresh_bed_level()); @@ -3495,7 +3515,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case LEVELING_M_X: if (draw) { - drawMenuItem(row, ICON_MoveX, F("Mesh Point X")); + drawMenuItem(row, ICON_MoveX, GET_TEXT_F(MSG_MESH_X)); drawFloat(mesh_conf.mesh_x, row, 0, 1); } else @@ -3503,7 +3523,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case LEVELING_M_Y: if (draw) { - drawMenuItem(row, ICON_MoveY, F("Mesh Point Y")); + drawMenuItem(row, ICON_MoveY, GET_TEXT_F(MSG_MESH_Y)); drawFloat(mesh_conf.mesh_y, row, 0, 1); } else @@ -3511,7 +3531,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case LEVELING_M_NEXT: if (draw) - drawMenuItem(row, ICON_More, F("Next Point")); + drawMenuItem(row, ICON_More, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT)); else { if (mesh_conf.mesh_x != (GRID_MAX_POINTS_X - 1) || mesh_conf.mesh_y != (GRID_MAX_POINTS_Y - 1)) { if ((mesh_conf.mesh_x == (GRID_MAX_POINTS_X - 1) && mesh_conf.mesh_y % 2 == 0) || (mesh_conf.mesh_x == 0 && mesh_conf.mesh_y % 2 == 1)) @@ -3526,7 +3546,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case LEVELING_M_OFFSET: if (draw) { - drawMenuItem(row, ICON_SetZOffset, F("Point Z Offset")); + drawMenuItem(row, ICON_SetZOffset, GET_TEXT_F(MSG_MESH_EDIT_Z)); drawFloat(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); } else { @@ -3537,7 +3557,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case LEVELING_M_UP: if (draw) - drawMenuItem(row, ICON_Axis, F("Microstep Up")); + drawMenuItem(row, ICON_Axis, F("+0.01mm Up")); else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; gcode.process_subcommands_now(F("M290 Z0.01")); @@ -3549,7 +3569,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case LEVELING_M_DOWN: if (draw) - drawMenuItem(row, ICON_AxisD, F("Microstep Down")); + drawMenuItem(row, ICON_AxisD, F("-0.01mm Down")); else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; gcode.process_subcommands_now(F("M290 Z-0.01")); @@ -3572,14 +3592,14 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra } break; #if ENABLED(AUTO_BED_LEVELING_UBL) - case LEVELING_M_UNDEF: - if (draw) - drawMenuItem(row, ICON_ResumeEEPROM, F("Clear Point Value")); - else { - mesh_conf.manualValueUpdate(true); - redrawMenu(false); - } - break; + case LEVELING_M_UNDEF: + if (draw) + drawMenuItem(row, ICON_ResumeEEPROM, F("Clear Point Value")); + else { + mesh_conf.manualValueUpdate(true); + redrawMenu(false); + } + break; #endif } break; @@ -3599,7 +3619,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case UBL_M_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else { set_bed_leveling_enabled(level_state); drawMenu(ID_Leveling, LEVELING_GET_MESH); @@ -3608,9 +3628,9 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case UBL_M_NEXT: if (draw) { if (mesh_conf.mesh_x != (GRID_MAX_POINTS_X - 1) || mesh_conf.mesh_y != (GRID_MAX_POINTS_Y - 1)) - drawMenuItem(row, ICON_More, F("Next Point")); + drawMenuItem(row, ICON_More, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT)); else - drawMenuItem(row, ICON_More, F("Save Mesh")); + drawMenuItem(row, ICON_More, GET_TEXT_F(MSG_UBL_SAVE_MESH)); } else { if (mesh_conf.mesh_x != (GRID_MAX_POINTS_X - 1) || mesh_conf.mesh_y != (GRID_MAX_POINTS_Y - 1)) { @@ -3647,7 +3667,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case UBL_M_OFFSET: if (draw) { - drawMenuItem(row, ICON_SetZOffset, F("Point Z Offset")); + drawMenuItem(row, ICON_SetZOffset, GET_TEXT_F(MSG_MESH_EDIT_Z)); drawFloat(bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y], row, false, 100); } else { @@ -3658,7 +3678,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case UBL_M_UP: if (draw) - drawMenuItem(row, ICON_Axis, F("Microstep Up")); + drawMenuItem(row, ICON_Axis, F("+0.01mm Up")); else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] < MAX_Z_OFFSET) { bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] += 0.01; gcode.process_subcommands_now(F("M290 Z0.01")); @@ -3670,7 +3690,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case UBL_M_DOWN: if (draw) - drawMenuItem(row, ICON_Axis, F("Microstep Down")); + drawMenuItem(row, ICON_Axis, F("-0.01mm Down")); else if (bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] > MIN_Z_OFFSET) { bedlevel.z_values[mesh_conf.mesh_x][mesh_conf.mesh_y] -= 0.01; gcode.process_subcommands_now(F("M290 Z-0.01")); @@ -3698,7 +3718,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case MMESH_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Cancel")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BUTTON_CANCEL)); else { gcode.process_subcommands_now(F("G29 A")); planner.synchronize(); @@ -3709,9 +3729,9 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case MMESH_NEXT: if (draw) { if (gridpoint < GRID_MAX_POINTS) - drawMenuItem(row, ICON_More, F("Next Point")); + drawMenuItem(row, ICON_More, GET_TEXT_F(MSG_LEVEL_BED_NEXT_POINT)); else - drawMenuItem(row, ICON_More, F("Save Mesh")); + drawMenuItem(row, ICON_More, GET_TEXT_F(MSG_UBL_SAVE_MESH)); } else if (gridpoint < GRID_MAX_POINTS) { popupHandler(Popup_MoveWait); @@ -3738,7 +3758,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case MMESH_UP: if (draw) - drawMenuItem(row, ICON_Axis, F("Microstep Up")); + drawMenuItem(row, ICON_Axis, F("+0.01mm Up")); else if (current_position.z < MAX_Z_OFFSET) { gcode.process_subcommands_now(F("M290 Z0.01")); planner.synchronize(); @@ -3749,7 +3769,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case MMESH_DOWN: if (draw) - drawMenuItem(row, ICON_AxisD, F("Microstep Down")); + drawMenuItem(row, ICON_AxisD, F("-0.01mm Down")); else if (current_position.z > MIN_Z_OFFSET) { gcode.process_subcommands_now(F("M290 Z-0.01")); planner.synchronize(); @@ -3796,8 +3816,10 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #define TUNE_ZOFFSET (TUNE_FAN + ENABLED(HAS_ZOFFSET_ITEM)) #define TUNE_ZUP (TUNE_ZOFFSET + ENABLED(HAS_ZOFFSET_ITEM)) #define TUNE_ZDOWN (TUNE_ZUP + ENABLED(HAS_ZOFFSET_ITEM)) - #define TUNE_CHANGEFIL (TUNE_ZDOWN + ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)) - #define TUNE_FILSENSORENABLED (TUNE_CHANGEFIL + ENABLED(FILAMENT_RUNOUT_SENSOR)) + #define TUNE_LA (TUNE_ZDOWN + ENABLED(LIN_ADVANCE)) + #define TUNE_CHANGEFIL (TUNE_LA + ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)) + #define TUNE_FWRETRACT (TUNE_CHANGEFIL + ENABLED(FWRETRACT)) + #define TUNE_FILSENSORENABLED (TUNE_FWRETRACT + ENABLED(FILAMENT_RUNOUT_SENSOR)) #define TUNE_BACKLIGHT_OFF (TUNE_FILSENSORENABLED + 1) #define TUNE_BACKLIGHT (TUNE_BACKLIGHT_OFF + 1) #define TUNE_TOTAL TUNE_BACKLIGHT @@ -3805,13 +3827,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case TUNE_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Back")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BACK)); else drawPrintScreen(); break; case TUNE_SPEED: if (draw) { - drawMenuItem(row, ICON_Speed, F("Print Speed")); + drawMenuItem(row, ICON_Speed, GET_TEXT_F(MSG_SPEED)); drawFloat(feedrate_percentage, row, false, 1); } else @@ -3821,7 +3843,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HOTEND case TUNE_FLOW: if (draw) { - drawMenuItem(row, ICON_Speed, F("Flow Rate")); + drawMenuItem(row, ICON_Speed, GET_TEXT_F(MSG_FLOW)); drawFloat(planner.flow_percentage[0], row, false, 1); } else @@ -3829,7 +3851,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case TUNE_HOTEND: if (draw) { - drawMenuItem(row, ICON_SetEndTemp, F("Hotend")); + drawMenuItem(row, ICON_SetEndTemp, GET_TEXT_F(MSG_NOZZLE)); drawFloat(thermalManager.degTargetHotend(0), row, false, 1); } else @@ -3840,7 +3862,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_HEATED_BED case TUNE_BED: if (draw) { - drawMenuItem(row, ICON_SetBedTemp, F("Bed")); + drawMenuItem(row, ICON_SetBedTemp, GET_TEXT_F(MSG_BED)); drawFloat(thermalManager.degTargetBed(), row, false, 1); } else @@ -3851,7 +3873,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #if HAS_FAN case TUNE_FAN: if (draw) { - drawMenuItem(row, ICON_FanSpeed, F("Fan")); + drawMenuItem(row, ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED)); drawFloat(thermalManager.fan_speed[0], row, false, 1); } else @@ -3870,7 +3892,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case TUNE_ZUP: if (draw) - drawMenuItem(row, ICON_Axis, F("Z-Offset Up")); + drawMenuItem(row, ICON_Axis, F("Z-Offset +0.01mm Up")); else if (zoffsetvalue < MAX_Z_OFFSET) { gcode.process_subcommands_now(F("M290 Z0.01")); zoffsetvalue += 0.01; @@ -3879,7 +3901,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case TUNE_ZDOWN: if (draw) - drawMenuItem(row, ICON_AxisD, F("Z-Offset Down")); + drawMenuItem(row, ICON_AxisD, F("Z-Offset -0.01mm Down")); else if (zoffsetvalue > MIN_Z_OFFSET) { gcode.process_subcommands_now(F("M290 Z-0.01")); zoffsetvalue -= 0.01; @@ -3888,6 +3910,17 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; #endif + #if ENABLED(LIN_ADVANCE) + case TUNE_LA: + if (draw) { + drawMenuItem(row, ICON_MaxAccelerated, GET_TEXT_F(MSG_ADVANCE_K)); + drawFloat(planner.extruder_advance_K[0], row, false, 100); + } + else + modifyValue(planner.extruder_advance_K[0], 0, 10, 100); + break; + #endif + #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case TUNE_CHANGEFIL: if (draw) @@ -3897,10 +3930,19 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; #endif + #if ENABLED(FWRETRACT) + case TUNE_FWRETRACT: + if (draw) + drawMenuItem(row, ICON_SetHome, GET_TEXT_F(MSG_FWRETRACT), nullptr, true); + else + drawMenu(ID_FWMenu); + break; + #endif + #if ENABLED(FILAMENT_RUNOUT_SENSOR) case TUNE_FILSENSORENABLED: if (draw) { - drawMenuItem(row, ICON_Extruder, F("Filament Sensor")); + drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR)); drawCheckbox(row, runout.enabled); } else { @@ -3912,13 +3954,13 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra case TUNE_BACKLIGHT_OFF: if (draw) - drawMenuItem(row, ICON_Brightness, F("Display Off")); + drawMenuItem(row, ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS_OFF)); else ui.set_brightness(0); break; case TUNE_BACKLIGHT: if (draw) { - drawMenuItem(row, ICON_Brightness, F("LCD Brightness")); + drawMenuItem(row, ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS)); drawFloat(ui.brightness, row, false, 1); } else @@ -3944,7 +3986,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra switch (item) { case PREHEATHOTEND_BACK: if (draw) - drawMenuItem(row, ICON_Back, F("Cancel")); + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BUTTON_CANCEL)); else { thermalManager.setTargetHotend(0, 0); TERN_(HAS_FAN, thermalManager.set_fan_speed(0, 0)); @@ -3953,7 +3995,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; case PREHEATHOTEND_CONTINUE: if (draw) - drawMenuItem(row, ICON_SetEndTemp, F("Continue")); + drawMenuItem(row, ICON_SetEndTemp, GET_TEXT_F(MSG_BUTTON_CONTINUE)); else { popupHandler(Popup_Heating); thermalManager.wait_for_hotend(0); @@ -3991,7 +4033,6 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra } break; - #define _PREHEAT_HOTEND_CASE(N) \ case PREHEATHOTEND_##N: \ if (draw) drawMenuItem(row, ICON_Temperature, F(PREHEAT_## N ##_LABEL)); \ @@ -4012,6 +4053,71 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; #endif // HAS_PREHEAT && HAS_HOTEND + + #if ENABLED(FWRETRACT) + case ID_FWMenu: + #define FWRETRACT_BACK 0 + #define FWRETRACT_RETLEN (FWRETRACT_BACK + 1) + #define FWRETRACT_RETSPD (FWRETRACT_RETLEN + 1) + #define FWRETRACT_RETZHOP (FWRETRACT_RETSPD + 1) + #define FWRETRACT_RECSPD (FWRETRACT_RETZHOP + 1) + #define FWRETRACT_RECLEN (FWRETRACT_RECSPD + 1) + #define FWRETRACT_TOTAL (FWRETRACT_RECLEN + 1) + + switch (item) { + case FWRETRACT_BACK: + if (draw) + drawMenuItem(row, ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK)); + else { + if (last_menu == ID_Prepare) + drawMenu(ID_Prepare, PREPARE_FWRETRACT); + else if (last_menu == ID_Tune) + drawMenu(ID_Tune, TUNE_FWRETRACT); + } + break; + case FWRETRACT_RETLEN: + if (draw) { + drawMenuItem(row, ICON_FWRetLength, GET_TEXT_F(MSG_CONTROL_RETRACT)); + drawFloat(fwretract.settings.retract_length, row, false, 10); + } + else + modifyValue(fwretract.settings.retract_length, 0, 10, 10); + break; + case FWRETRACT_RETSPD: + if (draw) { + drawMenuItem(row, ICON_FWRetLength, GET_TEXT_F(MSG_SINGLENOZZLE_RETRACT_SPEED)); + drawFloat(fwretract.settings.retract_feedrate_mm_s, row, false, 1); + } + else + modifyValue(fwretract.settings.retract_feedrate_mm_s, 1, 90, 1); + break; + case FWRETRACT_RETZHOP: + if (draw) { + drawMenuItem(row, ICON_FWRetLength, GET_TEXT_F(MSG_CONTROL_RETRACT_ZHOP)); + drawFloat(fwretract.settings.retract_zraise, row, false, 100); + } + else + modifyValue(fwretract.settings.retract_zraise, 0, 2, 100); + break; + case FWRETRACT_RECSPD: + if (draw) { + drawMenuItem(row, ICON_FWRetLength, GET_TEXT_F(MSG_SINGLENOZZLE_UNRETRACT_SPEED)); + drawFloat(fwretract.settings.retract_recover_feedrate_mm_s, row, false, 1); + } + else + modifyValue(fwretract.settings.retract_recover_feedrate_mm_s, 1, 90, 1); + break; + case FWRETRACT_RECLEN: + if (draw) { + drawMenuItem(row, ICON_FWRetLength, GET_TEXT_F(MSG_CONTROL_RETRACT_RECOVER)); + drawFloat(fwretract.settings.retract_recover_extra, row, false, 10); + } + else + modifyValue(fwretract.settings.retract_recover_extra, -5, 5, 10); + break; + } + break; + #endif } } @@ -4039,6 +4145,9 @@ FSTR_P JyersDWIN::getMenuTitle(const uint8_t menu) { return GET_TEXT_F(MSG_CUSTOM_COMMANDS); #endif #endif + #if ENABLED(FWRETRACT) + case ID_FWMenu: return GET_TEXT_F(MSG_FWRETRACT); + #endif case ID_Control: return GET_TEXT_F(MSG_CONTROL); case ID_TempMenu: return GET_TEXT_F(MSG_TEMPERATURE); #if ANY(PIDTEMP, PIDTEMPBED) @@ -4057,9 +4166,9 @@ FSTR_P JyersDWIN::getMenuTitle(const uint8_t menu) { #define _PREHEAT_TITLE_CASE(N) case ID_Preheat##N: return F(PREHEAT_## N ##_LABEL " Settings"); REPEAT_1(PREHEAT_COUNT, _PREHEAT_TITLE_CASE) #endif - case ID_Motion: return F("Motion Settings"); - case ID_HomeOffsets: return F("Home Offsets"); - case ID_MaxSpeed: return F("Max Speed"); + case ID_Motion: return GET_TEXT_F(MSG_MOTION); + case ID_HomeOffsets: return GET_TEXT_F(MSG_SET_HOME_OFFSETS); + case ID_MaxSpeed: return GET_TEXT_F(MSG_MAX_SPEED); case ID_MaxAcceleration: return F("Max Acceleration"); #if HAS_CLASSIC_JERK case ID_MaxJerk: return F("Max Jerk"); @@ -4074,10 +4183,10 @@ FSTR_P JyersDWIN::getMenuTitle(const uint8_t menu) { case ID_TMCMenu: return GET_TEXT_F(MSG_TMC_DRIVERS); #endif case ID_ColorSettings: return F("UI Color Settings"); - case ID_Info: return F("Info"); - case ID_InfoMain: return F("Info"); + case ID_Info: return GET_TEXT_F(MSG_BUTTON_INFO); + case ID_InfoMain: return GET_TEXT_F(MSG_BUTTON_INFO); #if HAS_MESH - case ID_Leveling: return F("Leveling"); + case ID_Leveling: return GET_TEXT_F(MSG_BED_LEVELING); case ID_LevelView: return GET_TEXT_F(MSG_MESH_VIEW); case ID_LevelSettings: return F("Leveling Settings"); case ID_MeshViewer: return GET_TEXT_F(MSG_MESH_VIEW); @@ -4113,6 +4222,9 @@ uint8_t JyersDWIN::getMenuSize(const uint8_t menu) { #if HAS_CUSTOM_MENU case ID_MenuCustom: return CUSTOM_MENU_TOTAL; #endif + #if ENABLED(FWRETRACT) + case ID_FWMenu: return FWRETRACT_TOTAL; + #endif case ID_Control: return CONTROL_TOTAL; case ID_TempMenu: return TEMP_TOTAL; #if ANY(PIDTEMP, PIDTEMPBED) @@ -4146,7 +4258,6 @@ uint8_t JyersDWIN::getMenuSize(const uint8_t menu) { #endif #if HAS_TRINAMIC_CONFIG case ID_TMCMenu: return TMC_TOTAL; - case ID_TMCMenu: return TMC_TOTAL; #endif case ID_Info: return INFO_TOTAL; case ID_InfoMain: return INFO_TOTAL; @@ -4180,28 +4291,37 @@ uint8_t JyersDWIN::getMenuSize(const uint8_t menu) { void JyersDWIN::popupHandler(const PopupID popupid, const bool option/*=false*/) { popup = last_popup = popupid; + FSTR_P const PWID = F("Please wait until done."); switch (popupid) { - case Popup_Pause: drawPopup(F("Pause Print"), F(""), F(""), Proc_Popup); break; - case Popup_Stop: drawPopup(F("Stop Print"), F(""), F(""), Proc_Popup); break; + case Popup_Pause: drawPopup(GET_TEXT_F(MSG_PAUSE_PRINT), F(""), F(""), Proc_Popup); break; + case Popup_Stop: drawPopup(GET_TEXT_F(MSG_STOP_PRINT), F(""), F(""), Proc_Popup); break; case Popup_Resume: drawPopup(F("Resume Print?"), F("Looks Like the last"), F("print was interrupted."), Proc_Popup); break; case Popup_ConfFilChange: drawPopup(F("Confirm Filament Change"), F(""), F(""), Proc_Popup); break; case Popup_PurgeMore: drawPopup(F("Purge more filament?"), F("(Cancel to finish process)"), F(""), Proc_Popup); break; - case Popup_SaveLevel: drawPopup(F("Leveling Complete"), F("Save to EEPROM?"), F(""), Proc_Popup); break; - case Popup_MeshSlot: drawPopup(F("Mesh slot not selected"), F("(Confirm to select slot 0)"), F(""), Proc_Popup); break; - case Popup_ETemp: drawPopup(F("Nozzle is too cold"), F("Open Preheat Menu?"), F(""), Proc_Popup); break; + #if ENABLED(AUTO_BED_LEVELING_UBL) + case Popup_SaveLevel: drawPopup(GET_TEXT_F(MSG_LEVEL_BED_DONE), F("Save to EEPROM?"), F(""), Proc_Popup); break; + case Popup_MeshSlot: drawPopup(F("Mesh slot not selected"), F("(Confirm to select slot 0)"), F(""), Proc_Popup); break; + #endif + case Popup_ETemp: drawPopup(GET_TEXT_F(MSG_HOTEND_TOO_COLD), F("Open Preheat Menu?"), F(""), Proc_Popup); break; case Popup_ManualProbing: drawPopup(F("Manual Probing"), F("(Confirm to probe)"), F("(cancel to exit)"), Proc_Popup); break; - case Popup_Level: drawPopup(F("Auto Bed Leveling"), F("Please wait until done."), F(""), Proc_Wait, ICON_AutoLeveling); break; - case Popup_Home: drawPopup(option ? F("Parking") : F("Homing"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; - case Popup_MoveWait: drawPopup(F("Moving to Point"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; - case Popup_Heating: drawPopup(F("Heating"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; - case Popup_FilLoad: drawPopup(option ? F("Unloading Filament") : F("Loading Filament"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; + case Popup_Level: drawPopup(GET_TEXT_F(MSG_BED_LEVELING), PWID, F(""), Proc_Wait, ICON_AutoLeveling); break; + case Popup_Home: drawPopup(option ? F("Parking") : GET_TEXT_F(MSG_HOMING), PWID, F(""), Proc_Wait, ICON_BLTouch); break; + case Popup_MoveWait: drawPopup(GET_TEXT_F(MSG_UBL_MOVING_TO_NEXT), PWID, F(""), Proc_Wait, ICON_BLTouch); break; + case Popup_Heating: drawPopup(GET_TEXT_F(MSG_HEATING), PWID, F(""), Proc_Wait, ICON_BLTouch); break; + case Popup_FilLoad: drawPopup(option ? F("Unloading Filament") : F("Loading Filament"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; case Popup_FilChange: drawPopup(F("Filament Change"), F("Please wait for prompt."), F(""), Proc_Wait, ICON_BLTouch); break; case Popup_TempWarn: drawPopup(option ? F("Nozzle temp too low!") : F("Nozzle temp too high!"), F(""), F(""), Proc_Wait, option ? ICON_TempTooLow : ICON_TempTooHigh); break; - case Popup_Runout: drawPopup(F("Filament Runout"), F(""), F(""), Proc_Wait, ICON_BLTouch); break; - case Popup_PIDWait: drawPopup(F("PID Autotune"), F("in process"), F("Please wait until done."), Proc_Wait, ICON_BLTouch); break; - case Popup_MPCWait: drawPopup(F("MPC Autotune"), F("in process"), F("Please wait until done."), Proc_Wait, ICON_BLTouch); break; - case Popup_Resuming: drawPopup(F("Resuming Print"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; - case Popup_Custom: drawPopup(F("Running Custom G-Code"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break; + #if ENABLED(FILAMENT_RUNOUT_SENSOR) + case Popup_Runout: drawPopup(F("Filament Runout"), F(""), F(""), Proc_Wait, ICON_BLTouch); break; + #endif + #if ANY(PIDTEMP, PIDTEMPBED) + case Popup_PIDWait: drawPopup(GET_TEXT_F(MSG_PID_AUTOTUNE), F("in progress"), PWID, Proc_Wait, ICON_BLTouch); break; + #endif + #if ENABLED(MPC_AUTOTUNE_MENU) + case Popup_MPCWait: drawPopup(GET_TEXT_F(MSG_MPC_AUTOTUNE), F("in progress"), PWID, Proc_Wait, ICON_BLTouch); break; + #endif + case Popup_Resuming: drawPopup(F("Resuming Print"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; + case Popup_Custom: drawPopup(F("Running Custom G-Code"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; default: break; } } @@ -4439,9 +4559,8 @@ void JyersDWIN::fileControl() { card.cd(card.filename); drawSDList(); } - else { + else card.openAndPrintFile(card.filename); - } } } dwinUpdateLCD(); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 4f0669f8d89d..050a4cb39eae 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -83,6 +83,7 @@ enum menuID : uint8_t { ID_Preheat, ID_ChangeFilament, ID_MenuCustom, + OPTITEM(FWRETRACT, ID_FWMenu) ID_Control, ID_TempMenu, ID_PID, @@ -105,9 +106,7 @@ enum menuID : uint8_t { ID_ColorSettings, ID_Advanced, ID_ProbeMenu, - #if HAS_TRINAMIC_CONFIG - ID_TMCMenu, - #endif + OPTITEM(HAS_TRINAMIC_CONFIG, ID_TMCMenu) ID_Info, ID_Leveling, ID_LevelManual, diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index 255b7ac60139..35f07404ff87 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -54,12 +54,6 @@ #define ICON_FilUnload ICON_ReadEEPROM #define ICON_Flow ICON_StepE #define ICON_Folder ICON_More -#define ICON_FWRetract ICON_StepE -#define ICON_FWRetLength ICON_StepE -#define ICON_FWRetSpeed ICON_Setspeed -#define ICON_FWRetZRaise ICON_MoveZ -#define ICON_FWRecSpeed ICON_Setspeed -#define ICON_FWRecExtra ICON_StepE #define ICON_HomeX ICON_MoveX #define ICON_HomeY ICON_MoveY #define ICON_HomeZ ICON_MoveZ diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index d6a5915dcc06..24595e191ffd 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -901,6 +901,7 @@ namespace LanguageNarrow_en { namespace LanguageWide_en { using namespace LanguageNarrow_en; #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_LIVE_MOVE = _UxGT("Live Movement"); LSTR MSG_HOST_START_PRINT = _UxGT("Start Host Print"); LSTR MSG_PRINTING_OBJECT = _UxGT("Printing Object"); LSTR MSG_CANCEL_OBJECT = _UxGT("Cancel Object"); From 4b0b00c8da5eb193bb157d42e788da9586ed5ba7 Mon Sep 17 00:00:00 2001 From: studiodyne <42887851+studiodyne@users.noreply.github.com> Date: Fri, 20 Oct 2023 03:23:23 +0200 Subject: [PATCH 108/268] =?UTF-8?q?=E2=9C=A8=20Tool=20Migration-specific?= =?UTF-8?q?=20settings=20(#26244)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 19 ++++++++- Marlin/src/inc/Conditionals_adv.h | 18 ++++++++ Marlin/src/module/tool_change.cpp | 68 ++++++++++++++++++++----------- 3 files changed, 81 insertions(+), 24 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 4d6ed12e99d5..2219592a8b11 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2780,7 +2780,21 @@ * - Switch to a different nozzle on an extruder jam */ #define TOOLCHANGE_MIGRATION_FEATURE - + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + // Override toolchange settings + // By default tool migration uses regular toolchange settings. + // With a prime tower, tool-change swapping/priming occur inside the bed. + // When migrating to a new unprimed tool you can set override values below. + //#define MIGRATION_ZRAISE 0 // (mm) + + // Longer prime to clean out + //#define MIGRATION_FS_EXTRA_PRIME 0 // (mm) Extra priming length + //#define MIGRATION_FS_WIPE_RETRACT 0 // (mm) Retract before cooling for less stringing, better wipe, etc. + + // Cool after prime to reduce stringing + //#define MIGRATION_FS_FAN_SPEED 255 // 0-255 + //#define MIGRATION_FS_FAN_TIME 0 // (seconds) + #endif #endif /** @@ -2793,6 +2807,9 @@ #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 // (mm/min) //#define TOOLCHANGE_PARK_X_ONLY // X axis only move //#define TOOLCHANGE_PARK_Y_ONLY // Y axis only move + #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) + //#define TOOLCHANGE_MIGRATION_DO_PARK // Force park (or no-park) on migration + #endif #endif #endif // HAS_MULTI_EXTRUDER diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 25050d972f32..5e3f86919ac0 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1275,6 +1275,24 @@ #undef TC_GCODE_USE_GLOBAL_Z #endif +// TOOLCHANGE_MIGRATION_FEATURE - Clean up after sloppy auto config +#if DISABLED(TOOLCHANGE_MIGRATION_FEATURE) + #undef MIGRATION_ZRAISE + #undef MIGRATION_FS_EXTRA_PRIME + #undef MIGRATION_FS_WIPE_RETRACT + #undef MIGRATION_FS_FAN_SPEED + #undef MIGRATION_FS_FAN_TIME + #undef TOOLCHANGE_MIGRATION_DO_PARK +#endif +// TOOLCHANGE_PARK - Clean up after sloppy auto config +#if DISABLED(TOOLCHANGE_PARK) + #undef TOOLCHANGE_PARK_XY + #undef TOOLCHANGE_PARK_XY_FEEDRATE + #undef TOOLCHANGE_PARK_X_ONLY + #undef TOOLCHANGE_PARK_Y_ONLY + #undef TOOLCHANGE_MIGRATION_DO_PARK +#endif + // Multi-Stepping Limit #ifndef MULTISTEPPING_LIMIT #define MULTISTEPPING_LIMIT 128 diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index b33b642966ae..22982fa91a44 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -34,9 +34,6 @@ //#define DEBUG_TOOL_CHANGE //#define DEBUG_TOOLCHANGE_FILAMENT_SWAP -#define DEBUG_OUT ENABLED(DEBUG_TOOL_CHANGE) -#include "../core/debug_out.h" - #if HAS_MULTI_EXTRUDER toolchange_settings_t toolchange_settings; // Initialized by settings.load() #endif @@ -154,6 +151,9 @@ void _line_to_current(const AxisEnum fr_axis, const float fscale=1) { void slow_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.2f); } void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.5f); } +#define DEBUG_OUT ENABLED(DEBUG_TOOL_CHANGE) +#include "../core/debug_out.h" + #if ENABLED(MAGNETIC_PARKING_EXTRUDER) float parkingposx[2], // M951 R L @@ -895,11 +895,8 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. */ #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - #ifdef DEBUG_TOOLCHANGE_FILAMENT_SWAP - #define FS_DEBUG(V...) SERIAL_ECHOLNPGM("DEBUG: " V) - #else - #define FS_DEBUG(...) NOOP - #endif + #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_FILAMENT_SWAP) + #include "../core/debug_out.h" // Define any variables required static Flags extruder_was_primed; // Extruders primed status @@ -941,12 +938,11 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. */ void extruder_cutting_recover(const_float_t e) { if (too_cold(active_extruder)) return; - const float dist = toolchange_settings.extra_resume + toolchange_settings.wipe_retract; - FS_DEBUG("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s"); + DEBUG_ECHOLNPGM("Performing Cutting Recover | Distance: ", dist, " | Speed: ", MMM_TO_MMS(toolchange_settings.unretract_speed), "mm/s"); unscaled_e_move(dist, MMM_TO_MMS(toolchange_settings.unretract_speed)); - FS_DEBUG("Set E position: ", e); + DEBUG_ECHOLNPGM("Set E position: ", e); current_position.e = e; sync_plan_position_e(); // Resume new E Position } @@ -961,7 +957,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. */ void extruder_prime() { if (too_cold(active_extruder)) { - FS_DEBUG("Priming Aborted - Nozzle Too Cold!"); + DEBUG_ECHOLNPGM("Priming Aborted - Nozzle Too Cold!"); return; // Extruder too cold to prime } @@ -978,7 +974,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. extruder_did_first_prime.set(active_extruder); // Log first prime complete // new nozzle - prime at user-specified speed. const feedRate_t prime_mm_s = MMM_TO_MMS(toolchange_settings.prime_speed); - FS_DEBUG("First time priming T", active_extruder, ", reducing speed from ", fr_mm_s, " to ", prime_mm_s, "mm/s"); + DEBUG_ECHOLNPGM("First time priming T", active_extruder, ", reducing speed from ", fr_mm_s, " to ", prime_mm_s, "mm/s"); fr_mm_s = prime_mm_s; unscaled_e_move(0, fr_mm_s); // Init planner with 0 length move } @@ -988,11 +984,11 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. if (toolchange_settings.extra_prime >= 0) { // Positive extra_prime value // - Return filament at speed (fr_mm_s) then extra_prime at prime speed - FS_DEBUG("Loading Filament for T", active_extruder, " | Distance: ", toolchange_settings.swap_length, " | Speed: ", fr_mm_s, "mm/s"); + DEBUG_ECHOLNPGM("Loading Filament for T", active_extruder, " | Distance: ", toolchange_settings.swap_length, " | Speed: ", fr_mm_s, "mm/s"); unscaled_e_move(toolchange_settings.swap_length, fr_mm_s); // Prime (Unretract) filament by extruding equal to Swap Length (Unretract) if (toolchange_settings.extra_prime > 0) { - FS_DEBUG("Performing Extra Priming for T", active_extruder, " | Distance: ", toolchange_settings.extra_prime, " | Speed: ", MMM_TO_MMS(toolchange_settings.prime_speed), "mm/s"); + DEBUG_ECHOLNPGM("Performing Extra Priming for T", active_extruder, " | Distance: ", toolchange_settings.extra_prime, " | Speed: ", MMM_TO_MMS(toolchange_settings.prime_speed), "mm/s"); unscaled_e_move(toolchange_settings.extra_prime, MMM_TO_MMS(toolchange_settings.prime_speed)); // Extra Prime Distance } } @@ -1000,8 +996,8 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. // Negative extra_prime value // - Unretract distance (swap length) is reduced by the value of extra_prime const float eswap = toolchange_settings.swap_length + toolchange_settings.extra_prime; - FS_DEBUG("Negative ExtraPrime value - Swap Return Length has been reduced from ", toolchange_settings.swap_length, " to ", eswap); - FS_DEBUG("Loading Filament for T", active_extruder, " | Distance: ", eswap, " | Speed: ", fr_mm_s, "mm/s"); + DEBUG_ECHOLNPGM("Negative ExtraPrime value - Swap Return Length has been reduced from ", toolchange_settings.swap_length, " to ", eswap); + DEBUG_ECHOLNPGM("Loading Filament for T", active_extruder, " | Distance: ", eswap, " | Speed: ", fr_mm_s, "mm/s"); unscaled_e_move(eswap, fr_mm_s); } @@ -1009,7 +1005,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. // Cutting retraction #if TOOLCHANGE_FS_WIPE_RETRACT - FS_DEBUG("Performing Cutting Retraction | Distance: ", -toolchange_settings.wipe_retract, " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s"); + DEBUG_ECHOLNPGM("Performing Cutting Retraction | Distance: ", -toolchange_settings.wipe_retract, " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s"); unscaled_e_move(-toolchange_settings.wipe_retract, MMM_TO_MMS(toolchange_settings.retract_speed)); #endif @@ -1027,7 +1023,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. */ void tool_change_prime() { - FS_DEBUG(">>> tool_change_prime()"); + DEBUG_SECTION(tcp, "tool_change_prime", true); if (!too_cold(active_extruder)) { destination = current_position; // Remember the old position @@ -1086,9 +1082,6 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0. extruder_cutting_recover(destination.e); // Cutting recover } - - FS_DEBUG("<<< tool_change_prime"); - } #endif // TOOLCHANGE_FILAMENT_SWAP @@ -1203,7 +1196,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { else if (extruder_was_primed[old_tool]) { // Retract the old extruder if it was previously primed // To-Do: Should SingleNozzle always retract? - FS_DEBUG("Retracting Filament for T", old_tool, ". | Distance: ", toolchange_settings.swap_length, " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s"); + DEBUG_ECHOLNPGM("Retracting Filament for T", old_tool, ". | Distance: ", toolchange_settings.swap_length, " | Speed: ", MMM_TO_MMS(toolchange_settings.retract_speed), "mm/s"); unscaled_e_move(-toolchange_settings.swap_length, MMM_TO_MMS(toolchange_settings.retract_speed)); } } @@ -1567,6 +1560,34 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { // Migrate Linear Advance K factor to the new extruder TERN_(LIN_ADVANCE, planner.extruder_advance_K[active_extruder] = planner.extruder_advance_K[migration_extruder]); + // Temporary migration toolchange_settings restored on exit. i.e., before next tool_change(). + #if defined(MIGRATION_FS_EXTRA_PRIME) \ + || defined(MIGRATION_FS_WIPE_RETRACT) \ + || defined(MIGRATION_FS_FAN_SPEED) \ + || defined(MIGRATION_FS_FAN_TIME) \ + || defined(MIGRATION_ZRAISE) \ + || defined(TOOLCHANGE_MIGRATION_DO_PARK) + REMEMBER(tmp_mig_settings, toolchange_settings); + #ifdef MIGRATION_FS_EXTRA_PRIME + toolchange_settings.extra_prime = MIGRATION_FS_EXTRA_PRIME; + #endif + #ifdef MIGRATION_FS_WIPE_RETRACT + toolchange_settings.wipe_retract = MIGRATION_FS_WIPE_RETRACT; + #endif + #ifdef MIGRATION_FS_FAN_SPEED + toolchange_settings.fan_speed = MIGRATION_FS_FAN_SPEED; + #endif + #ifdef MIGRATION_FS_FAN_TIME + toolchange_settings.fan_time = MIGRATION_FS_FAN_TIME; + #endif + #ifdef MIGRATION_ZRAISE + toolchange_settings.z_raise = MIGRATION_ZRAISE; + #endif + #ifdef TOOLCHANGE_MIGRATION_DO_PARK + toolchange_settings.enable_park = ENABLED(TOOLCHANGE_MIGRATION_DO_PARK); + #endif + #endif + // Perform the tool change tool_change(migration_extruder); @@ -1586,6 +1607,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { planner.synchronize(); planner.set_e_position_mm(current_position.e); // New extruder primed and ready + DEBUG_ECHOLNPGM("Migration Complete"); return true; } From b0ece8f8df130709f97da6c1474cd20cbd9119ed Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 20 Oct 2023 17:21:30 -0500 Subject: [PATCH 109/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Mar?= =?UTF-8?q?linUI=20menu=20tweaks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in prep for #26339 --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 6 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 10 +- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 107 ++++++++------- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 142 ++++++++++---------- Marlin/src/lcd/lcdprint.cpp | 78 +++++++++++ Marlin/src/lcd/lcdprint.h | 33 ++++- Marlin/src/lcd/menu/menu.h | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 12 +- Marlin/src/lcd/tft/ui_common.cpp | 8 +- 9 files changed, 249 insertions(+), 149 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 3206cb63347c..716d1341dbd4 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1165,12 +1165,12 @@ void MarlinUI::draw_status_screen() { #endif // ADVANCED_PAUSE_FEATURE // Draw a static item with no left-right margin required. Centered by default. - void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { lcd_moveto(0, row); int8_t n = LCD_WIDTH; const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int8_t plen = fstr ? utf8_strlen(fstr) : 0, + const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; int8_t pad = (center || full) ? n - plen - vlen : 0; @@ -1178,7 +1178,7 @@ void MarlinUI::draw_status_screen() { if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd_put_u8str(F(" ")); n--; } // Draw as much of the label as fits - if (plen) n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n - vlen); + if (plen) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n - vlen); if (vlen && n > 0) { // SS_FULL: Pad with enough space to justify the value diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 2d621d74cf2e..1c6e49644b52 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -969,7 +969,7 @@ void MarlinUI::draw_status_screen() { #endif // Draw a static item with no left-right margin required. Centered by default. - void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { + void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { if (!PanelDetected) return; lcd_moveto(0, row); @@ -1004,25 +1004,25 @@ void MarlinUI::draw_status_screen() { } // Draw a generic menu item with pre_char (if selected) and post_char - void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { + void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) { if (!PanelDetected) return; lcd_moveto(0, row); lcd.write(sel ? pre_char : ' '); uint8_t n = LCD_WIDTH - 2; - n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); + n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); for (; n; --n) lcd.write(' '); lcd.write(post_char); lcd.print_line(); } // Draw a menu item with a (potentially) editable value - void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { + void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { if (!PanelDetected) return; const uint8_t vlen = inStr ? (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)) : 0; lcd_moveto(0, row); lcd.write(sel ? LCD_STR_ARROW_RIGHT[0] : ' '); uint8_t n = LCD_WIDTH - 2 - vlen; - n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n); + n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); if (vlen) { lcd.write(':'); for (; n; --n) lcd.write(' '); diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index c2671b1b750e..6c15572f040b 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -411,63 +411,62 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop // Draw a static line of text in the same idiom as a menu item void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { - - if (mark_as_selected(row, style & SS_INVERT)) { - pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - - const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int pwide = ftpl ? calculateWidth(ftpl) : 0, - vlen = vstr ? utf8_strlen(vstr) : 0; - int pad = (center || full) ? ((LCD_PIXEL_WIDTH) - pwide - vlen * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH) : 0; - - // SS_CENTER: Pad with half of the unused space first - if (center) for (int lpad = pad / 2; lpad > 0; --lpad) n -= lcd_put_u8str(F(" ")); - - // Draw as much of the label as fits - if (pwide) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); - - if (vlen) { - // SS_FULL: Pad with enough space to justify the value - if (full && !center && n > MENU_FONT_WIDTH) { - // Move the leading colon from the value to the label - if (*vstr == ':') { n -= lcd_put_u8str(F(":")); vstr++; } - // Move spaces to the padding - while (*vstr == ' ') { vstr++; pad++; } - // Pad in-between - for (; pad > 0; --pad) n -= lcd_put_u8str(F(" ")); - } - n -= lcd_put_u8str_max(vstr, n); + if (!mark_as_selected(row, style & SS_INVERT)) return; + + pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed + + const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); + const int pwide = ftpl ? calculateWidth(ftpl) : 0, + vlen = vstr ? utf8_strlen(vstr) : 0; + int pad = (center || full) ? ((LCD_PIXEL_WIDTH) - pwide - vlen * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH) : 0; + + // SS_CENTER: Pad with half of the unused space first + if (center) for (int lpad = pad / 2; lpad > 0; --lpad) n -= lcd_put_u8str(F(" ")); + + // Draw as much of the label as fits + if (pwide) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); + + if (vlen) { + // SS_FULL: Pad with enough space to justify the value + if (full && !center && n > MENU_FONT_WIDTH) { + // Move the leading colon from the value to the label + if (*vstr == ':') { n -= lcd_put_u8str(F(":")); vstr++; } + // Move spaces to the padding + while (*vstr == ' ') { vstr++; pad++; } + // Pad in-between + for (; pad > 0; --pad) n -= lcd_put_u8str(F(" ")); } - while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); + n -= lcd_put_u8str_max(vstr, n); } + while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); } // Draw a generic menu item void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { - if (mark_as_selected(row, sel)) { - uint8_t n = LCD_WIDTH - 1; - n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); - for (; n; --n) lcd_put_u8str(F(" ")); - lcd_put_lchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); - lcd_put_u8str(F(" ")); - } + if (!mark_as_selected(row, sel)) return; + + uint8_t n = LCD_WIDTH - 1; + n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); + for (; n; --n) lcd_put_u8str(F(" ")); + lcd_put_lchar(LCD_PIXEL_WIDTH - (MENU_FONT_WIDTH), row_y2, post_char); + lcd_put_u8str(F(" ")); } // Draw a menu item with an editable value void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { - if (mark_as_selected(row, sel)) { - const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)), - pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), inStr)); - const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; - - uint8_t n = LCD_WIDTH - 2 - vallen * prop; - n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); - if (vallen) { - lcd_put_u8str(F(":")); - for (; n; --n) lcd_put_u8str(F(" ")); - lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2); - if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); - } + if (!mark_as_selected(row, sel)) return; + + const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(inStr)), + pixelwidth = (pgm ? uxg_GetUtf8StrPixelWidthP(u8g.getU8g(), inStr) : uxg_GetUtf8StrPixelWidth(u8g.getU8g(), inStr)); + const u8g_uint_t prop = USE_WIDE_GLYPH ? 2 : 1; + + uint8_t n = LCD_WIDTH - 2 - vallen * prop; + n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n); + if (vallen) { + lcd_put_u8str(F(":")); + for (; n; --n) lcd_put_u8str(F(" ")); + lcd_moveto(LCD_PIXEL_WIDTH - _MAX((MENU_FONT_WIDTH) * vallen, pixelwidth + 2), row_y2); + if (pgm) lcd_put_u8str_P(inStr); else lcd_put_u8str(inStr); } } @@ -545,13 +544,13 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop #if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { - if (mark_as_selected(row, sel)) { - const uint8_t maxlen = LCD_WIDTH - isDir; - if (isDir) lcd_put_lchar(LCD_STR_FOLDER[0]); - const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH); - pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); - for (; n > MENU_FONT_WIDTH; n -= MENU_FONT_WIDTH) lcd_put_u8str(F(" ")); - } + if (!mark_as_selected(row, sel)) return; + + const uint8_t maxlen = LCD_WIDTH - isDir; + if (isDir) lcd_put_lchar(LCD_STR_FOLDER[0]); + const pixel_len_t pixw = maxlen * (MENU_FONT_WIDTH); + pixel_len_t n = pixw - lcd_put_u8str_max(ui.scrolled_filename(theCard, maxlen, row, sel), pixw); + for (; n > MENU_FONT_WIDTH; n -= MENU_FONT_WIDTH) lcd_put_u8str(F(" ")); } #endif // HAS_MEDIA diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 27e5b38bd0a3..c0bf0a75d6f6 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -308,91 +308,91 @@ void MarlinUI::draw_status_message(const bool blink) { void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { // Call mark_as_selected to draw a bigger selection box // and draw the text without a background - if (mark_as_selected(row, (bool)(style & SS_INVERT), true)) { - ui.set_font(DWIN_FONT_MENU); - dwin_font.solid = false; - dwin_font.fg = COLOR_WHITE; + if (!mark_as_selected(row, (bool)(style & SS_INVERT), true)) return; - dwin_string.set(); + ui.set_font(DWIN_FONT_MENU); + dwin_font.solid = false; + dwin_font.fg = COLOR_WHITE; - const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, - vlen = vstr ? utf8_strlen(vstr) : 0; - int8_t pad = (center || full) ? (LCD_WIDTH) - 1 - plen - vlen : 0; + dwin_string.set(); - // SS_CENTER: Pad with half of the unused space first - if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) dwin_string.add(' '); + const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); + const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, + vlen = vstr ? utf8_strlen(vstr) : 0; + int8_t pad = (center || full) ? (LCD_WIDTH) - 1 - plen - vlen : 0; - // Append the templated label string - if (plen) { - dwin_string.add(ftpl, itemIndex, itemStringC, itemStringF); - pad -= dwin_string.length - plen; - } + // SS_CENTER: Pad with half of the unused space first + if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) dwin_string.add(' '); - // SS_FULL: Pad with enough space to justify the value - if (vlen) { - if (full && !center) { - // Move the leading colon from the value to the label - if (*vstr == ':') { dwin_string.add(':'); vstr++; } - // Move spaces to the padding - while (*vstr == ' ') { vstr++; pad++; } - // Pad in-between - for (; pad > 0; --pad) dwin_string.add(' '); - } - // Append the value - dwin_string.add(vstr); + // Append the templated label string + if (plen) { + dwin_string.add(ftpl, itemIndex, itemStringC, itemStringF); + pad -= dwin_string.length - plen; + } + + // SS_FULL: Pad with enough space to justify the value + if (vlen) { + if (full && !center) { + // Move the leading colon from the value to the label + if (*vstr == ':') { dwin_string.add(':'); vstr++; } + // Move spaces to the padding + while (*vstr == ' ') { vstr++; pad++; } + // Pad in-between + for (; pad > 0; --pad) dwin_string.add(' '); } + // Append the value + dwin_string.add(vstr); + } - // SS_CENTER: Pad the rest of the string - if (center) for (int8_t rpad = pad - (pad / 2); rpad > 0; --rpad) dwin_string.add(' '); + // SS_CENTER: Pad the rest of the string + if (center) for (int8_t rpad = pad - (pad / 2); rpad > 0; --rpad) dwin_string.add(' '); - lcd_moveto(1, row); - lcd_put_dwin_string(); - } + lcd_moveto(1, row); + lcd_put_dwin_string(); } // Draw a generic menu item void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char, const char post_char) { - if (mark_as_selected(row, sel)) { - ui.set_font(DWIN_FONT_MENU); - dwin_font.solid = false; - dwin_font.fg = COLOR_WHITE; + if (!mark_as_selected(row, sel)) return; - dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); + ui.set_font(DWIN_FONT_MENU); + dwin_font.solid = false; + dwin_font.fg = COLOR_WHITE; - pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length; - while (--n > 1) dwin_string.add(' '); + dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); - dwin_string.add(post_char); + pixel_len_t n = LCD_WIDTH - 1 - dwin_string.length; + while (--n > 1) dwin_string.add(' '); - lcd_moveto(1, row); - lcd_put_dwin_string(); - } + dwin_string.add(post_char); + + lcd_moveto(1, row); + lcd_put_dwin_string(); } // // Draw a menu item with an editable value // void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { - if (mark_as_selected(row, sel)) { - ui.set_font(DWIN_FONT_MENU); - dwin_font.solid = false; - dwin_font.fg = COLOR_WHITE; + if (!mark_as_selected(row, sel)) return; - const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(S(inStr))); + ui.set_font(DWIN_FONT_MENU); + dwin_font.solid = false; + dwin_font.fg = COLOR_WHITE; - dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); - if (vallen) dwin_string.add(':'); + const uint8_t vallen = (pgm ? utf8_strlen_P(inStr) : utf8_strlen(S(inStr))); - lcd_moveto(1, row); - lcd_put_dwin_string(); + dwin_string.set(ftpl, itemIndex, itemStringC, itemStringF); + if (vallen) dwin_string.add(':'); - if (vallen) { - dwin_font.fg = COLOR_YELLOW; - dwin_string.set(inStr); - lcd_moveto(LCD_WIDTH - vallen - 1, row); - lcd_put_dwin_string(); - } + lcd_moveto(1, row); + lcd_put_dwin_string(); + + if (vallen) { + dwin_font.fg = COLOR_YELLOW; + dwin_string.set(inStr); + lcd_moveto(LCD_WIDTH - vallen - 1, row); + lcd_put_dwin_string(); } } @@ -464,21 +464,21 @@ void MarlinUI::draw_status_message(const bool blink) { #if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { - if (mark_as_selected(row, sel)) { - dwin_string.set(); + if (!mark_as_selected(row, sel)) return; - uint8_t maxlen = LCD_WIDTH - 1; - if (isDir) { - dwin_string.add(LCD_STR_FOLDER " "); - maxlen -= 2; - } + dwin_string.set(); - dwin_string.add(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); - uint8_t n = maxlen - dwin_string.length; - while (n > 0) { dwin_string.add(' '); --n; } - lcd_moveto(1, row); - lcd_put_dwin_string(); + uint8_t maxlen = LCD_WIDTH - 1; + if (isDir) { + dwin_string.add(LCD_STR_FOLDER " "); + maxlen -= 2; } + + dwin_string.add(ui.scrolled_filename(theCard, maxlen, row, sel), maxlen); + uint8_t n = maxlen - dwin_string.length; + while (n > 0) { dwin_string.add(' '); --n; } + lcd_moveto(1, row); + lcd_put_dwin_string(); } #endif // HAS_MEDIA diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index bdf2513121ec..70e4e7326964 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -31,6 +31,84 @@ #include "marlinui.h" #include "lcdprint.h" +/** + * expand_u8str_P + * + * Expand a string with optional substitutions: + * + * $ displays the clipped string given by fstr or cstr + * { displays '0'....'10' for indexes 0 - 10 + * ~ displays '1'....'11' for indexes 0 - 10 + * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) + * @ displays an axis name such as XYZUVW, or E for an extruder + * + * Return the number of characters emitted + */ +lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t ind, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { + const uint8_t prop = USE_WIDE_GLYPH ? 2 : 1; + const uint8_t *p = (uint8_t*)ptpl; + char *o = outstr; + int8_t n = maxlen; + while (n > 0) { + lchar_t wc; + p = get_utf8_value_cb(p, read_byte_rom, wc); + if (!wc) break; + if (wc == '{' || wc == '~' || wc == '*') { + if (ind >= 0) { + if (wc == '*') { *o++ = 'E'; n--; } + if (n) { + int8_t inum = ind + ((wc == '{') ? 0 : LCD_FIRST_TOOL); + if (inum >= 10) { + *o++ = ('0' + (inum / 10)); n--; + inum %= 10; + } + if (n) { *o++ = '0' + inum; n--; } + } + } + else { + PGM_P const b = ind == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED); + strncpy_P(o, b, n); + n -= utf8_strlen_P(b); + o += strlen(o); + } + if (n > 0) { + strncpy_P(o, (PGM_P)p, n); + n -= utf8_strlen(o); + o += strlen(o); + break; + } + } + else if (wc == '$' && fstr) { + strncpy_P(o, FTOP(fstr), n); + n -= utf8_strlen_P(FTOP(fstr)); + o += strlen(o); + } + else if (wc == '$' && cstr) { + strncpy(o, cstr, n); + n -= utf8_strlen(o); + o += strlen(o); + } + else if (wc == '@') { + *o++ = AXIS_CHAR(ind); + *o = '\0'; + n--; + } + else if (wc > 255 && prop == 2) { + // Wide glyph support incomplete + *((uint16_t*)o) = wc; + o += 2; + *o = '\0'; + n--; + } + else { + *o++ = wc; + *o = '\0'; + n--; + } + } + return maxlen - n; +} + /** * lcd_put_u8str_P * diff --git a/Marlin/src/lcd/lcdprint.h b/Marlin/src/lcd/lcdprint.h index 9ba514791894..87032201fb0c 100644 --- a/Marlin/src/lcd/lcdprint.h +++ b/Marlin/src/lcd/lcdprint.h @@ -205,14 +205,37 @@ inline int lcd_put_u8str(const lcd_uint_t col, const lcd_uint_t row, FSTR_P cons return lcd_put_u8str_P(col, row, FTOP(fstr)); } +/** + * @brief Expand a string with optional substitution + * @details Expand a string with optional substitutions: + * $ : the clipped string given by fstr or cstr + * { : '0'....'10' for indexes 0 - 10 + * ~ : '1'....'11' for indexes 0 - 10 + * * : 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) + * @ : an axis name such as XYZUVW, or E for an extruder + * + * @param *outstr The output destination buffer + * @param ptpl A ROM string (template) + * @param ind An index value to use for = ~ * substitution + * @param cstr An SRAM C-string to use for $ substitution + * @param fstr A ROM F-string to use for $ substitution + * @param maxlen The maximum size of the string (in pixels on GLCD) + * @return the output width (in pixels on GLCD) + */ +lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH); + +inline lcd_uint_t expand_u8str(char * const outstr, FSTR_P const ftpl, const int8_t ind, const char *cstr=nullptr, FSTR_P const fstr=nullptr, const lcd_uint_t maxlen=LCD_WIDTH) { + return expand_u8str_P(outstr, FTOP(ftpl), ind, cstr, fstr, maxlen); +} + /** * @brief Draw a string with optional substitution * @details Print a string with optional substitutions: - * $ displays the clipped string given by fstr or cstr - * { displays '0'....'10' for indexes 0 - 10 - * ~ displays '1'....'11' for indexes 0 - 10 - * * displays 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) - * @ displays an axis name such as XYZUVW, or E for an extruder + * $ : the clipped string given by fstr or cstr + * { : '0'....'10' for indexes 0 - 10 + * ~ : '1'....'11' for indexes 0 - 10 + * * : 'E1'...'E11' for indexes 0 - 10 (By default. Uses LCD_FIRST_TOOL) + * @ : an axis name such as XYZUVW, or E for an extruder * * @param ptpl A ROM string (template) * @param ind An index value to use for = ~ * substitution diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index d4cbfd7a73d5..9bb785e927e8 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -76,7 +76,7 @@ class MenuItemBase { // STATIC_ITEM(LABEL,...) class MenuItem_static : public MenuItemBase { public: - static void draw(const uint8_t row, FSTR_P const fstr, const uint8_t style=SS_DEFAULT, const char *vstr=nullptr); + static void draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style=SS_DEFAULT, const char *vstr=nullptr); }; // BACK_ITEM(LABEL) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 4677d63b696c..293067b15cee 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -78,7 +78,7 @@ void menu_advanced_settings(); #if ENABLED(LCD_PROGRESS_BAR_TEST) - static void progress_bar_test() { + static void screen_progress_bar_test() { static int8_t bar_percent = 0; if (ui.use_click()) { ui.goto_previous_screen(); @@ -93,8 +93,8 @@ void menu_advanced_settings(); lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent); } - void _progress_bar_test() { - ui.goto_screen(progress_bar_test); + void _goto_progress_bar_test() { + ui.goto_screen(screen_progress_bar_test); TERN_(HAS_MARLINUI_HD44780, ui.set_custom_characters(CHARSET_INFO)); } @@ -108,7 +108,7 @@ void menu_advanced_settings(); #define STOP_MINMAX(A,I) STOP_ITEM(A,I,MIN,"Min") STOP_ITEM(A,I,MAX,"Max") #define FIL_ITEM(N) PSTRING_ITEM_N_P(N-1, MSG_FILAMENT_EN, (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) ? PSTR("PRESENT") : PSTR("out"), SS_FULL); - static void endstop_test() { + static void screen_endstop_test() { if (ui.use_click()) { ui.goto_previous_screen(); //endstops.enable_globally(false); @@ -148,11 +148,11 @@ void menu_advanced_settings(); BACK_ITEM(MSG_CONFIGURATION); #if ENABLED(LCD_PROGRESS_BAR_TEST) - SUBMENU(MSG_PROGRESS_BAR_TEST, _progress_bar_test); + SUBMENU(MSG_PROGRESS_BAR_TEST, _goto_progress_bar_test); #endif #if ENABLED(LCD_ENDSTOP_TEST) - SUBMENU(MSG_ENDSTOP_TEST, endstop_test); + SUBMENU(MSG_ENDSTOP_TEST, screen_endstop_test); #endif END_MENU(); diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 5f426294dce9..d4d398b9357d 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -339,10 +339,10 @@ void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, c } // Draw a menu item with a (potentially) editable value -void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char * const inStr, const bool pgm) { +void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { menu_item(row, sel); - tft_string.set(fstr, itemIndex, itemStringC, itemStringF); + tft_string.set(ftpl, itemIndex, itemStringC, itemStringF); tft.add_text(MENU_TEXT_X, MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); if (inStr) { tft_string.set(inStr); @@ -351,10 +351,10 @@ void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const fstr } // Draw a static item with no left-right margin required. Centered by default. -void MenuItem_static::draw(const uint8_t row, FSTR_P const fstr, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { +void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { menu_item(row); - tft_string.set(fstr, itemIndex, itemStringC, itemStringF); + tft_string.set(ftpl, itemIndex, itemStringC, itemStringF); const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); if (!full || !vstr) { From b8b1aa345cfeaa59e9d377edc3c143fc67cf16cc Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 21 Oct 2023 00:19:15 +0000 Subject: [PATCH 110/268] [cron] Bump distribution date (2023-10-21) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index eb6dce0bfd8d..eedd71dc9042 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-20" +//#define STRING_DISTRIBUTION_DATE "2023-10-21" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index c7200e2ebc23..3f5d4a3230fd 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-20" + #define STRING_DISTRIBUTION_DATE "2023-10-21" #endif /** From 156e7c1c5453e9b9fcd103fb1874eb5803ebea54 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Mon, 23 Oct 2023 08:25:28 +1300 Subject: [PATCH 111/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20TFT=20compile,=20K?= =?UTF-8?q?8400=20pins=20(#26359)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 4 ++-- Marlin/src/pins/mega/pins_GT2560_V41b.h | 2 +- Marlin/src/pins/ramps/pins_K8400.h | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 1c6e49644b52..419088c4c7e3 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -975,7 +975,7 @@ void MarlinUI::draw_status_screen() { uint8_t n = LCD_WIDTH; const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int8_t plen = fstr ? utf8_strlen(fstr) : 0, + const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, vlen = vstr ? utf8_strlen(vstr) : 0; int8_t pad = (center || full) ? n - plen - vlen : 0; @@ -983,7 +983,7 @@ void MarlinUI::draw_status_screen() { if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd.write(' '); n--; } // Draw as much of the label as fits - if (plen) n -= lcd_put_u8str(fstr, itemIndex, itemStringC, itemStringF, n - vlen); + if (plen) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n - vlen); if (vlen && n > 0) { // SS_FULL: Pad with enough space to justify the value diff --git a/Marlin/src/pins/mega/pins_GT2560_V41b.h b/Marlin/src/pins/mega/pins_GT2560_V41b.h index 449f246b19b9..ce0adc2a396f 100644 --- a/Marlin/src/pins/mega/pins_GT2560_V41b.h +++ b/Marlin/src/pins/mega/pins_GT2560_V41b.h @@ -233,7 +233,7 @@ #define BTN_EN2 H2_08_PIN #define BTN_ENC H2_09_PIN #define BEEPER_PIN H2_12_PIN -#elif ENABLED(CR10_STOCKDISPLAY) // Firmware compatible with stock GT 128x64 12pin LCD for the V41b +#elif ENABLED(CR10_STOCKDISPLAY) // Firmware compatible with stock GT 128x64 12pin LCD for the V41b #define LCD_PINS_RS H2_04_PIN // DOGLCD_CS #define LCD_PINS_D4 H2_05_PIN // DOGLCD_SCK #define LCD_PINS_EN H2_03_PIN // DOGLCD_MOSI diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h index bcb145825b24..abcffe484d5e 100644 --- a/Marlin/src/pins/ramps/pins_K8400.h +++ b/Marlin/src/pins/ramps/pins_K8400.h @@ -53,6 +53,11 @@ #define X_STOP_PIN 3 #define Y_STOP_PIN 14 +// +// Fans +// +#define FAN0_PIN 8 + #if ANY(BLTOUCH, TOUCH_MI_PROBE) #define INVERTED_PROBE_STATE #endif @@ -60,7 +65,7 @@ #include "pins_3DRAG.h" // ... RAMPS // -// Heaters / Fans +// Heaters // #undef HEATER_1_PIN #define HEATER_1_PIN 11 From 797ea5efa741ef96827870bb44b48fac7a41f1a0 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:15:38 -0700 Subject: [PATCH 112/268] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20MarlinUI=20expande?= =?UTF-8?q?d=20label=20alignment=20(#26339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ellensp <530024+ellensp@users.noreply.github.com> Co-authored-by: Scott Lahteine --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 33 ++++++++++---- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 27 +++++++++--- Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 38 +++++++++++----- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 33 +++++++++----- Marlin/src/lcd/lcdprint.cpp | 48 ++------------------- Marlin/src/lcd/menu/menu_configuration.cpp | 9 +++- 6 files changed, 106 insertions(+), 82 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 716d1341dbd4..ce19cb35ed9f 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1170,23 +1170,38 @@ void MarlinUI::draw_status_screen() { int8_t n = LCD_WIDTH; const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, - vlen = vstr ? utf8_strlen(vstr) : 0; - int8_t pad = (center || full) ? n - plen - vlen : 0; + + // Value length, if any + int8_t vlen = vstr ? utf8_strlen(vstr) : 0; + + // Expanded label string and width in chars + char estr[calculateWidth(ftpl) + 3] = "\0"; + int8_t llen = ftpl ? expand_u8str(estr, ftpl, itemIndex, itemStringC, itemStringF, n - vlen) : 0; + + bool mv_colon = false; + if (vlen) { + // Move the leading colon from the value to the label below + mv_colon = (*vstr == ':'); + // Shorter value, wider label + if (mv_colon) { vstr++; vlen--; llen++; } + // Remove leading spaces from the value and shorten + while (*vstr == ' ') { vstr++; vlen--; } + } + + // Padding for center or full justification + int8_t pad = (center || full) ? n - llen - vlen : 0; // SS_CENTER: Pad with half of the unused space first - if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd_put_u8str(F(" ")); n--; } + if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad, --pad, --n) lcd_put_u8str(F(" ")); - // Draw as much of the label as fits - if (plen) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n - vlen); + // Draw as much of the label as fits (without the relocated colon, drawn below) + if (llen) n -= lcd_put_u8str_max(estr, n - vlen); if (vlen && n > 0) { // SS_FULL: Pad with enough space to justify the value if (full && !center) { // Move the leading colon from the value to the label - if (*vstr == ':') { n -= lcd_put_u8str(F(":")); vstr++; } - // Move spaces to the padding - while (*vstr == ' ') { vstr++; pad++; } + if (mv_colon) n -= lcd_put_u8str(F(":")); // Pad in-between for (; pad > 0; --pad) { lcd_put_u8str(F(" ")); n--; } } diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 419088c4c7e3..a4d358c06311 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -975,23 +975,36 @@ void MarlinUI::draw_status_screen() { uint8_t n = LCD_WIDTH; const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, - vlen = vstr ? utf8_strlen(vstr) : 0; - int8_t pad = (center || full) ? n - plen - vlen : 0; + + // Value length, if any + int8_t vlen = vstr ? utf8_strlen(vstr) : 0; + + char estr[utf8_strlen(ftpl) + 3] = "\0"; + int8_t llen = ftpl ? expand_u8str(estr, ftpl, itemIndex, itemStringC, itemStringF, n - vlen) : 0; + + bool mv_colon = false; + if (vlen) { + // Move the leading colon from the value to the label below + mv_colon = (*vstr == ':'); + // Shorter value, wider label + if (mv_colon) { vstr++; vlen--; llen++; } + // Remove leading spaces from the value and shorten + while (*vstr == ' ') { vstr++; vlen--; } + } + + int8_t pad = (center || full) ? n - llen - vlen : 0; // SS_CENTER: Pad with half of the unused space first if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) { lcd.write(' '); n--; } // Draw as much of the label as fits - if (plen) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n - vlen); + if (llen) n -= lcd_put_u8str_max(estr, n - vlen); if (vlen && n > 0) { // SS_FULL: Pad with enough space to justify the value if (full && !center) { // Move the leading colon from the value to the label - if (*vstr == ':') { lcd.write(':'); vstr++; n--; } - // Move spaces to the padding - while (*vstr == ' ') { vstr++; pad++; } + if (mv_colon) { lcd.write(':'); n--; } // Pad in-between for (; pad > 0; --pad) { lcd.write(' '); n--; } } diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 6c15572f040b..1b608bcf5849 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -414,30 +414,46 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (!mark_as_selected(row, style & SS_INVERT)) return; pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed - const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int pwide = ftpl ? calculateWidth(ftpl) : 0, - vlen = vstr ? utf8_strlen(vstr) : 0; - int pad = (center || full) ? ((LCD_PIXEL_WIDTH) - pwide - vlen * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH) : 0; + + char estr[calculateWidth(ftpl) + 3] = "\0"; + pixel_len_t lwide = ftpl ? (MENU_FONT_WIDTH) * expand_u8str(estr, ftpl, itemIndex, itemStringC, itemStringF, (LCD_PIXEL_WIDTH) / (MENU_FONT_WIDTH)) : 0; + + // Value length, if any + int8_t vlen = vstr ? utf8_strlen(vstr) : 0; + + bool mv_colon = false; + if (vlen) { + // Move the leading colon from the value to the label below + mv_colon = (*vstr == ':'); + // Shorter value, wider label + if (mv_colon) { vstr++; vlen--; lwide += MENU_FONT_WIDTH; } + // Remove leading spaces from the value and shorten + while (*vstr == ' ') { vstr++; vlen--; } + } + + // Padding for center or full justification + int8_t pad = (center || full) ? ((LCD_PIXEL_WIDTH) - lwide - vlen * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH) : 0; // SS_CENTER: Pad with half of the unused space first - if (center) for (int lpad = pad / 2; lpad > 0; --lpad) n -= lcd_put_u8str(F(" ")); + if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) n -= lcd_put_u8str(F(" ")); - // Draw as much of the label as fits - if (pwide) n -= lcd_put_u8str(ftpl, itemIndex, itemStringC, itemStringF, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH); + // Draw as much of the label as fits (without the relocated colon, drawn below) + if (lwide) lcd_put_u8str_max(estr, n); + // Value string? if (vlen) { // SS_FULL: Pad with enough space to justify the value if (full && !center && n > MENU_FONT_WIDTH) { - // Move the leading colon from the value to the label - if (*vstr == ':') { n -= lcd_put_u8str(F(":")); vstr++; } - // Move spaces to the padding - while (*vstr == ' ') { vstr++; pad++; } + // Draw the leading colon moved from the value to the label + if (mv_colon) n -= lcd_put_u8str(F(":")); // Pad in-between for (; pad > 0; --pad) n -= lcd_put_u8str(F(" ")); } + // Draw the value string n -= lcd_put_u8str_max(vstr, n); } + // Always fill out the rest with spaces while (n > MENU_FONT_WIDTH) n -= lcd_put_u8str(F(" ")); } diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index c0bf0a75d6f6..f6804acac775 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -317,26 +317,39 @@ void MarlinUI::draw_status_message(const bool blink) { dwin_string.set(); const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); - const int8_t plen = ftpl ? utf8_strlen(ftpl) : 0, - vlen = vstr ? utf8_strlen(vstr) : 0; + int8_t plen = ftpl ? utf8_strlen(ftpl) : 0; + const int8_t olen = plen; + + // Value length, if any + int8_t vlen = vstr ? utf8_strlen(vstr) : 0; + + bool mv_colon = false; + if (vlen) { + // Move the leading colon from the value to the label below + mv_colon = (*vstr == ':'); + // Shorter value, wider label + if (mv_colon) { vstr++; vlen--; plen++; } + // Remove leading spaces from the value and shorten + while (*vstr == ' ') { vstr++; vlen--; } + } + int8_t pad = (center || full) ? (LCD_WIDTH) - 1 - plen - vlen : 0; // SS_CENTER: Pad with half of the unused space first - if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad) dwin_string.add(' '); + if (center) for (int8_t lpad = pad / 2; lpad > 0; --lpad, --pad) dwin_string.add(' '); - // Append the templated label string if (plen) { + // Append the templated label string dwin_string.add(ftpl, itemIndex, itemStringC, itemStringF); - pad -= dwin_string.length - plen; + // Remove padding if the string was expanded + pad -= dwin_string.length - olen; } // SS_FULL: Pad with enough space to justify the value if (vlen) { if (full && !center) { - // Move the leading colon from the value to the label - if (*vstr == ':') { dwin_string.add(':'); vstr++; } - // Move spaces to the padding - while (*vstr == ' ') { vstr++; pad++; } + // Append the leading colon moved from the value to the label + if (mv_colon) dwin_string.add(':'); // Pad in-between for (; pad > 0; --pad) dwin_string.add(' '); } @@ -345,7 +358,7 @@ void MarlinUI::draw_status_message(const bool blink) { } // SS_CENTER: Pad the rest of the string - if (center) for (int8_t rpad = pad - (pad / 2); rpad > 0; --rpad) dwin_string.add(' '); + if (center) while (pad--) dwin_string.add(' '); lcd_moveto(1, row); lcd_put_dwin_string(); diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 70e4e7326964..2b524e983f7e 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -123,50 +123,10 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in * Return the number of characters emitted */ lcd_uint_t lcd_put_u8str_P(PGM_P const ptpl, const int8_t ind, const char *cstr/*=nullptr*/, FSTR_P const fstr/*=nullptr*/, const lcd_uint_t maxlen/*=LCD_WIDTH*/) { - const uint8_t prop = USE_WIDE_GLYPH ? 2 : 1; - const uint8_t *p = (uint8_t*)ptpl; - int8_t n = maxlen; - while (n > 0) { - lchar_t wc; - p = get_utf8_value_cb(p, read_byte_rom, wc); - if (!wc) break; - if (wc == '{' || wc == '~' || wc == '*') { - if (ind >= 0) { - if (wc == '*') { lcd_put_u8str(F("E")); n--; } - if (n) { - int8_t inum = ind + ((wc == '{') ? 0 : LCD_FIRST_TOOL); - if (inum >= 10) { - lcd_put_lchar('0' + (inum / 10)); n--; - inum %= 10; - } - if (n) { lcd_put_lchar('0' + inum); n--; } - } - } - else { - PGM_P const b = ind == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED); - n -= lcd_put_u8str_max_P(b, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); - } - if (n) { - n -= lcd_put_u8str_max_P((PGM_P)p, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); - break; - } - } - else if (wc == '$' && fstr) { - n -= lcd_put_u8str_max_P(FTOP(fstr), n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); - } - else if (wc == '$' && cstr) { - n -= lcd_put_u8str_max(cstr, n * (MENU_FONT_WIDTH)) / (MENU_FONT_WIDTH); - } - else if (wc == '@') { - lcd_put_lchar(AXIS_CHAR(ind)); - n--; - } - else { - lcd_put_lchar(wc); - n -= wc > 255 ? prop : 1; - } - } - return maxlen - n; + char estr[maxlen + 2]; + const lcd_uint_t outlen = expand_u8str_P(estr, ptpl, ind, cstr, fstr, maxlen); + lcd_put_u8str_max(estr, maxlen * (MENU_FONT_WIDTH)); + return outlen; } // Calculate UTF8 width with a simple check diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 293067b15cee..63b7c527e015 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -104,7 +104,14 @@ void menu_advanced_settings(); #define __STOP_ITEM(F,S) PSTRING_ITEM_F_P(F, TEST(stops, S) ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN), SS_FULL); #define _STOP_ITEM(L,S) __STOP_ITEM(F(L), S) - #define STOP_ITEM(A,I,M,L) TERN(HAS_##A##I##_##M##_STATE, _STOP_ITEM, _IF_1_ELSE)(STRINGIFY(A) STRINGIFY(I) " " STRINGIFY(L), A##I##_##M) + #if HAS_X2_STATE || HAS_Y2_STATE || HAS_Z2_STATE + #define _S1_EXP_ ~, + #define _S1_SP_(I) THIRD(I, " ", "") + #define S1_SPACE(I) _S1_SP_(_CAT(_S1_EXP_,I)) + #else + #define S1_SPACE(I) + #endif + #define STOP_ITEM(A,I,M,L) TERN(HAS_##A##I##_##M##_STATE, _STOP_ITEM, _IF_1_ELSE)(STRINGIFY(A) STRINGIFY(I) S1_SPACE(I) " " L, A##I##_##M) #define STOP_MINMAX(A,I) STOP_ITEM(A,I,MIN,"Min") STOP_ITEM(A,I,MAX,"Max") #define FIL_ITEM(N) PSTRING_ITEM_N_P(N-1, MSG_FILAMENT_EN, (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) ? PSTR("PRESENT") : PSTR("out"), SS_FULL); From f72588595b4a4d3a0c40e26e1bad248ee0a062c9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 Oct 2023 15:17:30 -0500 Subject: [PATCH 113/268] =?UTF-8?q?=F0=9F=9A=B8=20SD=20refresh=20UI=20upda?= =?UTF-8?q?te=20with=20NO=5FSD=5FDETECT=20(#26366)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sascha --- Marlin/src/sd/cardreader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index 8ec33d1f72ef..9b9b3509d6e0 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -588,6 +588,8 @@ void CardReader::release() { flag.workDirIsRoot = true; nrItems = -1; SERIAL_ECHO_MSG(STR_SD_CARD_RELEASED); + + TERN_(NO_SD_DETECT, ui.refresh()); } /** From 8de007021ac357f44b06aec7df6d8d9522c3663b Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:44:29 -0700 Subject: [PATCH 114/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Don?= =?UTF-8?q?'t=20Recommend=20DevContainer=20(#26348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f495d14f53e8..52fe2a0bdbff 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,6 +6,7 @@ "platformio.platformio-ide" ], "unwantedRecommendations": [ + "ms-vscode-remote.remote-containers", "ms-vscode.cpptools-extension-pack" ] } From c345087b415e73e2a405c0088bd1f1e02ea6dd6a Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:46:34 -0700 Subject: [PATCH 115/268] =?UTF-8?q?=F0=9F=94=A8=20Add=20MKS=20Eagle=20FD?= =?UTF-8?q?=20Envs=20(#26346)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/pins.h | 2 +- ini/stm32f4.ini | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index d3f30e0e3f7a..122c9b937c47 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -787,7 +787,7 @@ #elif MB(MKS_ROBIN_NANO_V1_3_F4) #include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4 env:mks_robin_nano_v1_3_f4 env:mks_robin_nano_v1_3_f4_usbmod #elif MB(MKS_EAGLE) - #include "stm32f4/pins_MKS_EAGLE.h" // STM32F4 env:mks_eagle + #include "stm32f4/pins_MKS_EAGLE.h" // STM32F4 env:mks_eagle env:mks_eagle_usb_flash_drive env:mks_eagle_usb_flash_drive_msc #elif MB(ARTILLERY_RUBY) #include "stm32f4/pins_ARTILLERY_RUBY.h" // STM32F4 env:Artillery_Ruby #elif MB(CREALITY_V24S1_301F4) diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index 20009c89439f..b8e989642c8f 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -480,7 +480,6 @@ upload_protocol = jlink # # MKS Robin Nano V3 with USB Flash Drive Support -# Currently, using a STM32duino fork, until USB Host get merged # [env:mks_robin_nano_v3_usb_flash_drive] extends = env:mks_robin_nano_v3 @@ -493,7 +492,6 @@ build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} # # MKS Robin Nano V3 with USB Flash Drive Support and Shared Media -# Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged # [env:mks_robin_nano_v3_usb_flash_drive_msc] extends = env:mks_robin_nano_v3_usb_flash_drive @@ -510,7 +508,6 @@ board = marlin_STM32F407VET6_CCM # # MKS Robin Nano V3.1 with USB Flash Drive Support -# Currently, using a STM32duino fork, until USB Host get merged # [env:mks_robin_nano_v3_1_usb_flash_drive] extends = env:mks_robin_nano_v3_usb_flash_drive @@ -518,7 +515,6 @@ board = marlin_STM32F407VET6_CCM # # MKS Robin Nano V3.1 with USB Flash Drive Support and Shared Media -# Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged # [env:mks_robin_nano_v3_1_usb_flash_drive_msc] extends = env:mks_robin_nano_v3_usb_flash_drive_msc @@ -543,7 +539,6 @@ upload_protocol = jlink # # MKS Eagle with USB Flash Drive Support -# Currently, using a STM32duino fork, until USB Host get merged # [env:mks_eagle_usb_flash_drive] extends = env:mks_eagle @@ -556,7 +551,6 @@ build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} # # MKS Eagle with USB Flash Drive Support and Shared Media -# Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged # [env:mks_eagle_usb_flash_drive_msc] extends = env:mks_eagle_usb_flash_drive @@ -588,7 +582,6 @@ upload_protocol = jlink # # MKS Monster8 V1 / V2 (STM32F407VET6 ARM Cortex-M4) with USB Flash Drive Support -# Currently, using a STM32duino fork, until USB Host get merged # [env:mks_monster8_usb_flash_drive] extends = env:mks_monster8 @@ -601,7 +594,6 @@ build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1_CAN.build_flag # # MKS Monster8 V1 / V2 (STM32F407VET6 ARM Cortex-M4) with USB Flash Drive Support and Shared Media -# Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged # [env:mks_monster8_usb_flash_drive_msc] extends = env:mks_monster8_usb_flash_drive From 9e6d0ea6109157941179c67eed063b8ab68ef99b Mon Sep 17 00:00:00 2001 From: Marcio T Date: Sun, 22 Oct 2023 16:22:16 -0600 Subject: [PATCH 116/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20FTDI=20Eve=20Touch?= =?UTF-8?q?=20UI=20meshGetter,=20etc.=20(#26342)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/inc/Conditionals_adv.h | 2 +- .../ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp | 2 +- .../ftdi_eve_touch_ui/generic/filament_runout_screen.cpp | 4 +++- .../extui/ftdi_eve_touch_ui/generic/language_menu.cpp | 2 ++ buildroot/tests/FYSETC_S6 | 9 ++++++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 5e3f86919ac0..baba95267ecf 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1230,7 +1230,7 @@ #define _HAS_1(N) (defined(MAIN_MENU_ITEM_##N##_DESC) && defined(MAIN_MENU_ITEM_##N##_GCODE)) #define HAS_USER_ITEM(V...) DO(HAS,||,V) #else - #define HAS_USER_ITEM(N) 0 + #define HAS_USER_ITEM(...) 0 #endif /** diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp index c42d83420f2c..6030fd02a0e7 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/bed_mesh_view_screen.cpp @@ -53,7 +53,7 @@ constexpr static float gaugeThickness = 0.25; #endif static float meshGetter(uint8_t x, uint8_t y, void*) { - return ExtUI::getMeshPoint(xy_uint8_t(x, y)); + return ExtUI::getMeshPoint(xy_uint8_t({ x, y })); } void BedMeshViewScreen::onEntry() { diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_runout_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_runout_screen.cpp index 68948b0c5e5d..0569b90032d1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_runout_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_runout_screen.cpp @@ -46,7 +46,9 @@ void FilamentRunoutScreen::onRedraw(draw_mode_t what) { bool FilamentRunoutScreen::onTouchHeld(uint8_t tag) { using namespace ExtUI; - const float increment = getIncrement(); + #if HAS_FILAMENT_RUNOUT_DISTANCE + const float increment = getIncrement(); + #endif switch (tag) { case 2: setFilamentRunoutEnabled(!getFilamentRunoutEnabled()); break; #if HAS_FILAMENT_RUNOUT_DISTANCE diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp index 5d797f44df31..15252941d7de 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/language_menu.cpp @@ -53,6 +53,8 @@ void LanguageMenu::onRedraw(draw_mode_t) { #endif } +extern uint8_t ftdi_language; + bool LanguageMenu::onTouchEnd(uint8_t tag) { if (tag > 0 && tag <= NUM_LANGUAGES) { diff --git a/buildroot/tests/FYSETC_S6 b/buildroot/tests/FYSETC_S6 index 6d67800d77ec..9043b7b6e383 100755 --- a/buildroot/tests/FYSETC_S6 +++ b/buildroot/tests/FYSETC_S6 @@ -14,11 +14,14 @@ opt_set Y_DRIVER_TYPE TMC2209 Z_DRIVER_TYPE TMC2130 exec_test $1 $2 "FYSETC S6 Example" "$3" # -# Build with the default configurations with FYSETC TFT81050 +# Build with FTDI Eve Touch UI and some features # restore_configs -opt_set MOTHERBOARD BOARD_FYSETC_S6_V2_0 SERIAL_PORT 1 -opt_enable TOUCH_UI_FTDI_EVE LCD_FYSETC_TFT81050 S6_TFT_PINMAP +opt_set MOTHERBOARD BOARD_FYSETC_S6_V2_0 SERIAL_PORT 1 X_DRIVER_TYPE TMC2130 +opt_enable TOUCH_UI_FTDI_EVE LCD_FYSETC_TFT81050 S6_TFT_PINMAP LCD_LANGUAGE_2 SDSUPPORT CUSTOM_MENU_MAIN \ + FIX_MOUNTED_PROBE AUTO_BED_LEVELING_UBL Z_SAFE_HOMING \ + EEPROM_SETTINGS PRINTCOUNTER CALIBRATION_GCODE LIN_ADVANCE \ + FILAMENT_RUNOUT_SENSOR ADVANCED_PAUSE_FEATURE NOZZLE_PARK_FEATURE exec_test $1 $2 "FYSETC S6 2 with LCD FYSETC TFT81050" "$3" # cleanup From 45a6e9614e671ed97a1de33a966e25cd28329a14 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 22 Oct 2023 18:33:36 -0500 Subject: [PATCH 117/268] =?UTF-8?q?=F0=9F=93=9D=20Community=20Reporting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/code_of_conduct.md | 8 +------- .github/contributing.md | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/code_of_conduct.md b/.github/code_of_conduct.md index 854fed4ec458..888c2ccf76fd 100644 --- a/.github/code_of_conduct.md +++ b/.github/code_of_conduct.md @@ -28,15 +28,9 @@ Project maintainers are responsible for clarifying the standards of acceptable b Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [marlinfirmware@github.com](mailto:marlinfirmware@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by messaging @MarlinFirmware/moderators on the relevant issue, [or privately](//github.com/orgs/MarlinFirmware/teams/moderators). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. ## Attribution diff --git a/.github/contributing.md b/.github/contributing.md index ef1726366a7d..f3825d208112 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -26,7 +26,7 @@ The following is a set of guidelines for contributing to Marlin, hosted by the [ ## Code of Conduct -This project and everyone participating in it is governed by the [Marlin Code of Conduct](code_of_conduct.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [marlinfirmware@github.com](mailto:marlinfirmware@github.com). +This project and everyone participating in it is governed by the [Marlin Code of Conduct](code_of_conduct.md). By participating, you are expected to uphold this code. Please report unacceptable behavior by messaging @MarlinFirmware/moderators on the relevant issue, [or privately](//github.com/orgs/MarlinFirmware/teams/moderators). ## I don't want to read this whole thing I just have a question!!! From 089d075c8fd8f9c76df5eb03df9451aca3af5160 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 23 Oct 2023 00:20:43 +0000 Subject: [PATCH 118/268] [cron] Bump distribution date (2023-10-23) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index eedd71dc9042..53bb86cee99c 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-21" +//#define STRING_DISTRIBUTION_DATE "2023-10-23" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3f5d4a3230fd..b3aea032b9f1 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-21" + #define STRING_DISTRIBUTION_DATE "2023-10-23" #endif /** From fd62c42faa15998d6771a18a5f704e24f7bfa1f8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 23 Oct 2023 17:07:04 -0500 Subject: [PATCH 119/268] =?UTF-8?q?=F0=9F=A9=B9=20No=20GET=5FTEXT=20with?= =?UTF-8?q?=20DGUS=5FTFT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #26164 --- .../src/lcd/extui/anycubic_vyper/dgus_tft.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index 1aaa37870806..b1889281af56 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -293,9 +293,9 @@ namespace Anycubic { DEBUG_ECHOLNPGM("printerKilled()\nerror: ", error, "\ncomponent: ", component); #endif - if (strcmp_P(error, GET_TEXT(MSG_ERR_HEATING_FAILED)) == 0) { + if (strcmp_P(error, Language_en::MSG_ERR_HEATING_FAILED) == 0) { - if (strcmp_P(component, PSTR("Bed")) == 0) { + if (strcmp_P(component, Language_en::MSG_BED) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_HEATER); SERIAL_ECHOLNPGM("Check Bed heater"); } @@ -305,9 +305,9 @@ namespace Anycubic { } } - else if (strcmp_P(error, GET_TEXT(MSG_ERR_MINTEMP)) == 0) { + else if (strcmp_P(error, Language_en::MSG_ERR_MINTEMP) == 0) { - if (strcmp_P(component, PSTR("Bed")) == 0) { + if (strcmp_P(component, Language_en::MSG_BED) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_NTC); SERIAL_ECHOLNPGM("Check Bed thermistor"); } @@ -317,9 +317,9 @@ namespace Anycubic { } } - else if (strcmp_P(error, GET_TEXT(MSG_ERR_MAXTEMP)) == 0) { + else if (strcmp_P(error, Language_en::MSG_ERR_MAXTEMP) == 0) { - if (strcmp_P(component, PSTR("Bed")) == 0) { + if (strcmp_P(component, Language_en::MSG_BED) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_NTC); SERIAL_ECHOLNPGM("Check Bed thermistor"); } @@ -329,9 +329,9 @@ namespace Anycubic { } } - else if (strcmp_P(error, GET_TEXT(MSG_ERR_THERMAL_RUNAWAY)) == 0) { + else if (strcmp_P(error, Language_en::MSG_ERR_THERMAL_RUNAWAY) == 0) { - if (strcmp_P(component, PSTR("Bed")) == 0) { + if (strcmp_P(component, Language_en::MSG_BED) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_HEATER); SERIAL_ECHOLNPGM("Check Bed thermal runaway"); } @@ -341,7 +341,7 @@ namespace Anycubic { } } - else if (strcmp_P(error, GET_TEXT(MSG_KILL_HOMING_FAILED)) == 0) { + else if (strcmp_P(error, Language_en::MSG_KILL_HOMING_FAILED) == 0) { if (strcmp_P(component, PSTR("X")) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_X_ENDSTOP); From ff5eb5de29e889c972bfda73cce01796205d47f0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 23 Oct 2023 18:54:11 -0500 Subject: [PATCH 120/268] =?UTF-8?q?=F0=9F=A9=B9=20No=20GET=5FTEXT=20with?= =?UTF-8?q?=20DGUS=5FTFT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #26164 --- .../src/lcd/extui/anycubic_vyper/dgus_tft.cpp | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index b1889281af56..4726cba3786a 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -276,6 +276,9 @@ namespace Anycubic { return stringLength; } + #undef GET_TEXT + #define GET_TEXT(MSG) Language_en::MSG + void DgusTFT::printerKilled(FSTR_P error_p, FSTR_P component_p) { // copy string in FLASH to RAM for strcmp_P @@ -293,9 +296,9 @@ namespace Anycubic { DEBUG_ECHOLNPGM("printerKilled()\nerror: ", error, "\ncomponent: ", component); #endif - if (strcmp_P(error, Language_en::MSG_ERR_HEATING_FAILED) == 0) { + if (strcmp_P(error, GET_TEXT(MSG_ERR_HEATING_FAILED)) == 0) { - if (strcmp_P(component, Language_en::MSG_BED) == 0) { + if (strcmp_P(component, GET_TEXT(MSG_BED)) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_HEATER); SERIAL_ECHOLNPGM("Check Bed heater"); } @@ -305,9 +308,9 @@ namespace Anycubic { } } - else if (strcmp_P(error, Language_en::MSG_ERR_MINTEMP) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_ERR_MINTEMP)) == 0) { - if (strcmp_P(component, Language_en::MSG_BED) == 0) { + if (strcmp_P(component, GET_TEXT(MSG_BED)) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_NTC); SERIAL_ECHOLNPGM("Check Bed thermistor"); } @@ -317,9 +320,9 @@ namespace Anycubic { } } - else if (strcmp_P(error, Language_en::MSG_ERR_MAXTEMP) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_ERR_MAXTEMP)) == 0) { - if (strcmp_P(component, Language_en::MSG_BED) == 0) { + if (strcmp_P(component, GET_TEXT(MSG_BED)) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_NTC); SERIAL_ECHOLNPGM("Check Bed thermistor"); } @@ -329,9 +332,9 @@ namespace Anycubic { } } - else if (strcmp_P(error, Language_en::MSG_ERR_THERMAL_RUNAWAY) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_ERR_THERMAL_RUNAWAY)) == 0) { - if (strcmp_P(component, Language_en::MSG_BED) == 0) { + if (strcmp_P(component, GET_TEXT(MSG_BED)) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_BED_HEATER); SERIAL_ECHOLNPGM("Check Bed thermal runaway"); } @@ -341,7 +344,7 @@ namespace Anycubic { } } - else if (strcmp_P(error, Language_en::MSG_KILL_HOMING_FAILED) == 0) { + else if (strcmp_P(error, GET_TEXT(MSG_KILL_HOMING_FAILED)) == 0) { if (strcmp_P(component, PSTR("X")) == 0) { changePageOfTFT(PAGE_CHS_ABNORMAL_X_ENDSTOP); From e9b04ada1d2f14f124a0d449205deda8c372340b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 23 Oct 2023 18:51:34 -0500 Subject: [PATCH 121/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20PLR=20debug=20with?= =?UTF-8?q?=20NO=5FVOLUMETRICS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/powerloss.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 7fb60349c6e5..75ac03f00cad 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -219,15 +219,13 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW #endif #endif - #if HAS_EXTRUDERS + #if HAS_HOTEND HOTEND_LOOP() info.target_temperature[e] = thermalManager.degTargetHotend(e); #endif TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.degTargetBed()); - #if HAS_FAN - COPY(info.fan_speed, thermalManager.fan_speed); - #endif + TERN_(HAS_FAN, COPY(info.fan_speed, thermalManager.fan_speed)); #if HAS_LEVELING info.flag.leveling = planner.leveling_active; @@ -672,7 +670,9 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPGM("flag.dryrun: ", AS_DIGIT(info.flag.dryrun)); DEBUG_ECHOLNPGM("flag.allow_cold_extrusion: ", AS_DIGIT(info.flag.allow_cold_extrusion)); - DEBUG_ECHOLNPGM("flag.volumetric_enabled: ", AS_DIGIT(info.flag.volumetric_enabled)); + #if DISABLED(NO_VOLUMETRICS) + DEBUG_ECHOLNPGM("flag.volumetric_enabled: ", AS_DIGIT(info.flag.volumetric_enabled)); + #endif } else DEBUG_ECHOLNPGM("INVALID DATA"); From bcd07c2c91a1148b34c5929f29e746ca1158cce7 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 24 Oct 2023 00:19:54 +0000 Subject: [PATCH 122/268] [cron] Bump distribution date (2023-10-24) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 53bb86cee99c..6e5e76e2c238 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-23" +//#define STRING_DISTRIBUTION_DATE "2023-10-24" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b3aea032b9f1..e4b54285e356 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-23" + #define STRING_DISTRIBUTION_DATE "2023-10-24" #endif /** From 046439a5a1bcbc9baac156f9fbb7686edbf7bbeb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Oct 2023 14:27:22 -0500 Subject: [PATCH 123/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Ech?= =?UTF-8?q?o=20by=20default=20in=20dev=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/serial.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index a41740f25ffd..d6c4b55459de 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -27,7 +27,8 @@ #include "../feature/ethernet.h" #endif -uint8_t marlin_debug_flags = MARLIN_DEBUG_NONE; +// Echo commands to the terminal by default in dev mode +uint8_t marlin_debug_flags = TERN(MARLIN_DEV_MODE, MARLIN_DEBUG_ECHO, MARLIN_DEBUG_NONE); // Commonly-used strings in serial output PGMSTR(SP_A_STR, " A"); PGMSTR(SP_B_STR, " B"); PGMSTR(SP_C_STR, " C"); From b25f523acabde814397b9c2eddc2e77792fb86a9 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 26 Oct 2023 00:23:31 +0000 Subject: [PATCH 124/268] [cron] Bump distribution date (2023-10-26) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 6e5e76e2c238..5b172862f969 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-24" +//#define STRING_DISTRIBUTION_DATE "2023-10-26" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e4b54285e356..aabc9fd9fbf3 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-24" + #define STRING_DISTRIBUTION_DATE "2023-10-26" #endif /** From 2a88e7600298fef27e8cbbe01b708959515677fb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 25 Oct 2023 19:41:32 -0500 Subject: [PATCH 125/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Mis?= =?UTF-8?q?c.=20LCD=20/=20string=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/G35.cpp | 7 ++--- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 4 +-- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 4 +-- Marlin/src/lcd/dogm/lcdprint_u8g.cpp | 6 ++++ Marlin/src/lcd/dogm/marlinui_DOGM.cpp | 4 +-- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 12 ++++---- Marlin/src/lcd/marlinui.cpp | 14 ++++++---- Marlin/src/lcd/marlinui.h | 2 +- Marlin/src/lcd/menu/menu.cpp | 4 +-- Marlin/src/lcd/menu/menu.h | 16 +++++------ Marlin/src/lcd/menu/menu_item.h | 31 +++++++++++---------- Marlin/src/lcd/tft/ui_color_ui.cpp | 12 ++++---- Marlin/src/lcd/tft/ui_common.cpp | 13 +++++---- 13 files changed, 71 insertions(+), 58 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index a37e5623e746..1b2f115cdfb7 100644 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -57,7 +57,8 @@ * 41 - Counter-Clockwise M4 * 50 - Clockwise M5 * 51 - Counter-Clockwise M5 - **/ + * + */ void GcodeSuite::G35() { DEBUG_SECTION(log_G35, "G35", DEBUGGING(LEVELING)); @@ -82,9 +83,7 @@ void GcodeSuite::G35() { set_bed_leveling_enabled(false); #endif - #if ENABLED(CNC_WORKSPACE_PLANES) - workspace_plane = PLANE_XY; - #endif + TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY); probe.use_probing_tool(); diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index ce19cb35ed9f..2564d4f96e23 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1248,8 +1248,8 @@ void MarlinUI::draw_status_screen() { } // The Select Screen presents a prompt and two "buttons" - void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { - ui.draw_select_screen_prompt(pref, string, suff); + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const fsuf/*=nullptr*/) { + ui.draw_select_screen_prompt(fpre, string, fsuf); if (no) { SETCURSOR(0, LCD_HEIGHT - 1); lcd_put_lchar(yesno ? ' ' : '['); lcd_put_u8str(no); lcd_put_lchar(yesno ? ' ' : ']'); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index a4d358c06311..4a6a6eec4722 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -1064,9 +1064,9 @@ void MarlinUI::draw_status_screen() { } // The Select Screen presents a prompt and two "buttons" - void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string, FSTR_P const suff) { + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string, FSTR_P const fsuf) { if (!PanelDetected) return; - ui.draw_select_screen_prompt(pref, string, suff); + ui.draw_select_screen_prompt(fpre, string, fsuf); lcd.write(COLOR_EDIT); if (no) { lcd_moveto(0, MIDDLE_Y); diff --git a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp index a615c2176661..30d687ddef5c 100644 --- a/Marlin/src/lcd/dogm/lcdprint_u8g.cpp +++ b/Marlin/src/lcd/dogm/lcdprint_u8g.cpp @@ -38,6 +38,9 @@ int lcd_put_lchar_max(const lchar_t &c, const pixel_len_t max_length) { return ret; } +/** + * @return output width in pixels + */ int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length); @@ -45,6 +48,9 @@ int lcd_put_u8str_max(const char * utf8_str, const pixel_len_t max_length) { return ret; } +/** + * @return output width in pixels + */ int lcd_put_u8str_max_P(PGM_P utf8_pstr, const pixel_len_t max_length) { u8g_uint_t x = u8g.getPrintCol(), y = u8g.getPrintRow(), ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_pstr, max_length); diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp index 1b608bcf5849..30258f0d483a 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.cpp +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.cpp @@ -551,8 +551,8 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop if (inv) u8g.setColorIndex(1); } - void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { - ui.draw_select_screen_prompt(fpre, string, suff); + void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const fsuf/*=nullptr*/) { + ui.draw_select_screen_prompt(fpre, string, fsuf); if (no) draw_boxed_string(1, LCD_HEIGHT - 1, no, !yesno); if (yes) draw_boxed_string(LCD_WIDTH - (utf8_strlen(yes) * (USE_WIDE_GLYPH ? 2 : 1) + 1), LCD_HEIGHT - 1, yes, yesno); } diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index f6804acac775..cc9d7b2e7b31 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -412,12 +412,12 @@ void MarlinUI::draw_status_message(const bool blink) { // // Draw an edit screen with label and current value // - void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char* const value/*=nullptr*/) { + void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char* const value/*=nullptr*/) { ui.encoder_direction_normal(); - const dwin_coord_t labellen = utf8_strlen(fstr), vallen = utf8_strlen(value); + const dwin_coord_t labellen = utf8_strlen(ftpl), vallen = utf8_strlen(value); - dwin_string.set(FTOP(fstr), itemIndex); + dwin_string.set(FTOP(ftpl), itemIndex); if (vallen) dwin_string.add(':'); // If a value is included, add a colon // Assume the label is alpha-numeric (with a descender) @@ -453,7 +453,7 @@ void MarlinUI::draw_status_message(const bool blink) { } inline void draw_boxed_string(const bool yesopt, FSTR_P const fstr, const bool inv) { - const uint8_t len = utf8_strlen(fstr), + const uint8_t len = utf8_strlen_P(FTOP(fstr)), mar = TERN(DWIN_MARLINUI_PORTRAIT, 1, 4), col = yesopt ? LCD_WIDTH - mar - len : mar, row = (LCD_HEIGHT >= 8 ? LCD_HEIGHT / 2 + 3 : LCD_HEIGHT - 1); @@ -464,12 +464,12 @@ void MarlinUI::draw_status_message(const bool blink) { void MenuItem_confirm::draw_select_screen( FSTR_P const yes, FSTR_P const no, const bool yesno, - FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/ + FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const fsuf/*=nullptr*/ ) { ui.set_font(DWIN_FONT_MENU); dwin_font.solid = false; dwin_font.fg = COLOR_WHITE; - ui.draw_select_screen_prompt(pref, string, suff); + ui.draw_select_screen_prompt(fpre, string, fsuf); if (no) draw_boxed_string(false, no, !yesno); if (yes) draw_boxed_string(true, yes, yesno); } diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 1076d40de014..463d406110e7 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -444,8 +444,9 @@ void MarlinUI::init() { p = get_utf8_value_cb(p, cb_read_byte, wc); const bool eol = !wc; // zero ends the string // End or a break between phrases? - if (eol || wc == ' ' || wc == '-' || wc == '+' || wc == '.') { - if (!c && wc == ' ') { if (wrd) wrd++; continue; } // collapse extra spaces + if (eol || wc == ' ' || wc == '-' || wc == '+' || wc == '.' || wc == '\n') { + const bool newline_after = wc == '\n'; + if (!c && (wc == ' ' || newline_after)) { if (wrd) wrd++; continue; } // collapse extra spaces // Past the right and the word is not too long? if (col + c > LCD_WIDTH && col >= (LCD_WIDTH) / 4) _newline(); // should it wrap? c += !eol; // +1 so the space will be printed @@ -456,6 +457,7 @@ void MarlinUI::init() { lcd_put_lchar(wc); // character to the LCD } if (eol) break; // all done! + if (newline_after) _newline(); wrd = nullptr; // set up for next word } else c++; // count word characters @@ -472,20 +474,20 @@ void MarlinUI::init() { } } - void MarlinUI::draw_select_screen_prompt(FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { - const uint8_t plen = utf8_strlen(pref), slen = suff ? utf8_strlen(suff) : 0; + void MarlinUI::draw_select_screen_prompt(FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const fsuf/*=nullptr*/) { + const uint8_t plen = utf8_strlen_P(FTOP(fpre)), slen = fsuf ? utf8_strlen_P(FTOP(fsuf)) : 0; uint8_t col = 0, row = 0; if (!string && plen + slen <= LCD_WIDTH) { col = (LCD_WIDTH - plen - slen) / 2; row = LCD_HEIGHT > 3 ? 1 : 0; } if (LCD_HEIGHT >= 8) row = LCD_HEIGHT / 2 - 2; - wrap_string_P(col, row, FTOP(pref), true); + wrap_string_P(col, row, FTOP(fpre), true); if (string) { if (col) { col = 0; row++; } // Move to the start of the next line wrap_string(col, row, string); } - if (suff) wrap_string_P(col, row, FTOP(suff)); + if (fsuf) wrap_string_P(col, row, FTOP(fsuf)); } #endif // !HAS_GRAPHICAL_TFT diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 9c301e03f639..69235dda36b9 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -729,7 +729,7 @@ class MarlinUI { static float ubl_mesh_value(); #endif - static void draw_select_screen_prompt(FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr); + static void draw_select_screen_prompt(FSTR_P const fpre, const char * const string=nullptr, FSTR_P const fsuf=nullptr); #else diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index a9574dd4d9af..a4eab8fc9d85 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -352,13 +352,13 @@ bool MarlinUI::update_selection() { void MenuItem_confirm::select_screen( FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/ + FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const fsuf/*=nullptr*/ ) { ui.defer_status_screen(); const bool ui_selection = !yes ? false : !no || ui.update_selection(), got_click = ui.use_click(); if (got_click || ui.should_draw()) { - draw_select_screen(yes, no, ui_selection, pref, string, suff); + draw_select_screen(yes, no, ui_selection, fpre, string, fsuf); if (got_click) { selectFunc_t callFunc = ui_selection ? yesFunc : noFunc; if (callFunc) callFunc(); else ui.goto_previous_screen(); diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 9bb785e927e8..e4cd183b4646 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -102,31 +102,31 @@ class MenuItem_confirm : public MenuItemBase { FSTR_P const yes, // Right option label FSTR_P const no, // Left option label const bool yesno, // Is "yes" selected? - FSTR_P const pref, // Prompt prefix + FSTR_P const fpre, // Prompt prefix const char * const string, // Prompt runtime string - FSTR_P const suff // Prompt suffix + FSTR_P const fsuf // Prompt suffix ); static void select_screen( FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr + FSTR_P const fpre, const char * const string=nullptr, FSTR_P const fsuf=nullptr ); static void select_screen( FSTR_P const yes, FSTR_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, - FSTR_P const pref, FSTR_P const fstr, FSTR_P const suff=nullptr + FSTR_P const fpre, FSTR_P const fstr, FSTR_P const fsuf=nullptr ) { #ifdef __AVR__ char str[strlen_P(FTOP(fstr)) + 1]; strcpy_P(str, FTOP(fstr)); - select_screen(yes, no, yesFunc, noFunc, pref, str, suff); + select_screen(yes, no, yesFunc, noFunc, fpre, str, fsuf); #else - select_screen(yes, no, yesFunc, noFunc, pref, FTOP(fstr), suff); + select_screen(yes, no, yesFunc, noFunc, fpre, FTOP(fstr), fsuf); #endif } // Shortcut for prompt with "NO"/ "YES" labels - FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, FSTR_P const pref, const char * const string=nullptr, FSTR_P const suff=nullptr) { - select_screen(GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO), yesFunc, noFunc, pref, string, suff); + FORCE_INLINE static void confirm_screen(selectFunc_t yesFunc, selectFunc_t noFunc, FSTR_P const fpre, const char * const string=nullptr, FSTR_P const fsuf=nullptr) { + select_screen(GET_TEXT_F(MSG_YES), GET_TEXT_F(MSG_NO), yesFunc, noFunc, fpre, string, fsuf); } }; diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index ecc1ac4047a7..011cdc4423aa 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -242,6 +242,9 @@ class MenuItem_bool : public MenuEditItemBase { #define START_SCREEN() SCREEN_OR_MENU_LOOP(false) #define START_MENU() SCREEN_OR_MENU_LOOP(true) #define NEXT_ITEM() (++_thisItemNr) +#define MY_LINE() (_menuLineNr == _thisItemNr) +#define HIGHLIGHTED() (encoderLine == _thisItemNr) +#define CLICKED() (HIGHLIGHTED() && ui.use_click()) #define SKIP_ITEM() NEXT_ITEM() #define END_SCREEN() } screen_items = _thisItemNr #define END_MENU() END_SCREEN(); UNUSED(_skipStatic) @@ -274,19 +277,19 @@ class MenuItem_bool : public MenuEditItemBase { #define _MENU_INNER_F(TYPE, USE_MULTIPLIER, FLABEL, V...) do { \ FSTR_P const flabel = FLABEL; \ - if (encoderLine == _thisItemNr && ui.use_click()) { \ + if (CLICKED()) { \ _MENU_ITEM_MULTIPLIER_CHECK(USE_MULTIPLIER); \ MenuItem_##TYPE::action(flabel, ##V); \ if (ui.screen_changed) return; \ } \ if (ui.should_draw()) \ MenuItem_##TYPE::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, flabel, ##V); \ + (HIGHLIGHTED(), _lcdLineNr, flabel, ##V); \ }while(0) // Item with optional data #define _MENU_ITEM_F(TYPE, V...) do { \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ _MENU_INNER_F(TYPE, ##V); \ } \ @@ -295,7 +298,7 @@ class MenuItem_bool : public MenuEditItemBase { // Item with index value, C-string, and optional data #define _MENU_ITEM_N_S_F(TYPE, N, S, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ MenuItemBase::init(N, S); \ _MENU_INNER_F(TYPE, ##V); \ @@ -305,7 +308,7 @@ class MenuItem_bool : public MenuEditItemBase { // Item with index value and F-string #define _MENU_ITEM_N_f_F(TYPE, N, f, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ MenuItemBase::init(N, f); \ _MENU_INNER_F(TYPE, ##V); \ @@ -315,7 +318,7 @@ class MenuItem_bool : public MenuEditItemBase { // Item with index value #define _MENU_ITEM_N_F(TYPE, N, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ MenuItemBase::init(N); \ _MENU_INNER_F(TYPE, ##V); \ @@ -325,7 +328,7 @@ class MenuItem_bool : public MenuEditItemBase { // Items with a unique string #define _MENU_ITEM_S_F(TYPE, S, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ MenuItemBase::init(0, S); \ _MENU_INNER_F(TYPE, ##V); \ @@ -335,7 +338,7 @@ class MenuItem_bool : public MenuEditItemBase { // Items with a unique F-string #define _MENU_ITEM_f_F(TYPE, f, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ MenuItemBase::init(0, f); \ _MENU_INNER_F(TYPE, ##V); \ @@ -356,13 +359,13 @@ class MenuItem_bool : public MenuEditItemBase { } while(0) #define STATIC_ITEM_F(FLABEL, V...) do{ \ - if (_menuLineNr == _thisItemNr) \ + if (MY_LINE()) \ STATIC_ITEM_INNER_F(FLABEL, ##V); \ NEXT_ITEM(); \ } while(0) #define STATIC_ITEM_N_F(N, FLABEL, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ MenuItemBase::init(N); \ STATIC_ITEM_INNER_F(FLABEL, ##V); \ } \ @@ -500,18 +503,18 @@ class MenuItem_bool : public MenuEditItemBase { #define EDIT_ITEM_FAST_f(TYPE, f, LABEL, V...) EDIT_ITEM_FAST_f_F(TYPE, f, GET_TEXT_F(LABEL), ##V) #define _CONFIRM_ITEM_INNER_F(FLABEL, V...) do { \ - if (encoderLine == _thisItemNr && ui.use_click()) { \ + if (CLICKED()) { \ ui.push_current_screen(); \ ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \ return; \ } \ if (ui.should_draw()) MenuItem_confirm::draw \ - (encoderLine == _thisItemNr, _lcdLineNr, FLABEL, ##V); \ + (HIGHLIGHTED(), _lcdLineNr, FLABEL, ##V); \ }while(0) // Indexed items set a global index value and optional data #define _CONFIRM_ITEM_F(FLABEL, V...) do { \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ _CONFIRM_ITEM_INNER_F(FLABEL, ##V); \ } \ @@ -520,7 +523,7 @@ class MenuItem_bool : public MenuEditItemBase { // Indexed items set a global index value #define _CONFIRM_ITEM_N_S_F(N, S, V...) do{ \ - if (_menuLineNr == _thisItemNr) { \ + if (MY_LINE()) { \ _skipStatic = false; \ MenuItemBase::init(N, S); \ _CONFIRM_ITEM_INNER_F(TYPE, ##V); \ diff --git a/Marlin/src/lcd/tft/ui_color_ui.cpp b/Marlin/src/lcd/tft/ui_color_ui.cpp index cefbd05d1953..d6f3d2eff7fa 100644 --- a/Marlin/src/lcd/tft/ui_color_ui.cpp +++ b/Marlin/src/lcd/tft/ui_color_ui.cpp @@ -393,14 +393,14 @@ void MarlinUI::draw_status_screen() { } // Low-level draw_edit_screen can be used to draw an edit screen from anyplace -void MenuEditItemBase::draw_edit_screen(FSTR_P const fstr, const char * const value/*=nullptr*/) { +void MenuEditItemBase::draw_edit_screen(FSTR_P const ftpl, const char * const value/*=nullptr*/) { ui.encoder_direction_normal(); TERN_(TOUCH_SCREEN, touch.clear()); uint16_t line = 1; menu_line(line++); - tft_string.set(fstr, itemIndex, itemStringC, itemStringF); + tft_string.set(ftpl, itemIndex, itemStringC, itemStringF); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); @@ -457,13 +457,13 @@ void TFT::draw_edit_screen_buttons() { } // The Select Screen presents a prompt and two "buttons" -void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const pref, const char * const string/*=nullptr*/, FSTR_P const suff/*=nullptr*/) { +void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, const bool yesno, FSTR_P const fpre, const char * const string/*=nullptr*/, FSTR_P const fsuf/*=nullptr*/) { uint16_t line = 1; if (!string) line++; menu_line(line++); - tft_string.set(pref); + tft_string.set(fpre); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); @@ -474,9 +474,9 @@ void MenuItem_confirm::draw_select_screen(FSTR_P const yes, FSTR_P const no, con tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); } - if (suff) { + if (fsuf) { menu_line(line); - tft_string.set(suff); + tft_string.set(fsuf); tft_string.trim(); tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); } diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index d4d398b9357d..3426abab0e20 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -316,14 +316,14 @@ void lcd_put_int(const int i) { // // Draw a generic menu item with pre_char (if selected) and post_char -void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const fstr, const char pre_char, const char post_char) { +void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) { menu_item(row, sel); - const char *string = FTOP(fstr); + const char *string = FTOP(ftpl); MarlinImage image = noImage; switch (*string) { - case 0x01: image = imgRefresh; break; // LCD_STR_REFRESH - case 0x02: image = imgDirectory; break; // LCD_STR_FOLDER + case LCD_STR_REFRESH[0]: image = imgRefresh; break; + case LCD_STR_FOLDER[0]: image = imgDirectory; break; } uint8_t offset = MENU_TEXT_X; @@ -354,7 +354,10 @@ void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { menu_item(row); - tft_string.set(ftpl, itemIndex, itemStringC, itemStringF); + if (ftpl) + tft_string.set(ftpl, itemIndex, itemStringC, itemStringF); + else + tft_string.set(); const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); if (!full || !vstr) { From f82d0109e491756b0f004b31fe8fe0da25615aa8 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 27 Oct 2023 00:19:27 +0000 Subject: [PATCH 126/268] [cron] Bump distribution date (2023-10-27) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 5b172862f969..559896a34284 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-26" +//#define STRING_DISTRIBUTION_DATE "2023-10-27" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index aabc9fd9fbf3..7d69dcb27098 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-26" + #define STRING_DISTRIBUTION_DATE "2023-10-27" #endif /** From aa0671fb32eb93d1f028764422c5fb8acc9b8fa1 Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri, 27 Oct 2023 22:10:02 +0100 Subject: [PATCH 127/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Input=20Shaping=20?= =?UTF-8?q?max=5Fisr=5Frate=20with=20Distinct=20E=20factors=20(#26167)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/stepper.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index eb84426dc79d..2ccc9e7be9f8 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -139,14 +139,15 @@ constexpr ena_mask_t enable_overlap[] = { #ifdef SHAPING_MAX_STEPRATE constexpr float max_step_rate = SHAPING_MAX_STEPRATE; #else + #define ISALIM(I, ARR) _MIN(I, COUNT(ARR) - 1) constexpr float _ISDASU[] = DEFAULT_AXIS_STEPS_PER_UNIT; constexpr feedRate_t _ISDMF[] = DEFAULT_MAX_FEEDRATE; constexpr float max_shaped_rate = TERN0(INPUT_SHAPING_X, _ISDMF[X_AXIS] * _ISDASU[X_AXIS]) + TERN0(INPUT_SHAPING_Y, _ISDMF[Y_AXIS] * _ISDASU[Y_AXIS]); #if defined(__AVR__) || !defined(ADAPTIVE_STEP_SMOOTHING) // MIN_STEP_ISR_FREQUENCY is known at compile time on AVRs and any reduction in SRAM is welcome - template constexpr float max_isr_rate() { - return _MAX(_ISDMF[INDEX - 1] * _ISDASU[INDEX - 1], max_isr_rate()); + template constexpr float max_isr_rate() { + return _MAX(_ISDMF[ISALIM(INDEX - 1, _ISDMF)] * _ISDASU[ISALIM(INDEX - 1, _ISDASU)], max_isr_rate()); } template<> constexpr float max_isr_rate<0>() { return TERN0(ADAPTIVE_STEP_SMOOTHING, MIN_STEP_ISR_FREQUENCY); From c666b492c4e188987e9382e6ec2e79453b5136bc Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:06:04 +0100 Subject: [PATCH 128/268] =?UTF-8?q?=F0=9F=94=A5=20Automatic=20minimum=20pl?= =?UTF-8?q?anner=20junction=20speed=20(#26198)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 6 +--- Marlin/src/feature/max7219.cpp | 9 ++++++ Marlin/src/inc/SanityCheck.h | 4 +-- Marlin/src/module/planner.cpp | 53 +++++++++++++++++++++++----------- Marlin/src/module/planner.h | 30 ++++++++++++++----- 5 files changed, 70 insertions(+), 32 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 2219592a8b11..0eddf0571349 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1257,11 +1257,6 @@ #define XY_FREQUENCY_MIN_PERCENT 5 // (percent) Minimum FR percentage to apply. Set with M201 G. #endif -// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end -// of the buffer and all stops. This should not be much greater than zero and should only be changed -// if unwanted behavior is observed on a user's machine when running at very slow speeds. -#define MINIMUM_PLANNER_SPEED 0.05 // (mm/s) - // // Backlash Compensation // Adds extra movement to axes on direction-changes to account for backlash. @@ -4238,6 +4233,7 @@ // row. By default idle() is profiled so this shows how "idle" the processor is. // See class CodeProfiler. //#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multi-stepping 1 to 128 on this LED matrix row. + //#define MAX7219_DEBUG_SLOWDOWN 6 // Count (mod 16) how many times SLOWDOWN has reduced print speed. #endif /** diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp index e27f6eb974da..f37c78dde575 100644 --- a/Marlin/src/feature/max7219.cpp +++ b/Marlin/src/feature/max7219.cpp @@ -735,6 +735,15 @@ void Max7219::idle_tasks() { } #endif + #ifdef MAX7219_DEBUG_SLOWDOWN + static uint8_t last_slowdown_count = 0; + const uint8_t slowdown_count = Planner::slowdown_count; + if (slowdown_count != last_slowdown_count) { + mark16(MAX7219_DEBUG_SLOWDOWN, last_slowdown_count, slowdown_count, &row_change_mask); + last_slowdown_count = slowdown_count; + } + #endif + // batch line updates suspended--; if (!suspended) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 0e9ef07eb3fb..3fe26eddc182 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3463,8 +3463,8 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." #error "CNC_COORDINATE_SYSTEMS is incompatible with NO_WORKSPACE_OFFSETS." #endif -#if !BLOCK_BUFFER_SIZE || !IS_POWER_OF_2(BLOCK_BUFFER_SIZE) - #error "BLOCK_BUFFER_SIZE must be a power of 2." +#if !BLOCK_BUFFER_SIZE + #error "BLOCK_BUFFER_SIZE must be non-zero." #elif BLOCK_BUFFER_SIZE > 64 #error "A very large BLOCK_BUFFER_SIZE is not needed and takes longer to drain the buffer on pause / cancel." #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 0916ade58158..1414a3144578 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -188,6 +188,10 @@ float Planner::mm_per_step[DISTINCT_AXES]; // (mm) Millimeters per step Planner::volumetric_extruder_feedrate_limit[EXTRUDERS]; // pre calculated extruder feedrate limit based on volumetric_extruder_limit; pre-calculated to reduce computation in the planner #endif +#ifdef MAX7219_DEBUG_SLOWDOWN + uint8_t Planner::slowdown_count = 0; +#endif + #if HAS_LEVELING bool Planner::leveling_active = false; // Flag that auto bed leveling is enabled #if ABL_PLANAR @@ -985,9 +989,7 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t */ // The kernel called by recalculate() when scanning the plan from last to first entry. -void Planner::reverse_pass_kernel(block_t * const current, const block_t * const next - OPTARG(HINTS_SAFE_EXIT_SPEED, const_float_t safe_exit_speed_sqr) -) { +void Planner::reverse_pass_kernel(block_t * const current, const block_t * const next, const_float_t safe_exit_speed_sqr) { if (current) { // If entry speed is already at the maximum entry speed, and there was no change of speed // in the next block, there is no need to recheck. Block is cruising and there is no need to @@ -1007,7 +1009,7 @@ void Planner::reverse_pass_kernel(block_t * const current, const block_t * const // the reverse and forward planners, the corresponding block junction speed will always be at the // the maximum junction speed and may always be ignored for any speed reduction checks. - const float next_entry_speed_sqr = next ? next->entry_speed_sqr : _MAX(TERN0(HINTS_SAFE_EXIT_SPEED, safe_exit_speed_sqr), sq(float(MINIMUM_PLANNER_SPEED))), + const float next_entry_speed_sqr = next ? next->entry_speed_sqr : safe_exit_speed_sqr, new_entry_speed_sqr = current->flag.nominal_length ? max_entry_speed_sqr : _MIN(max_entry_speed_sqr, max_allowable_speed_sqr(-current->acceleration, next_entry_speed_sqr, current->millimeters)); @@ -1039,7 +1041,7 @@ void Planner::reverse_pass_kernel(block_t * const current, const block_t * const * recalculate() needs to go over the current plan twice. * Once in reverse and once forward. This implements the reverse pass. */ -void Planner::reverse_pass(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t safe_exit_speed_sqr)) { +void Planner::reverse_pass(const_float_t safe_exit_speed_sqr) { // Initialize block index to the last block in the planner buffer. uint8_t block_index = prev_block_index(block_buffer_head); @@ -1063,7 +1065,7 @@ void Planner::reverse_pass(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t safe_exit_ // Only process movement blocks if (current->is_move()) { - reverse_pass_kernel(current, next OPTARG(HINTS_SAFE_EXIT_SPEED, safe_exit_speed_sqr)); + reverse_pass_kernel(current, next, safe_exit_speed_sqr); next = current; } @@ -1176,7 +1178,7 @@ void Planner::forward_pass() { * according to the entry_factor for each junction. Must be called by * recalculate() after updating the blocks. */ -void Planner::recalculate_trapezoids(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t safe_exit_speed_sqr)) { +void Planner::recalculate_trapezoids(const_float_t safe_exit_speed_sqr) { // The tail may be changed by the ISR so get a local copy. uint8_t block_index = block_buffer_tail, head_block_index = block_buffer_head; @@ -1243,8 +1245,7 @@ void Planner::recalculate_trapezoids(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t // Last/newest block in buffer. Always recalculated. if (block) { - // Exit speed is set with MINIMUM_PLANNER_SPEED unless some code higher up knows better. - next_entry_speed = _MAX(TERN0(HINTS_SAFE_EXIT_SPEED, SQRT(safe_exit_speed_sqr)), float(MINIMUM_PLANNER_SPEED)); + next_entry_speed = SQRT(safe_exit_speed_sqr); // Mark the next(last) block as RECALCULATE, to prevent the Stepper ISR running it. // As the last block is always recalculated here, there is a chance the block isn't @@ -1267,15 +1268,15 @@ void Planner::recalculate_trapezoids(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t } } -void Planner::recalculate(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t safe_exit_speed_sqr)) { +void Planner::recalculate(const_float_t safe_exit_speed_sqr) { // Initialize block index to the last block in the planner buffer. const uint8_t block_index = prev_block_index(block_buffer_head); // If there is just one block, no planning can be done. Avoid it! if (block_index != block_buffer_planned) { - reverse_pass(TERN_(HINTS_SAFE_EXIT_SPEED, safe_exit_speed_sqr)); + reverse_pass(safe_exit_speed_sqr); forward_pass(); } - recalculate_trapezoids(TERN_(HINTS_SAFE_EXIT_SPEED, safe_exit_speed_sqr)); + recalculate_trapezoids(safe_exit_speed_sqr); } /** @@ -1829,10 +1830,12 @@ bool Planner::_buffer_steps(const xyze_long_t &target if (cleaning_buffer_counter) return false; // Fill the block with the specified movement + float minimum_planner_speed_sqr; if (!_populate_block(block, target OPTARG(HAS_POSITION_FLOAT, target_float) OPTARG(HAS_DIST_MM_ARG, cart_dist_mm) , fr_mm_s, extruder, hints + , minimum_planner_speed_sqr ) ) { // Movement was not queued, probably because it was too short. @@ -1853,8 +1856,14 @@ bool Planner::_buffer_steps(const xyze_long_t &target // Move buffer head block_buffer_head = next_buffer_head; + // find a speed from which the new block can stop safely + const float safe_exit_speed_sqr = _MAX( + TERN0(HINTS_SAFE_EXIT_SPEED, hints.safe_exit_speed_sqr), + minimum_planner_speed_sqr + ); + // Recalculate and optimize trapezoidal speed profiles - recalculate(TERN_(HINTS_SAFE_EXIT_SPEED, hints.safe_exit_speed_sqr)); + recalculate(safe_exit_speed_sqr); // Movement successfully queued! return true; @@ -1882,6 +1891,7 @@ bool Planner::_populate_block( OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , feedRate_t fr_mm_s, const uint8_t extruder, const PlannerHints &hints + , float &minimum_planner_speed_sqr ) { xyze_long_t dist = target - position; @@ -2316,6 +2326,9 @@ bool Planner::_populate_block( #define SLOWDOWN_DIVISOR 2 #endif if (WITHIN(moves_queued, 2, (BLOCK_BUFFER_SIZE) / (SLOWDOWN_DIVISOR) - 1)) { + #ifdef MAX7219_DEBUG_SLOWDOWN + slowdown_count = (slowdown_count + 1) & 0x0F; + #endif const int32_t time_diff = settings.min_segment_time_us - segment_time_us; if (time_diff > 0) { // Buffer is draining so add extra time. The amount of time added increases if the buffer is still emptied more. @@ -2548,6 +2561,10 @@ bool Planner::_populate_block( } #endif + // The minimum possible speed is the average speed for + // the first / last step at current acceleration limit + minimum_planner_speed_sqr = 0.5f * block->acceleration / steps_per_mm; + float vmax_junction_sqr; // Initial limit on the segment entry velocity (mm/s)^2 #if HAS_JUNCTION_DEVIATION @@ -2630,7 +2647,7 @@ bool Planner::_populate_block( // NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta). if (junction_cos_theta > 0.999999f) { // For a 0 degree acute junction, just set minimum junction speed. - vmax_junction_sqr = sq(float(MINIMUM_PLANNER_SPEED)); + vmax_junction_sqr = minimum_planner_speed_sqr; } else { // Convert delta vector to unit vector @@ -2838,6 +2855,8 @@ bool Planner::_populate_block( previous_safe_speed = safe_speed; + NOLESS(minimum_planner_speed_sqr, sq(safe_speed)); + #if HAS_JUNCTION_DEVIATION NOMORE(vmax_junction_sqr, sq(vmax_junction)); // Throttle down to max speed #else @@ -2849,11 +2868,11 @@ bool Planner::_populate_block( // Max entry speed of this block equals the max exit speed of the previous block. block->max_entry_speed_sqr = vmax_junction_sqr; - // Initialize block entry speed. Compute based on deceleration to user-defined MINIMUM_PLANNER_SPEED. - const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, sq(float(MINIMUM_PLANNER_SPEED)), block->millimeters); + // Initialize block entry speed. Compute based on deceleration to sqrt(minimum_planner_speed_sqr). + const float v_allowable_sqr = max_allowable_speed_sqr(-block->acceleration, minimum_planner_speed_sqr, block->millimeters); // Start with the minimum allowed speed - block->entry_speed_sqr = sq(float(MINIMUM_PLANNER_SPEED)); + block->entry_speed_sqr = minimum_planner_speed_sqr; // Initialize planner efficiency flags // Set flag if block will always reach maximum junction speed regardless of entry/exit speeds. diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 6fde0b2bf38e..5c9830757790 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -310,6 +310,14 @@ typedef struct PlannerBlock { #define HAS_POSITION_FLOAT 1 #endif +constexpr uint8_t block_dec_mod(const uint8_t v1, const uint8_t v2) { + return v1 >= v2 ? v1 - v2 : v1 - v2 + BLOCK_BUFFER_SIZE; +} + +constexpr uint8_t block_inc_mod(const uint8_t v1, const uint8_t v2) { + return v1 + v2 < BLOCK_BUFFER_SIZE ? v1 + v2 : v1 + v2 - BLOCK_BUFFER_SIZE; +} + #if IS_POWER_OF_2(BLOCK_BUFFER_SIZE) #define BLOCK_MOD(n) ((n)&((BLOCK_BUFFER_SIZE)-1)) #else @@ -546,6 +554,11 @@ class Planner { */ static uint32_t acceleration_long_cutoff; + #ifdef MAX7219_DEBUG_SLOWDOWN + friend class Max7219; + static uint8_t slowdown_count; + #endif + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) static float last_fade_z; #endif @@ -768,10 +781,10 @@ class Planner { #endif // HAS_POSITION_MODIFIERS // Number of moves currently in the planner including the busy block, if any - FORCE_INLINE static uint8_t movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_tail); } + FORCE_INLINE static uint8_t movesplanned() { return block_dec_mod(block_buffer_head, block_buffer_tail); } // Number of nonbusy moves currently in the planner - FORCE_INLINE static uint8_t nonbusy_movesplanned() { return BLOCK_MOD(block_buffer_head - block_buffer_nonbusy); } + FORCE_INLINE static uint8_t nonbusy_movesplanned() { return block_dec_mod(block_buffer_head, block_buffer_nonbusy); } // Remove all blocks from the buffer FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_planned = block_buffer_head = block_buffer_tail = 0; } @@ -837,6 +850,7 @@ class Planner { OPTARG(HAS_POSITION_FLOAT, const xyze_pos_t &target_float) OPTARG(HAS_DIST_MM_ARG, const xyze_float_t &cart_dist_mm) , feedRate_t fr_mm_s, const uint8_t extruder, const PlannerHints &hints + , float &minimum_planner_speed_sqr ); /** @@ -1029,8 +1043,8 @@ class Planner { /** * Get the index of the next / previous block in the ring buffer */ - static constexpr uint8_t next_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index + 1); } - static constexpr uint8_t prev_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index - 1); } + static constexpr uint8_t next_block_index(const uint8_t block_index) { return block_inc_mod(block_index, 1); } + static constexpr uint8_t prev_block_index(const uint8_t block_index) { return block_dec_mod(block_index, 1); } /** * Calculate the maximum allowable speed squared at this point, in order @@ -1052,15 +1066,15 @@ class Planner { static void calculate_trapezoid_for_block(block_t * const block, const_float_t entry_factor, const_float_t exit_factor); - static void reverse_pass_kernel(block_t * const current, const block_t * const next OPTARG(ARC_SUPPORT, const_float_t safe_exit_speed_sqr)); + static void reverse_pass_kernel(block_t * const current, const block_t * const next, const_float_t safe_exit_speed_sqr); static void forward_pass_kernel(const block_t * const previous, block_t * const current, uint8_t block_index); - static void reverse_pass(TERN_(ARC_SUPPORT, const_float_t safe_exit_speed_sqr)); + static void reverse_pass(const_float_t safe_exit_speed_sqr); static void forward_pass(); - static void recalculate_trapezoids(TERN_(ARC_SUPPORT, const_float_t safe_exit_speed_sqr)); + static void recalculate_trapezoids(const_float_t safe_exit_speed_sqr); - static void recalculate(TERN_(ARC_SUPPORT, const_float_t safe_exit_speed_sqr)); + static void recalculate(const_float_t safe_exit_speed_sqr); #if HAS_JUNCTION_DEVIATION From b082f1a2b882a827cb614f4c020787f6ffce2449 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Sat, 28 Oct 2023 11:15:23 +1300 Subject: [PATCH 129/268] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Faster=20COMPACT?= =?UTF-8?q?=5FMARLIN=5FBOOT=5FLOGO=20(rle16)=20(#26153)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/tft/canvas.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Marlin/src/lcd/tft/canvas.cpp b/Marlin/src/lcd/tft/canvas.cpp index 4bded7225125..2486179ce3de 100644 --- a/Marlin/src/lcd/tft/canvas.cpp +++ b/Marlin/src/lcd/tft/canvas.cpp @@ -129,6 +129,13 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) } #if ENABLED(COMPACT_MARLIN_BOOT_LOGO) + + static struct { + bool has_rle_state = false; + int16_t dstx, dsty, srcx, srcy; + uint32_t rle_offset; + } rle_state; + // RLE16 HIGHCOLOR - 16 bits per pixel if (color_mode == RLE16) { uint8_t *bytedata = (uint8_t *)images[image].data; @@ -139,8 +146,25 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) dsty = y, dstx = x; // Destination line / column index uint16_t color = 0; // Persist the last fetched color value + if (rle_state.has_rle_state) { // do we have RLE position data? + rle_state.has_rle_state = false; // invalidate stored RLE state + dstx = rle_state.dstx; // restore required states + dsty = rle_state.dsty; + srcx = rle_state.srcx; + srcy = rle_state.srcy; + bytedata = (uint8_t *)images[image].data + rle_state.rle_offset; // Restart decode from here instead of the start of data + } + bool done = false; while (!done) { + if (dsty >= endLine - 1 || srcy >= image_height - 1) { // Store state? + rle_state.dstx = dstx; // Save required states + rle_state.dsty = dsty; + rle_state.srcx = srcx; + rle_state.srcy = srcy; + rle_state.rle_offset = bytedata - (uint8_t *)images[image].data;; // Keep these for skipping full RLE decode on future iteratons + } + uint8_t count = *bytedata++; // Get the count byte const bool uniq = bool(count & 0x80); // >= 128 is a distinct run; < 128 is a repeat run count = (count & 0x7F) + 1; // Actual count is 7-bit plus 1 @@ -169,6 +193,7 @@ void Canvas::addImage(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) srcx = 0; dstx = x; // May be shifted within the canvas, but usually not if (dsty >= endLine || srcy >= image_height) { // Done with the segment or the image? done = true; // Set a flag to end the loop... + rle_state.has_rle_state = true; // RLE state is stored break; // ...and break out of while(count--) } } From 5a259a726670b0dbc21a58651847259d83f54c7b Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:18:15 +0200 Subject: [PATCH 130/268] =?UTF-8?q?=F0=9F=8C=90=20Update=20Italian=20langu?= =?UTF-8?q?age=20(#26208)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_it.h | 67 +++++++++++++++++++-------- 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 9e3776d36b8e..620171ab63c6 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -38,6 +38,8 @@ #define DISPLAY_CHARSET_ISO10646_1 +#define MEDIA_TYPE_IT "Media" + namespace LanguageNarrow_it { using namespace Language_en; // Inherit undefined strings from English @@ -52,14 +54,16 @@ namespace LanguageNarrow_it { LSTR MSG_BACK = _UxGT("Indietro"); LSTR MSG_ERROR = _UxGT("Errore"); LSTR MSG_MEDIA_ABORTING = _UxGT("Annullando..."); - LSTR MSG_MEDIA_INSERTED = _UxGT("Media inserito"); - LSTR MSG_MEDIA_REMOVED = _UxGT("Media rimosso"); - LSTR MSG_MEDIA_WAITING = _UxGT("Aspettando media"); - LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Iniz.Media fallita"); - LSTR MSG_MEDIA_READ_ERROR = _UxGT("Err.leggendo media"); + LSTR MSG_MEDIA_INSERTED = MEDIA_TYPE_IT _UxGT(" inserito"); + LSTR MSG_MEDIA_REMOVED = MEDIA_TYPE_IT _UxGT(" rimosso"); + LSTR MSG_MEDIA_WAITING = _UxGT("Aspettando ") MEDIA_TYPE_IT; + LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Iniz.") MEDIA_TYPE_IT _UxGT(" fallita"); + LSTR MSG_MEDIA_READ_ERROR = _UxGT("Err.leggendo ") MEDIA_TYPE_IT; LSTR MSG_MEDIA_USB_REMOVED = _UxGT("Dispos.USB rimosso"); LSTR MSG_MEDIA_USB_FAILED = _UxGT("Avvio USB fallito"); - LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Overflow subchiamate"); + LSTR MSG_MEDIA_SORT = _UxGT("Ordina ") MEDIA_TYPE_IT; + LSTR MSG_MEDIA_UPDATE = _UxGT("Aggiorna ") MEDIA_TYPE_IT; + LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Overflow sottochiamate"); LSTR MSG_LCD_ENDSTOPS = _UxGT("Finecor."); // Max 8 characters LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Finecorsa Soft"); LSTR MSG_MAIN_MENU = _UxGT("Menu principale"); @@ -175,6 +179,7 @@ namespace LanguageNarrow_it { LSTR MSG_MESH_CENTER = _UxGT("Area centrale"); LSTR MSG_MESH_EDIT_Z = _UxGT("Valore di Z"); LSTR MSG_MESH_CANCEL = _UxGT("Mesh cancellata"); + LSTR MSG_MESH_RESET = _UxGT("Resetta mesh"); LSTR MSG_CUSTOM_COMMANDS = _UxGT("Comandi personaliz."); LSTR MSG_M48_TEST = _UxGT("Test sonda M48"); LSTR MSG_M48_POINT = _UxGT("Punto M48"); @@ -383,6 +388,7 @@ namespace LanguageNarrow_it { LSTR MSG_VN_JERK = _UxGT("Max Jerk @"); LSTR MSG_VE_JERK = _UxGT("Max Jerk E"); LSTR MSG_JUNCTION_DEVIATION = _UxGT("Deviaz. giunzioni"); + LSTR MSG_STEP_SMOOTHING = _UxGT("Leviga passo"); LSTR MSG_MAX_SPEED = _UxGT("Vel.massima (mm/s)"); LSTR MSG_VMAX_A = _UxGT("Vel.Massima ") STR_A; LSTR MSG_VMAX_B = _UxGT("Vel.Massima ") STR_B; @@ -406,6 +412,12 @@ namespace LanguageNarrow_it { LSTR MSG_SHAPING_DISABLE = _UxGT("Disabil. shaping @"); LSTR MSG_SHAPING_FREQ = _UxGT("Frequenza @"); LSTR MSG_SHAPING_ZETA = _UxGT("Smorzamento @"); + LSTR MSG_SHAPING_A_FREQ = _UxGT("Frequenza ") STR_A; + LSTR MSG_SHAPING_B_FREQ = _UxGT("Frequenza ") STR_B; + LSTR MSG_SHAPING_A_ZETA = _UxGT("Smorzamento ") STR_A _UxGT(" "); + LSTR MSG_SHAPING_B_ZETA = _UxGT("Smorzamento ") STR_B _UxGT(" "); + LSTR MSG_SHAPING_X_ENABLE = _UxGT("Abilita shaping X"); + LSTR MSG_SHAPING_Y_ENABLE = _UxGT("Abilita shaping Y"); LSTR MSG_XY_FREQUENCY_LIMIT = _UxGT("Frequenza max"); LSTR MSG_XY_FREQUENCY_FEEDRATE = _UxGT("Feed min"); LSTR MSG_STEPS_PER_MM = _UxGT("Passi/mm"); @@ -448,7 +460,7 @@ namespace LanguageNarrow_it { LSTR MSG_ERR_EEPROM_VERSION = _UxGT("Err: Versione EEPROM"); LSTR MSG_ERR_EEPROM_CORRUPT = _UxGT("Err: EEPROM corrotta"); LSTR MSG_SETTINGS_STORED = _UxGT("Impostazioni mem."); - LSTR MSG_MEDIA_UPDATE = _UxGT("Aggiorna media"); + LSTR MSG_HAS_PREVIEW = _UxGT("Ha anteprima"); LSTR MSG_RESET_PRINTER = _UxGT("Resetta stampante"); LSTR MSG_REFRESH = LCD_STR_REFRESH _UxGT("Aggiorna"); LSTR MSG_INFO_SCREEN = _UxGT("Schermata info"); @@ -495,8 +507,8 @@ namespace LanguageNarrow_it { LSTR MSG_CANCEL_OBJECT_N = _UxGT("Canc. Oggetto {"); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Ripresa da PowerLoss"); LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Cont.proc.stampa"); - LSTR MSG_MEDIA_MENU = _UxGT("Stampa da media"); - LSTR MSG_NO_MEDIA = _UxGT("Media non presente"); + LSTR MSG_MEDIA_MENU = _UxGT("Stampa da ") MEDIA_TYPE_IT; + LSTR MSG_NO_MEDIA = MEDIA_TYPE_IT _UxGT(" non presente"); LSTR MSG_DWELL = _UxGT("Sospensione..."); LSTR MSG_USERWAIT = _UxGT("Premi tasto.."); LSTR MSG_PRINT_PAUSED = _UxGT("Stampa sospesa"); @@ -546,10 +558,11 @@ namespace LanguageNarrow_it { LSTR MSG_FILAMENTUNLOAD = _UxGT("Rimuovi filamento"); LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Rimuovi filam. *"); LSTR MSG_FILAMENTUNLOAD_ALL = _UxGT("Rimuovi tutto"); - LSTR MSG_ATTACH_MEDIA = _UxGT("Collega media"); + LSTR MSG_ATTACH_MEDIA = _UxGT("Collega ") MEDIA_TYPE_IT; + LSTR MSG_ATTACH_SD_MEDIA = _UxGT("Collega scheda SD"); LSTR MSG_ATTACH_USB_MEDIA = _UxGT("Collega penna USB"); - LSTR MSG_CHANGE_MEDIA = _UxGT("Cambia media"); - LSTR MSG_RELEASE_MEDIA = _UxGT("Rilascia media"); + LSTR MSG_CHANGE_MEDIA = _UxGT("Cambia ") MEDIA_TYPE_IT; + LSTR MSG_RELEASE_MEDIA = _UxGT("Rilascia ") MEDIA_TYPE_IT; LSTR MSG_ZPROBE_OUT = _UxGT("Z probe fuori piatto"); LSTR MSG_SKEW_FACTOR = _UxGT("Fattore distorsione"); LSTR MSG_BLTOUCH = _UxGT("BLTouch"); @@ -640,6 +653,9 @@ namespace LanguageNarrow_it { LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Controllo fuga: OFF"); LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Controllo fuga: ON"); LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Timeout inatt.ugello"); + LSTR MSG_HOTEND_IDLE_DISABLE = _UxGT("Disabilita Timeout"); + LSTR MSG_HOTEND_IDLE_NOZZLE_TARGET = _UxGT("Temp.inatt.ugello"); + LSTR MSG_HOTEND_IDLE_BED_TARGET = _UxGT("Temp.inatt.letto"); LSTR MSG_FAN_SPEED_FAULT = _UxGT("Err.vel.della ventola"); LSTR MSG_CASE_LIGHT = _UxGT("Luci Case"); @@ -768,17 +784,18 @@ namespace LanguageNarrow_it { LSTR MSG_FILAMENT_CHANGE_PURGE = _UxGT(MSG_1_LINE("Spurgo filamento")); LSTR MSG_FILAMENT_CHANGE_CONT_PURGE = _UxGT(MSG_1_LINE("Premi x terminare")); LSTR MSG_FILAMENT_CHANGE_RESUME = _UxGT(MSG_1_LINE("Ripresa...")); - LSTR MSG_TMC_DRIVERS = _UxGT("Driver TMC"); - LSTR MSG_TMC_CURRENT = _UxGT("Correnti driver"); + LSTR MSG_TMC_CURRENT = _UxGT("Corrente driver"); + LSTR MSG_TMC_ACURRENT = _UxGT("Corrente driver ") STR_A; + LSTR MSG_TMC_BCURRENT = _UxGT("Corrente driver ") STR_B; + LSTR MSG_TMC_CCURRENT = _UxGT("Corrente driver ") STR_C; + LSTR MSG_TMC_ECURRENT = _UxGT("Corrente driver E"); LSTR MSG_TMC_HYBRID_THRS = _UxGT("Soglia modo ibrido"); LSTR MSG_TMC_HOMING_THRS = _UxGT("Sensorless homing"); - LSTR MSG_TMC_STEPPING_MODE = _UxGT("Stealthchop"); - LSTR MSG_TMC_STEALTH_ENABLED = _UxGT("Stealthchop"); - + LSTR MSG_TMC_STEPPING_MODE = _UxGT("Modo Stepping"); + LSTR MSG_TMC_STEALTH_ENABLED = _UxGT("StealthChop abil."); LSTR MSG_SERVICE_RESET = _UxGT("Resetta"); LSTR MSG_SERVICE_IN = _UxGT(" tra:"); - LSTR MSG_BACKLASH = _UxGT("Gioco"); LSTR MSG_BACKLASH_CORRECTION = _UxGT("Correzione"); LSTR MSG_BACKLASH_SMOOTHING = _UxGT("Appianamento"); @@ -798,6 +815,8 @@ namespace LanguageNarrow_it { LSTR MSG_FTM_MASS_BASED = _UxGT("Base-Massa"); LSTR MSG_FTM_BASE_FREQ_N = _UxGT("@ Freq. Base"); LSTR MSG_FTM_DFREQ_K_N = _UxGT("@ Freq. Dinam."); + LSTR MSG_FTM_ZETA = _UxGT("Smorzamento"); + LSTR MSG_FTM_VTOL = _UxGT("Livello Vib."); LSTR MSG_LEVEL_X_AXIS = _UxGT("Livello asse X"); LSTR MSG_AUTO_CALIBRATE = _UxGT("Auto Calibra"); @@ -859,10 +878,18 @@ namespace LanguageNarrow_it { namespace LanguageWide_it { using namespace LanguageNarrow_it; #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_HOST_START_PRINT = _UxGT("Avvio stampa host"); + LSTR MSG_PRINTING_OBJECT = _UxGT("Sto stampando l'oggetto"); + LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella l'oggetto"); + LSTR MSG_CANCEL_OBJECT_N = _UxGT("Cancella l'oggetto {"); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Continua il Job di stampa"); + LSTR MSG_MEDIA_MENU = _UxGT("Seleziona dal supporto"); + LSTR MSG_TURN_OFF = _UxGT("Spegni la stampante"); + LSTR MSG_END_LOOPS = _UxGT("Termina i cicli di ripetizione"); LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito."); LSTR MSG_PLEASE_PREHEAT = _UxGT("Si prega di preriscaldare l'hot end."); - LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera contatori stampa"); - LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contatori stampa"); + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Azzera i contatori di stampa"); + LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contatori di stampa"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Lavoro più lungo"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Totale estruso"); From 6907df0bd6af90fcb9753b54c84b3d3bd8910b2b Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 28 Oct 2023 00:18:59 +0000 Subject: [PATCH 131/268] [cron] Bump distribution date (2023-10-28) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 559896a34284..045d1ee1699e 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-27" +//#define STRING_DISTRIBUTION_DATE "2023-10-28" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 7d69dcb27098..270d028a219e 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-27" + #define STRING_DISTRIBUTION_DATE "2023-10-28" #endif /** From 050439ccba39ba2d614b2069e4d606521fe13e22 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sat, 28 Oct 2023 03:46:09 +0300 Subject: [PATCH 132/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Upd?= =?UTF-8?q?ate=20.editorconfig=20settings=20(#26264)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #26219 --- .editorconfig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 84f2d090b194..1037e74ef3ec 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +1,14 @@ # editorconfig.org root = true +[*] +trim_trailing_whitespace = true +insert_final_newline = true + [{*.patch,syntax_test_*}] trim_trailing_whitespace = false [{*.c,*.cpp,*.h,*.ino,*.py,Makefile}] -trim_trailing_whitespace = true -insert_final_newline = true end_of_line = lf [{*.c,*.cpp,*.h,*.ino}] @@ -18,6 +20,10 @@ indent_size = 2 indent_style = tab indent_size = 2 +[*.md] +# Two spaces at the end of the line means newline in Markdown +trim_trailing_whitespace = false + [{*.py}] indent_style = space indent_size = 4 From cb8df74a9c9a1311940c113732503766295fdcb8 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sat, 28 Oct 2023 04:01:04 +0300 Subject: [PATCH 133/268] =?UTF-8?q?=F0=9F=9A=B8=20Move=20Debug=20menu=20do?= =?UTF-8?q?wn=20(#26266)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_configuration.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 63b7c527e015..0a8d4a975aba 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -547,13 +547,6 @@ void menu_configuration() { START_MENU(); BACK_ITEM(MSG_MAIN_MENU); - // - // Debug Menu when certain options are enabled - // - #if HAS_DEBUG_MENU - SUBMENU(MSG_DEBUG_MENU, menu_debug); - #endif - #if ENABLED(CUSTOM_MENU_CONFIG) if (TERN1(CUSTOM_MENU_CONFIG_ONLY_IDLE, !busy)) { #ifdef CUSTOM_MENU_CONFIG_TITLE @@ -657,6 +650,12 @@ void menu_configuration() { EDIT_ITEM(bool, MSG_SOUND, &ui.sound_on, []{ ui.chirp(); }); #endif + // Debug Menu when certain options are enabled + // Note: it is at the end of the list, so a more commonly used items should be placed above + #if HAS_DEBUG_MENU + SUBMENU(MSG_DEBUG_MENU, menu_debug); + #endif + #if ENABLED(EEPROM_SETTINGS) ACTION_ITEM(MSG_STORE_EEPROM, ui.store_settings); if (!busy) ACTION_ITEM(MSG_LOAD_EEPROM, ui.load_settings); From a6c8afc5a9487ced6249a5d0abbc53ae077db786 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 29 Oct 2023 00:21:30 +0000 Subject: [PATCH 134/268] [cron] Bump distribution date (2023-10-29) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 045d1ee1699e..797c21ba7fd0 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-28" +//#define STRING_DISTRIBUTION_DATE "2023-10-29" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 270d028a219e..f24965c4e5d2 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-28" + #define STRING_DISTRIBUTION_DATE "2023-10-29" #endif /** From 5523c12cfd01c859a01f26575a1dfff4c43eac8e Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:02:11 +0100 Subject: [PATCH 135/268] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20MarlinUI=20UTF-8?= =?UTF-8?q?=20chars=20(#26381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/lcdprint.cpp | 18 +++++------------- Marlin/src/lcd/utf8.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Marlin/src/lcd/lcdprint.cpp b/Marlin/src/lcd/lcdprint.cpp index 2b524e983f7e..c84a695c786a 100644 --- a/Marlin/src/lcd/lcdprint.cpp +++ b/Marlin/src/lcd/lcdprint.cpp @@ -51,6 +51,7 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in int8_t n = maxlen; while (n > 0) { lchar_t wc; + uint8_t *psc = (uint8_t *)p; p = get_utf8_value_cb(p, read_byte_rom, wc); if (!wc) break; if (wc == '{' || wc == '~' || wc == '*') { @@ -88,20 +89,11 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in n -= utf8_strlen(o); o += strlen(o); } - else if (wc == '@') { - *o++ = AXIS_CHAR(ind); - *o = '\0'; - n--; - } - else if (wc > 255 && prop == 2) { - // Wide glyph support incomplete - *((uint16_t*)o) = wc; - o += 2; - *o = '\0'; - n--; - } else { - *o++ = wc; + if (wc == '@') + *o++ = AXIS_CHAR(ind); + else + while (psc != p) *o++ = read_byte_rom(psc++); *o = '\0'; n--; } diff --git a/Marlin/src/lcd/utf8.cpp b/Marlin/src/lcd/utf8.cpp index 6957fffc6457..d9dd53e95324 100644 --- a/Marlin/src/lcd/utf8.cpp +++ b/Marlin/src/lcd/utf8.cpp @@ -94,13 +94,15 @@ int pf_bsearch_r(void *userdata, size_t num_data, pf_bsearch_cb_comp_t cb_comp, return -1; } -/* Returns true if passed byte is first byte of UTF-8 char sequence */ +// Is the passed byte the first byte of a UTF-8 char sequence? static inline bool utf8_is_start_byte_of_char(const uint8_t b) { return 0x80 != (b & 0xC0); } -/* This function gets the character at the pstart position, interpreting UTF8 multibyte sequences - and returns the pointer to the next character */ +/** + * Get the character at pstart, interpreting UTF8 multibyte sequences. + * Return the pointer to the next character. + */ const uint8_t* get_utf8_value_cb(const uint8_t *pstart, read_byte_cb_t cb_read_byte, lchar_t &pval) { uint32_t val = 0; const uint8_t *p = pstart; From e0767f867517e49ce680b4be97fbaf3c5cb2d653 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:03:28 +0100 Subject: [PATCH 136/268] =?UTF-8?q?=F0=9F=8C=90=20Fix=20long=20Italian=20s?= =?UTF-8?q?tring=20(#26378)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/language/language_it.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 620171ab63c6..61a572b3b331 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -883,7 +883,7 @@ namespace LanguageWide_it { LSTR MSG_CANCEL_OBJECT = _UxGT("Cancella l'oggetto"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Cancella l'oggetto {"); LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Continua il Job di stampa"); - LSTR MSG_MEDIA_MENU = _UxGT("Seleziona dal supporto"); + LSTR MSG_MEDIA_MENU = _UxGT("Selez.da supporto"); LSTR MSG_TURN_OFF = _UxGT("Spegni la stampante"); LSTR MSG_END_LOOPS = _UxGT("Termina i cicli di ripetizione"); LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nessun supporto inserito."); From 41a6f2bc8da53e3277c6b183bdc167399245c858 Mon Sep 17 00:00:00 2001 From: Chris <52449218+shadow578@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:10:37 +0100 Subject: [PATCH 137/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Imp?= =?UTF-8?q?rove=20POSTMORTEM=5FDEBUGGING=20(#26374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp | 7 ++++++- Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp index 148927a19f52..bd87b6731cdf 100644 --- a/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp +++ b/Marlin/src/HAL/shared/backtrace/unwarmbytab.cpp @@ -55,7 +55,12 @@ static const char *UnwTabGetFunctionName(const UnwindCallbacks *cb, uint32_t add return nullptr; if ((flag_word & 0xFF000000) == 0xFF000000) { - return (const char *)(address - 4 - (flag_word & 0x00FFFFFF)); + const uint32_t fn_name_addr = address - 4 - (flag_word & 0x00FFFFFF); + + // Ensure the address is readable to avoid returning a bogus pointer + uint8_t dummy = 0; + if (cb->readB(fn_name_addr, &dummy)) + return (const char *)fn_name_addr; } return nullptr; } diff --git a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp index e54661c77071..3c514f58a9c4 100644 --- a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp +++ b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp @@ -279,8 +279,6 @@ void CommonHandler_C(ContextStateFrame * frame, unsigned long lr, unsigned long if (!faulted_from_exception) { // Not sure about the non_usage_fault, we want to try anyway, don't we ? && !non_usage_fault_occurred) // Try to resume to our handler here CFSR |= CFSR; // The ARM programmer manual says you must write to 1 all fault bits to clear them so this instruction is correct - // The frame will not be valid when returning anymore, let's clean it - savedFrame.CFSR = 0; frame->pc = (uint32_t)resume_from_fault; // Patch where to return to frame->lr = 0xDEADBEEF; // If our handler returns (it shouldn't), let's make it trigger an exception immediately From 24cf29b6a8e9f5e3cd37c4160a20b0a75ff04ad5 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 1 Nov 2023 01:19:48 +0000 Subject: [PATCH 138/268] [cron] Bump distribution date (2023-11-01) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 797c21ba7fd0..d99e5ebf5e43 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-10-29" +//#define STRING_DISTRIBUTION_DATE "2023-11-01" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index f24965c4e5d2..3de54adc4672 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-10-29" + #define STRING_DISTRIBUTION_DATE "2023-11-01" #endif /** From 76f938309efc62d6ed4983c350f2379ff77ea02e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 1 Nov 2023 15:36:26 -0500 Subject: [PATCH 139/268] =?UTF-8?q?=F0=9F=94=A8=20Minor=20schema.py=20upda?= =?UTF-8?q?tes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/schema.py | 33 +++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/schema.py b/buildroot/share/PlatformIO/scripts/schema.py index afac7b5d2788..535a8f671e94 100755 --- a/buildroot/share/PlatformIO/scripts/schema.py +++ b/buildroot/share/PlatformIO/scripts/schema.py @@ -85,7 +85,8 @@ class Parse: NORMAL = 0 # No condition yet BLOCK_COMMENT = 1 # Looking for the end of the block comment EOL_COMMENT = 2 # EOL comment started, maybe add the next comment? - GET_SENSORS = 3 # Gathering temperature sensor options + SLASH_COMMENT = 3 # Block-like comment, starting with aligned // + GET_SENSORS = 4 # Gathering temperature sensor options ERROR = 9 # Syntax error # List of files to process, with shorthand @@ -107,6 +108,7 @@ class Parse: line_number = 0 # Counter for the line number of the file conditions = [] # Create a condition stack for the current file comment_buff = [] # A temporary buffer for comments + prev_comment = '' # Copy before reset for an EOL comment options_json = '' # A buffer for the most recent options JSON found eol_options = False # The options came from end of line, so only apply once join_line = False # A flag that the line should be joined with the previous one @@ -143,9 +145,13 @@ class Parse: if not defmatch and the_line.startswith('//'): comment_buff.append(the_line[2:].strip()) else: - last_added_ref['comment'] = ' '.join(comment_buff) - comment_buff = [] state = Parse.NORMAL + cline = ' '.join(comment_buff) + comment_buff = [] + if cline != '': + # A (block or slash) comment was already added + cfield = 'notes' if 'comment' in last_added_ref else 'comment' + last_added_ref[cfield] = cline def use_comment(c, opt, sec, bufref): if c.startswith(':'): # If the comment starts with : then it has magic JSON @@ -162,6 +168,15 @@ def use_comment(c, opt, sec, bufref): bufref.append(c) return opt, sec + # For slash comments, capture consecutive slash comments. + # The comment will be applied to the next #define. + if state == Parse.SLASH_COMMENT: + if not defmatch and the_line.startswith('//'): + use_comment(the_line[2:].strip(), options_json, section, comment_buff) + continue + else: + state = Parse.NORMAL + # In a block comment, capture lines up to the end of the comment. # Assume nothing follows the comment closure. if state in (Parse.BLOCK_COMMENT, Parse.GET_SENSORS): @@ -178,14 +193,14 @@ def use_comment(c, opt, sec, bufref): state = Parse.NORMAL # Strip the leading '*' from block comments - if cline.startswith('*'): cline = cline[1:].strip() + cline = re.sub(r'^\* ?', '', cline) # Collect temperature sensors if state == Parse.GET_SENSORS: sens = re.match(r'^(-?\d+)\s*:\s*(.+)$', cline) if sens: s2 = sens[2].replace("'","''") - options_json += f"{sens[1]}:'{s2}', " + options_json += f"{sens[1]}:'{sens[1]} - {s2}', " elif state == Parse.BLOCK_COMMENT: @@ -216,15 +231,19 @@ def use_comment(c, opt, sec, bufref): # Comment after a define may be continued on the following lines if defmatch != None and cpos > 10: state = Parse.EOL_COMMENT + prev_comment = '\n'.join(comment_buff) comment_buff = [] + else: + state = Parse.SLASH_COMMENT # Process the start of a new comment if cpos != -1: + comment_buff = [] cline, line = line[cpos+2:].strip(), line[:cpos].strip() if state == Parse.BLOCK_COMMENT: # Strip leading '*' from block comments - if cline.startswith('*'): cline = cline[1:].strip() + cline = re.sub(r'^\* ?', '', cline) else: # Expire end-of-line options after first use if cline.startswith(':'): eol_options = True @@ -320,7 +339,7 @@ def atomize(s): if value_type != '': define_info['type'] = value_type # Join up accumulated conditions with && - if conditions: define_info['requires'] = ' && '.join(sum(conditions, [])) + if conditions: define_info['requires'] = '(' + ') && ('.join(sum(conditions, [])) + ')' # If the comment_buff is not empty, add the comment to the info if comment_buff: From cac742009c1b44f3789e6bd8c400d9ee5763521b Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sat, 4 Nov 2023 04:12:33 +0000 Subject: [PATCH 140/268] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Backlash=20Compens?= =?UTF-8?q?ation=20layer=20shift=20(#26392)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/backlash.cpp | 54 ++++++++++++++++++++++----------- Marlin/src/feature/backlash.h | 2 +- Marlin/src/module/planner.cpp | 2 +- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/Marlin/src/feature/backlash.cpp b/Marlin/src/feature/backlash.cpp index c6eb0d33f309..07fa7725a06c 100644 --- a/Marlin/src/feature/backlash.cpp +++ b/Marlin/src/feature/backlash.cpp @@ -63,25 +63,25 @@ Backlash backlash; * spread over multiple segments, smoothing out artifacts even more. */ -void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const AxisBits dm, block_t * const block) { +void Backlash::add_correction_steps(const xyze_long_t &dist, const AxisBits dm, block_t * const block) { AxisBits changed_dir = last_direction_bits ^ dm; // Ignore direction change unless steps are taken in that direction #if DISABLED(CORE_BACKLASH) || ANY(MARKFORGED_XY, MARKFORGED_YX) - if (!da) changed_dir.x = false; - if (!db) changed_dir.y = false; - if (!dc) changed_dir.z = false; + if (!dist.a) changed_dir.x = false; + if (!dist.b) changed_dir.y = false; + if (!dist.c) changed_dir.z = false; #elif CORE_IS_XY - if (!(da + db)) changed_dir.x = false; - if (!(da - db)) changed_dir.y = false; - if (!dc) changed_dir.z = false; + if (!(dist.a + dist.b)) changed_dir.x = false; + if (!(dist.a - dist.b)) changed_dir.y = false; + if (!dist.c) changed_dir.z = false; #elif CORE_IS_XZ - if (!(da + dc)) changed_dir.x = false; - if (!(da - dc)) changed_dir.z = false; - if (!db) changed_dir.y = false; + if (!(dist.a + dist.c)) changed_dir.x = false; + if (!(dist.a - dist.c)) changed_dir.z = false; + if (!dist.b) changed_dir.y = false; #elif CORE_IS_YZ - if (!(db + dc)) changed_dir.y = false; - if (!(db - dc)) changed_dir.z = false; - if (!da) changed_dir.x = false; + if (!(dist.b + dist.c)) changed_dir.y = false; + if (!(dist.b - dist.c)) changed_dir.z = false; + if (!dist.a) changed_dir.x = false; #endif last_direction_bits ^= changed_dir; @@ -97,7 +97,15 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const const float f_corr = float(correction) / all_on; + bool changed = false; + float millimeters_delta = 0.0f; + #if IS_KINEMATIC + float sqr_stepper_space_mm = 0.0f; + #endif + LOOP_NUM_AXES(axis) { + TERN_(IS_KINEMATIC, sqr_stepper_space_mm += sq(dist[axis] * planner.mm_per_step[axis])); + if (distance_mm[axis]) { const bool forward = dm[axis]; @@ -107,8 +115,6 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const // Decide how much of the residual error to correct in this segment int32_t error_correction = residual_error[axis]; - if (forward == (error_correction < 0)) - error_correction = 0; // Don't take up any backlash in this segment, as it would subtract steps #ifdef BACKLASH_SMOOTHING_MM if (error_correction && smoothing_mm != 0) { @@ -118,9 +124,18 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } #endif + // Don't correct backlash in the opposite direction to movement on this axis and for accuracy in + // updating block->millimeters, don't add too many steps to the movement on this axis + if (forward) + LIMIT(error_correction, 0, dist[axis]); + else + LIMIT(error_correction, dist[axis], 0); + // This correction reduces the residual error and adds block steps if (error_correction) { + changed = true; block->steps[axis] += ABS(error_correction); + millimeters_delta += dist[axis] * error_correction * sq(planner.mm_per_step[axis]); #if ENABLED(CORE_BACKLASH) switch (axis) { case CORE_AXIS_1: @@ -142,6 +157,11 @@ void Backlash::add_correction_steps(const int32_t &da, const int32_t &db, const } } } + + // If backlash correction steps were added modify block->millimeters with a linear approximation + // See https://github.com/MarlinFirmware/Marlin/pull/26392 + if (changed) + block->millimeters += TERN(IS_KINEMATIC, millimeters_delta * block->millimeters / sqr_stepper_space_mm, millimeters_delta / block->millimeters); } int32_t Backlash::get_applied_steps(const AxisEnum axis) { @@ -151,8 +171,8 @@ int32_t Backlash::get_applied_steps(const AxisEnum axis) { const int32_t residual_error_axis = residual_error[axis]; - // At startup it is assumed the last move was forwards. So the applied - // steps will always be a non-positive number. + // At startup it is assumed the last move was forward. + // So the applied steps will always be negative. if (forward) return -residual_error_axis; diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 14c0fe20e378..593e51b9d0fe 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -72,7 +72,7 @@ class Backlash { return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS); } - static void add_correction_steps(const int32_t &da, const int32_t &db, const int32_t &dc, const AxisBits dm, block_t * const block); + static void add_correction_steps(const xyze_long_t &dist, const AxisBits dm, block_t * const block); static int32_t get_applied_steps(const AxisEnum axis); #if ENABLED(BACKLASH_GCODE) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 1414a3144578..8e9021b03069 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -2175,7 +2175,7 @@ bool Planner::_populate_block( * A correction function is permitted to add steps to an axis, it * should *never* remove steps! */ - TERN_(BACKLASH_COMPENSATION, backlash.add_correction_steps(dist.a, dist.b, dist.c, dm, block)); + TERN_(BACKLASH_COMPENSATION, backlash.add_correction_steps(dist, dm, block)); } TERN_(HAS_EXTRUDERS, block->steps.e = esteps); From 0d42196d11670d52e7b84bbdf5d577c5ba59cb38 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 4 Nov 2023 06:05:47 +0000 Subject: [PATCH 141/268] [cron] Bump distribution date (2023-11-04) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index d99e5ebf5e43..79eeb9231dcf 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-11-01" +//#define STRING_DISTRIBUTION_DATE "2023-11-04" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 3de54adc4672..ec6641f31f01 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-11-01" + #define STRING_DISTRIBUTION_DATE "2023-11-04" #endif /** From cb044d989c397fcbf6f106502df69a7e5c41d34b Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 5 Nov 2023 09:46:57 +0300 Subject: [PATCH 142/268] =?UTF-8?q?=E2=9C=A8=20Probe=20XY=20Offset=20value?= =?UTF-8?q?=20limits=20(#26267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 10 +++-- Marlin/src/gcode/probe/M851.cpp | 12 +++--- Marlin/src/inc/Changes.h | 2 + Marlin/src/inc/Conditionals_post.h | 20 ++++++++-- Marlin/src/inc/SanityCheck.h | 37 +++++++++++++++---- Marlin/src/lcd/e3v2/creality/dwin.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- .../lcd/extui/ia_creality/ia_creality_rts.cpp | 6 +-- .../src/lcd/extui/mks_ui/draw_number_key.cpp | 6 +-- Marlin/src/lcd/extui/ui_api.cpp | 2 +- Marlin/src/lcd/menu/menu.cpp | 2 +- Marlin/src/lcd/menu/menu.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 6 +-- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 6 +-- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/menu/menu_item.h | 2 +- Marlin/src/lcd/tft/ui_common.cpp | 10 ++--- 17 files changed, 85 insertions(+), 44 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 33810011cfbf..c5a73982364a 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1641,9 +1641,13 @@ #define Z_PROBE_LOW_POINT -2 // (mm) Farthest distance below the trigger-point to go before stopping -// For M851 give a range for adjusting the Z probe offset -#define Z_PROBE_OFFSET_RANGE_MIN -20 // (mm) -#define Z_PROBE_OFFSET_RANGE_MAX 20 // (mm) +// For M851 provide ranges for adjusting the X, Y, and Z probe offsets +//#define PROBE_OFFSET_XMIN -50 // (mm) +//#define PROBE_OFFSET_XMAX 50 // (mm) +//#define PROBE_OFFSET_YMIN -50 // (mm) +//#define PROBE_OFFSET_YMAX 50 // (mm) +//#define PROBE_OFFSET_ZMIN -20 // (mm) +//#define PROBE_OFFSET_ZMAX 20 // (mm) // Enable the M48 repeatability test to test probe accuracy //#define Z_MIN_PROBE_REPEATABILITY_TEST diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index e66392acb454..ec63ff190dc0 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -44,10 +44,10 @@ void GcodeSuite::M851() { if (parser.seenval('X')) { const float x = parser.value_float(); #if HAS_PROBE_XY_OFFSET - if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE)) + if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX)) offs.x = x; else { - SERIAL_ECHOLNPGM("?X out of range (-", X_BED_SIZE, " to ", X_BED_SIZE, ")"); + SERIAL_ECHOLNPGM("?X out of range (", PROBE_OFFSET_XMIN, " to ", PROBE_OFFSET_XMAX, ")"); ok = false; } #else @@ -58,10 +58,10 @@ void GcodeSuite::M851() { if (parser.seenval('Y')) { const float y = parser.value_float(); #if HAS_PROBE_XY_OFFSET - if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE)) + if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX)) offs.y = y; else { - SERIAL_ECHOLNPGM("?Y out of range (-", Y_BED_SIZE, " to ", Y_BED_SIZE, ")"); + SERIAL_ECHOLNPGM("?Y out of range (", PROBE_OFFSET_YMIN, " to ", PROBE_OFFSET_YMAX, ")"); ok = false; } #else @@ -71,10 +71,10 @@ void GcodeSuite::M851() { if (parser.seenval('Z')) { const float z = parser.value_float(); - if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) offs.z = z; else { - SERIAL_ECHOLNPGM("?Z out of range (", Z_PROBE_OFFSET_RANGE_MIN, " to ", Z_PROBE_OFFSET_RANGE_MAX, ")"); + SERIAL_ECHOLNPGM("?Z out of range (", PROBE_OFFSET_ZMIN, " to ", PROBE_OFFSET_ZMAX, ")"); ok = false; } } diff --git a/Marlin/src/inc/Changes.h b/Marlin/src/inc/Changes.h index 40116bc5a498..3e80fe70cd62 100644 --- a/Marlin/src/inc/Changes.h +++ b/Marlin/src/inc/Changes.h @@ -665,6 +665,8 @@ #error "FOLDER_SORTING is now SDSORT_FOLDERS." #elif defined(BTT_MINI_12864_V1) #error "BTT_MINI_12864_V1 is now BTT_MINI_12864." +#elif defined(Z_PROBE_OFFSET_RANGE_MIN) || defined(Z_PROBE_OFFSET_RANGE_MAX) + #error "Z_PROBE_OFFSET_RANGE_(MIN|MAX) is now PROBE_OFFSET_Z(MIN|MAX)." #endif // L64xx stepper drivers have been removed diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index ab3da7325942..d172f6d858d9 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2943,14 +2943,26 @@ * Bed Probe dependencies */ #if ANY(MESH_BED_LEVELING, HAS_BED_PROBE) - #ifndef Z_PROBE_OFFSET_RANGE_MIN - #define Z_PROBE_OFFSET_RANGE_MIN -20 + #ifndef PROBE_OFFSET_ZMIN + #define PROBE_OFFSET_ZMIN -20 #endif - #ifndef Z_PROBE_OFFSET_RANGE_MAX - #define Z_PROBE_OFFSET_RANGE_MAX 20 + #ifndef PROBE_OFFSET_ZMAX + #define PROBE_OFFSET_ZMAX 20 #endif #endif #if HAS_BED_PROBE + #ifndef PROBE_OFFSET_XMIN + #define PROBE_OFFSET_XMIN -50 + #endif + #ifndef PROBE_OFFSET_XMAX + #define PROBE_OFFSET_XMAX 50 + #endif + #ifndef PROBE_OFFSET_YMIN + #define PROBE_OFFSET_YMIN -50 + #endif + #ifndef PROBE_OFFSET_YMAX + #define PROBE_OFFSET_YMAX 50 + #endif #if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE) #define ENDSTOPPULLUP_ZMIN_PROBE #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 3fe26eddc182..8796ea224fdc 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1418,20 +1418,15 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif /** - * Check for improper NOZZLE_TO_PROBE_OFFSET + * Check for improper PROBING_MARGIN */ - constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET; - #if ENABLED(NOZZLE_AS_PROBE) - static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0, - "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0."); - #elif !IS_KINEMATIC + #if NONE(NOZZLE_AS_PROBE, IS_KINEMATIC) static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0."); static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0."); static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0."); static_assert(PROBING_MARGIN_LEFT >= 0, "PROBING_MARGIN_LEFT must be >= 0."); static_assert(PROBING_MARGIN_RIGHT >= 0, "PROBING_MARGIN_RIGHT must be >= 0."); #endif - #define _MARGIN(A) TERN(IS_KINEMATIC, PRINTABLE_RADIUS, ((A##_BED_SIZE) / 2)) static_assert(PROBING_MARGIN < _MARGIN(X), "PROBING_MARGIN is too large."); static_assert(PROBING_MARGIN_BACK < _MARGIN(Y), "PROBING_MARGIN_BACK is too large."); @@ -1440,6 +1435,34 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L static_assert(PROBING_MARGIN_RIGHT < _MARGIN(X), "PROBING_MARGIN_RIGHT is too large."); #undef _MARGIN + /** + * Check for improper PROBE_OFFSET_[XYZ](MIN|MAX) + */ + #define PROBE_OFFSET_ASSERT(varname, x, min, max) static_assert(WITHIN(x, min, max), varname " must be within " STRINGIFY(min) " and " STRINGIFY(max)) + #if HAS_PROBE_XY_OFFSET + PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMIN", PROBE_OFFSET_XMIN, -(X_BED_SIZE), X_BED_SIZE); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_XMAX", PROBE_OFFSET_XMAX, -(X_BED_SIZE), X_BED_SIZE); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMIN", PROBE_OFFSET_YMIN, -(Y_BED_SIZE), Y_BED_SIZE); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_YMAX", PROBE_OFFSET_YMAX, -(Y_BED_SIZE), Y_BED_SIZE); + #endif + PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMIN", PROBE_OFFSET_ZMIN, -20, 20); + PROBE_OFFSET_ASSERT("PROBE_OFFSET_ZMAX", PROBE_OFFSET_ZMAX, -20, 20); + + /** + * Check for improper NOZZLE_AS_PROBE or NOZZLE_TO_PROBE_OFFSET + */ + constexpr xyz_pos_t sanity_nozzle_to_probe_offset = NOZZLE_TO_PROBE_OFFSET; + #if ENABLED(NOZZLE_AS_PROBE) + static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0, + "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0."); + #endif + #if HAS_PROBE_XY_OFFSET + PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.x", sanity_nozzle_to_probe_offset.x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX); + PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.y", sanity_nozzle_to_probe_offset.y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX); + #endif + PROBE_OFFSET_ASSERT("NOZZLE_TO_PROBE_OFFSET.z", sanity_nozzle_to_probe_offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); + #undef PROBE_OFFSET_ASSERT + /** * Make sure Z raise values are set */ diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index b21cc3085032..f99a3d0a1ab0 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1384,7 +1384,7 @@ void hmiMoveDone(const AxisEnum axis) { dwinUpdateLCD(); return; } - LIMIT(hmiValues.offset_value, (Z_PROBE_OFFSET_RANGE_MIN) * 100, (Z_PROBE_OFFSET_RANGE_MAX) * 100); + LIMIT(hmiValues.offset_value, (PROBE_OFFSET_ZMIN) * 100, (PROBE_OFFSET_ZMAX) * 100); last_zoffset = dwin_zoffset; dwin_zoffset = hmiValues.offset_value / 100.0f; #if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 0f038a30b214..843009c27461 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2057,7 +2057,7 @@ void autoHome() { queue.inject_P(G28_STR); } #if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) babystep.accum = round(planner.settings.axis_steps_per_mm[Z_AXIS] * BABY_Z_VAR); #endif - setPFloatOnClick(Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, 2, applyZOffset, liveZOffset); + setPFloatOnClick(PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX, 2, applyZOffset, liveZOffset); } void setMoveZto0() { diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index fdb068d32f38..68581aeafd9b 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -795,7 +795,7 @@ void RTS::handleData() { tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100; else tmp_zprobe_offset = float(recdat.data[0]) / 100; - if (WITHIN((tmp_zprobe_offset), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN((tmp_zprobe_offset), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { int16_t tmpSteps = mmToWholeSteps(getZOffset_mm() - tmp_zprobe_offset, axis_t(Z)); if (tmpSteps == 0) tmpSteps = getZOffset_mm() < tmp_zprobe_offset ? 1 : -1; smartAdjustAxis_steps(-tmpSteps, axis_t(Z), false); @@ -1116,7 +1116,7 @@ void RTS::handleData() { #if HAS_BED_PROBE case 2: { // Z-axis to Up - if (WITHIN((getZOffset_mm() + 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN((getZOffset_mm() + 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); //setZOffset_mm(getZOffset_mm() + 0.1); sendData(getZOffset_mm() * 100, ProbeOffset_Z); @@ -1125,7 +1125,7 @@ void RTS::handleData() { break; } case 3: { // Z-axis to Down - if (WITHIN((getZOffset_mm() - 0.1), Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN((getZOffset_mm() - 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false); //babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z)); //setZOffset_mm(getZOffset_mm() - 0.1); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp index 850a409a1857..9bb93e333394 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp @@ -358,20 +358,20 @@ static void set_value_confirm() { case x_offset: { #if HAS_PROBE_XY_OFFSET const float x = atof(key_value); - if (WITHIN(x, -(X_BED_SIZE), X_BED_SIZE)) + if (WITHIN(x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX)) probe.offset.x = x; #endif } break; case y_offset: { #if HAS_PROBE_XY_OFFSET const float y = atof(key_value); - if (WITHIN(y, -(Y_BED_SIZE), Y_BED_SIZE)) + if (WITHIN(y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX)) probe.offset.y = y; #endif } break; case z_offset: { const float z = atof(key_value); - if (WITHIN(z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + if (WITHIN(z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) probe.offset.z = z; } break; #endif diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index bccc543b7f34..19f4903cc69b 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -895,7 +895,7 @@ namespace ExtUI { void setZOffset_mm(const_float_t value) { #if HAS_BED_PROBE - if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) + if (WITHIN(value, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) probe.offset.z = value; #elif ENABLED(BABYSTEP_DISPLAY_TOTAL) babystep.add_mm(Z_AXIS, value - getZOffset_mm()); diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp index a4eab8fc9d85..1c77d9a0923c 100644 --- a/Marlin/src/lcd/menu/menu.cpp +++ b/Marlin/src/lcd/menu/menu.cpp @@ -298,7 +298,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) { , do_probe ? new_probe_offset : hotend_offset[active_extruder].z - diff , new_probe_offset ); - if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN(new_offs, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { babystep.add_steps(Z_AXIS, babystep_increment); diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index e4cd183b4646..3f95d08effbe 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -39,7 +39,7 @@ typedef void (*selectFunc_t)(); #define SS_INVERT 0x04 #define SS_DEFAULT SS_CENTER -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) && Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9 +#if ENABLED(BABYSTEP_ZPROBE_OFFSET) && PROBE_OFFSET_ZMIN >= -9 && PROBE_OFFSET_ZMAX <= 9 #define BABYSTEP_TO_STR(N) ftostr43sign(N) #elif ENABLED(BABYSTEPPING) #define BABYSTEP_TO_STR(N) ftostr53sign(N) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 2bcd4e681b61..90a37ed5199c 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -628,10 +628,10 @@ void menu_backlash(); START_MENU(); BACK_ITEM(MSG_ADVANCED_SETTINGS); #if HAS_PROBE_XY_OFFSET - EDIT_ITEM(float31sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, -(X_BED_SIZE), X_BED_SIZE); - EDIT_ITEM(float31sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, -(Y_BED_SIZE), Y_BED_SIZE); + EDIT_ITEM(float31sign, MSG_ZPROBE_XOFFSET, &probe.offset.x, PROBE_OFFSET_XMIN, PROBE_OFFSET_XMAX); + EDIT_ITEM(float31sign, MSG_ZPROBE_YOFFSET, &probe.offset.y, PROBE_OFFSET_YMIN, PROBE_OFFSET_YMAX); #endif - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #if ENABLED(PROBE_OFFSET_WIZARD) SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard); diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 981c51a6b056..f4d5a269af69 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -278,18 +278,18 @@ void menu_bed_leveling() { // Mesh Bed Leveling Z-Offset // #if ENABLED(MESH_BED_LEVELING) - #if WITHIN(Z_PROBE_OFFSET_RANGE_MIN, -9, 9) + #if WITHIN(PROBE_OFFSET_ZMIN, -9, 9) #define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000 #else #define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99 #endif - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #endif #if ENABLED(BABYSTEP_ZPROBE_OFFSET) SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #elif HAS_BED_PROBE - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #endif #if ENABLED(PROBE_OFFSET_WIZARD) diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 0a8d4a975aba..52123d101b68 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -562,7 +562,7 @@ void menu_configuration() { #if ENABLED(BABYSTEP_ZPROBE_OFFSET) SUBMENU(MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset); #elif HAS_BED_PROBE - EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX); + EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX); #endif // diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 011cdc4423aa..ea26b48907a2 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -163,7 +163,7 @@ DEFINE_MENU_EDIT_ITEM_TYPE(long5 ,uint32_t ,ftostr5rj , 0.01f DEFINE_MENU_EDIT_ITEM_TYPE(long5_25 ,uint32_t ,ftostr5rj , 0.04f ); // 12345 right-justified (25 increment) #if HAS_BED_PROBE - #if Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9 + #if WITHIN(PROBE_OFFSET_ZMIN, -9, 9) #define LCD_Z_OFFSET_TYPE float43 // Values from -9.000 to +9.000 #else #define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99 diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 3426abab0e20..13c8d60d1c83 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -85,7 +85,7 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { , do_probe ? new_probe_offset : hotend_offset[active_extruder].z - bsDiff , new_probe_offset ); - if (WITHIN(new_offs, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) { + if (WITHIN(new_offs, PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) { babystep.add_steps(Z_AXIS, babystep_increment); if (do_probe) probe.offset.z = new_offs; @@ -100,12 +100,12 @@ void moveAxis(const AxisEnum axis, const int8_t direction) { #else // Only change probe.offset.z probe.offset.z += diff; - if (direction < 0 && current_position.z < Z_PROBE_OFFSET_RANGE_MIN) { - current_position.z = Z_PROBE_OFFSET_RANGE_MIN; + if (direction < 0 && current_position.z < PROBE_OFFSET_ZMIN) { + current_position.z = PROBE_OFFSET_ZMIN; drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } - else if (direction > 0 && current_position.z > Z_PROBE_OFFSET_RANGE_MAX) { - current_position.z = Z_PROBE_OFFSET_RANGE_MAX; + else if (direction > 0 && current_position.z > PROBE_OFFSET_ZMAX) { + current_position.z = PROBE_OFFSET_ZMAX; drawMessage(GET_TEXT_F(MSG_LCD_SOFT_ENDSTOPS)); } else From 5ac4ebad78044feec0a88c386fb7c2d25f53c692 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 5 Nov 2023 12:06:43 +0000 Subject: [PATCH 143/268] [cron] Bump distribution date (2023-11-05) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 79eeb9231dcf..330a5266a6ec 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-11-04" +//#define STRING_DISTRIBUTION_DATE "2023-11-05" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ec6641f31f01..e045a4f12683 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-11-04" + #define STRING_DISTRIBUTION_DATE "2023-11-05" #endif /** From dba613fadde7671858cc11a80b500601d648b177 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 12:29:05 -0600 Subject: [PATCH 144/268] =?UTF-8?q?=F0=9F=94=A8=20Fix=20test=20of=20env['P?= =?UTF-8?q?ROGNAME']?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #26386 --- buildroot/share/scripts/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index ee48af6fc6de..9fb927c42685 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -157,7 +157,7 @@ def _RollbackUpload(FirmwareFile): marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR') # Get firmware upload params - upload_firmware_source_name = env['PROGNAME'] + '.bin' if env['PROGNAME'] else str(source[0]) + upload_firmware_source_name = env['PROGNAME'] + '.bin' if 'PROGNAME' in env else str(source[0]) # Source firmware filename upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200 # baud rate of serial connection From 06215944423aa8d304108521bd3b73aa046bfc82 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 14:55:06 -0600 Subject: [PATCH 145/268] =?UTF-8?q?=E2=9C=85=20Update=20stale=20/=20close?= =?UTF-8?q?=20durations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/close-stale.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/close-stale.yml b/.github/workflows/close-stale.yml index 88fea1996ddc..ef1b33b4eb17 100644 --- a/.github/workflows/close-stale.yml +++ b/.github/workflows/close-stale.yml @@ -20,9 +20,21 @@ jobs: - uses: actions/stale@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.' - days-before-stale: 60 - days-before-close: 10 + stale-issue-message: | + Greetings from the Marlin AutoBot! + This issue has had no activity for the last 90 days. + Do you still see this issue with the latest `bugfix-2.1.x` code? + Please add a reply within 14 days or this issue will be automatically closed. + To keep a confirmed issue open we can also add a "Bug: Confirmed" tag. + + Disclaimer: This is an open community project with lots of activity and limited + resources. The main project contributors will do a bug sweep ahead of the next + release, but any skilled member of the community may jump in at any time to fix + this issue. That can take a while depending on our busy lives so please be patient, + and take advantage of other resources such as the MarlinFirmware Discord to help + solve the issue. + days-before-stale: 90 + days-before-close: 14 stale-issue-label: 'stale-closing-soon' exempt-all-assignees: true exempt-issue-labels: 'Bug: Confirmed !,T: Feature Request,Needs: More Data,Needs: Discussion,Needs: Documentation,Needs: Patch,Needs: Work,Needs: Testing,help wanted,no-locking' From e4e85e39b39dbe7b5cb80f8daf8abcdb532a9727 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 15:01:12 -0600 Subject: [PATCH 146/268] =?UTF-8?q?=E2=9C=85=20Get=20LCD/Controller=20in?= =?UTF-8?q?=20bug=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index b40d881a7524..52bac0cd04bd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -109,8 +109,13 @@ body: - type: input attributes: - label: Add-ons - description: Please list any hardware add-ons that could be involved. + label: LCD/Controller + description: Some Marlin behaviors are determined by the controller. Describe your LCD/Controller model and version. + + - type: input + attributes: + label: Other add-ons + description: Please list any other hardware add-ons that could be involved. - type: dropdown attributes: From 0bdbf52bc61f054b418b623bb18256edb4a2dd13 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 6 Nov 2023 00:21:03 +0000 Subject: [PATCH 147/268] [cron] Bump distribution date (2023-11-06) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 330a5266a6ec..e99190944902 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-11-05" +//#define STRING_DISTRIBUTION_DATE "2023-11-06" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e045a4f12683..2eff1f5918a7 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-11-05" + #define STRING_DISTRIBUTION_DATE "2023-11-06" #endif /** From 3341683db23c1aef9aaa538439df7a079f200166 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 5 Nov 2023 21:30:04 -0600 Subject: [PATCH 148/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Use?= =?UTF-8?q?=20FLT=5FMAX=20for=20HUGE=5FVALF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 15e36ac678f7..df3faaa50f45 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -788,7 +788,7 @@ void unified_bed_leveling::shift_mesh_height() { #endif #ifndef HUGE_VALF - #define HUGE_VALF (10e100F) + #define HUGE_VALF FLT_MAX #endif best = do_furthest // Points with valid data or HUGE_VALF are skipped From 9a6c2635eec0ea78ef3be58e5f1afffa0abdd7d7 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 7 Nov 2023 00:20:29 +0000 Subject: [PATCH 149/268] [cron] Bump distribution date (2023-11-07) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index e99190944902..0555c2eeba04 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2023-11-06" +//#define STRING_DISTRIBUTION_DATE "2023-11-07" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2eff1f5918a7..0512d068c6dc 100644 --- a/Marlin/src/inc/Version.h +++ b/Marlin/src/inc/Version.h @@ -42,7 +42,7 @@ * version was tagged. */ #ifndef STRING_DISTRIBUTION_DATE - #define STRING_DISTRIBUTION_DATE "2023-11-06" + #define STRING_DISTRIBUTION_DATE "2023-11-07" #endif /** From bf5612c0ed3818d5a61e053a5cfb53f9914ef45f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 9 Nov 2023 16:05:11 -0600 Subject: [PATCH 150/268] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Use?= =?UTF-8?q?=20=5F=5FFLT=5FMAX=5F=5F=20for=20HUGE=5FVALF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 df3faaa50f45..7496c9e9b5e1 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -788,7 +788,7 @@ void unified_bed_leveling::shift_mesh_height() { #endif #ifndef HUGE_VALF - #define HUGE_VALF FLT_MAX + #define HUGE_VALF __FLT_MAX__ #endif best = do_furthest // Points with valid data or HUGE_VALF are skipped From b2758208c7e63567baa0165a3d552b706c85cf85 Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:34:48 -0500 Subject: [PATCH 151/268] =?UTF-8?q?=E2=9C=A8=20G27=20P3=20/=20P4=20(#26401?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/feature/pause/G27.cpp | 9 +++++- Marlin/src/libs/nozzle.cpp | 41 ++++++++++++++++---------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/Marlin/src/gcode/feature/pause/G27.cpp b/Marlin/src/gcode/feature/pause/G27.cpp index f61453e6fb75..229b22a96c0a 100644 --- a/Marlin/src/gcode/feature/pause/G27.cpp +++ b/Marlin/src/gcode/feature/pause/G27.cpp @@ -29,7 +29,14 @@ #include "../../../module/motion.h" /** - * G27: Park the nozzle + * G27: Park the nozzle according with the given style + * + * P