diff --git a/Marlin/Version.h b/Marlin/Version.h index 99c097f65f67..737ca23f6f8e 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-11-28" +//#define STRING_DISTRIBUTION_DATE "2024-12-01" /** * The protocol for communication to the host. Protocol indicates communication diff --git a/Marlin/src/HAL/ESP32/wifi.cpp b/Marlin/src/HAL/ESP32/wifi.cpp index 060f3bdb4874..aa2796adeae4 100644 --- a/Marlin/src/HAL/ESP32/wifi.cpp +++ b/Marlin/src/HAL/ESP32/wifi.cpp @@ -21,11 +21,12 @@ */ #ifdef ARDUINO_ARCH_ESP32 -#include "../../core/serial.h" #include "../../inc/MarlinConfigPre.h" #if ENABLED(WIFISUPPORT) +#include "../../core/serial.h" + #include #include #include diff --git a/Marlin/src/HAL/HC32/HAL.h b/Marlin/src/HAL/HC32/HAL.h index 8111e1b57ee6..3f4ba1461550 100644 --- a/Marlin/src/HAL/HC32/HAL.h +++ b/Marlin/src/HAL/HC32/HAL.h @@ -30,7 +30,6 @@ #include "../../inc/MarlinConfig.h" -#include "../../core/macros.h" #include "../shared/Marduino.h" #include "../shared/math_32bit.h" #include "../shared/HAL_SPI.h" @@ -39,8 +38,6 @@ #include "timers.h" #include "MarlinSerial.h" -#include - // // Serial Ports // diff --git a/Marlin/src/feature/mixing.cpp b/Marlin/src/feature/mixing.cpp index 4021393f18e6..f3fb2d07a3a2 100644 --- a/Marlin/src/feature/mixing.cpp +++ b/Marlin/src/feature/mixing.cpp @@ -28,10 +28,6 @@ Mixer mixer; -#ifdef MIXER_NORMALIZER_DEBUG - #include "../core/serial.h" -#endif - // Used up to Planner level uint_fast8_t Mixer::selected_vtool = 0; float Mixer::collector[MIXING_STEPPERS]; // mix proportion. 0.0 = off, otherwise <= COLOR_A_MASK. diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index a97887773c51..3cd96e11550c 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -28,8 +28,9 @@ #if ENABLED(POWER_LOSS_RECOVERY) +#include "../inc/MarlinConfig.h" + #include "powerloss.h" -#include "../core/macros.h" #if ENABLED(EXTENSIBLE_UI) #include "../lcd/extui/ui_api.h" @@ -60,7 +61,6 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0 #include "../module/planner.h" #include "../module/printcounter.h" #include "../module/temperature.h" -#include "../core/serial.h" #if HOMING_Z_WITH_PROBE #include "../module/probe.h" diff --git a/Marlin/src/gcode/eeprom/M500-M504.cpp b/Marlin/src/gcode/eeprom/M500-M504.cpp index c3962117e51f..ffa6d5c6860e 100644 --- a/Marlin/src/gcode/eeprom/M500-M504.cpp +++ b/Marlin/src/gcode/eeprom/M500-M504.cpp @@ -22,7 +22,6 @@ #include "../gcode.h" #include "../../module/settings.h" -#include "../../core/serial.h" #include "../../inc/MarlinConfig.h" #if ENABLED(CONFIGURATION_EMBEDDING) diff --git a/Marlin/src/gcode/motion/M290.cpp b/Marlin/src/gcode/motion/M290.cpp index d10f9ee73caa..192efe7e7f98 100644 --- a/Marlin/src/gcode/motion/M290.cpp +++ b/Marlin/src/gcode/motion/M290.cpp @@ -29,10 +29,6 @@ #include "../../module/probe.h" #include "../../module/planner.h" -#if ENABLED(BABYSTEP_ZPROBE_OFFSET) - #include "../../core/serial.h" -#endif - #if ENABLED(MESH_BED_LEVELING) #include "../../feature/bedlevel/bedlevel.h" #endif diff --git a/Marlin/src/gcode/stats/M31.cpp b/Marlin/src/gcode/stats/M31.cpp index ad48eae8663f..a826f9fa8c22 100644 --- a/Marlin/src/gcode/stats/M31.cpp +++ b/Marlin/src/gcode/stats/M31.cpp @@ -21,7 +21,6 @@ */ #include "../gcode.h" -#include "../../core/serial.h" #include "../../module/printcounter.h" #include "../../libs/duration_t.h" #include "../../lcd/marlinui.h" diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index b09df9e45ec8..338de3c10542 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-11-28" + #define STRING_DISTRIBUTION_DATE "2024-12-01" #endif /** diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index 08853c5cc145..fcbeecde83c3 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -51,8 +51,6 @@ #include "../../../sd/cardreader.h" #include "../../../MarlinCore.h" -#include "../../../core/serial.h" -#include "../../../core/macros.h" #include "../../../gcode/queue.h" #include "../../../module/temperature.h" diff --git a/Marlin/src/lcd/e3v2/jyersui/README.md b/Marlin/src/lcd/e3v2/jyersui/README.md deleted file mode 100644 index 09055d03a492..000000000000 --- a/Marlin/src/lcd/e3v2/jyersui/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# DWIN for Creality Ender-3 v2 - -Marlin's Ender-3 v2 support requires the `DWIN_SET` included with the Ender-3 V2 [example configuration](https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.1.x/config/examples/Creality/Ender-3%20V2). - -## Easy Install - -Copy the `DWIN_SET` folder onto a Micro-SD card and insert the card into the slot on the DWIN screen. Cycle the machine and wait for the screen to go from blue to orange. Turn the machine off and remove the SD card. When you turn on the machine the screen will display a "Creality" loading screen. diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index f4b5ba5339ac..8ed75ae1c004 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -40,8 +40,6 @@ #include "../../marlinui.h" #include "../../extui/ui_api.h" #include "../../../MarlinCore.h" -#include "../../../core/serial.h" -#include "../../../core/macros.h" #include "../../../module/temperature.h" #include "../../../module/printcounter.h" #include "../../../module/motion.h" diff --git a/Marlin/src/lcd/sovol_rts/sovol_rts.cpp b/Marlin/src/lcd/sovol_rts/sovol_rts.cpp index 13db7452bc3a..cdffca409b5e 100644 --- a/Marlin/src/lcd/sovol_rts/sovol_rts.cpp +++ b/Marlin/src/lcd/sovol_rts/sovol_rts.cpp @@ -39,8 +39,6 @@ RTS rts; #include #include #include "../../MarlinCore.h" -#include "../../core/serial.h" -#include "../../core/macros.h" #include "../../sd/cardreader.h" #include "../../module/temperature.h" #include "../../module/planner.h" @@ -56,7 +54,6 @@ RTS rts; #include "../../gcode/queue.h" #include "../../gcode/gcode.h" #include "../marlinui.h" -//#include "../utf8.h" #include "../../libs/BL24CXX.h" #if ENABLED(FIX_MOUNTED_PROBE) diff --git a/Marlin/src/libs/hex_print.cpp b/Marlin/src/libs/hex_print.cpp index 9a354011e841..9ff3fc6eb2f4 100644 --- a/Marlin/src/libs/hex_print.cpp +++ b/Marlin/src/libs/hex_print.cpp @@ -25,7 +25,6 @@ #if NEED_HEX_PRINT #include "hex_print.h" -#include "../core/serial.h" static char _hex[] = "0x00000000"; // 0:adr32 2:long 4:adr16 6:word 8:byte diff --git a/buildroot/bin/build_all_examples b/buildroot/bin/build_all_examples index 0c4a0ee394a1..c2b0007b0c2f 100755 --- a/buildroot/bin/build_all_examples +++ b/buildroot/bin/build_all_examples @@ -2,21 +2,21 @@ # # Usage: # -# build_all_examples [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x) +# build_all_examples [-a|--archive] - Copy the binary to the export location # [-B|--base] - Base path of configurations, overriding -b +# [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x) # [-c|--continue] - Continue the paused build -# [-p|--purge] - Purge the status file and start over -# [-s|--skip] - Continue the paused build, skipping one -# [-r|--resume=] - Start at some config in the filesystem order +# [-d|-v|--debug] - Print extra debug output (after) +# [-e|--export=N] - Set CONFIG_EXPORT and export to the export location +# [-f|--nofail] - Don't stop on a failed build +# [-h|--help] - Print usage and exit # [-l|--limit=#] - Limit the number of builds in this run -# [-d|--debug] - Print extra debug output (after) # [-n|--nobuild] - Don't actually build anything -# [-f|--nofail] - Don't stop on a failed build -# [-e|--export=N] - Set CONFIG_EXPORT and export into each config folder -# [-a|--archive] - Copy the binary to the export location # [-o|--output] - Redirect export / archiving to another location # (By default export to origin config folders) -# [-h|--help] - Print usage and exit +# [-p|--purge] - Purge the status file and start over +# [-r|--resume=] - Start at some config in the filesystem order +# [-s|--skip] - Continue the paused build, skipping one # HERE=`dirname $0` @@ -29,21 +29,21 @@ STAT_FILE=./.pio/.buildall usage() { echo "Usage: -build_all_examples [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x) +build_all_examples [-a|--archive] - Copy the binary to the export location [-B|--base] - Base path of configurations, overriding -b + [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x) [-c|--continue] - Continue the paused build - [-p|--purge] - Purge the status file and start over - [-s|--skip] - Continue the paused build, skipping one - [-r|--resume=] - Start at some config in the filesystem order + [-d|-v|--debug] - Print extra debug output (after) [-e|--export=N] - Set CONFIG_EXPORT and export to the export location - [-a|--archive] - Copy the binary to the export location - [-o|--output] - Redirect export / archiving to another location - (By default export to origin config folders) - [-d|--debug] - Print extra debug output (after) - [-l|--limit=#] - Limit the number of builds in this run - [-n|--nobuild] - Don't actually build anything [-f|--nofail] - Don't stop on a failed build [-h|--help] - Print usage and exit + [-l|--limit=#] - Limit the number of builds in this run + [-n|--nobuild] - Don't actually build anything + [-o|--output] - Redirect export / archiving to another location + (By default export to origin config folders) + [-p|--purge] - Purge the status file and start over + [-r|--resume=] - Start at some config in the filesystem order + [-s|--skip] - Continue the paused build, skipping one " } @@ -53,22 +53,22 @@ unset FIRST_CONF EXIT_USAGE= LIMIT=1000 -while getopts 'aB:b:ce:fdhl:no:pr:sv-:' OFLAG; do +while getopts 'aB:b:cde:fhl:no:pr:sv-:' OFLAG; do case "${OFLAG}" in a) ARCHIVE=1 ; bugout "Archiving" ;; B) CBASE=${OPTARG%/} ; bugout "Base: $CBASE" ;; b) BRANCH=$OPTARG ; bugout "Branch: $BRANCH" ;; - f) NOFAIL=1 ; bugout "Continue on Fail" ;; - r) ISRES=1 ; FIRST_CONF=$OPTARG ; bugout "Resume: $FIRST_CONF" ;; c) CONTINUE=1 ; bugout "Continue" ;; - s) CONTSKIP=1 ; bugout "Continue, skipping" ;; + d|v) DEBUG=1 ; bugout "Debug ON" ;; e) CEXPORT=$OPTARG ; bugout "Export $CEXPORT" ;; - o) OUTBASE="${OPTARG%/}" ; bugout "Archive to $OUTBASE" ;; + f) NOFAIL=1 ; bugout "Continue on Fail" ;; h) EXIT_USAGE=1 ; break ;; l) LIMIT=$OPTARG ; bugout "Limit to $LIMIT build(s)" ;; - d|v) DEBUG=1 ; bugout "Debug ON" ;; n) DRYRUN=1 ; bugout "Dry Run" ;; + o) OUTBASE="${OPTARG%/}" ; bugout "Archive to $OUTBASE" ;; p) PURGE=1 ; bugout "Purge stat file" ;; + r) ISRES=1 ; FIRST_CONF=$OPTARG ; bugout "Resume: $FIRST_CONF" ;; + s) CONTSKIP=1 ; bugout "Continue, skipping" ;; -) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}" case "$ONAM" in archive) ARCHIVE=1 ; bugout "Archiving" ;; diff --git a/buildroot/bin/build_example b/buildroot/bin/build_example index 2d558310ad57..566919abd665 100755 --- a/buildroot/bin/build_example +++ b/buildroot/bin/build_example @@ -53,16 +53,17 @@ EXPNUM= NOFAIL= OUTBASE= BUILDINDEX=1 -while getopts 'ab:c:e:fhin:o:r-:' OFLAG; do + +while getopts 'ab:c:e:fhn:o:r-:' OFLAG; do case "${OFLAG}" in a) ARCHIVE=1 ;; b) BASE="${OPTARG%/}" ;; c) CONFIG="${OPTARG%/}" ;; e) EXPNUM="$OPTARG" ;; + f) NOFAIL=1 ;; + h) EXIT_USAGE=1 ; break ;; n) BUILDINDEX="$OPTARG" ;; o) OUTBASE="${OPTARG%/}" ;; - h) EXIT_USAGE=1 ; break ;; - f) NOFAIL=1 ;; r) REVEAL=1 ;; -) ONAM="${OPTARG%%=*}" ; OVAL="${OPTARG#*=}" case "$ONAM" in @@ -159,11 +160,12 @@ ENAME=("-name" "marlin_config.json" \ "-o" "-name" "schema.yml") # Possible built firmware names (in the build folder) -BNAME=("-name" 'firmware*.hex' \ +BNAME=("-name" "firmware*.hex" \ "-o" "-name" "firmware*.bin" \ "-o" "-name" "project*.bin" \ "-o" "-name" "Robin*.bin" \ - "-o" "-name" "main_*.bin") + "-o" "-name" "main_*.bin" \ + "-o" "-name" "MarlinSimulator*") mkdir -p "$BUILD" @@ -171,10 +173,10 @@ mkdir -p "$BUILD" if [[ $EXPNUM ]]; then opt_set CONFIG_EXPORT $EXPNUM # Clean up old exports - find "$BUILD" \( "${ENAME[@]}" \) -exec rm "{}" \; + find "$BUILD" -type f \( "${ENAME[@]}" \) -exec rm "{}" \; fi -((ARCHIVE)) && find "$BUILD" \( "${BNAME[@]}" \) -exec rm "{}" \; +((ARCHIVE)) && find "$BUILD" -type f \( "${BNAME[@]}" \) -exec rm "{}" \; set +e @@ -200,7 +202,7 @@ else if [[ -n $EXPNUM ]]; then annc "Exporting $EXPNUM" [[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$ARCSUB"/Config.h ; } - find "$BUILD" \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \; + find "$BUILD" -type f \( "${ENAME[@]}" \) -exec cp "{}" "$ARCSUB" \; fi # Copy potential firmware files into the config folder @@ -208,21 +210,30 @@ else # Currently only BOARD_CREALITY_F401RE env:STM32F401RE_creality if ((ARCHIVE)); then annc "Archiving" - rm -f "$ARCSUB"/*.tar.gz "$ARCSUB"/*.sha256.txt - find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c ' - ARCSUB="$1" - CONFIG="$2" - shift 2 - for FILE in "$@"; do - cd "${FILE%/*}" - NAME=${FILE##*/} - SHRT=${NAME%.*} - SHASUM=$(sha256sum "$NAME" | cut -d" " -f1) - tar -czf "$ARCSUB/$SHRT.tar.gz" "$NAME" - echo "$CONFIG\n$SHASUM" > "$ARCSUB/$NAME.sha256.txt" - rm "$NAME" - cd - >/dev/null - done + find "$BUILD" -type f \( "${BNAME[@]}" \) -exec sh -c ' + ARCSUB="$1" ; CONFIG="$2" ; FILE="$3" ; shift 3 + NAME=${FILE##*/} ; SHRT=${NAME%.*} ; DIR=${FILE%/*} + ZIPX= + if [[ $CONFIG == *Simulator* ]]; then + case $(uname | tr '[:upper:]' '[:lower:]') in + darwin) SUB="macOS" ; ZIPX="-X" ;; + *linux) SUB="Linux" ;; + win*) SUB="Windows" ;; + msys*) SUB="Windows" ;; + cygwin*) SUB="Windows" ;; + mingw*) SUB="Windows" ;; + *) SUB='Unix' ;; + esac + ARCH=$(uname -m | tr '[:lower:]' '[:upper:]') + ARCSUB="$ARCSUB/$SUB-$ARCH" + fi + mkdir -p "$ARCSUB" + rm -f "$ARCSUB"/*.zip "$ARCSUB"/*.sha256.txt + cd "$DIR" + SHASUM=$(sha256sum "$NAME" | cut -d" " -f1) + echo "$CONFIG\n$SHASUM" > "$ARCSUB/$NAME.sha256.txt" + zip $ZIPX "$ARCSUB/$SHRT.zip" "$NAME" && rm "$NAME" + cd - >/dev/null ' sh "$ARCSUB" "$CONFIG" {} + fi diff --git a/buildroot/bin/mftest b/buildroot/bin/mftest index b6f78e4f42e8..57aa95400cec 100755 --- a/buildroot/bin/mftest +++ b/buildroot/bin/mftest @@ -16,23 +16,24 @@ bugout() { ((DEBUG)) && echo -e "\033[0;32m$1\033[0m" ; } usage() { echo " -Usage: mftest [-t|--env=] [-n|--num=] [-m|--make] [-y|--build=] - mftest [-a|--autobuild] +Usage: mftest [-a|--autobuild] mftest [-r|--rebuild] mftest [-s|--silent] + mftest [-t|--env=] [-n|--num=] [-m|--make] [-y|--build=] mftest [-u|--autoupload] [-n|--num=] OPTIONS - -t --env The environment to apply / run, or the menu index number. - -n --num The index of the test to run. (In file order.) - -m --make Use the make / Docker method for the build. - -y --build Skip 'Do you want to build this test?' and assume YES. - -h --help Print this help. -a --autobuild PIO Build using the MOTHERBOARD environment. + -d --default Restore to defaults before applying configs. + -h --help Print this help. + -m --make Use the make / Docker method for the build. + -n --num The index of the test to run. (In file order.) + -r --rebuild Rebuild previous PIO Build. + -s --silent Silence build output from PlatformIO. + -t --env The environment to apply / run, or the menu index number. -u --autoupload PIO Upload using the MOTHERBOARD environment. -v --verbose Extra output for debugging. - -s --silent Silence build output from PlatformIO. - -d --default Restore to defaults before applying configs. + -y --build Skip 'Do you want to build this test?' and assume YES. env shortcuts: tree due esp lin lp8|lpc8 lp9|lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41 " @@ -56,7 +57,7 @@ TESTENV='-' CHOICE=0 DEBUG=0 -while getopts 'abdhmrsuvyn:t:-:' OFLAG; do +while getopts 'adhmn:rst:uvy-:' OFLAG; do case "${OFLAG}" in a) AUTO_BUILD=1 ; bugout "Auto-Build target..." ;; d) DL_DEFAULTS=1 ; bugout "Restore to defaults..." ;; diff --git a/buildroot/share/PlatformIO/scripts/schema.py b/buildroot/share/PlatformIO/scripts/schema.py index f522632bbb1f..d5179d43b5ed 100755 --- a/buildroot/share/PlatformIO/scripts/schema.py +++ b/buildroot/share/PlatformIO/scripts/schema.py @@ -126,7 +126,7 @@ class Parse: sid = 0 # Loop through files and parse them line by line for fn, fk in filekey.items(): - with Path("Marlin", fn).open() as fileobj: + with Path("Marlin", fn).open(encoding='utf-8') as fileobj: section = 'none' # Current Settings section line_number = 0 # Counter for the line number of the file conditions = [] # Create a condition stack for the current file @@ -343,14 +343,14 @@ def atomize(s): # Type is based on the value value_type = \ 'switch' if val == '' \ - else 'bool' if re.match(r'^(true|false)$', val) \ else 'int' if re.match(r'^[-+]?\s*\d+$', val) \ else 'ints' if re.match(r'^([-+]?\s*\d+)(\s*,\s*[-+]?\s*\d+)+$', val) \ else 'floats' if re.match(rf'({flt}(\s*,\s*{flt})+)', val) \ else 'float' if re.match(f'^({flt})$', val) \ else 'string' if val[0] == '"' \ else 'char' if val[0] == "'" \ - else 'state' if re.match(r'^(LOW|HIGH)$', val) \ + else 'bool' if val in ('true', 'false') \ + else 'state' if val in ('HIGH', 'LOW') \ else 'enum' if re.match(r'^[A-Za-z0-9_]{3,}$', val) \ else 'int[]' if re.match(r'^{\s*[-+]?\s*\d+(\s*,\s*[-+]?\s*\d+)*\s*}$', val) \ else 'float[]' if re.match(r'^{{\s*{flt}(\s*,\s*{flt})*\s*}}$', val) \ @@ -385,7 +385,7 @@ def atomize(s): units = re.match(r'^\(([^)]+)\)', full_comment) if units: units = units[1] - if units == 's' or units == 'sec': units = 'seconds' + if units in ('s', 'sec'): units = 'seconds' define_info['units'] = units if 'comment' not in define_info or define_info['comment'] == '': @@ -428,12 +428,12 @@ def extract(): return extract_files({ 'Configuration.h':'basic', 'Configuration_adv.h':'advanced' }) def dump_json(schema:dict, jpath:Path): - with jpath.open('w') as jfile: + with jpath.open('w', encoding='utf-8') as jfile: json.dump(schema, jfile, ensure_ascii=False, indent=2) def dump_yaml(schema:dict, ypath:Path): import yaml - with ypath.open('w') as yfile: + with ypath.open('w', encoding='utf-8') as yfile: yaml.dump(schema, yfile, default_flow_style=False, width=120, indent=2) def main(): diff --git a/ini/lpc176x.ini b/ini/lpc176x.ini index 4551ef0da1d6..28c6546f06f2 100644 --- a/ini/lpc176x.ini +++ b/ini/lpc176x.ini @@ -14,7 +14,7 @@ # [common_LPC] platform = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.3.zip -platform_packages = framework-arduino-lpc176x@^0.2.9 +platform_packages = framework-arduino-lpc176x@https://github.com/p3p/pio-framework-arduino-lpc176x/archive/ab41696b64.zip toolchain-gccarmnoneeabi@1.100301.220327 board = nxp_lpc1768 lib_ldf_mode = off