From f02fa6339f003a8a5074131b50e0905f102ee8e4 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 2 Jan 2024 00:21:06 +0000 Subject: [PATCH 01/26] [cron] Bump distribution date (2024-01-02) --- 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 2044279143..f910608ffe 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 "2024-01-01" +//#define STRING_DISTRIBUTION_DATE "2024-01-02" /** * 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 1e97cfcb19..eeb4aee587 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 "2024-01-01" + #define STRING_DISTRIBUTION_DATE "2024-01-02" #endif /** From 5b74e25108a47acad41d9a50560cd1fbae38040a Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:25:26 +1300 Subject: [PATCH 02/26] =?UTF-8?q?=F0=9F=94=A8=20BSD=20string=20workaround?= =?UTF-8?q?=20(#26532)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/LINUX/HAL.cpp | 46 ++++++++++++++++++ Marlin/src/HAL/LINUX/HAL.h | 14 ++++++ Marlin/src/HAL/LINUX/include/Arduino.h | 3 -- Marlin/src/HAL/NATIVE_SIM/HAL.cpp | 67 ++++++++++++++++++++++++++ Marlin/src/HAL/NATIVE_SIM/HAL.h | 10 ++++ Marlin/src/inc/Conditionals_post.h | 20 ++++---- ini/native.ini | 9 +++- 7 files changed, 154 insertions(+), 15 deletions(-) create mode 100644 Marlin/src/HAL/NATIVE_SIM/HAL.cpp diff --git a/Marlin/src/HAL/LINUX/HAL.cpp b/Marlin/src/HAL/LINUX/HAL.cpp index 6a767c76e7..a90819b6b0 100644 --- a/Marlin/src/HAL/LINUX/HAL.cpp +++ b/Marlin/src/HAL/LINUX/HAL.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see . * */ + #ifdef __PLAT_LINUX__ #include "../../inc/MarlinConfig.h" @@ -57,4 +58,49 @@ uint16_t MarlinHAL::adc_value() { void MarlinHAL::reboot() { /* Reset the application state and GPIO */ } +// ------------------------ +// BSD String +// ------------------------ + +/** + * Copyright (c) 1998, 2015 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HAS_LIBBSD + + /** + * Copy string src to buffer dst of size dsize. At most dsize-1 + * chars will be copied. Always NUL terminates (unless dsize == 0). + * Returns strlen(src); if retval >= dsize, truncation occurred. + */ + size_t MarlinHAL::_strlcpy(char *dst, const char *src, size_t dsize) { + const char *osrc = src; + size_t nleft = dsize; + + // Copy as many bytes as will fit. + if (nleft != 0) while (--nleft != 0) if ((*dst++ = *src++) == '\0') break; + + // Not enough room in dst, add NUL and traverse rest of src. + if (nleft == 0) { + if (dsize != 0) *dst = '\0'; // NUL-terminate dst + while (*src++) { /* nada */ } + } + + return (src - osrc - 1); // count does not include NUL + } + +#endif // HAS_LIBBSD + #endif // __PLAT_LINUX__ diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index e84516d4dc..bb5fb73e05 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -26,6 +26,11 @@ #include #include #include + +#ifdef HAS_LIBBSD + #include +#endif + #undef min #undef max #include @@ -162,4 +167,13 @@ public: } static void set_pwm_frequency(const pin_t, int) {} + + #ifndef HAS_LIBBSD + /** + * Redirect missing strlcpy here + */ + static size_t _strlcpy(char *dst, const char *src, size_t dsize); + #define strlcpy hal._strlcpy + #endif + }; diff --git a/Marlin/src/HAL/LINUX/include/Arduino.h b/Marlin/src/HAL/LINUX/include/Arduino.h index 6e9c80ee07..f05aaed880 100644 --- a/Marlin/src/HAL/LINUX/include/Arduino.h +++ b/Marlin/src/HAL/LINUX/include/Arduino.h @@ -28,9 +28,6 @@ #include -#define strlcpy(A, B, C) strncpy(A, B, (C) - 1) -#define strlcpy_P(A, B, C) strncpy_P(A, B, (C) - 1) - #define HIGH 0x01 #define LOW 0x00 diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.cpp b/Marlin/src/HAL/NATIVE_SIM/HAL.cpp new file mode 100644 index 0000000000..18c225fb3f --- /dev/null +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.cpp @@ -0,0 +1,67 @@ +/** + * 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 . + * + */ + +/** + * Copyright (c) 1998, 2015 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef __PLAT_NATIVE_SIM__ + +#ifndef HAS_LIBBSD + + #include "HAL.h" + + /** + * Copy string src to buffer dst of size dsize. At most dsize-1 + * chars will be copied. Always NUL terminates (unless dsize == 0). + * Returns strlen(src); if retval >= dsize, truncation occurred. + */ + size_t MarlinHAL::_strlcpy(char *dst, const char *src, size_t dsize) { + const char *osrc = src; + size_t nleft = dsize; + + // Copy as many bytes as will fit. + if (nleft != 0) while (--nleft != 0) if ((*dst++ = *src++) == '\0') break; + + // Not enough room in dst, add NUL and traverse rest of src. + if (nleft == 0) { + if (dsize != 0) *dst = '\0'; // NUL-terminate dst + while (*src++) { /* nada */ } + } + + return (src - osrc - 1); // count does not include NUL + } + +#endif // HAS_LIBBSD +#endif // __PLAT_NATIVE_SIM__ diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index 8e88e50230..f57e065a8e 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -263,4 +263,14 @@ public: analogWrite(pin, v); } + static void set_pwm_frequency(const pin_t, int) {} + + #ifndef HAS_LIBBSD + /** + * Redirect missing strlcpy here + */ + static size_t _strlcpy(char *dst, const char *src, size_t dsize); + #define strlcpy hal._strlcpy + #endif + }; diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 04e96177b5..e87681684d 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -30,6 +30,16 @@ // Extras for CI testing #endif +// Arduino IDE with Teensy Additions +#ifdef TEENSYDUINO + #undef max + #define max(a,b) ((a)>(b)?(a):(b)) + #undef min + #define min(a,b) ((a)<(b)?(a):(b)) + #undef NOT_A_PIN // Override Teensyduino legacy CapSense define work-around + #define NOT_A_PIN 0 // For PINS_DEBUGGING +#endif + // ADC #ifdef BOARD_ADC_VREF_MV #define ADC_VREF_MV BOARD_ADC_VREF_MV @@ -64,16 +74,6 @@ #undef OTA_FIRMWARE_UPDATE #endif -#ifdef TEENSYDUINO - #undef max - #define max(a,b) ((a)>(b)?(a):(b)) - #undef min - #define min(a,b) ((a)<(b)?(a):(b)) - - #undef NOT_A_PIN // Override Teensyduino legacy CapSense define work-around - #define NOT_A_PIN 0 // For PINS_DEBUGGING -#endif - /** * Axis lengths and center */ diff --git a/ini/native.ini b/ini/native.ini index 40511beb6f..86608ff3d7 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -36,7 +36,8 @@ build_src_filter = ${common.default_src_filter} + [simulator_common] platform = native framework = -build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g +build_flags = ${common.build_flags} -std=gnu++17 -D__PLAT_NATIVE_SIM__ -DU8G_HAL_LINKS + -I/usr/include/SDL2 -IMarlin -IMarlin/src/HAL/NATIVE_SIM/u8g build_src_flags = -Wall -Wno-expansion-to-defined -Wno-deprecated-declarations -Wcast-align release_flags = -g0 -O3 -flto debug_build_flags = -fstack-protector-strong -g -g3 -ggdb @@ -99,6 +100,7 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags} [simulator_macos] build_unflags = -lGL -fstack-protector-strong build_flags = + -DHAS_LIBBSD -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/SDL2/ @@ -135,5 +137,8 @@ custom_gcc = g++ [env:simulator_windows] extends = simulator_common build_src_flags = ${simulator_common.build_src_flags} -fpermissive -build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp +build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} + -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows + -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp + -DHAS_LIBBSD build_type = debug From 7c159a20e538e42af5185c80c660c90c0377b909 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 3 Jan 2024 00:21:14 +0000 Subject: [PATCH 03/26] [cron] Bump distribution date (2024-01-03) --- 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 f910608ffe..79c3ef6253 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 "2024-01-02" +//#define STRING_DISTRIBUTION_DATE "2024-01-03" /** * 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 eeb4aee587..4007aaccef 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 "2024-01-02" + #define STRING_DISTRIBUTION_DATE "2024-01-03" #endif /** From 1ac6428c82aa72cc41c0c9f758659b71e7fce1cf Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:52:12 +1300 Subject: [PATCH 04/26] =?UTF-8?q?=F0=9F=94=AA=20Options=20to=20slim=20M111?= =?UTF-8?q?,=20remove=20M115=20(#26603)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration_adv.h | 12 ++++++++++++ Marlin/src/core/serial.h | 21 ++++++++------------ Marlin/src/gcode/control/M111.cpp | 32 ++++++++++++++++++------------- Marlin/src/gcode/gcode.cpp | 5 ++++- Marlin/src/gcode/gcode.h | 5 ++++- Marlin/src/gcode/host/M115.cpp | 7 ++++++- Marlin/src/inc/Warnings.cpp | 8 ++++++++ ini/features.ini | 1 + platformio.ini | 1 - 9 files changed, 62 insertions(+), 30 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 72aee11588..d19fb1d503 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3935,6 +3935,18 @@ //#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW +/** + * Enable M111 debug flags 1=ECHO, 2=INFO, 4=ERRORS (unimplemented). + * Disable to save some flash. Some hosts (Repetier Host) may rely on this feature. + */ +#define DEBUG_FLAGS_GCODE + +/** + * M115 - Report capabilites. Disable to save ~1150 bytes of flash. + * Some hosts (and serial TFT displays) rely on this feature. + */ +#define REPORT_CAPABILITIES_GCODE + /** * Enable this option for a leaner build of Marlin that removes * workspace offsets to slightly optimize performance. diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h index ff02ebedc2..f9b73e6d26 100644 --- a/Marlin/src/core/serial.h +++ b/Marlin/src/core/serial.h @@ -33,19 +33,14 @@ // enum MarlinDebugFlags : uint8_t { MARLIN_DEBUG_NONE = 0, - MARLIN_DEBUG_ECHO = _BV(0), ///< Echo commands in order as they are processed - MARLIN_DEBUG_INFO = _BV(1), ///< Print messages for code that has debug output - MARLIN_DEBUG_ERRORS = _BV(2), ///< Not implemented - MARLIN_DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands - MARLIN_DEBUG_COMMUNICATION = _BV(4), ///< Not implemented - #if ENABLED(DEBUG_LEVELING_FEATURE) - MARLIN_DEBUG_LEVELING = _BV(5), ///< Print detailed output for homing and leveling - MARLIN_DEBUG_MESH_ADJUST = _BV(6), ///< UBL bed leveling - #else - MARLIN_DEBUG_LEVELING = 0, - MARLIN_DEBUG_MESH_ADJUST = 0, - #endif - MARLIN_DEBUG_ALL = 0xFF + MARLIN_DEBUG_ECHO = TERN0(DEBUG_FLAGS_GCODE, _BV(0)), //!< Echo commands in order as they are processed + MARLIN_DEBUG_INFO = TERN0(DEBUG_FLAGS_GCODE, _BV(1)), //!< Print messages for code that has debug output + MARLIN_DEBUG_ERRORS = TERN0(DEBUG_FLAGS_GCODE, _BV(2)), //!< Not implemented + MARLIN_DEBUG_DRYRUN = _BV(3), //!< Ignore temperature setting and E movement commands + MARLIN_DEBUG_COMMUNICATION = TERN0(DEBUG_FLAGS_GCODE, _BV(4)), //!< Not implemented + MARLIN_DEBUG_LEVELING = TERN0(DEBUG_LEVELING_FEATURE, _BV(5)), //!< Print detailed output for homing and leveling + MARLIN_DEBUG_MESH_ADJUST = TERN0(DEBUG_LEVELING_FEATURE, _BV(6)), //!< UBL bed leveling + MARLIN_DEBUG_ALL = MARLIN_DEBUG_ECHO|MARLIN_DEBUG_INFO|MARLIN_DEBUG_ERRORS|MARLIN_DEBUG_COMMUNICATION|MARLIN_DEBUG_LEVELING|MARLIN_DEBUG_MESH_ADJUST }; extern uint8_t marlin_debug_flags; diff --git a/Marlin/src/gcode/control/M111.cpp b/Marlin/src/gcode/control/M111.cpp index 02f37f8497..a8e549b69d 100644 --- a/Marlin/src/gcode/control/M111.cpp +++ b/Marlin/src/gcode/control/M111.cpp @@ -20,6 +20,7 @@ * */ +#include "../../inc/MarlinConfig.h" #include "../gcode.h" /** @@ -27,18 +28,25 @@ */ void GcodeSuite::M111() { if (parser.seenval('S')) marlin_debug_flags = parser.value_byte(); - - static PGMSTR(str_debug_1, STR_DEBUG_ECHO); - static PGMSTR(str_debug_2, STR_DEBUG_INFO); - static PGMSTR(str_debug_4, STR_DEBUG_ERRORS); + #if ENABLED(DEBUG_FLAGS_GCODE) + static PGMSTR(str_debug_1, STR_DEBUG_ECHO); + static PGMSTR(str_debug_2, STR_DEBUG_INFO); + static PGMSTR(str_debug_4, STR_DEBUG_ERRORS); + #endif static PGMSTR(str_debug_8, STR_DEBUG_DRYRUN); - static PGMSTR(str_debug_16, STR_DEBUG_COMMUNICATION); + #if ENABLED(DEBUG_FLAGS_GCODE) + static PGMSTR(str_debug_16, STR_DEBUG_COMMUNICATION); + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) static PGMSTR(str_debug_detail, STR_DEBUG_DETAIL); #endif static PGM_P const debug_strings[] PROGMEM = { - str_debug_1, str_debug_2, str_debug_4, str_debug_8, str_debug_16, + TERN(DEBUG_FLAGS_GCODE, str_debug_1, nullptr), + TERN(DEBUG_FLAGS_GCODE, str_debug_2, nullptr), + TERN(DEBUG_FLAGS_GCODE, str_debug_4, nullptr), + str_debug_8, + TERN(DEBUG_FLAGS_GCODE, str_debug_16, nullptr), TERN_(DEBUG_LEVELING_FEATURE, str_debug_detail) }; @@ -47,31 +55,29 @@ void GcodeSuite::M111() { if (marlin_debug_flags) { uint8_t comma = 0; for (uint8_t i = 0; i < COUNT(debug_strings); ++i) { - if (TEST(marlin_debug_flags, i)) { + PGM_P const pstr = (PGM_P)pgm_read_ptr(&debug_strings[i]); + if (pstr && TEST(marlin_debug_flags, i)) { if (comma++) SERIAL_CHAR(','); - SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&debug_strings[i])); + SERIAL_ECHOPGM_P(pstr); } } } else { SERIAL_ECHOPGM(STR_DEBUG_OFF); - #if !defined(__AVR__) || !defined(USBCON) + #if !(defined(__AVR__) && defined(USBCON)) #if ENABLED(SERIAL_STATS_RX_BUFFER_OVERRUNS) SERIAL_ECHOPGM("\nBuffer Overruns: ", MYSERIAL1.buffer_overruns()); #endif - #if ENABLED(SERIAL_STATS_RX_FRAMING_ERRORS) SERIAL_ECHOPGM("\nFraming Errors: ", MYSERIAL1.framing_errors()); #endif - #if ENABLED(SERIAL_STATS_DROPPED_RX) SERIAL_ECHOPGM("\nDropped bytes: ", MYSERIAL1.dropped()); #endif - #if ENABLED(SERIAL_STATS_MAX_RX_QUEUED) SERIAL_ECHOPGM("\nMax RX Queue Size: ", MYSERIAL1.rxMaxEnqueued()); #endif - #endif // !__AVR__ || !USBCON + #endif // !(__AVR__ && USBCON) } SERIAL_EOL(); } diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 6a0e8cb171..4266136ef4 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -669,7 +669,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes case 114: M114(); break; // M114: Report current position - case 115: M115(); break; // M115: Report capabilities + + #if ENABLED(REPORT_CAPABILITIES_GCODE) + case 115: M115(); break; // M115: Report capabilities + #endif case 117: TERN_(HAS_STATUS_MESSAGE, M117()); break; // M117: Set LCD message text, if possible diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index fffd0d714b..d5adf6c415 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -760,7 +760,10 @@ private: #endif static void M114(); - static void M115(); + + #if ENABLED(REPORT_CAPABILITIES_GCODE) + static void M115(); + #endif #if HAS_STATUS_MESSAGE static void M117(); diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index 806e593fcb..ae8e615507 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -20,8 +20,11 @@ * */ -#include "../gcode.h" #include "../../inc/MarlinConfig.h" + +#if ENABLED(REPORT_CAPABILITIES_GCODE) + +#include "../gcode.h" #include "../queue.h" // for getting the command port #if ENABLED(M115_GEOMETRY_REPORT) @@ -271,3 +274,5 @@ void GcodeSuite::M115() { #endif // EXTENDED_CAPABILITIES_REPORT } + +#endif // REPORT_CAPABILITIES_GCODE diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index d239e6a7d5..8f260b237c 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -42,6 +42,14 @@ #endif #endif +#if DISABLED(DEBUG_FLAGS_GCODE) + #warning "DEBUG_FLAGS_GCODE is recommended if you have space. Some hosts rely on it." +#endif + +#if DISABLED(REPORT_CAPABILITIES_GCODE) + #warning "REPORT_CAPABILITIES_GCODE is recommended if you have space. Some hosts rely on it." +#endif + #if ENABLED(LA_DEBUG) #warning "WARNING! Disable LA_DEBUG for the final build!" #endif diff --git a/ini/features.ini b/ini/features.ini index a550783a38..120d599dca 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -322,6 +322,7 @@ CNC_COORDINATE_SYSTEMS = build_src_filter=+ EXPECTED_PRINTER_CHECK = build_src_filter=+ HOST_KEEPALIVE_FEATURE = build_src_filter=+ +REPORT_CAPABILITIES_GCODE = build_src_filter=+ AUTO_REPORT_POSITION = build_src_filter=+ REPETIER_GCODE_M360 = build_src_filter=+ HAS_GCODE_M876 = build_src_filter=+ diff --git a/platformio.ini b/platformio.ini index 81f97e73b8..5249b790f2 100644 --- a/platformio.ini +++ b/platformio.ini @@ -111,7 +111,6 @@ default_src_filter = + - - + + + - + + + + From 4a9e102c2ef96b75378195ad3b89cb1646ac4df4 Mon Sep 17 00:00:00 2001 From: I3DBeeTech <129617321+I3DBeeTech@users.noreply.github.com> Date: Wed, 3 Jan 2024 06:23:41 +0530 Subject: [PATCH 05/26] =?UTF-8?q?=F0=9F=93=BA=20I3DBEE=20TECH=20Beez=20Min?= =?UTF-8?q?i=2012864=20(#26596)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 5 +++++ Marlin/src/inc/Conditionals_LCD.h | 4 ++-- Marlin/src/inc/SanityCheck.h | 10 +++++----- Marlin/src/inc/Warnings.cpp | 6 +++--- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 2 +- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 6 +++--- Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h | 4 ++-- 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index fd2dbbb273..1b0e92923e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -3015,6 +3015,11 @@ // //#define BTT_MINI_12864 +// +// BEEZ MINI 12864 is an alias for FYSETC_MINI_12864_2_1. Type A/B. NeoPixel RGB Backlight. +// +//#define BEEZ_MINI_12864 + // // Factory display for Creality CR-10 / CR-7 / Ender-3 // https://www.aliexpress.com/item/32833148327.html diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index b501a556f8..a81c8639cf 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -566,8 +566,8 @@ #define MKS_MINI_12864 #endif -// 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) +// MKS_MINI_12864_V3 , BTT_MINI_12864 and BEEZ_MINI_12864 have identical pinouts to FYSETC_MINI_12864_2_1 +#if ANY(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864) #define FYSETC_MINI_12864_2_1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index e5cba03102..d1c84665ed 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2275,7 +2275,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #endif /** - * FYSETC/MKS/BTT Mini Panel Requirements + * FYSETC/MKS/BTT/BEEZ Mini Panel Requirements */ #if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) #ifndef NEO_RGB @@ -2283,9 +2283,9 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #define FAUX_RGB 1 #endif #if defined(NEOPIXEL_TYPE) && NEOPIXEL_TYPE != NEO_RGB - #error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB." + #error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_TYPE to be NEO_RGB." #elif defined(NEOPIXEL_PIXELS) && NEOPIXEL_PIXELS < 3 - #error "Your FYSETC/MKS/BTT Mini Panel requires NEOPIXEL_PIXELS >= 3." + #error "Your FYSETC/MKS/BTT/BEEZ Mini Panel requires NEOPIXEL_PIXELS >= 3." #endif #if FAUX_RGB #undef NEO_RGB @@ -2618,8 +2618,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)) \ - + COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864) \ + + (ENABLED(FYSETC_MINI_12864_2_1) && NONE(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_MINI_12864)) \ + + COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864, BEEZ_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/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 8f260b237c..384fe04c61 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -703,16 +703,16 @@ #endif /** - * FYSETC/MKS/BTT Mini Panel backlighting + * FYSETC/MKS/BTT/BEEZ Mini Panel backlighting */ #if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864_2_1) && !ALL(NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, LED_COLOR_PRESETS) - #warning "Your FYSETC/MKS/BTT Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS." + #warning "Your FYSETC/MKS/BTT/BEEZ Mini Panel works best with NEOPIXEL_LED, LED_CONTROL_MENU, LED_USER_PRESET_STARTUP, and LED_COLOR_PRESETS." #endif #if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) && DISABLED(RGB_LED) #warning "Your FYSETC Mini Panel works best with RGB_LED." #elif ANY(FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) && DISABLED(LED_USER_PRESET_STARTUP) - #warning "Your FYSETC/MKS/BTT Mini Panel works best with LED_USER_PRESET_STARTUP." + #warning "Your FYSETC/MKS/BTT/BEEZ Mini Panel works best with LED_USER_PRESET_STARTUP." #endif #if ANY(FYSETC_242_OLED_12864, FYSETC_MINI_12864) && ALL(PSU_CONTROL, HAS_COLOR_LEDS) && !LED_POWEROFF_TIMEOUT diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 60ed800ba6..43196bafa9 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, FYSETC_MINI_12864_2_1 + // MKS_MINI_12864_V3, BTT_MINI_12864, FYSETC_MINI_12864_2_1, BEEZ_MINI_12864 #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 f752350cc6..b36ef2287a 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 display pinout + * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 display pinout * * Board Display * ------ ------ @@ -251,13 +251,13 @@ * EXP1 EXP1 * * - * ----- ------ + * --- ------ * | 1 | RST -- |10 9 | -- * | 2 | PA3 RX2 RESET_BTN | 8 7 | SD_DETECT * | 3 | PA2 TX2 LCD_MOSI | 6 5 EN2 * | 4 | GND -- | 4 3 | EN1 * | 5 | 5V LCD_SCK | 2 1 | -- - * ----- ------ + * --- ------ * TFT EXP2 * 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 362cfca307..4ab1e15cdd 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 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 / BEEZ_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 display pinout + * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 display pinout * * Board Display * ------ ------ From 6d407767e7692d66bc93a0012d71268770e4835c Mon Sep 17 00:00:00 2001 From: plampix Date: Wed, 3 Jan 2024 16:43:18 +0100 Subject: [PATCH 06/26] =?UTF-8?q?=F0=9F=94=A7=20CONFIGURE=5FFILAMENT=5FCHA?= =?UTF-8?q?NGE=20-=20Optional=20M603=20(#26613)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 4 ++-- Marlin/Configuration_adv.h | 3 ++- Marlin/src/feature/max7219.cpp | 2 +- Marlin/src/feature/pause.cpp | 4 +++- Marlin/src/feature/pause.h | 19 ++++++++++++++----- Marlin/src/gcode/feature/pause/M603.cpp | 6 +++--- Marlin/src/gcode/gcode.cpp | 4 +++- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 4 ++-- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- Marlin/src/lcd/extui/nextion/nextion_tft.cpp | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- Marlin/src/module/settings.cpp | 18 ++++++------------ buildroot/tests/BIGTREE_GTR_V1_0 | 1 + ini/features.ini | 3 ++- 14 files changed, 42 insertions(+), 32 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 1b0e92923e..9acdc107ca 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2054,7 +2054,7 @@ /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. - * NOTE: Requires a lot of PROGMEM! + * NOTE: Requires a lot of flash! */ //#define DEBUG_LEVELING_FEATURE @@ -2343,7 +2343,7 @@ */ //#define EEPROM_SETTINGS // Persistent storage with M500 and M501 //#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release! -#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM. +#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save flash. #define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load #if ENABLED(EEPROM_SETTINGS) //#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors. diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index d19fb1d503..10316ac928 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1342,7 +1342,7 @@ #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm - // Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM). + // Uncomment to enable reporting (required for "G425 V", but consumes flash). //#define CALIBRATION_REPORTING // The true location and dimension the cube/bolt/washer on the bed. @@ -2929,6 +2929,7 @@ //#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu. //#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302) + #define CONFIGURE_FILAMENT_CHANGE // Add M603 G-code and menu items. Requires ~1.3K bytes of flash. #endif // @section tmc_smart diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp index 12e4a539d3..6089b1a86e 100644 --- a/Marlin/src/feature/max7219.cpp +++ b/Marlin/src/feature/max7219.cpp @@ -39,7 +39,7 @@ #if ENABLED(MAX7219_DEBUG) -#define MAX7219_ERRORS // Disable to save 406 bytes of Program Memory +#define MAX7219_ERRORS // Requires ~400 bytes of flash #include "max7219.h" diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index f098ad9c51..8756c339e3 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -89,7 +89,9 @@ static xyze_pos_t resume_position; PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT; #endif -fil_change_settings_t fc_settings[EXTRUDERS]; +#if ENABLED(CONFIGURE_FILAMENT_CHANGE) + fil_change_settings_t fc_settings[EXTRUDERS]; +#endif #if HAS_MEDIA #include "../sd/cardreader.h" diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 45f62dc310..304c8a611d 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -26,10 +26,6 @@ * This may be combined with related G-codes if features are consolidated. */ -typedef struct { - float unload_length, load_length; -} fil_change_settings_t; - #include "../inc/MarlinConfigPre.h" #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -69,7 +65,20 @@ enum PauseMessage : char { extern PauseMode pause_mode; #endif -extern fil_change_settings_t fc_settings[EXTRUDERS]; +typedef struct FilamentChangeSettings { + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) + float load_length, unload_length; + #else + static constexpr float load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH, + unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH; + #endif +} fil_change_settings_t; + +#if ENABLED(CONFIGURE_FILAMENT_CHANGE) + extern fil_change_settings_t fc_settings[EXTRUDERS]; +#else + constexpr fil_change_settings_t fc_settings[EXTRUDERS]; +#endif extern uint8_t did_pause_print; diff --git a/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin/src/gcode/feature/pause/M603.cpp index 0512a0d29b..2f24cc6421 100644 --- a/Marlin/src/gcode/feature/pause/M603.cpp +++ b/Marlin/src/gcode/feature/pause/M603.cpp @@ -20,9 +20,9 @@ * */ -#include "../../../inc/MarlinConfig.h" +#include "../../../inc/MarlinConfigPre.h" -#if ENABLED(ADVANCED_PAUSE_FEATURE) +#if ENABLED(CONFIGURE_FILAMENT_CHANGE) #include "../../gcode.h" #include "../../../feature/pause.h" @@ -80,4 +80,4 @@ void GcodeSuite::M603_report(const bool forReplay/*=true*/) { #endif } -#endif // ADVANCED_PAUSE_FEATURE +#endif // CONFIGURE_FILAMENT_CHANGE diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 4266136ef4..945da708b4 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -948,7 +948,9 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #if ENABLED(ADVANCED_PAUSE_FEATURE) case 600: M600(); break; // M600: Pause for Filament Change - case 603: M603(); break; // M603: Configure Filament Change + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) + case 603: M603(); break; // M603: Configure Filament Change + #endif #endif #if HAS_DUPLICATION_MODE diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index da6fda08d5..296f46f68a 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -2910,7 +2910,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) case ADVANCED_LOAD: if (draw) { drawMenuItem(row, ICON_WriteEEPROM, F("Load Length")); @@ -2927,7 +2927,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra else modifyValue(fc_settings[0].unload_length, 0, EXTRUDE_MAXLENGTH, 1); break; - #endif // ADVANCED_PAUSE_FEATURE + #endif // CONFIGURE_FILAMENT_CHANGE #if ENABLED(PREVENT_COLD_EXTRUSION) case ADVANCED_COLD_EXTRUDE: diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 894102e8a3..5262dba385 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -3302,7 +3302,7 @@ void drawFilSetMenu() { #if ENABLED(PREVENT_COLD_EXTRUSION) EDIT_ITEM(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, setExtMinT, &hmiData.extMinT); #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) EDIT_ITEM(ICON_FilLoad, MSG_FILAMENT_LOAD, onDrawPFloatMenu, setFilLoad, &fc_settings[0].load_length); EDIT_ITEM(ICON_FilUnload, MSG_FILAMENT_UNLOAD, onDrawPFloatMenu, setFilUnload, &fc_settings[0].unload_length); #endif diff --git a/Marlin/src/lcd/extui/nextion/nextion_tft.cpp b/Marlin/src/lcd/extui/nextion/nextion_tft.cpp index c29a2dd404..0474328650 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_tft.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_tft.cpp @@ -323,7 +323,7 @@ void NextionTFT::panelInfo(uint8_t req) { SEND_PRINT_INFO("t8", getFilamentUsed_str); break; - case 28: // Filament laod/unload + case 28: // Filament load/unload #if ENABLED(ADVANCED_PAUSE_FEATURE) #define SEND_PAUSE_INFO(A, B) SEND_VALasTXT(A, fc_settings[getActiveTool()].B) #else diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 95d965bdf9..698687b96d 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -136,7 +136,7 @@ void menu_backlash(); } #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) constexpr float extrude_maxlength = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 999); EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index fa7beee94b..387d86ba29 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 "V89" +#define EEPROM_VERSION "V90" #define EEPROM_OFFSET 100 // Check the integrity of data offsets. @@ -508,7 +508,7 @@ typedef struct SettingsDataStruct { // // ADVANCED_PAUSE_FEATURE // - #if HAS_EXTRUDERS + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L #endif @@ -1551,11 +1551,8 @@ void MarlinSettings::postprocess() { // // Advanced Pause filament load & unload lengths // - #if HAS_EXTRUDERS + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) { - #if DISABLED(ADVANCED_PAUSE_FEATURE) - const fil_change_settings_t fc_settings[EXTRUDERS] = { 0, 0 }; - #endif _FIELD_TEST(fc_settings); EEPROM_WRITE(fc_settings); } @@ -2626,11 +2623,8 @@ void MarlinSettings::postprocess() { // // Advanced Pause filament load & unload lengths // - #if HAS_EXTRUDERS + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) { - #if DISABLED(ADVANCED_PAUSE_FEATURE) - fil_change_settings_t fc_settings[EXTRUDERS]; - #endif _FIELD_TEST(fc_settings); EEPROM_READ(fc_settings); } @@ -3549,7 +3543,7 @@ void MarlinSettings::reset() { // // Advanced Pause filament load & unload lengths // - #if ENABLED(ADVANCED_PAUSE_FEATURE) + #if ENABLED(CONFIGURE_FILAMENT_CHANGE) EXTRUDER_LOOP() { fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH; fc_settings[e].load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH; @@ -3924,7 +3918,7 @@ void MarlinSettings::reset() { // // Advanced Pause filament load & unload lengths // - TERN_(ADVANCED_PAUSE_FEATURE, gcode.M603_report(forReplay)); + TERN_(CONFIGURE_FILAMENT_CHANGE, gcode.M603_report(forReplay)); // // Tool-changing Parameters diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0 index 8f69f5b069..62ca3c24f2 100755 --- a/buildroot/tests/BIGTREE_GTR_V1_0 +++ b/buildroot/tests/BIGTREE_GTR_V1_0 @@ -18,6 +18,7 @@ opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH NEOPIXEL_LED Z_SAFE_HOMING NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE \ FILAMENT_RUNOUT_SENSOR FIL_RUNOUT4_PULLUP FIL_RUNOUT8_PULLUP FILAMENT_CHANGE_RESUME_ON_INSERT PAUSE_REHEAT_FAST_RESUME \ LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE +opt_disable CONFIGURE_FILAMENT_CHANGE exec_test $1 $2 "BigTreeTech GTR | 8 Extruders | Auto-Fan | Mixed TMC Drivers | Runout Sensors w/ distinct states" "$3" restore_configs diff --git a/ini/features.ini b/ini/features.ini index 120d599dca..f9822fa7a8 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -259,7 +259,8 @@ MIXING_EXTRUDER = build_src_filter=+ HAS_PRUSA_MMU2 = build_src_filter=+ + PASSWORD_FEATURE = build_src_filter=+ + -ADVANCED_PAUSE_FEATURE = build_src_filter=+ + + +ADVANCED_PAUSE_FEATURE = build_src_filter=+ + +CONFIGURE_FILAMENT_CHANGE = build_src_filter=+ PSU_CONTROL = build_src_filter=+ HAS_POWER_MONITOR = build_src_filter=+ + POWER_LOSS_RECOVERY = build_src_filter=+ + From 68b7802fc17cd4160fa3923897ab69dbea09f4ed Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Wed, 3 Jan 2024 20:19:19 +0100 Subject: [PATCH 07/26] =?UTF-8?q?=F0=9F=93=9D=20Update=20M493=20(FT=5FMOTI?= =?UTF-8?q?ON)=20comments=20(#26620)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/gcode/feature/ft_motion/M493.cpp | 43 ++++++++++++--------- Marlin/src/module/ft_types.h | 28 +++++++------- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/Marlin/src/gcode/feature/ft_motion/M493.cpp b/Marlin/src/gcode/feature/ft_motion/M493.cpp index 7f202be413..d374ca58c9 100644 --- a/Marlin/src/gcode/feature/ft_motion/M493.cpp +++ b/Marlin/src/gcode/feature/ft_motion/M493.cpp @@ -38,14 +38,14 @@ void say_shaping() { SERIAL_ECHOPGM(" with "); switch (ftMotion.cfg.mode) { default: break; - case ftMotionMode_ZV: SERIAL_ECHOPGM("ZV"); break; - case ftMotionMode_ZVD: SERIAL_ECHOPGM("ZVD"); break; - case ftMotionMode_ZVDD: SERIAL_ECHOPGM("ZVDD"); break; - case ftMotionMode_ZVDDD: SERIAL_ECHOPGM("ZVDDD"); break; - case ftMotionMode_EI: SERIAL_ECHOPGM("EI"); break; - case ftMotionMode_2HEI: SERIAL_ECHOPGM("2 Hump EI"); break; - case ftMotionMode_3HEI: SERIAL_ECHOPGM("3 Hump EI"); break; - case ftMotionMode_MZV: SERIAL_ECHOPGM("MZV"); break; + case ftMotionMode_ZV: SERIAL_ECHOPGM("ZV"); break; + case ftMotionMode_ZVD: SERIAL_ECHOPGM("ZVD"); break; + case ftMotionMode_ZVDD: SERIAL_ECHOPGM("ZVDD"); break; + case ftMotionMode_ZVDDD: SERIAL_ECHOPGM("ZVDDD"); break; + case ftMotionMode_EI: SERIAL_ECHOPGM("EI"); break; + case ftMotionMode_2HEI: SERIAL_ECHOPGM("2 Hump EI"); break; + case ftMotionMode_3HEI: SERIAL_ECHOPGM("3 Hump EI"); break; + case ftMotionMode_MZV: SERIAL_ECHOPGM("MZV"); break; //case ftMotionMode_DISCTF: SERIAL_ECHOPGM("discrete transfer functions"); break; //case ftMotionMode_ULENDO_FBS: SERIAL_ECHOPGM("Ulendo FBS."); return; } @@ -129,14 +129,17 @@ void GcodeSuite::M493_report(const bool forReplay/*=true*/) { * M493: Set Fixed-time Motion Control parameters * * S Set the motion / shaping mode. Shaping requires an X axis, at the minimum. - * 0: NORMAL - * 1: FIXED-TIME - * 10: ZV - * 11: ZVD - * 12: EI - * 13: 2HEI - * 14: 3HEI - * 15: MZV + * + * 0: Standard Motion + * 1: Fixed-Time Motion + * 10: ZV : Zero Vibration + * 11: ZVD : Zero Vibration and Derivative + * 12: ZVDD : Zero Vibration, Derivative, and Double Derivative + * 13: ZVDDD : Zero Vibration, Derivative, Double Derivative, and Triple Derivative + * 14: EI : Extra-Intensive + * 15: 2HEI : 2-Hump Extra-Intensive + * 16: 3HEI : 3-Hump Extra-Intensive + * 17: MZV : Mass-based Zero Vibration * * P Enable (1) or Disable (0) Linear Advance pressure control * @@ -147,11 +150,15 @@ void GcodeSuite::M493_report(const bool forReplay/*=true*/) { * 1: Z-based (Requires a Z axis) * 2: Mass-based (Requires X and E axes) * - * A Set static/base frequency for the X axis - * F Set frequency scaling for the X axis + * A Set static/base frequency for the X axis + * F Set frequency scaling for the X axis + * I 0.0 Set damping ratio for the X axis + * Q 0.00 Set the vibration tolerance for the X axis * * B Set static/base frequency for the Y axis * H Set frequency scaling for the Y axis + * J 0.0 Set damping ratio for the Y axis + * R 0.00 Set the vibration tolerance for the Y axis */ void GcodeSuite::M493() { struct { bool update_n:1, update_a:1, reset_ft:1, report_h:1; } flag = { false }; diff --git a/Marlin/src/module/ft_types.h b/Marlin/src/module/ft_types.h index e7bcf37ac6..b17c00974e 100644 --- a/Marlin/src/module/ft_types.h +++ b/Marlin/src/module/ft_types.h @@ -24,24 +24,22 @@ #include "../core/types.h" typedef enum FXDTICtrlMode : uint8_t { - ftMotionMode_DISABLED = 0U, - ftMotionMode_ENABLED = 1U, - //ftMotionMode_ULENDO_FBS = 2U, - ftMotionMode_ZV = 10U, - ftMotionMode_ZVD = 11U, - ftMotionMode_ZVDD = 12U, - ftMotionMode_ZVDDD = 13U, - ftMotionMode_EI = 14U, - ftMotionMode_2HEI = 15U, - ftMotionMode_3HEI = 16U, - ftMotionMode_MZV = 17U, - //ftMotionMode_DISCTF = 20U + ftMotionMode_DISABLED = 0, // Standard Motion + ftMotionMode_ENABLED = 1, // Time-Based Motion + ftMotionMode_ZV = 10, // Zero Vibration + ftMotionMode_ZVD = 11, // Zero Vibration and Derivative + ftMotionMode_ZVDD = 12, // Zero Vibration, Derivative, and Double Derivative + ftMotionMode_ZVDDD = 13, // Zero Vibration, Derivative, Double Derivative, and Triple Derivative + ftMotionMode_EI = 14, // Extra-Intensive + ftMotionMode_2HEI = 15, // 2-Hump Extra-Intensive + ftMotionMode_3HEI = 16, // 3-Hump Extra-Intensive + ftMotionMode_MZV = 17 // Mass-based Zero Vibration } ftMotionMode_t; enum dynFreqMode_t : uint8_t { - dynFreqMode_DISABLED = 0U, - dynFreqMode_Z_BASED = 1U, - dynFreqMode_MASS_BASED = 2U + dynFreqMode_DISABLED = 0, + dynFreqMode_Z_BASED = 1, + dynFreqMode_MASS_BASED = 2 }; #define IS_EI_MODE(N) WITHIN(N, ftMotionMode_EI, ftMotionMode_3HEI) From be1dee7caf8197f10811574265714e78ca08ec83 Mon Sep 17 00:00:00 2001 From: Orel <37673727+0r31@users.noreply.github.com> Date: Wed, 3 Jan 2024 21:02:20 +0100 Subject: [PATCH 08/26] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20old=20#includ?= =?UTF-8?q?es=20(#26621)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/queue.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 9ce28f781c..db06af82f0 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -37,14 +37,6 @@ GCodeQueue queue; #include "../MarlinCore.h" #include "../core/bug_on.h" -#if ENABLED(PRINTER_EVENT_LEDS) - #include "../feature/leds/printer_event_leds.h" -#endif - -#if HAS_ETHERNET - #include "../feature/ethernet.h" -#endif - #if ENABLED(BINARY_FILE_TRANSFER) #include "../feature/binary_stream.h" #endif From f8771e9ad5d572f22ec89c199e81cd53106ffc5c Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 4 Jan 2024 00:21:47 +0000 Subject: [PATCH 09/26] [cron] Bump distribution date (2024-01-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 79c3ef6253..1cdc982294 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 "2024-01-03" +//#define STRING_DISTRIBUTION_DATE "2024-01-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 4007aaccef..2b250079f5 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 "2024-01-03" + #define STRING_DISTRIBUTION_DATE "2024-01-04" #endif /** From 54b7da18cbbbed49fee93f0f39b7093c527c25ea Mon Sep 17 00:00:00 2001 From: Taylor Talkington Date: Wed, 3 Jan 2024 21:45:50 -0500 Subject: [PATCH 10/26] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Bed=20PID=20Autotune?= =?UTF-8?q?=20output=20(#26606)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #25928 --- Marlin/src/module/temperature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 5b4dcc83bc..3f55dde598 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -849,9 +849,9 @@ volatile bool Temperature::raw_temps_ready = false; #if ANY(PIDTEMPBED, PIDTEMPCHAMBER) FSTR_P const estring = GHV(F("chamber"), F("bed"), FPSTR(NUL_STR)); - say_default_(); SERIAL_ECHO(estring, F("Kp "), tune_pid.p); - say_default_(); SERIAL_ECHO(estring, F("Ki "), tune_pid.i); - say_default_(); SERIAL_ECHO(estring, F("Kd "), tune_pid.d); + say_default_(); SERIAL_ECHOLN(estring, F("Kp "), tune_pid.p); + say_default_(); SERIAL_ECHOLN(estring, F("Ki "), tune_pid.i); + say_default_(); SERIAL_ECHOLN(estring, F("Kd "), tune_pid.d); #else say_default_(); SERIAL_ECHOLNPGM("Kp ", tune_pid.p); say_default_(); SERIAL_ECHOLNPGM("Ki ", tune_pid.i); From 991f433ac1375cca0b8fcd76fcbacbe43b307ac3 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Wed, 3 Jan 2024 19:14:17 -0800 Subject: [PATCH 11/26] =?UTF-8?q?=F0=9F=90=9B=20Fix=20hangs=20in=20DUE=20n?= =?UTF-8?q?ative=20USB=20(#26572)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/DUE/usb/README.md | 29 ++++++++ Marlin/src/HAL/DUE/usb/uotghs_device_due.c | 79 +++++++++++++++++++--- buildroot/tests/DUE_archim | 1 + 3 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 Marlin/src/HAL/DUE/usb/README.md diff --git a/Marlin/src/HAL/DUE/usb/README.md b/Marlin/src/HAL/DUE/usb/README.md new file mode 100644 index 0000000000..2548135aca --- /dev/null +++ b/Marlin/src/HAL/DUE/usb/README.md @@ -0,0 +1,29 @@ +# USB Files Source Documentation + +## Source + +We sourced the USB files in Marlin from the Atmel ASF (Advanced Software Framework). The framework provides a variety of examples which were utilized in this project. + +Atmel doesn't provide these files in a source repository but they can be extracted from ASF, which can be downloaded from Atmel. + +[Advanced Software Framework](https://www.microchip.com/en-us/tools-resources/develop/libraries/advanced-software-framework) + +## Modifications + +The files are mostly unmodified except for minor cosmetic changes but some more significant changes were needed. + +The changes that prompted the addition of this README file are listed below. Other changes may have been made prior to this. + +1. Modified `uotghs_device_due.c` to resolve race conditions that could leave interrupts asserted when freezing the peripheral clock, resulting in hangs and watchdog resets due to the ensuing interrupt storm. + +## Version Information + +We don't know the exact version of ASF used as the source. However, the copyright information in the files indicates they are from 2015. + +## Upgrade Considerations + +We looked at the ASF 3.52.0 files released in 2022 but saw no immediate benefits to justify an upgrade. It's important to note that the files in Marlin don't follow the same folder structure as the files in ASF, which complicates the process of comparing and applying updated files. + +When these files are updated it's important to carefully compare them to Marlin's versions so any improvements in the Marlin sources are brought forward. + +It would be best to make Marlin's directory structure align with ASF or at least document the source of each file to ease future updates. diff --git a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c index c7e8f8d991..5a988b7421 100644 --- a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c +++ b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c @@ -116,6 +116,23 @@ //#define dbg_print printf #define dbg_print(...) +// Marlin modification: Redefine the otg_freeze_clock and otg_unfreeze_clock macros +// to add memory barriers to ensure that any accesses to USB registers aren't re-ordered +// to occur while the clock is frozen. +#undef otg_freeze_clock +#undef otg_unfreeze_clock + +#define otg_freeze_clock() do { \ + __DSB(); \ + Set_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK); \ +} while (0) + +#define otg_unfreeze_clock() \ +do { \ + Clr_bits(UOTGHS->UOTGHS_CTRL, UOTGHS_CTRL_FRZCLK); \ + __DSB(); \ +} while (0) + /** * \ingroup udd_group * \defgroup udd_udphs_group USB On-The-Go High-Speed Port for device mode (UOTGHS) @@ -611,6 +628,18 @@ ISR(UDD_USB_INT_FUN) // The wakeup interrupt is automatic acked when a suspend occur udd_disable_wake_up_interrupt(); udd_enable_suspend_interrupt(); + + // Marlin modification: The RESET, SOF, and MSOF interrupts were previously + // enabled in udd_attach, which caused a race condition where they could + // be raised and unclearable with the clock is frozen. They are now + // enabled here, after the clock has been unfrozen in response to the wake + // interrupt. + udd_enable_reset_interrupt(); + udd_enable_sof_interrupt(); +#ifdef USB_DEVICE_HS_SUPPORT + udd_enable_msof_interrupt(); +#endif + udd_sleep_mode(true); // Enter in IDLE mode #ifdef UDC_RESUME_EVENT UDC_RESUME_EVENT(); @@ -776,6 +805,27 @@ void udd_disable(void) cpu_irq_restore(flags); } +// Marlin modification: The original implementation did not use a memory +// barrier between disabling and clearing interrupts. This sometimes +// allowed interrupts to remain raised and unclearable after the clock +// was frozen. This helper was added to ensure that memory barriers +// are used consistently from all places where interrupts are disabled. +static void disable_and_ack_sync_interrupts() +{ + // Disable USB line events + udd_disable_reset_interrupt(); + udd_disable_sof_interrupt(); +#ifdef USB_DEVICE_HS_SUPPORT + udd_disable_msof_interrupt(); +#endif + __DSB(); + udd_ack_reset(); + udd_ack_sof(); +#ifdef USB_DEVICE_HS_SUPPORT + udd_ack_msof(); +#endif + __DSB(); +} void udd_attach(void) { @@ -796,17 +846,16 @@ void udd_attach(void) udd_attach_device(); // Enable USB line events - udd_enable_reset_interrupt(); udd_enable_suspend_interrupt(); udd_enable_wake_up_interrupt(); - udd_enable_sof_interrupt(); -#ifdef USB_DEVICE_HS_SUPPORT - udd_enable_msof_interrupt(); -#endif - // Reset following interrupts flag - udd_ack_reset(); - udd_ack_sof(); - udd_ack_msof(); + + // Marlin modification: The RESET, SOF, and MSOF interrupts were previously + // enabled here, which caused a race condition where they could be raised + // and unclearable with the clock is frozen. They are now enabled in the + // wake interrupt handler, after the clock has been unfrozen. They are now + // explicitly disabled here to ensure that they cannot be raised before + // the clock is frozen. + disable_and_ack_sync_interrupts(); // The first suspend interrupt must be forced // The first suspend interrupt is not detected else raise it @@ -824,6 +873,12 @@ void udd_detach(void) // Detach device from the bus udd_detach_device(); + + // Marlin modification: Added the explicit disabling of the RESET, SOF, and + // MSOF interrupts here, to ensure that they cannot be raised after the + // clock is frozen. + disable_and_ack_sync_interrupts(); + otg_freeze_clock(); udd_sleep_mode(false); } @@ -2043,6 +2098,12 @@ static bool udd_ep_interrupt(void) dbg_print("I "); udd_disable_in_send_interrupt(ep); // One bank is free then send a ZLP + + // Marlin modification: Add a barrier to ensure in_send is disabled + // before it is cleared. This was not an observed problem, but + // other interrupts were seen to misbehave without this barrier. + __DSB(); + udd_ack_in_send(ep); udd_ack_fifocon(ep); udd_ep_finish_job(ptr_job, false, ep); diff --git a/buildroot/tests/DUE_archim b/buildroot/tests/DUE_archim index f1711a8f3d..8f9e6cbb81 100755 --- a/buildroot/tests/DUE_archim +++ b/buildroot/tests/DUE_archim @@ -16,6 +16,7 @@ exec_test $1 $2 "Archim 1 base configuration" "$3" # Test Archim 2 # use_example_configs UltiMachine/Archim2 +opt_enable USB_FLASH_DRIVE_SUPPORT exec_test $1 $2 "Archim 2 base configuration" "$3" restore_configs From 52693f72afca243ace00a7a57365301f5f8c42c0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 4 Jan 2024 13:01:45 -0600 Subject: [PATCH 12/26] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20some=20checks?= =?UTF-8?q?=20&=20includes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/MarlinCore.cpp | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 4 --- Marlin/src/feature/mixing.h | 4 --- Marlin/src/feature/solenoid.cpp | 2 +- Marlin/src/gcode/bedlevel/G35.cpp | 4 --- Marlin/src/gcode/bedlevel/abl/G29.cpp | 4 --- Marlin/src/gcode/calibrate/G33.cpp | 4 --- Marlin/src/gcode/calibrate/G34_M422.cpp | 4 --- Marlin/src/gcode/calibrate/G425.cpp | 5 ++- Marlin/src/gcode/config/M217.cpp | 4 +-- Marlin/src/gcode/control/T.cpp | 4 +-- Marlin/src/gcode/feature/pause/M603.cpp | 4 --- Marlin/src/gcode/probe/G30.cpp | 4 --- Marlin/src/gcode/temp/M104_M109.cpp | 4 --- Marlin/src/inc/Changes.h | 32 +++++++++++++++++ Marlin/src/inc/Conditionals_LCD.h | 38 +++++++++++--------- Marlin/src/inc/SanityCheck.h | 40 ++------------------- Marlin/src/lcd/menu/menu_temperature.cpp | 4 --- Marlin/src/lcd/menu/menu_tune.cpp | 4 --- Marlin/src/module/temperature.cpp | 4 --- 20 files changed, 65 insertions(+), 110 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 1dcee50d12..0a97b4d132 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -776,7 +776,7 @@ void idle(const bool no_stepper_sleep/*=false*/) { if (marlin_state == MF_INITIALIZING) goto IDLE_DONE; // TODO: Still causing errors - (void)check_tool_sensor_stats(active_extruder, true); + TERN_(TOOL_SENSOR, (void)check_tool_sensor_stats(active_extruder, true)); // Handle filament runout sensors #if HAS_FILAMENT_SENSOR diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index c61a84894a..720c86769d 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -37,10 +37,6 @@ #include "../../../gcode/gcode.h" #include "../../../libs/least_squares_fit.h" -#if HAS_MULTI_HOTEND - #include "../../../module/tool_change.h" -#endif - #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index 4340a510a5..c0f45e364a 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -43,10 +43,6 @@ typedef int8_t mixer_perc_t; -#ifndef MIXING_VIRTUAL_TOOLS - #define MIXING_VIRTUAL_TOOLS 1 -#endif - enum MixTool { FIRST_USER_VIRTUAL_TOOL = 0 , LAST_USER_VIRTUAL_TOOL = MIXING_VIRTUAL_TOOLS - 1 diff --git a/Marlin/src/feature/solenoid.cpp b/Marlin/src/feature/solenoid.cpp index 46364eaf8f..cc4522e30a 100644 --- a/Marlin/src/feature/solenoid.cpp +++ b/Marlin/src/feature/solenoid.cpp @@ -27,7 +27,7 @@ #include "solenoid.h" #include "../module/motion.h" // for active_extruder -#include "../module/tool_change.h" +#include "../module/tool_change.h" // for parking_extruder_set_parked // Used primarily with MANUAL_SOLENOID_CONTROL static void set_solenoid(const uint8_t num, const uint8_t state) { diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp index 8e11383166..89a43ef08a 100644 --- a/Marlin/src/gcode/bedlevel/G35.cpp +++ b/Marlin/src/gcode/bedlevel/G35.cpp @@ -29,10 +29,6 @@ #include "../../module/probe.h" #include "../../feature/bedlevel/bedlevel.h" -#if HAS_MULTI_HOTEND - #include "../../module/tool_change.h" -#endif - #if ENABLED(BLTOUCH) #include "../../feature/bltouch.h" #endif diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index acd920c729..700562df81 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -55,10 +55,6 @@ #include "../../../lcd/e3v2/proui/dwin.h" #endif -#if HAS_MULTI_HOTEND - #include "../../../module/tool_change.h" -#endif - #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #include "../../../core/debug_out.h" diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp index d8f104bfce..223beb4ddf 100644 --- a/Marlin/src/gcode/calibrate/G33.cpp +++ b/Marlin/src/gcode/calibrate/G33.cpp @@ -35,10 +35,6 @@ #include "../../module/probe.h" #endif -#if HAS_MULTI_HOTEND - #include "../../module/tool_change.h" -#endif - #if HAS_LEVELING #include "../../feature/bedlevel/bedlevel.h" #endif diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index af2c6a5f65..bbc403904f 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -37,10 +37,6 @@ #include "../../feature/bedlevel/bedlevel.h" #endif -#if HAS_MULTI_HOTEND - #include "../../module/tool_change.h" -#endif - #if HAS_Z_STEPPER_ALIGN_STEPPER_XY #include "../../libs/least_squares_fit.h" #endif diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index fb211ad88c..992d7c38e6 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -33,10 +33,13 @@ #include "../../lcd/marlinui.h" #include "../../module/motion.h" #include "../../module/planner.h" -#include "../../module/tool_change.h" #include "../../module/endstops.h" #include "../../feature/bedlevel/bedlevel.h" +#if HAS_MULTI_HOTEND + #include "../../module/tool_change.h" +#endif + #if !AXIS_CAN_CALIBRATE(X) #undef CALIBRATION_MEASURE_LEFT #undef CALIBRATION_MEASURE_RIGHT diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 908a19fae7..5ef06e4823 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -28,11 +28,9 @@ #include "../../module/tool_change.h" #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) - #include "../../module/motion.h" + #include "../../module/motion.h" // for active_extruder #endif -#include "../../MarlinCore.h" // for SP_X_STR, etc. - /** * M217 - Set toolchange parameters * diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index c5ebbcf50e..cbe4d26fac 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -71,8 +71,8 @@ void GcodeSuite::T(const int8_t tool_index) { tool_change(tool_index #if HAS_MULTI_EXTRUDER - , TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change() - || parser.boolval('S') + , parser.boolval('S') + || TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change() #endif ); } diff --git a/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin/src/gcode/feature/pause/M603.cpp index 2f24cc6421..0204ab25ef 100644 --- a/Marlin/src/gcode/feature/pause/M603.cpp +++ b/Marlin/src/gcode/feature/pause/M603.cpp @@ -29,10 +29,6 @@ #include "../../../module/motion.h" #include "../../../module/printcounter.h" -#if HAS_MULTI_EXTRUDER - #include "../../../module/tool_change.h" -#endif - /** * M603: Configure filament change * diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp index 383b5015a0..e83df544c8 100644 --- a/Marlin/src/gcode/probe/G30.cpp +++ b/Marlin/src/gcode/probe/G30.cpp @@ -34,10 +34,6 @@ #include "../../feature/probe_temp_comp.h" #endif -#if HAS_MULTI_HOTEND - #include "../../module/tool_change.h" -#endif - /** * G30: Do a single Z probe at the given XY (default: current) * diff --git a/Marlin/src/gcode/temp/M104_M109.cpp b/Marlin/src/gcode/temp/M104_M109.cpp index db150d5518..4df86edc55 100644 --- a/Marlin/src/gcode/temp/M104_M109.cpp +++ b/Marlin/src/gcode/temp/M104_M109.cpp @@ -45,10 +45,6 @@ #endif #endif -#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - #include "../../module/tool_change.h" -#endif - /** * M104: Set Hotend Temperature target and return immediately * M109: Set Hotend Temperature target and wait diff --git a/Marlin/src/inc/Changes.h b/Marlin/src/inc/Changes.h index 25d3401579..5a03e87b1d 100644 --- a/Marlin/src/inc/Changes.h +++ b/Marlin/src/inc/Changes.h @@ -579,6 +579,18 @@ #error "Y_DUAL_STEPPER_DRIVERS is no longer needed and should be removed." #elif defined(NUM_Z_STEPPER_DRIVERS) #error "NUM_Z_STEPPER_DRIVERS is no longer needed and should be removed." +#elif defined(SNMM) + #error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead." +#elif defined(MK2_MULTIPLEXER) + #error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead." +#elif defined(PRUSA_MMU2) + #error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead." +#elif defined(PRUSA_MMU2_S_MODE) + #error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead." +#elif defined(SMUFF_EMU_MMU2) + #error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead." +#elif defined(SMUFF_EMU_MMU2S) + #error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead." #elif defined(LEVEL_BED_CORNERS) #error "LEVEL_BED_CORNERS is now LCD_BED_TRAMMING." #elif defined(LEVEL_CORNERS_INSET_LFRB) || defined(LEVEL_CORNERS_HEIGHT) || defined(LEVEL_CORNERS_Z_HOP) || defined(LEVEL_CORNERS_USE_PROBE) || defined(LEVEL_CORNERS_PROBE_TOLERANCE) || defined(LEVEL_CORNERS_VERIFY_RAISED) || defined(LEVEL_CORNERS_AUDIO_FEEDBACK) @@ -675,6 +687,26 @@ #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING is now CTC_A10S_A13." #endif +// Changes to Probe Temp Compensation (#17392) +#if HAS_PTC && TEMP_SENSOR_PROBE && TEMP_SENSOR_BED + #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z) + #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)." + #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y) + #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)." + #endif +#endif + +// Consolidate TMC26X, validate migration (#24373) +#define _ISMAX_1(A) defined(A##_MAX_CURRENT) +#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR) +#if DO(ISMAX,||,ALL_AXIS_NAMES) + #error "*_MAX_CURRENT is now set with *_CURRENT." +#elif DO(ISSNS,||,ALL_AXIS_NAMES) + #error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000." +#endif +#undef _ISMAX_1 +#undef _ISSNS_1 + // L64xx stepper drivers have been removed #define _L6470 0x6470 #define _L6474 0x6474 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index a81c8639cf..e07d026cb9 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -82,33 +82,36 @@ /** * Multi-Material-Unit supported models */ -#define PRUSA_MMU1 1 -#define PRUSA_MMU2 2 -#define PRUSA_MMU2S 3 -#define EXTENDABLE_EMU_MMU2 12 -#define EXTENDABLE_EMU_MMU2S 13 - #ifdef MMU_MODEL #define HAS_MMU 1 #define SINGLENOZZLE - #if MMU_MODEL == PRUSA_MMU1 + + #define _PRUSA_MMU1 1 + #define _PRUSA_MMU2 2 + #define _PRUSA_MMU2S 3 + #define _EXTENDABLE_EMU_MMU2 12 + #define _EXTENDABLE_EMU_MMU2S 13 + #define _MMU CAT(_,MMU_MODEL) + + #if _MMU == _PRUSA_MMU1 #define HAS_PRUSA_MMU1 1 - #elif MMU_MODEL % 10 == PRUSA_MMU2 + #elif _MMU % 10 == _PRUSA_MMU2 #define HAS_PRUSA_MMU2 1 - #elif MMU_MODEL % 10 == PRUSA_MMU2S + #elif _MMU % 10 == _PRUSA_MMU2S #define HAS_PRUSA_MMU2 1 #define HAS_PRUSA_MMU2S 1 #endif - #if MMU_MODEL >= EXTENDABLE_EMU_MMU2 + #if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S #define HAS_EXTENDABLE_MMU 1 #endif -#endif -#undef PRUSA_MMU1 -#undef PRUSA_MMU2 -#undef PRUSA_MMU2S -#undef EXTENDABLE_EMU_MMU2 -#undef EXTENDABLE_EMU_MMU2S + #undef _MMU + #undef _PRUSA_MMU1 + #undef _PRUSA_MMU2 + #undef _PRUSA_MMU2S + #undef _EXTENDABLE_EMU_MMU2 + #undef _EXTENDABLE_EMU_MMU2S +#endif #if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0 @@ -132,6 +135,9 @@ #if MIXING_STEPPERS == 2 #define HAS_DUAL_MIXING 1 #endif + #ifndef MIXING_VIRTUAL_TOOLS + #define MIXING_VIRTUAL_TOOLS 1 + #endif #elif ENABLED(SWITCHING_TOOLHEAD) // Toolchanger diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index d1c84665ed..c3fed355d3 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -116,17 +116,6 @@ constexpr float arm[] = AXIS_RELATIVE_MODES; static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements."); -// Consolidate TMC26X, validate migration (#24373) -#define _ISMAX_1(A) defined(A##_MAX_CURRENT) -#define _ISSNS_1(A) defined(A##_SENSE_RESISTOR) -#if DO(ISMAX,||,ALL_AXIS_NAMES) - #error "*_MAX_CURRENT is now set with *_CURRENT." -#elif DO(ISSNS,||,ALL_AXIS_NAMES) - #error "*_SENSE_RESISTOR (in Milli-Ohms) is now set with *_RSENSE (in Ohms), so you must divide values by 1000." -#endif -#undef _ISMAX_1 -#undef _ISSNS_1 - /** * RADDS is forbidden for non-DUE boards, for now. */ @@ -160,16 +149,8 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L * Probe temp compensation requirements */ #if HAS_PTC - #if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED - #if defined(PTC_PARK_POS_X) || defined(PTC_PARK_POS_Y) || defined(PTC_PARK_POS_Z) - #error "PTC_PARK_POS_[XYZ] is now PTC_PARK_POS (array)." - #elif !defined(PTC_PARK_POS) - #error "PTC_PARK_POS is required for Probe Temperature Compensation." - #elif defined(PTC_PROBE_POS_X) || defined(PTC_PROBE_POS_Y) - #error "PTC_PROBE_POS_[XY] is now PTC_PROBE_POS (array)." - #elif !defined(PTC_PROBE_POS) - #error "PTC_PROBE_POS is required for Probe Temperature Compensation." - #endif + #if TEMP_SENSOR_PROBE && TEMP_SENSOR_BED && !(defined(PTC_PARK_POS) && defined(PTC_PROBE_POS)) + #error "PTC_PARK_POS and PTC_PROBE_POS are required for Probe Temperature Compensation." #endif #if ENABLED(PTC_PROBE) @@ -611,23 +592,6 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." #endif -/** - * Sanity checking for all Průša MMU - */ -#ifdef SNMM - #error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead." -#elif ENABLED(MK2_MULTIPLEXER) - #error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead." -#elif ENABLED(PRUSA_MMU2) - #error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead." -#elif ENABLED(PRUSA_MMU2_S_MODE) - #error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead." -#elif ENABLED(SMUFF_EMU_MMU2) - #error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead." -#elif ENABLED(SMUFF_EMU_MMU2S) - #error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead." -#endif - /** * Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements */ diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 710cef6468..e8a7b25dcb 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -39,10 +39,6 @@ #include "../../feature/cooler.h" #endif -#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - #include "../../module/tool_change.h" -#endif - // // "Temperature" submenu items // diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index ecd4e5f342..68f61caaec 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -34,10 +34,6 @@ #include "../../module/temperature.h" #include "../../MarlinCore.h" -#if ENABLED(SINGLENOZZLE_STANDBY_TEMP) - #include "../../module/tool_change.h" -#endif - #if HAS_LEVELING #include "../../feature/bedlevel/bedlevel.h" #endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 3f55dde598..e65297b04a 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -182,10 +182,6 @@ #include "../feature/joystick.h" #endif -#if ENABLED(SINGLENOZZLE) - #include "tool_change.h" -#endif - #if HAS_BEEPER #include "../libs/buzzer.h" #endif From 6e67ad51b70ce4f02be967bb14e5557a021e48eb Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:07:53 -0500 Subject: [PATCH 13/26] =?UTF-8?q?=F0=9F=8E=A8=20Followup=20to=20optional?= =?UTF-8?q?=20M111/M115=20(#26626)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #26603 --- Marlin/Configuration_adv.h | 84 +++++++++++++++--------------- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 4 +- Marlin/src/gcode/host/M115.cpp | 4 +- Marlin/src/inc/Warnings.cpp | 4 +- Marlin/src/lcd/e3v2/proui/dwin.cpp | 2 +- ini/features.ini | 2 +- 7 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 10316ac928..248841d748 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3836,38 +3836,6 @@ */ //#define CNC_COORDINATE_SYSTEMS -// @section reporting - -/** - * Auto-report fan speed with M123 S - * Requires fans with tachometer pins - */ -//#define AUTO_REPORT_FANS - -/** - * Auto-report temperatures with M155 S - */ -#define AUTO_REPORT_TEMPERATURES -#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT - //#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report -#endif - -/** - * Auto-report position with M154 S - */ -//#define AUTO_REPORT_POSITION -#if ENABLED(AUTO_REPORT_POSITION) - //#define AUTO_REPORT_REAL_POSITION // Auto-report the real position -#endif - -/** - * Include capabilities in M115 output - */ -#define EXTENDED_CAPABILITIES_REPORT -#if ENABLED(EXTENDED_CAPABILITIES_REPORT) - //#define M115_GEOMETRY_REPORT -#endif - // @section security /** @@ -3910,13 +3878,51 @@ // @section reporting -// Extra options for the M114 "Current Position" report +/** + * Extra options for the M114 "Current Position" report + */ //#define M114_DETAIL // Use 'M114` for details to check planner calculations //#define M114_REALTIME // Real current position based on forward kinematics //#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed. + +/** + * Auto-report fan speed with M123 S + * Requires fans with tachometer pins + */ +//#define AUTO_REPORT_FANS + //#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others) +/** + * Auto-report temperatures with M155 S + */ +#define AUTO_REPORT_TEMPERATURES +#if ENABLED(AUTO_REPORT_TEMPERATURES) && TEMP_SENSOR_REDUNDANT + //#define AUTO_REPORT_REDUNDANT // Include the "R" sensor in the auto-report +#endif + +/** + * Auto-report position with M154 S + */ +//#define AUTO_REPORT_POSITION +#if ENABLED(AUTO_REPORT_POSITION) + //#define AUTO_REPORT_REAL_POSITION // Auto-report the real position +#endif + +/** + * M115 - Report capabilites. Disable to save ~1150 bytes of flash. + * Some hosts (and serial TFT displays) rely on this feature. + */ +#define CAPABILITIES_REPORT +#if ENABLED(CAPABILITIES_REPORT) + // Include capabilities in M115 output + #define EXTENDED_CAPABILITIES_REPORT + #if ENABLED(EXTENDED_CAPABILITIES_REPORT) + //#define M115_GEOMETRY_REPORT + #endif +#endif + // @section gcode /** @@ -3928,7 +3934,9 @@ //#define GCODE_QUOTED_STRINGS // Support for quoted string parameters #endif -// Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack) +/** + * Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack) + */ //#define MEATPACK_ON_SERIAL_PORT_1 //#define MEATPACK_ON_SERIAL_PORT_2 @@ -3942,12 +3950,6 @@ */ #define DEBUG_FLAGS_GCODE -/** - * M115 - Report capabilites. Disable to save ~1150 bytes of flash. - * Some hosts (and serial TFT displays) rely on this feature. - */ -#define REPORT_CAPABILITIES_GCODE - /** * Enable this option for a leaner build of Marlin that removes * workspace offsets to slightly optimize performance. @@ -3975,8 +3977,6 @@ //#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode #endif -// @section gcode - /** * Startup commands * diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 945da708b4..5fb0594d9f 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -670,7 +670,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 92: M92(); break; // M92: Set the steps-per-unit for one or more axes case 114: M114(); break; // M114: Report current position - #if ENABLED(REPORT_CAPABILITIES_GCODE) + #if ENABLED(CAPABILITIES_REPORT) case 115: M115(); break; // M115: Report capabilities #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index d5adf6c415..ae60ac7556 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -149,7 +149,7 @@ * * M113 - Get or set the timeout interval for Host Keepalive "busy" messages. (Requires HOST_KEEPALIVE_FEATURE) * M114 - Report current position. - * M115 - Report capabilities. (Extended capabilities requires EXTENDED_CAPABILITIES_REPORT) + * M115 - Report capabilities. (Requires CAPABILITIES_REPORT) * M117 - Display a message on the controller screen. (Requires an LCD) * M118 - Display a message in the host console. * @@ -761,7 +761,7 @@ private: static void M114(); - #if ENABLED(REPORT_CAPABILITIES_GCODE) + #if ENABLED(CAPABILITIES_REPORT) static void M115(); #endif diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index ae8e615507..d1571d58ac 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(REPORT_CAPABILITIES_GCODE) +#if ENABLED(CAPABILITIES_REPORT) #include "../gcode.h" #include "../queue.h" // for getting the command port @@ -275,4 +275,4 @@ void GcodeSuite::M115() { #endif // EXTENDED_CAPABILITIES_REPORT } -#endif // REPORT_CAPABILITIES_GCODE +#endif // CAPABILITIES_REPORT diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 384fe04c61..560acf4cd8 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -46,8 +46,8 @@ #warning "DEBUG_FLAGS_GCODE is recommended if you have space. Some hosts rely on it." #endif -#if DISABLED(REPORT_CAPABILITIES_GCODE) - #warning "REPORT_CAPABILITIES_GCODE is recommended if you have space. Some hosts rely on it." +#if DISABLED(CAPABILITIES_REPORT) + #warning "CAPABILITIES_REPORT is recommended if you have space. Some hosts rely on it." #endif #if ENABLED(LA_DEBUG) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 5262dba385..7520b46b60 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -2306,7 +2306,7 @@ void setMoveZ() { hmiValue.axis = Z_AXIS; setPFloatOnClick(Z_MIN_POS, Z_MAX_POS, #endif #endif -#if ENABLED(ADVANCED_PAUSE_FEATURE) +#if ENABLED(CONFIGURE_FILAMENT_CHANGE) void setFilLoad() { setPFloatOnClick(0, EXTRUDE_MAXLENGTH, UNITFDIGITS); } void setFilUnload() { setPFloatOnClick(0, EXTRUDE_MAXLENGTH, UNITFDIGITS); } #endif diff --git a/ini/features.ini b/ini/features.ini index f9822fa7a8..32fd6c2621 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -323,7 +323,7 @@ CNC_COORDINATE_SYSTEMS = build_src_filter=+ EXPECTED_PRINTER_CHECK = build_src_filter=+ HOST_KEEPALIVE_FEATURE = build_src_filter=+ -REPORT_CAPABILITIES_GCODE = build_src_filter=+ +CAPABILITIES_REPORT = build_src_filter=+ AUTO_REPORT_POSITION = build_src_filter=+ REPETIER_GCODE_M360 = build_src_filter=+ HAS_GCODE_M876 = build_src_filter=+ From 994aa9f6923e2307d13badd26a15e6d57525955f Mon Sep 17 00:00:00 2001 From: plampix Date: Fri, 5 Jan 2024 00:09:53 +0100 Subject: [PATCH 14/26] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Slimmer=20null=20T?= =?UTF-8?q?=20command=20(#26615)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/MarlinCore.cpp | 4 +++- Marlin/src/gcode/bedlevel/G26.cpp | 6 ++++-- Marlin/src/gcode/config/M217.cpp | 7 +++++-- Marlin/src/gcode/control/T.cpp | 6 ++++++ Marlin/src/gcode/gcode.cpp | 18 ++++++++++-------- Marlin/src/gcode/gcode.h | 2 +- Marlin/src/inc/Conditionals_adv.h | 4 ++++ Marlin/src/module/tool_change.cpp | 4 ++++ ini/features.ini | 1 + platformio.ini | 1 - 10 files changed, 38 insertions(+), 15 deletions(-) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 0a97b4d132..f0bd97ac1c 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -219,7 +219,9 @@ #include "feature/fanmux.h" #endif -#include "module/tool_change.h" +#if HAS_TOOLCHANGE + #include "module/tool_change.h" +#endif #if HAS_FANCHECK #include "feature/fancheck.h" diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 30643cb84e..5c7f9e1f6d 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -501,8 +501,10 @@ void GcodeSuite::G26() { // or if the parameter parsing did not go OK, abort if (homing_needed_error()) return; - // Change the tool first, if specified - if (parser.seenval('T')) tool_change(parser.value_int()); + #if HAS_TOOLCHANGE + // Change the tool first, if specified + if (parser.seenval('T')) tool_change(parser.value_int()); + #endif g26_helper_t g26; diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 5ef06e4823..59737d3b04 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -25,7 +25,10 @@ #if HAS_MULTI_EXTRUDER #include "../gcode.h" -#include "../../module/tool_change.h" + +#if HAS_TOOLCHANGE + #include "../../module/tool_change.h" +#endif #if ENABLED(TOOLCHANGE_MIGRATION_FEATURE) #include "../../module/motion.h" // for active_extruder @@ -119,7 +122,7 @@ void GcodeSuite::M217() { #endif #endif - #if HAS_Z_AXIS + #if HAS_Z_AXIS && HAS_TOOLCHANGE if (parser.seenval('Z')) { toolchange_settings.z_raise = parser.value_linear_units(); } #endif diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index cbe4d26fac..3c13fe231a 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -20,6 +20,10 @@ * */ +#include "../../inc/MarlinConfigPre.h" + +#if HAS_TOOLCHANGE + #include "../gcode.h" #include "../../module/tool_change.h" @@ -76,3 +80,5 @@ void GcodeSuite::T(const int8_t tool_index) { #endif ); } + +#endif // HAS_TOOLCHANGE diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 5fb0594d9f..86d73dd56f 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -122,14 +122,16 @@ void GcodeSuite::say_units() { * Return -1 if the T parameter is out of range */ int8_t GcodeSuite::get_target_extruder_from_command() { - if (parser.seenval('T')) { - const int8_t e = parser.value_byte(); - if (e < EXTRUDERS) return e; - SERIAL_ECHO_START(); - SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); - SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e); - return -1; - } + #if HAS_TOOLCHANGE + if (parser.seenval('T')) { + const int8_t e = parser.value_byte(); + if (e < EXTRUDERS) return e; + SERIAL_ECHO_START(); + SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); + SERIAL_ECHOLNPGM(" " STR_INVALID_EXTRUDER " ", e); + return -1; + } + #endif return active_extruder; } diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index ae60ac7556..6be5dc642c 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -1285,7 +1285,7 @@ private: static void M710_report(const bool forReplay=true); #endif - static void T(const int8_t tool_index); + static void T(const int8_t tool_index) IF_DISABLED(HAS_TOOLCHANGE, { UNUSED(tool_index); }); }; diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 89a57f274d..191da44af7 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -803,6 +803,10 @@ #endif #endif +#if HAS_MULTI_EXTRUDER || HAS_MULTI_HOTEND || HAS_PRUSA_MMU2 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1) + #define HAS_TOOLCHANGE 1 +#endif + #if ENABLED(MIXING_EXTRUDER) && (ENABLED(RETRACT_SYNC_MIXING) || ALL(FILAMENT_LOAD_UNLOAD_GCODES, FILAMENT_UNLOAD_ALL_EXTRUDERS)) #define HAS_MIXER_SYNC_CHANNEL 1 #endif diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 373dcf3142..b5cacc2f3b 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -22,6 +22,8 @@ #include "../inc/MarlinConfigPre.h" +#if HAS_TOOLCHANGE + #include "tool_change.h" #include "motion.h" @@ -1629,3 +1631,5 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { } #endif // TOOLCHANGE_MIGRATION_FEATURE + +#endif // HAS_TOOLCHANGE diff --git a/ini/features.ini b/ini/features.ini index 32fd6c2621..c4af1d0d95 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -306,6 +306,7 @@ SERVO_DETACH_GCODE = build_src_filter=+ SPI_FLASH_BACKUP = build_src_filter=+ PLATFORM_M997_SUPPORT = build_src_filter=+ +HAS_TOOLCHANGE = build_src_filter=+ FT_MOTION = build_src_filter=+ + LIN_ADVANCE = build_src_filter=+ PHOTO_GCODE = build_src_filter=+ diff --git a/platformio.ini b/platformio.ini index 5249b790f2..e6adfe2b6b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -107,7 +107,6 @@ default_src_filter = + - - + + + - + + + + From 5e0a8d21245d21eafdc55e77645cb20eef750017 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 5 Jan 2024 00:21:26 +0000 Subject: [PATCH 15/26] [cron] Bump distribution date (2024-01-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 1cdc982294..25d9a5b782 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 "2024-01-04" +//#define STRING_DISTRIBUTION_DATE "2024-01-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 2b250079f5..a9ad73b331 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 "2024-01-04" + #define STRING_DISTRIBUTION_DATE "2024-01-05" #endif /** From a5d097abe6e8cbad3dead9086439b3c0f44c7cb2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 4 Jan 2024 18:50:23 -0600 Subject: [PATCH 16/26] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20CTC=5FA10S=5FA?= =?UTF-8?q?13=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #26514 --- Marlin/src/pins/sanguino/pins_ANET_10.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h index 12afa23393..9a217d9b4e 100644 --- a/Marlin/src/pins/sanguino/pins_ANET_10.h +++ b/Marlin/src/pins/sanguino/pins_ANET_10.h @@ -187,7 +187,7 @@ * * Only the following displays are supported: * ZONESTAR_LCD - * CTC_A10S_A13G + * CTC_A10S_A13 * REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER */ @@ -209,10 +209,10 @@ #elif IS_RRD_FG_SC // Pin definitions for the Anet A6 Full Graphics display and the RepRapDiscount Full Graphics - // display using an adapter board // https://go.aisler.net/benlye/anet-lcd-adapter/pcb + // display using an adapter board. See https://go.aisler.net/benlye/anet-lcd-adapter/pcb // See below for alternative pin definitions for use with https://www.thingiverse.com/thing:2103748 - #if ENABLED(CTC_A10S_A13G) + #if ENABLED(CTC_A10S_A13) /** * CTC_A10S_A13 pinout From 4ae2a76492b176c831647e29cc6150e7d8c0605a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 5 Jan 2024 12:34:50 -0600 Subject: [PATCH 17/26] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20ws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 1 - Marlin/src/gcode/feature/ft_motion/M493.cpp | 2 +- docs/BinaryFileTransferProtocol.md | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 248841d748..3208364c3c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3885,7 +3885,6 @@ //#define M114_REALTIME // Real current position based on forward kinematics //#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed. - /** * Auto-report fan speed with M123 S * Requires fans with tachometer pins diff --git a/Marlin/src/gcode/feature/ft_motion/M493.cpp b/Marlin/src/gcode/feature/ft_motion/M493.cpp index d374ca58c9..a72a35d5bf 100644 --- a/Marlin/src/gcode/feature/ft_motion/M493.cpp +++ b/Marlin/src/gcode/feature/ft_motion/M493.cpp @@ -129,7 +129,7 @@ void GcodeSuite::M493_report(const bool forReplay/*=true*/) { * M493: Set Fixed-time Motion Control parameters * * S Set the motion / shaping mode. Shaping requires an X axis, at the minimum. - * + * * 0: Standard Motion * 1: Fixed-Time Motion * 10: ZV : Zero Vibration diff --git a/docs/BinaryFileTransferProtocol.md b/docs/BinaryFileTransferProtocol.md index 46c1bf9718..6d52671789 100644 --- a/docs/BinaryFileTransferProtocol.md +++ b/docs/BinaryFileTransferProtocol.md @@ -1,5 +1,5 @@ # Marlin Binary File Transfer (BFT) -Marlin is capable of transferring binary data to the internal storage (SD card) via serial when built with `BINARY_FILE_TRANSFER` enabled. The following is a description of the binary protocol that must be used to conduct transfers once the printer is in binary mode after running `M28 B1`. +Marlin is capable of transferring binary data to the internal storage (SD card) via serial when built with `BINARY_FILE_TRANSFER` enabled. The following is a description of the binary protocol that must be used to conduct transfers once the printer is in binary mode after running `M28 B1`. ## Data Endianness All data structures are **little-endian**! This means that when constructing the packets with multi-byte values, the lower bits are packed first. For example, each packet should start with a 16-bit start token with the value of `0xB5AD`. The data itself should start with a value of `0xAD` followed by `0xB5` etc. From 2a8c00bdeb5268b11a3bbddfc8797a3f09a92947 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 6 Jan 2024 00:21:22 +0000 Subject: [PATCH 18/26] [cron] Bump distribution date (2024-01-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 25d9a5b782..baa1539a5b 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 "2024-01-05" +//#define STRING_DISTRIBUTION_DATE "2024-01-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 a9ad73b331..892d02c745 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 "2024-01-05" + #define STRING_DISTRIBUTION_DATE "2024-01-06" #endif /** From 4cddc61eda70d9e78ef7767fc052995855e34a79 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilenko Date: Mon, 8 Jan 2024 03:18:18 +0300 Subject: [PATCH 19/26] =?UTF-8?q?=F0=9F=90=9B=20Fix=20SPI=20TFT=20for=20ST?= =?UTF-8?q?M32F1/F4=20(#26052)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 111 ++++++++++++++---------- Marlin/src/lcd/extui/mks_ui/SPI_TFT.cpp | 4 +- Marlin/src/lcd/tft/tft_string.cpp | 2 +- Marlin/src/lcd/tft_io/tft_io.cpp | 32 +++---- Marlin/src/lcd/tft_io/tft_io.h | 2 +- 5 files changed, 85 insertions(+), 66 deletions(-) diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index cca247e20d..cda2eb28e3 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -31,6 +31,10 @@ #include "tft_spi.h" #include "pinconfig.h" +//#define DEBUG_TFT_IO +#define DEBUG_OUT ENABLED(DEBUG_TFT_IO) +#include "../../../core/debug_out.h" + SPI_HandleTypeDef TFT_SPI::SPIx; DMA_HandleTypeDef TFT_SPI::DMAtx; @@ -43,8 +47,9 @@ void TFT_SPI::init() { if ((spiInstance = (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK)) == NP) return; if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI)) return; - #if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN - if (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO)) return; + #if PIN_EXISTS(TFT_MISO) + // Check these pins in code because they are sometimes defined as analog pin references + if ((TFT_MISO_PIN != TFT_MOSI_PIN) && (spiInstance != (SPI_TypeDef *)pinmap_peripheral(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO))) return; #endif SPIx.Instance = spiInstance; @@ -76,10 +81,13 @@ void TFT_SPI::init() { pinmap_pinout(digitalPinToPinName(TFT_SCK_PIN), PinMap_SPI_SCLK); pinmap_pinout(digitalPinToPinName(TFT_MOSI_PIN), PinMap_SPI_MOSI); - #if PIN_EXISTS(TFT_MISO) && TFT_MISO_PIN != TFT_MOSI_PIN - pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO); + #if PIN_EXISTS(TFT_MISO) + // Check these pins in code because they are sometimes defined as analog pin references + if (TFT_MISO_PIN != TFT_MOSI_PIN) pinmap_pinout(digitalPinToPinName(TFT_MISO_PIN), PinMap_SPI_MISO); #endif + //pin_PullConfig(get_GPIO_Port(STM_PORT(digitalPinToPinName(TFT_SCK_PIN))), STM_LL_GPIO_PIN(digitalPinToPinName(TFT_SCK_PIN)), GPIO_PULLDOWN); + #ifdef SPI1_BASE if (SPIx.Instance == SPI1) { __HAL_RCC_SPI1_CLK_ENABLE(); @@ -151,29 +159,47 @@ void TFT_SPI::dataTransferBegin(uint16_t dataSize) { WRITE(TFT_CS_PIN, LOW); } -#ifdef TFT_DEFAULT_DRIVER - #include "../../../lcd/tft_io/tft_ids.h" -#endif +#include "../../../lcd/tft_io/tft_ids.h" uint32_t TFT_SPI::getID() { - uint32_t id; - id = readID(LCD_READ_ID); + DEBUG_ECHOLNPGM("TFT_SPI::getID()"); + + uint32_t id = readID(LCD_READ_ID); + #if ENABLED(DEBUG_TFT_IO) + char debug_register[3], debug_value[5]; + sprintf_P(debug_register, PSTR("%02X"), LCD_READ_ID); + sprintf_P(debug_value, PSTR("%04X"), uint16_t(id)); + DEBUG_ECHOLNPGM(" readID(0x", debug_register, ") : 0x", debug_value); + #endif + if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) { id = readID(LCD_READ_ID4); - #ifdef TFT_DEFAULT_DRIVER - if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) - id = TFT_DEFAULT_DRIVER; + #if ENABLED(DEBUG_TFT_IO) + sprintf_P(debug_register, PSTR("%02X"), LCD_READ_ID4); + sprintf_P(debug_value, PSTR("%04X"), uint16_t(id)); + DEBUG_ECHOLNPGM(" readID(0x", debug_register, ") : 0x", debug_value); #endif - } + } + + #ifdef TFT_DEFAULT_DRIVER + if ((id & 0xFFFF) == 0 || (id & 0xFFFF) == 0xFFFF) { + id = TFT_DEFAULT_DRIVER; + #if ENABLED(DEBUG_TFT_IO) + sprintf_P(debug_value, PSTR("%04X"), uint16_t(id)); + DEBUG_ECHOLNPGM(" Fallback to TFT_DEFAULT_DRIVER : 0x", debug_value); + #endif + } + #endif + return id; } uint32_t TFT_SPI::readID(const uint16_t inReg) { uint32_t data = 0; #if PIN_EXISTS(TFT_MISO) - const uint32_t oldPrescaler = SPIx.Init.BaudRatePrescaler; - + uint32_t BaudRatePrescaler = SPIx.Init.BaudRatePrescaler; SPIx.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64; + dataTransferBegin(DATASIZE_8BIT); writeReg(inReg); @@ -185,10 +211,8 @@ uint32_t TFT_SPI::readID(const uint16_t inReg) { __HAL_SPI_ENABLE(&SPIx); SET_BIT(SPIx.Instance->CR1, SPI_CR1_CSTART); - #if TFT_MISO_PIN != TFT_MOSI_PIN - SPIx.Instance->TXDR = 0; - #endif - while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_EOT)) {} + if (SPIx.Init.Direction == SPI_DIRECTION_2LINES) SPIx.Instance->TXDR = 0; + while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_EOT)) { /* nada */ } data = (data << 8) | SPIx.Instance->RXDR; __HAL_SPI_DISABLE(&SPIx); __HAL_SPI_CLEAR_EOTFLAG(&SPIx); @@ -197,19 +221,22 @@ uint32_t TFT_SPI::readID(const uint16_t inReg) { #else __HAL_SPI_ENABLE(&SPIx); for (uint32_t i = 0; i < 4; i++) { - #if TFT_MISO_PIN != TFT_MOSI_PIN - while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) {} + if (SPIx.Init.Direction == SPI_DIRECTION_2LINES) { + while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) { /* nada */ } SPIx.Instance->DR = 0; - #endif - while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_RXNE)) {} + } + while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_RXNE)) { /* nada */ } data = (data << 8) | SPIx.Instance->DR; } #endif dataTransferEnd(); - SPIx.Init.BaudRatePrescaler = oldPrescaler; + #if DISABLED(DEBUG_TFT_IO) + SPIx.Init.BaudRatePrescaler = BaudRatePrescaler; + #endif #endif + DEBUG_ECHOLNPGM(" raw data : ", data); return data >> 7; } @@ -238,13 +265,13 @@ bool TFT_SPI::isBusy() { // Check if SPI data transfer is completed if (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_EOT)) return true; #else - // Check if SPI is idle - if (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) return true; + // Check if SPI transmit butter is empty and SPI is idle + if ((!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) || (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY))) return true; #endif } abort(); - return false; + return true; } void TFT_SPI::abort() { @@ -263,9 +290,7 @@ void TFT_SPI::abort() { } void TFT_SPI::transmit(uint16_t data) { - #if TFT_MISO_PIN == TFT_MOSI_PIN - SPI_1LINE_TX(&SPIx); - #endif + if (SPIx.Init.Direction == SPI_DIRECTION_1LINE) SPI_1LINE_TX(&SPIx); #ifdef STM32H7xx MODIFY_REG(SPIx.Instance->CR2, SPI_CR2_TSIZE, 1); @@ -274,30 +299,26 @@ void TFT_SPI::transmit(uint16_t data) { SPIx.Instance->TXDR = data; - while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) {} + while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) { /* nada */ } __HAL_SPI_CLEAR_EOTFLAG(&SPIx); __HAL_SPI_CLEAR_TXTFFLAG(&SPIx); + __HAL_SPI_DISABLE(&SPIx); #else __HAL_SPI_ENABLE(&SPIx); SPIx.Instance->DR = data; - while (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) {} + while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) { /* nada */ } // Wait for data transfer to actually start + while ( __HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) { /* nada */ } // Wait until SPI is idle #endif - __HAL_SPI_DISABLE(&SPIx); - - #if TFT_MISO_PIN != TFT_MOSI_PIN - __HAL_SPI_CLEAR_OVRFLAG(&SPIx); // Clear overrun flag in 2 Lines communication mode because received data is not read - #endif + if (SPIx.Init.Direction == SPI_DIRECTION_2LINES) __HAL_SPI_CLEAR_OVRFLAG(&SPIx); // Clear overrun flag in 2 Lines communication mode because received data is not read } void TFT_SPI::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t count) { DMAtx.Init.MemInc = memoryIncrease; HAL_DMA_Init(&DMAtx); - #if TFT_MISO_PIN == TFT_MOSI_PIN - SPI_1LINE_TX(&SPIx); - #endif + if (SPIx.Init.Direction == SPI_DIRECTION_1LINE) SPI_1LINE_TX(&SPIx); dataTransferBegin(); @@ -316,7 +337,7 @@ void TFT_SPI::transmitDMA(uint32_t memoryIncrease, uint16_t *data, uint16_t coun SET_BIT(SPIx.Instance->CR2, SPI_CR2_TXDMAEN); // Enable Tx DMA Request #endif - TERN_(TFT_SHARED_IO, while (isBusy())); + TERN_(TFT_SHARED_IO, while (isBusy()) { /* nada */ }); } void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) { @@ -324,9 +345,10 @@ void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) HAL_DMA_PollForTransfer(&DMAtx, HAL_DMA_FULL_TRANSFER, HAL_MAX_DELAY); #ifdef STM32H7xx - while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) {} + while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_SR_EOT)) { /* nada */ } #else - while (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) {} + while (!__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_TXE)) { /* nada */ } + while (__HAL_SPI_GET_FLAG(&SPIx, SPI_FLAG_BSY)) { /* nada */ } #endif abort(); } @@ -337,8 +359,7 @@ void TFT_SPI::transmit(uint32_t memoryIncrease, uint16_t *data, uint16_t count) DMAtx.Init.MemInc = memoryIncrease; HAL_DMA_Init(&DMAtx); - if (TFT_MISO_PIN == TFT_MOSI_PIN) - SPI_1LINE_TX(&SPIx); + if (SPIx.Init.Direction == SPI_DIRECTION_1LINE) SPI_1LINE_TX(&SPIx); dataTransferBegin(); diff --git a/Marlin/src/lcd/extui/mks_ui/SPI_TFT.cpp b/Marlin/src/lcd/extui/mks_ui/SPI_TFT.cpp index 6cbe13e9fd..236ff3f615 100644 --- a/Marlin/src/lcd/extui/mks_ui/SPI_TFT.cpp +++ b/Marlin/src/lcd/extui/mks_ui/SPI_TFT.cpp @@ -63,9 +63,7 @@ void TFT::lcdInit() { #if PIN_EXISTS(TFT_BACKLIGHT) OUT_WRITE(TFT_BACKLIGHT_PIN, HIGH); #endif - #if HAS_LOGO_IN_FLASH - delay(2000); - #endif + TERN_(HAS_LOGO_IN_FLASH, delay(2000)); } void TFT::lcdClear(uint16_t color) { diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp index 9b4ab3e084..ad1a53c455 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); diff --git a/Marlin/src/lcd/tft_io/tft_io.cpp b/Marlin/src/lcd/tft_io/tft_io.cpp index d46c2de418..893ba617eb 100644 --- a/Marlin/src/lcd/tft_io/tft_io.cpp +++ b/Marlin/src/lcd/tft_io/tft_io.cpp @@ -111,37 +111,37 @@ void TFT_IO::initTFT() { switch (lcd_id) { case LTDC_RGB: break; - case ST7796: // ST7796S 480x320 - DEBUG_ECHO_MSG(" ST7796S"); + case ST7796: + DEBUG_ECHO_MSG(" ST7796S"); // 480x320 write_esc_sequence(st7796s_init); break; - case ST7789: // ST7789V 320x240 - DEBUG_ECHO_MSG(" ST7789V"); + case ST7789: + DEBUG_ECHO_MSG(" ST7789V"); // 320x240 write_esc_sequence(st7789v_init); break; - case SSD1963: // SSD1963 + case SSD1963: DEBUG_ECHO_MSG(" SSD1963"); write_esc_sequence(ssd1963_init); break; - case ST7735: // ST7735 160x128 - DEBUG_ECHO_MSG(" ST7735"); + case ST7735: + DEBUG_ECHO_MSG(" ST7735"); // 160x128 write_esc_sequence(st7735_init); break; - case R61505: // R61505U 320x240 - DEBUG_ECHO_MSG(" R61505U"); + case R61505: + DEBUG_ECHO_MSG(" R61505U"); // 320x240 write_esc_sequence(r61505_init); break; - case ILI9328: // ILI9328 320x240 - DEBUG_ECHO_MSG(" ILI9328"); + case ILI9328: + DEBUG_ECHO_MSG(" ILI9328"); // 320x240 write_esc_sequence(ili9328_init); break; - case ILI9341: // ILI9341 320x240 - DEBUG_ECHO_MSG(" ILI9341"); + case ILI9341: + DEBUG_ECHO_MSG(" ILI9341"); // 320x240 write_esc_sequence(ili9341_init); break; - case ILI9488: // ILI9488 480x320 - case ILI9488_ID1: // 0x8066 ILI9488 480x320 - DEBUG_ECHO_MSG(" ILI9488"); + case ILI9488: + case ILI9488_ID1: + DEBUG_ECHO_MSG(" ILI9488"); // 480x320 write_esc_sequence(ili9488_init); break; default: diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 98ce740726..efbd79b7c1 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -38,7 +38,7 @@ #endif #ifndef TFT_DRIVER - #define TFT_DRIVER AUTO + #define TFT_DRIVER AUTO #endif #define ESC_REG(x) 0xFFFF, 0x00FF & (uint16_t)x From 3a888e956b081a9cde1f496b6c24fa39b5061f39 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 8 Jan 2024 00:30:52 +0000 Subject: [PATCH 20/26] [cron] Bump distribution date (2024-01-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 baa1539a5b..ddde5554e1 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 "2024-01-06" +//#define STRING_DISTRIBUTION_DATE "2024-01-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 892d02c745..323e8f75d7 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 "2024-01-06" + #define STRING_DISTRIBUTION_DATE "2024-01-08" #endif /** From 5987a5464bc8622d77ab52990b88d5ae035074e1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jan 2024 19:34:34 -0600 Subject: [PATCH 21/26] =?UTF-8?q?=F0=9F=8E=A8=20Use=20float=20CEIL/FLOOR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp | 6 +++--- Marlin/src/module/ft_motion.cpp | 6 +++--- Marlin/src/module/stepper.cpp | 2 +- 3 files changed, 7 insertions(+), 7 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 68581aeafd..01a2c4ebcc 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -1655,9 +1655,9 @@ void RTS::handleData() { case AutolevelVal: { uint8_t meshPoint = (recdat.addr - AutolevelVal) / 2, - yPnt = floor(meshPoint / GRID_MAX_POINTS_X), - xPnt = meshPoint - (yPnt * GRID_MAX_POINTS_X); - if (yPnt % 2 != 0) xPnt = (GRID_MAX_POINTS_X - 1) - xPnt; // zag row + yPnt = meshPoint / (GRID_MAX_POINTS_X), + xPnt = meshPoint - yPnt * (GRID_MAX_POINTS_X); + if (yPnt % 2 != 0) xPnt = (GRID_MAX_POINTS_X) - 1 - xPnt; // zag row float meshVal = float(recdat.data[0] - (recdat.data[0] >= 32768 ? 65536 : 0)) / 1000; diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index ba1361f922..447f372e63 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -544,9 +544,9 @@ void FTMotion::loadBlockData(block_t * const current_block) { const float T1 = (F_n - f_s) * oneOverAccel, T3 = (F_n - f_e) * oneOverAccel; - N1 = ceil(T1 * (FTM_FS)); // Accel datapoints based on Hz frequency - N2 = ceil(T2 * (FTM_FS)); // Coast - N3 = ceil(T3 * (FTM_FS)); // Decel + N1 = CEIL(T1 * (FTM_FS)); // Accel datapoints based on Hz frequency + N2 = CEIL(T2 * (FTM_FS)); // Coast + N3 = CEIL(T3 * (FTM_FS)); // Decel const float T1_P = N1 * (FTM_TS), // (s) Accel datapoints x timestep resolution T2_P = N2 * (FTM_TS), // (s) Coast diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 9c1668619b..552b7cb34a 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -3161,7 +3161,7 @@ void Stepper::init() { factor2 += -7.58095488 * zeta2; const float zeta3 = zeta2 * zeta; factor2 += 43.073216 * zeta3; - factor2 = floor(factor2); + factor2 = FLOOR(factor2); } const bool was_on = hal.isr_state(); From f4eafed188189d2a77c53a2a68bd931ee838b584 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 7 Jan 2024 21:59:25 -0600 Subject: [PATCH 22/26] =?UTF-8?q?=F0=9F=94=A7=20Z=5FPROBE=5FEND=5FSCRIPT?= =?UTF-8?q?=20=3D>=20EVENT=5FGCODE=5FAFTER=5FG29?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 6 +++--- Marlin/src/gcode/bedlevel/abl/G29.cpp | 6 +++--- Marlin/src/inc/Changes.h | 2 ++ buildroot/tests/mega2560 | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 9acdc107ca..ad659f70e2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2032,7 +2032,7 @@ * 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" +//#define EVENT_GCODE_AFTER_G29 "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" /** * Normally G28 leaves leveling disabled on completion. Enable one of diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 720c86769d..560ff71e84 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -681,11 +681,11 @@ void unified_bed_leveling::G29() { ui.release(); #endif - #ifdef Z_PROBE_END_SCRIPT - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", Z_PROBE_END_SCRIPT); + #ifdef EVENT_GCODE_AFTER_G29 + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", EVENT_GCODE_AFTER_G29); if (probe_deployed) { planner.synchronize(); - gcode.process_subcommands_now(F(Z_PROBE_END_SCRIPT)); + gcode.process_subcommands_now(F(EVENT_GCODE_AFTER_G29)); } #else UNUSED(probe_deployed); diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 700562df81..1ca3826c81 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -987,10 +987,10 @@ G29_TYPE GcodeSuite::G29() { TERN_(HAS_BED_PROBE, probe.move_z_after_probing()); - #ifdef Z_PROBE_END_SCRIPT - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", Z_PROBE_END_SCRIPT); + #ifdef EVENT_GCODE_AFTER_G29 + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Probe End Script: ", EVENT_GCODE_AFTER_G29); planner.synchronize(); - process_subcommands_now(F(Z_PROBE_END_SCRIPT)); + process_subcommands_now(F(EVENT_GCODE_AFTER_G29)); #endif probe.use_probing_tool(false); diff --git a/Marlin/src/inc/Changes.h b/Marlin/src/inc/Changes.h index 5a03e87b1d..0fd91ee9ca 100644 --- a/Marlin/src/inc/Changes.h +++ b/Marlin/src/inc/Changes.h @@ -685,6 +685,8 @@ #error "SDIO_SUPPORT is now ONBOARD_SDIO." #elif defined(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING is now CTC_A10S_A13." +#elif defined(Z_PROBE_END_SCRIPT) + #error "Z_PROBE_END_SCRIPT is now EVENT_GCODE_AFTER_G29." #endif // Changes to Probe Temp Compensation (#17392) diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560 index 1fbdd6b58b..c41e73640d 100755 --- a/buildroot/tests/mega2560 +++ b/buildroot/tests/mega2560 @@ -87,7 +87,7 @@ opt_disable X_DRIVER_TYPE Y_DRIVER_TYPE Z_DRIVER_TYPE exec_test $1 $2 "E Axis Only | DOGM MarlinUI" "$3" # -# Mixing Extruder with 5 steppers, Greek +# Mixing Extruder with 5 steppers, Russian # restore_configs opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO MIXING_STEPPERS 5 LCD_LANGUAGE ru \ @@ -98,7 +98,7 @@ opt_enable MIXING_EXTRUDER GRADIENT_MIX GRADIENT_VTOOL CR10_STOCKDISPLAY \ XY_AFTER_HOMING EVENT_GCODE_AFTER_HOMING \ FILAMENT_RUNOUT_SENSOR ADVANCED_PAUSE_FEATURE NOZZLE_PARK_FEATURE INPUT_SHAPING_X INPUT_SHAPING_Y opt_disable DISABLE_OTHER_EXTRUDERS -exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Input Shaping | Greek" "$3" +exec_test $1 $2 "Azteeg X3 | Mixing Extruder (x5) | Gradient Mix | Input Shaping | Russian" "$3" # # Test SPEAKER with BOARD_BQ_ZUM_MEGA_3D and BQ_LCD_SMART_CONTROLLER From 38f483c4a6a0b6c814e5ee88747f58eed17fa61e Mon Sep 17 00:00:00 2001 From: mikemerryguy <57319047+mikemerryguy@users.noreply.github.com> Date: Sun, 7 Jan 2024 23:14:24 -0500 Subject: [PATCH 23/26] =?UTF-8?q?=F0=9F=A9=B9=20Skip=20post-G28=20XY=20mov?= =?UTF-8?q?e=20for=20untrusted=20X=20or=20Y=20(#26644)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #26469 Co-authored-by: Scott Lahteine --- Marlin/src/gcode/calibrate/G28.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 98d0a40148..55698c942b 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -639,8 +639,8 @@ void GcodeSuite::G28() { #endif #ifdef XY_AFTER_HOMING - constexpr xy_pos_t xy_after XY_AFTER_HOMING; - do_blocking_move_to(xy_after); + if (!axes_should_home(_BV(X_AXIS) | _BV(Y_AXIS))) + do_blocking_move_to(xy_pos_t(XY_AFTER_HOMING)); #endif restore_feedrate_and_scaling(); From b106f59eb495718d7158e27347eca5deb11fbe86 Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Mon, 8 Jan 2024 05:17:43 +0100 Subject: [PATCH 24/26] =?UTF-8?q?=F0=9F=90=9B=20Refine=20FT=20Motion,=20I2?= =?UTF-8?q?S=20Stepping=20(#26628)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/HAL/ESP32/i2s.cpp | 56 ++++++++++++++-------- Marlin/src/inc/Conditionals_adv.h | 6 +++ Marlin/src/inc/SanityCheck.h | 8 +++- Marlin/src/inc/Warnings.cpp | 7 +++ Marlin/src/module/ft_motion.cpp | 35 +++++++++----- Marlin/src/module/ft_motion.h | 15 +++--- Marlin/src/module/ft_types.h | 9 +--- Marlin/src/module/stepper.cpp | 23 +++++---- Marlin/src/pins/esp32/pins_ENWI_ESPNP.h | 4 +- Marlin/src/pins/esp32/pins_ESP32.h | 4 +- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 4 +- Marlin/src/pins/esp32/pins_MM_JOKER.h | 4 +- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 4 +- Marlin/src/pins/esp32/pins_RESP32_CUSTOM.h | 4 +- ini/esp32.ini | 20 ++++---- 15 files changed, 132 insertions(+), 71 deletions(-) diff --git a/Marlin/src/HAL/ESP32/i2s.cpp b/Marlin/src/HAL/ESP32/i2s.cpp index 69f8ca9845..5404c3e9e2 100644 --- a/Marlin/src/HAL/ESP32/i2s.cpp +++ b/Marlin/src/HAL/ESP32/i2s.cpp @@ -34,6 +34,10 @@ #include #include "../../module/stepper.h" +#if ENABLED(FT_MOTION) + #include "../../module/ft_motion.h" +#endif + #define DMA_BUF_COUNT 8 // number of DMA buffers to store data #define DMA_BUF_LEN 4092 // maximum size in bytes #define I2S_SAMPLE_SIZE 4 // 4 bytes, 32 bits per sample @@ -134,8 +138,8 @@ static void IRAM_ATTR i2s_intr_handler_default(void *arg) { if (high_priority_task_awoken == pdTRUE) portYIELD_FROM_ISR(); - // clear interrupt - I2S0.int_clr.val = I2S0.int_st.val; //clear pending interrupt + // Clear pending interrupt + I2S0.int_clr.val = I2S0.int_st.val; } void stepperTask(void *parameter) { @@ -148,29 +152,43 @@ void stepperTask(void *parameter) { xQueueReceive(dma.queue, &dma.current, portMAX_DELAY); dma.rw_pos = 0; + const bool using_ftMotion = TERN0(FT_MOTION, ftMotion.cfg.mode); + while (dma.rw_pos < DMA_SAMPLE_COUNT) { - if (!nextMainISR) { - Stepper::pulse_phase_isr(); - nextMainISR = Stepper::block_phase_isr(); - } - #if ENABLED(LIN_ADVANCE) - else if (!nextAdvanceISR) { - Stepper::advance_isr(); - nextAdvanceISR = Stepper::la_interval; + + #if ENABLED(FT_MOTION) + + if (using_ftMotion) { + if (!nextMainISR) stepper.ftMotion_stepper(); + nextMainISR = 0; } + #endif - else - i2s_push_sample(); - nextMainISR--; + if (!using_ftMotion) { + if (!nextMainISR) { + Stepper::pulse_phase_isr(); + nextMainISR = Stepper::block_phase_isr(); + } + #if ENABLED(LIN_ADVANCE) + else if (!nextAdvanceISR) { + Stepper::advance_isr(); + nextAdvanceISR = Stepper::la_interval; + } + #endif + else + i2s_push_sample(); - #if ENABLED(LIN_ADVANCE) - if (nextAdvanceISR == Stepper::LA_ADV_NEVER) - nextAdvanceISR = Stepper::la_interval; + nextMainISR--; - if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER) - nextAdvanceISR--; - #endif + #if ENABLED(LIN_ADVANCE) + if (nextAdvanceISR == Stepper::LA_ADV_NEVER) + nextAdvanceISR = Stepper::la_interval; + + if (nextAdvanceISR && nextAdvanceISR != Stepper::LA_ADV_NEVER) + nextAdvanceISR--; + #endif + } } } } diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 191da44af7..d535553ca9 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1309,6 +1309,12 @@ #define HAS_ZV_SHAPING 1 #endif +// FT Motion unified window and batch size +#if ALL(FT_MOTION, FTM_UNIFIED_BWS) + #define FTM_WINDOW_SIZE FTM_BW_SIZE + #define FTM_BATCH_SIZE FTM_BW_SIZE +#endif + // Toolchange Event G-code #if !HAS_MULTI_EXTRUDER || !(defined(EVENT_GCODE_TOOLCHANGE_T0) || defined(EVENT_GCODE_TOOLCHANGE_T1) || defined(EVENT_GCODE_TOOLCHANGE_T2) || defined(EVENT_GCODE_TOOLCHANGE_T3) || defined(EVENT_GCODE_TOOLCHANGE_T4) || defined(EVENT_GCODE_TOOLCHANGE_T5) || defined(EVENT_GCODE_TOOLCHANGE_T6) || defined(EVENT_GCODE_TOOLCHANGE_T7)) #undef TC_GCODE_USE_GLOBAL_X diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c3fed355d3..8fa189e9ce 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -4123,8 +4123,12 @@ static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive." /** * Fixed-Time Motion limitations */ -#if ALL(FT_MOTION, MIXING_EXTRUDER) - #error "FT_MOTION does not currently support MIXING_EXTRUDER." +#if ENABLED(FT_MOTION) + #if ENABLED(MIXING_EXTRUDER) + #error "FT_MOTION does not currently support MIXING_EXTRUDER." + #elif DISABLED(FTM_UNIFIED_BWS) + #error "FT_MOTION requires FTM_UNIFIED_BWS to be enabled because FBS is not yet implemented." + #endif #endif // Multi-Stepping Limit diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 560acf4cd8..669f3fce76 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -826,3 +826,10 @@ #if PIN_EXISTS(BEEPER) && ALL(SPEAKER, NO_SPEAKER) #warning "The BEEPER cannot produce tones so you can disable SPEAKER." #endif + +/** + * Fixed-Time Motion + */ +#if ALL(FT_MOTION, I2S_STEPPER_STREAM) + #warning "FT_MOTION has not been tested with I2S_STEPPER_STREAM." +#endif diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index 447f372e63..e912255561 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -55,8 +55,8 @@ FTMotion ftMotion; ft_config_t FTMotion::cfg; bool FTMotion::busy; // = false ft_command_t FTMotion::stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE] = {0U}; // Stepper commands buffer. -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. +int32_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 FTMotion::sts_stepperBusy = false; // The stepper buffer has items and is in use. @@ -123,6 +123,8 @@ uint32_t FTMotion::interpIdx = 0, // Index of current data point b 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); + //----------------------------------------------------------------- // Function definitions. //----------------------------------------------------------------- @@ -145,8 +147,16 @@ void FTMotion::runoutBlock() { ratio.reset(); max_intervals = cfg.modeHasShaper() ? shaper_intervals : 0; - if (max_intervals <= TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, min_max_intervals - (FTM_BATCH_SIZE))) max_intervals = min_max_intervals; - max_intervals += TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, FTM_WINDOW_SIZE) - makeVector_batchIdx; + if (max_intervals <= TERN(FTM_UNIFIED_BWS, FTM_BATCH_SIZE, min_max_intervals - (FTM_BATCH_SIZE))) + max_intervals = min_max_intervals; + + max_intervals += ( + #if ENABLED(FTM_UNIFIED_BWS) + FTM_WINDOW_SIZE - makeVector_batchIdx + #else + FTM_WINDOW_SIZE - ((last_batchIdx < (FTM_BATCH_SIZE)) ? 0 : makeVector_batchIdx) + #endif + ); blockProcRdy = blockDataIsRunout = true; runoutEna = blockProcDn = false; } @@ -198,7 +208,7 @@ void FTMotion::loop() { ); // Shift the time series back in the window - #define TSHIFT(A) memcpy(traj.A, &traj.A[FTM_BATCH_SIZE], (FTM_WINDOW_SIZE - FTM_BATCH_SIZE) * sizeof(traj.A[0])) + #define TSHIFT(A) memcpy(traj.A, &traj.A[FTM_BATCH_SIZE], last_batchIdx * sizeof(traj.A[0])) LOGICAL_AXIS_CODE( TSHIFT(e), TSHIFT(x), TSHIFT(y), TSHIFT(z), @@ -219,7 +229,7 @@ void FTMotion::loop() { && (interpIdx - interpIdx_z1 < (FTM_STEPS_PER_LOOP)) ) { convertToSteps(interpIdx); - if (++interpIdx == TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, FTM_BATCH_SIZE)) { + if (++interpIdx == FTM_BATCH_SIZE) { batchRdyForInterp = false; interpIdx = 0; } @@ -449,7 +459,7 @@ void FTMotion::reset() { endPosn_prevBlock.reset(); makeVector_idx = makeVector_idx_z1 = 0; - makeVector_batchIdx = 0; + makeVector_batchIdx = TERN(FTM_UNIFIED_BWS, 0, _MAX(last_batchIdx, FTM_BATCH_SIZE)); steps.reset(); interpIdx = interpIdx_z1 = 0; @@ -464,10 +474,11 @@ void FTMotion::reset() { } // Private functions. + // Auxiliary function to get number of step commands in the buffer. -uint32_t FTMotion::stepperCmdBuffItems() { - const uint32_t udiff = stepperCmdBuff_produceIdx - stepperCmdBuff_consumeIdx; - return stepperCmdBuff_produceIdx < stepperCmdBuff_consumeIdx ? (FTM_STEPPERCMD_BUFF_SIZE) + udiff : udiff; +int32_t FTMotion::stepperCmdBuffItems() { + const int32_t udiff = stepperCmdBuff_produceIdx - stepperCmdBuff_consumeIdx; + return (udiff < 0) ? udiff + (FTM_STEPPERCMD_BUFF_SIZE) : udiff; } // Initializes storage variables before startup. @@ -677,8 +688,8 @@ void FTMotion::makeVector() { #endif // Filled up the queue with regular and shaped steps - if (++makeVector_batchIdx == TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, (FTM_WINDOW_SIZE - FTM_BATCH_SIZE))) { - makeVector_batchIdx = 0; + if (++makeVector_batchIdx == FTM_WINDOW_SIZE) { + makeVector_batchIdx = last_batchIdx; batchRdy = true; } diff --git a/Marlin/src/module/ft_motion.h b/Marlin/src/module/ft_motion.h index 8c8098873f..884a183479 100644 --- a/Marlin/src/module/ft_motion.h +++ b/Marlin/src/module/ft_motion.h @@ -102,12 +102,11 @@ class FTMotion { } static ft_command_t stepperCmdBuff[FTM_STEPPERCMD_BUFF_SIZE]; // Buffer of stepper commands. - static uint32_t stepperCmdBuff_produceIdx, // Index of next stepper command write to the buffer. - stepperCmdBuff_consumeIdx; // Index of next stepper command read from the buffer. + static int32_t stepperCmdBuff_produceIdx, // Index of next stepper command write to the buffer. + stepperCmdBuff_consumeIdx; // Index of next stepper command read from the buffer. static bool sts_stepperBusy; // The stepper buffer has items and is in use. - // Public methods static void init(); static void startBlockProc(); // Set controller states to begin processing a block. @@ -153,10 +152,10 @@ class FTMotion { static uint32_t N1, N2, N3; static uint32_t max_intervals; - static constexpr uint32_t _ftm_size = TERN(FTM_UNIFIED_BWS, FTM_BW_SIZE, FTM_BATCH_SIZE), - _ftm_wind = TERN(FTM_UNIFIED_BWS, 2, CEIL((FTM_WINDOW_SIZE) / _ftm_size)), - shaper_intervals = _ftm_size * CEIL((FTM_ZMAX) / _ftm_size), - min_max_intervals = _ftm_size * _ftm_wind; + #define _DIVCEIL(A,B) (((A) + (B) - 1) / (B)) + static constexpr uint32_t _ftm_ratio = TERN(FTM_UNIFIED_BWS, 2, _DIVCEIL(FTM_WINDOW_SIZE, FTM_BATCH_SIZE)), + shaper_intervals = (FTM_BATCH_SIZE) * _DIVCEIL(FTM_ZMAX, FTM_BATCH_SIZE), + min_max_intervals = (FTM_BATCH_SIZE) * _ftm_ratio; // Make vector variables. static uint32_t makeVector_idx, @@ -203,7 +202,7 @@ class FTMotion { #endif // Private methods - static uint32_t stepperCmdBuffItems(); + static int32_t stepperCmdBuffItems(); static void loadBlockData(block_t *const current_block); static void makeVector(); static void convertToSteps(const uint32_t idx); diff --git a/Marlin/src/module/ft_types.h b/Marlin/src/module/ft_types.h index b17c00974e..d460853262 100644 --- a/Marlin/src/module/ft_types.h +++ b/Marlin/src/module/ft_types.h @@ -44,13 +44,8 @@ enum dynFreqMode_t : uint8_t { #define IS_EI_MODE(N) WITHIN(N, ftMotionMode_EI, ftMotionMode_3HEI) -#if ENABLED(FTM_UNIFIED_BWS) - typedef struct XYZEarray xyze_trajectory_t; - typedef struct XYZEarray xyze_trajectoryMod_t; -#else - typedef struct XYZEarray xyze_trajectory_t; - typedef struct XYZEarray xyze_trajectoryMod_t; -#endif +typedef struct XYZEarray xyze_trajectory_t; +typedef struct XYZEarray xyze_trajectoryMod_t; enum { LIST_N(DOUBLE(LOGICAL_AXES), diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 552b7cb34a..8d55d37b96 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -1508,14 +1508,12 @@ void Stepper::isr() { #if ENABLED(FT_MOTION) if (using_ftMotion) { - if (!nextMainISR) { - nextMainISR = FTM_MIN_TICKS; - ftMotion_stepper(); - endstops.update(); - TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr()); + if (!nextMainISR) { // Main ISR is ready to fire during this iteration? + nextMainISR = FTM_MIN_TICKS; // Set to minimum interval (a limit on the top speed) + ftMotion_stepper(); // Run FTM Stepping } - interval = nextMainISR; - nextMainISR -= interval; + interval = nextMainISR; // Interval is either some old nextMainISR or FTM_MIN_TICKS + nextMainISR = 0; // For FT Motion fire again ASAP } #endif @@ -3448,7 +3446,8 @@ void Stepper::report_positions() { // Use one byte to restore one stepper command in the format: // |X_step|X_direction|Y_step|Y_direction|Z_step|Z_direction|E_step|E_direction| const ft_command_t command = ftMotion.stepperCmdBuff[ftMotion.stepperCmdBuff_consumeIdx]; - if (++ftMotion.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) ftMotion.stepperCmdBuff_consumeIdx = 0U; + if (++ftMotion.stepperCmdBuff_consumeIdx == (FTM_STEPPERCMD_BUFF_SIZE)) + ftMotion.stepperCmdBuff_consumeIdx = 0; if (abort_current_block) return; @@ -3492,6 +3491,8 @@ void Stepper::report_positions() { U_APPLY_STEP(axis_did_move.u, false), V_APPLY_STEP(axis_did_move.v, false), W_APPLY_STEP(axis_did_move.w, false) ); + TERN_(I2S_STEPPER_STREAM, i2s_push_sample()); + // Begin waiting for the minimum pulse duration START_TIMED_PULSE(); @@ -3533,6 +3534,12 @@ void Stepper::report_positions() { U_APPLY_STEP(!STEP_STATE_U, false), V_APPLY_STEP(!STEP_STATE_V, false), W_APPLY_STEP(!STEP_STATE_W, false) ); + // Check endstops on every step + IF_DISABLED(ENDSTOP_INTERRUPTS_FEATURE, endstops.update()); + + // Also handle babystepping here + TERN_(BABYSTEPPING, if (babystep.has_steps()) babystepping_isr()); + } // Stepper::ftMotion_stepper void Stepper::ftMotion_blockQueueUpdate() { diff --git a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h index 360501aa08..65f734c760 100644 --- a/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h +++ b/Marlin/src/pins/esp32/pins_ENWI_ESPNP.h @@ -34,7 +34,9 @@ // // I2S (steppers & other output-only pins) // -#define I2S_STEPPER_STREAM +#ifndef I2S_STEPPER_STREAM + #define I2S_STEPPER_STREAM +#endif #if ENABLED(I2S_STEPPER_STREAM) #define I2S_WS 17 #define I2S_BCK 22 diff --git a/Marlin/src/pins/esp32/pins_ESP32.h b/Marlin/src/pins/esp32/pins_ESP32.h index 1c01be8a88..9c9b06ca64 100644 --- a/Marlin/src/pins/esp32/pins_ESP32.h +++ b/Marlin/src/pins/esp32/pins_ESP32.h @@ -32,7 +32,9 @@ // // I2S (steppers & other output-only pins) // -#define I2S_STEPPER_STREAM +#ifndef I2S_STEPPER_STREAM + #define I2S_STEPPER_STREAM +#endif #if ENABLED(I2S_STEPPER_STREAM) #define I2S_WS 25 #define I2S_BCK 26 diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 43196bafa9..69afcc1aeb 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -56,7 +56,9 @@ // // Enable I2S stepper stream // -#define I2S_STEPPER_STREAM +#ifndef I2S_STEPPER_STREAM + #define I2S_STEPPER_STREAM +#endif #if ENABLED(I2S_STEPPER_STREAM) #define I2S_WS 26 #define I2S_BCK 25 diff --git a/Marlin/src/pins/esp32/pins_MM_JOKER.h b/Marlin/src/pins/esp32/pins_MM_JOKER.h index 52ed543c33..b992fe89c3 100644 --- a/Marlin/src/pins/esp32/pins_MM_JOKER.h +++ b/Marlin/src/pins/esp32/pins_MM_JOKER.h @@ -85,7 +85,9 @@ // // Enable I2S stepper stream // -#define I2S_STEPPER_STREAM +#ifndef I2S_STEPPER_STREAM + #define I2S_STEPPER_STREAM +#endif #if ENABLED(I2S_STEPPER_STREAM) #define I2S_WS 26 #define I2S_BCK 25 diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index d88a3ab359..90ff78487f 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -51,7 +51,9 @@ // // Enable I2S stepper stream // -#define I2S_STEPPER_STREAM +#ifndef I2S_STEPPER_STREAM + #define I2S_STEPPER_STREAM +#endif #if ENABLED(I2S_STEPPER_STREAM) #define I2S_WS 26 #define I2S_BCK 25 diff --git a/Marlin/src/pins/esp32/pins_RESP32_CUSTOM.h b/Marlin/src/pins/esp32/pins_RESP32_CUSTOM.h index 5d3f75574d..f627909a7a 100644 --- a/Marlin/src/pins/esp32/pins_RESP32_CUSTOM.h +++ b/Marlin/src/pins/esp32/pins_RESP32_CUSTOM.h @@ -34,4 +34,6 @@ // // I2S (steppers & other output-only pins) // -#define I2S_STEPPER_STREAM +#ifndef I2S_STEPPER_STREAM + #define I2S_STEPPER_STREAM +#endif diff --git a/ini/esp32.ini b/ini/esp32.ini index 98c3e06755..909394eae1 100644 --- a/ini/esp32.ini +++ b/ini/esp32.ini @@ -13,15 +13,17 @@ # Espressif ESP32 # [env:esp32] -platform = espressif32@2.1.0 -board = esp32dev -build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 -build_src_filter = ${common.default_src_filter} + -lib_ignore = NativeEthernet -upload_speed = 500000 -monitor_speed = 250000 -monitor_filters = colorize, time, send_on_enter, log2file, esp32_exception_decoder -#upload_port = marlinesp.local +platform = espressif32@2.1.0 +platform_packages = espressif/toolchain-xtensa-esp32s3 +board = esp32dev +build_flags = ${common.build_flags} -DCORE_DEBUG_LEVEL=0 -std=gnu++17 +build_unflags = -std=gnu11 -std=gnu++11 +build_src_filter = ${common.default_src_filter} + +lib_ignore = NativeEthernet +upload_speed = 500000 +monitor_speed = 250000 +monitor_filters = colorize, time, send_on_enter, log2file, esp32_exception_decoder +#upload_port = marlinesp.local #board_build.flash_mode = qio [env:FYSETC_E4] From b2dd2dc217af35011bcded3f8603c954f5fed95a Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Mon, 8 Jan 2024 05:26:34 +0100 Subject: [PATCH 25/26] =?UTF-8?q?=F0=9F=9A=B8=20FT=20Motion=20M493=20repor?= =?UTF-8?q?t=20less=20precision=20(#26643)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/feature/ft_motion/M493.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Marlin/src/gcode/feature/ft_motion/M493.cpp b/Marlin/src/gcode/feature/ft_motion/M493.cpp index a72a35d5bf..64d57118a0 100644 --- a/Marlin/src/gcode/feature/ft_motion/M493.cpp +++ b/Marlin/src/gcode/feature/ft_motion/M493.cpp @@ -79,7 +79,7 @@ void say_shaping() { SERIAL_ECHO_TERNARY(dynamic, "X/A ", "base dynamic", "static", " compensator frequency: "); 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(ftMotion.cfg.dynFreqK[X_AXIS], 8), F("Hz/"), z_based ? F("mm") : F("g")); + if (dynamic) SERIAL_ECHO(F(" scaling: "), p_float_t(ftMotion.cfg.dynFreqK[X_AXIS], 2), F("Hz/"), z_based ? F("mm") : F("g")); #endif SERIAL_EOL(); #endif @@ -88,7 +88,7 @@ void say_shaping() { SERIAL_ECHO_TERNARY(dynamic, "Y/B ", "base dynamic", "static", " compensator frequency: "); 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(ftMotion.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], 2), F("Hz/"), z_based ? F("mm") : F("g")); #endif SERIAL_EOL(); #endif @@ -96,7 +96,10 @@ void say_shaping() { #if HAS_EXTRUDERS SERIAL_ECHO_TERNARY(ftMotion.cfg.linearAdvEna, "Linear Advance ", "en", "dis", "abled"); - SERIAL_ECHOLN(F(". Gain: "), p_float_t(ftMotion.cfg.linearAdvK, 5)); + if (ftMotion.cfg.linearAdvEna) + SERIAL_ECHOLNPGM(". Gain: ", ftMotion.cfg.linearAdvK); + else + SERIAL_EOL(); #endif } From 477b70eccf3210dc2fff2e84555830320bea9655 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 9 Jan 2024 00:22:16 +0000 Subject: [PATCH 26/26] [cron] Bump distribution date (2024-01-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 ddde5554e1..3c4056e1b4 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 "2024-01-08" +//#define STRING_DISTRIBUTION_DATE "2024-01-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 323e8f75d7..0d4a1fe679 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 "2024-01-08" + #define STRING_DISTRIBUTION_DATE "2024-01-09" #endif /**