From 9a04c32f7fb9fc7a764f697f8e2a4f2faa67ddad Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 26 Aug 2024 00:24:58 +0000 Subject: [PATCH 01/18] [cron] Bump distribution date (2024-08-26) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 6feedc9c5966..a63f22011f2c 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-08-25" +//#define STRING_DISTRIBUTION_DATE "2024-08-26" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 35d3b9e37521..9b98462291e3 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-08-25" + #define STRING_DISTRIBUTION_DATE "2024-08-26" #endif /** From 2cb252da4a97d31b4affa8f05099448b650fcbb0 Mon Sep 17 00:00:00 2001 From: narno2202 <130909513+narno2202@users.noreply.github.com> Date: Mon, 26 Aug 2024 06:20:11 +0200 Subject: [PATCH 02/18] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20FT=5FMOTION=20compil?= =?UTF-8?q?e=20(#27367)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/ft_motion.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/module/ft_motion.cpp b/Marlin/src/module/ft_motion.cpp index d63ca9f25df2..b999dec7cb12 100644 --- a/Marlin/src/module/ft_motion.cpp +++ b/Marlin/src/module/ft_motion.cpp @@ -92,12 +92,12 @@ uint32_t FTMotion::interpIdx = 0; // Index of current data point b // Shaping variables. #if HAS_FTM_SHAPING FTMotion::shaping_t FTMotion::shaping = { - 0, + 0 #if HAS_X_AXIS - x:{ false, { 0.0f }, { 0.0f }, { 0 }, 0 } // ena, d_zi[], Ai[], Ni[], max_i + , x:{ false, { 0.0f }, { 0.0f }, { 0 }, 0 } // ena, d_zi[], Ai[], Ni[], max_i #endif #if HAS_Y_AXIS - y:{ false, { 0.0f }, { 0.0f }, { 0 }, 0 } // ena, d_zi[], Ai[], Ni[], max_i + , y:{ false, { 0.0f }, { 0.0f }, { 0 }, 0 } // ena, d_zi[], Ai[], Ni[], max_i #endif }; #endif From d193c814d3a00ae53d7036ade200ea94f7c8b474 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 24 Aug 2024 23:59:04 -0500 Subject: [PATCH 03/18] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20misc=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/HC32/sysclock.cpp | 2 +- Marlin/src/feature/leds/pca9632.cpp | 2 +- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 11 ++++++----- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 7 +++---- Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp | 4 ++-- Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp | 1 - 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Marlin/src/HAL/HC32/sysclock.cpp b/Marlin/src/HAL/HC32/sysclock.cpp index 3057da1a02b0..475be3bbc9cb 100644 --- a/Marlin/src/HAL/HC32/sysclock.cpp +++ b/Marlin/src/HAL/HC32/sysclock.cpp @@ -97,7 +97,7 @@ void core_hook_sysclock_init() { #endif // sysclk is now configured according to F_CPU (i.e., 200MHz PLL output) - constexpr uint32_t sysclock = F_CPU; + const uint32_t sysclock = F_CPU; // Setup clock divisors for sysclk = 200 MHz // Note: PCLK1 is used for step+temp timers, and need to be kept at 50 MHz (until there is a better solution) diff --git a/Marlin/src/feature/leds/pca9632.cpp b/Marlin/src/feature/leds/pca9632.cpp index 07c379a8154a..40c16a9276a6 100644 --- a/Marlin/src/feature/leds/pca9632.cpp +++ b/Marlin/src/feature/leds/pca9632.cpp @@ -148,7 +148,7 @@ void PCA9632_set_led_color(const LEDColor &color) { #if ENABLED(PCA9632_BUZZER) - void PCA9632_buzz(const long, const uint16_t=0) { + void PCA9632_buzz(const long, const uint16_t/*=0*/) { uint8_t data[] = PCA9632_BUZZER_DATA; Wire.beginTransmission(I2C_ADDRESS(PCA9632_ADDRESS)); Wire.write(data, sizeof(data)); diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 435f40e3a4a0..071a88e4753d 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -833,8 +833,6 @@ void MarlinUI::draw_status_message(const bool blink) { #if HAS_PRINT_PROGRESS #define TPOFFSET (LCD_WIDTH - 1) - static uint8_t timepos = TPOFFSET - 6; - static char buffer[8]; #if ENABLED(SHOW_PROGRESS_PERCENT) static lcd_uint_t pc = 0, pr = 2; @@ -853,8 +851,9 @@ void MarlinUI::draw_status_message(const bool blink) { #if ENABLED(SHOW_REMAINING_TIME) void MarlinUI::drawRemain() { if (printJobOngoing()) { + char buffer[8]; const duration_t remaint = get_remaining_time(); - timepos = TPOFFSET - remaint.toDigital(buffer); + const uint8_t timepos = TPOFFSET - remaint.toDigital(buffer); IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20)); lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'R'); lcd_put_u8str(buffer); @@ -866,7 +865,8 @@ void MarlinUI::draw_status_message(const bool blink) { void MarlinUI::drawInter() { const duration_t interactt = interaction_time; if (printingIsActive() && interactt.value) { - timepos = TPOFFSET - interactt.toDigital(buffer); + char buffer[8]; + const uint8_t timepos = TPOFFSET - interactt.toDigital(buffer); IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20)); lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'C'); lcd_put_u8str(buffer); @@ -877,8 +877,9 @@ void MarlinUI::draw_status_message(const bool blink) { #if ENABLED(SHOW_ELAPSED_TIME) void MarlinUI::drawElapsed() { if (printJobOngoing()) { + char buffer[8]; const duration_t elapsedt = print_job_timer.duration(); - timepos = TPOFFSET - elapsedt.toDigital(buffer); + const uint8_t timepos = TPOFFSET - elapsedt.toDigital(buffer); IF_DISABLED(LCD_INFO_SCREEN_STYLE, lcd_put_lchar(timepos - 1, 2, 0x20)); lcd_put_lchar(TERN(LCD_INFO_SCREEN_STYLE, 11, timepos), 2, 'E'); lcd_put_u8str(buffer); diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index eb4ce135db37..6a80044a34db 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -601,7 +601,6 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const #if HAS_PRINT_PROGRESS // UNTESTED!!! #define TPOFFSET (LCD_WIDTH - 1) - static uint8_t timepos = TPOFFSET - 6; #if ENABLED(SHOW_PROGRESS_PERCENT) void MarlinUI::drawPercent() { @@ -619,7 +618,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const if (printJobOngoing()) { const duration_t remaint = ui.get_remaining_time(); char buffer[10]; - timepos = TPOFFSET - remaint.toDigital(buffer); + const uint8_t timepos = TPOFFSET - remaint.toDigital(buffer); lcd_moveto(timepos, 1); lcd.write('R'); lcd.print(buffer); @@ -631,7 +630,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const const duration_t interactt = ui.interaction_time; if (printingIsActive() && interactt.value) { char buffer[10]; - timepos = TPOFFSET - interactt.toDigital(buffer); + const uint8_t timepos = TPOFFSET - interactt.toDigital(buffer); lcd_moveto(timepos, 1); lcd.write('C'); lcd.print(buffer); @@ -643,7 +642,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const if (printJobOngoing()) { const duration_t elapsedt = print_job_timer.duration(); char buffer[10]; - timepos = TPOFFSET - elapsedt.toDigital(buffer); + const uint8_t timepos = TPOFFSET - elapsedt.toDigital(buffer); lcd_moveto(timepos, 1); lcd.write('E'); lcd.print(buffer); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp index d408b49e83fb..a0551fa28c3e 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp @@ -804,13 +804,13 @@ void DGUSRxHandler::pidSetTemp(DGUS_VP &vp, void *data_ptr) { return; } - uint16_t temp = BE16_P(data_ptr); + celsius_t temp = BE16_P(data_ptr); switch (screen.pid_heater) { default: return; #if HAS_HEATED_BED case DGUS_Data::Heater::BED: - LIMIT(temp, BED_MINTEMP, BED_MAX_TARGET); + LIMIT(temp, celsius_t(BED_MINTEMP), celsius_t(BED_MAX_TARGET)); break; #endif #if HAS_HOTEND diff --git a/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp b/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp index b7a27a253b39..400b29470187 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_number_key.cpp @@ -68,7 +68,6 @@ enum { static void disp_key_value() { char *temp; - TERN_(HAS_TRINAMIC_CONFIG, float milliamps); switch (value) { default: break; From 4c1f76567c9aff79bd4683df63743cc1a723ed16 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 25 Aug 2024 23:03:18 -0500 Subject: [PATCH 04/18] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20build?= =?UTF-8?q?=5Fall=5Fexamples=20--base=20--archive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/build_all_examples | 74 +++++++++++++++++++------------- buildroot/bin/build_example | 31 +++++++++---- 2 files changed, 67 insertions(+), 38 deletions(-) diff --git a/buildroot/bin/build_all_examples b/buildroot/bin/build_all_examples index 13f976c787a1..ccfc461c7678 100755 --- a/buildroot/bin/build_all_examples +++ b/buildroot/bin/build_all_examples @@ -3,6 +3,7 @@ # Usage: # # build_all_examples [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x) +# [-B|--base] - Base path of configurations, overriding -b # [-c|--continue] - Continue the paused build # [-p|--purge] - Purge the status file and start over # [-s|--skip] - Continue the paused build, skipping one @@ -10,6 +11,7 @@ # [-e|--export=N] - Set CONFIG_EXPORT and export into each config folder # [-d|--debug] - Print extra debug output (after) # [-l|--limit=#] - Limit the number of builds in this run +# [-a|--archive] - Copy the binary to the export location # [-n|--nobuild] - Don't actually build anything # [-f|--nofail] - Don't stop on a failed build # [-h|--help] - Print usage and exit @@ -25,6 +27,7 @@ STAT_FILE=./.pio/.buildall usage() { echo "Usage: build_all_examples [-b|--branch=] - Branch to fetch from Configurations repo (import-2.1.x) + [-B|--base] - Base path of configurations, overriding -b [-c|--continue] - Continue the paused build [-p|--purge] - Purge the status file and start over [-s|--skip] - Continue the paused build, skipping one @@ -32,6 +35,7 @@ build_all_examples [-b|--branch=] - Branch to fetch from Configurations [-e|--export=N] - Set CONFIG_EXPORT and export into each config folder [-d|--debug] - Print extra debug output (after) [-l|--limit=#] - Limit the number of builds in this run + [-a|--archive] - Copy the binary to the export location [-n|--nobuild] - Don't actually build anything [-f|--nofail] - Don't stop on a failed build [-h|--help] - Print usage and exit @@ -44,32 +48,36 @@ unset FIRST_CONF EXIT_USAGE= LIMIT=1000 -while getopts 'b:ce:fdhl:npr:sv-:' OFLAG; do +while getopts 'aB:b:ce:fdhl:npr:sv-:' OFLAG; do case "${OFLAG}" in - b) BRANCH=$OPTARG ; bugout "Branch: $BRANCH" ;; - f) NOFAIL=1 ; bugout "Continue on Fail" ;; + a) ARCHIVE=1 ; bugout "Archiving" ;; + B) OPATH="$OPTARG" ; bugout "Base: $OPATH" ;; + 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" ;; - e) CEXPORT="$OPTARG" ; bugout "Export $CEXPORT" ;; + c) CONTINUE=1 ; bugout "Continue" ;; + s) CONTSKIP=1 ; bugout "Continue, skipping" ;; + e) CEXPORT="$OPTARG" ; bugout "Export $CEXPORT" ;; 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" ;; - p) PURGE=1 ; bugout "Purge stat file" ;; + l) LIMIT=$OPTARG ; bugout "Limit to $LIMIT build(s)" ;; + d|v) DEBUG=1 ; bugout "Debug ON" ;; + n) DRYRUN=1 ; bugout "Dry Run" ;; + p) PURGE=1 ; bugout "Purge stat file" ;; -) IFS="=" read -r ONAM OVAL <<< "$OPTARG" case "$ONAM" in - branch) BRANCH=$OVAL ; bugout "Branch: $BRANCH" ;; - nofail) NOFAIL=1 ; bugout "Continue on Fail" ;; + archive) ARCHIVE=1 ; bugout "Archiving" ;; + base) OPATH="$OVAL" ; bugout "Base: $OPATH" ;; + branch) BRANCH=$OVAL ; bugout "Branch: $BRANCH" ;; + nofail) NOFAIL=1 ; bugout "Continue on Fail" ;; resume) ISRES=1 ; FIRST_CONF="$OVAL" ; bugout "Resume: $FIRST_CONF" ;; - continue) CONTINUE=1 ; bugout "Continue" ;; - skip) CONTSKIP=1 ; bugout "Continue, skipping" ;; - export) CEXPORT="$OVAL" ; bugout "Export $EXPORT" ;; - limit) LIMIT=$OVAL ; bugout "Limit to $LIMIT build(s)" ;; + continue) CONTINUE=1 ; bugout "Continue" ;; + skip) CONTSKIP=1 ; bugout "Continue, skipping" ;; + export) CEXPORT="$OVAL"; bugout "Export $EXPORT" ;; + limit) LIMIT=$OVAL ; bugout "Limit to $LIMIT build(s)" ;; help) [[ -z "$OVAL" ]] || perror "option can't take value $OVAL" $ONAM ; EXIT_USAGE=1 ;; - debug) DEBUG=1 ; bugout "Debug ON" ;; - nobuild) DRYRUN=1 ; bugout "Dry Run" ;; - purge) PURGE=1 ; bugout "Purge stat file" ;; + debug) DEBUG=1 ; bugout "Debug ON" ;; + nobuild) DRYRUN=1 ; bugout "Dry Run" ;; + purge) PURGE=1 ; bugout "Purge stat file" ;; *) EXIT_USAGE=2 ; echo "$SELF: unrecognized option \`--$ONAM'" ; break ;; esac ;; @@ -117,18 +125,22 @@ else fi # Create a temporary folder inside .pio -TMP=./.pio/build-$BRANCH -[[ -d "$TMP" ]] || mkdir -p $TMP - -# Download Configurations into the temporary folder -if [[ ! -e "$TMP/README.md" ]]; then - echo "Fetching Configurations from GitHub to $TMP" - git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$TMP" || { echo "Failed to clone the configuration repository"; exit ; } +if [[ -n $OPATH ]]; then + TMP=$OPATH + [[ -d "$TMP" ]] || { echo "Given base -B $TMP not found." ; exit ; } else - echo "Using cached Configurations at $TMP" + # Make a Configurations temporary folder if needed + TMP=./.pio/build-$BRANCH + [[ -d "$TMP" ]] || mkdir -p $TMP + # Download the specified Configurations branch if needed + if [[ ! -e "$TMP/README.md" ]]; then + echo "Fetching Configurations from GitHub to $TMP" + git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$TMP" || { echo "Failed to clone the configuration repository"; exit ; } + fi fi -echo -e "Start build...\n=====================" +# Build +echo -e "=====================\nProceed with builds...\n=====================" shopt -s nullglob IFS=' ' @@ -146,7 +158,7 @@ for CONF in $CONF_TREE ; do # If skipping, don't build the found one [[ $SKIP_CONF ]] && { unset SKIP_CONF ; continue ; } - # ...if skipping, don't build this one + # At least one config file is required here compgen -G "${CONF}Con*.h" > /dev/null || continue # Command arguments for 'build_example' @@ -158,6 +170,9 @@ for CONF in $CONF_TREE ; do # Continue on fail? Add -n argument ((NOFAIL)) && CARGS+=("-n") + # Archive the build? Add -a argument + ((ARCHIVE)) && CARGS+=("-a") + # Build or print build command for --nobuild if [[ $DRYRUN ]]; then echo -e "\033[0;32m[DRYRUN] build_example ${CARGS[@]}\033[0m" @@ -165,6 +180,7 @@ for CONF in $CONF_TREE ; do # Remember where we are in case of failure echo "${BRANCH}*${DIR}" >"$STAT_FILE" ((DEBUG)) && echo "\"$HERE/build_example\" ${CARGS[@]}" + # Invoke build_example "$HERE"/build_example "${CARGS[@]}" || { echo "Failed to build $DIR" ; exit ; } fi diff --git a/buildroot/bin/build_example b/buildroot/bin/build_example index c32ee7360a6d..d796a5587bad 100755 --- a/buildroot/bin/build_example +++ b/buildroot/bin/build_example @@ -2,29 +2,34 @@ # # Usage: # -# build_example -b|--base= - Configurations root folder (e.g., ./.pio/build-BRANCH) -# -c|--config= - Path of the configs to build (within config/examples) +# build_example -b|--base= - Configurations root folder (e.g., ./.pio/build-BRANCH) +# -c|--config= - Sub-path of the configs to build (within config/examples) # [-e|--export=N] - Set CONFIG_EXPORT before build and export into the config folder # [-n|--nofail] - Don't stop on a failed build # [-r|--reveal] - Reveal the config folder after the build # [-h|--help] - Print usage and exit +# [-a|--archive] - Archive the build (to the export location) # [--allow] - Allow this script to run standalone # HERE=`dirname $0` -. "$HERE/mfutil" +source "$HERE/mfutil" + +annc() { echo -e "\033[0;32m$1\033[0m" ; } # Get arguments CLEANER=1 ALLOW="" +ARCHIVE="" BASE="" CONFIG="" REVEAL="" EXPNUM="" NOFAIL="" -while getopts 'b:c:e:hinr-:' OFLAG; do +while getopts 'ab:c:e:hinr-:' OFLAG; do case "${OFLAG}" in + a) ARCHIVE=1 ;; b) BASE="$OPTARG" ;; c) CONFIG="$OPTARG" ;; e) EXPNUM="$OPTARG" ;; @@ -33,6 +38,7 @@ while getopts 'b:c:e:hinr-:' OFLAG; do r) REVEAL=1 ;; -) IFS="=" read -r ONAM OVAL <<< "$OPTARG" case "$ONAM" in + archive) ARCHIVE=1 ;; allow) ALLOW=1 ;; base) BASE="$OVAL" ;; config) CONFIG="$OVAL" ;; @@ -53,7 +59,7 @@ SUB1="$BASE/config/examples" [[ -d "$SUB1" ]] || { echo "--base $BASE doesn't contain config/examples" ; exit 1 ; } # Make sure the specific config folder exists -SUB=$SUB1/$CONFIG +SUB="$SUB1/$CONFIG" [[ -d "$SUB" ]] || { echo "--config $CONFIG doesn't exist" ; exit 1 ; } compgen -G "${SUB}Con*.h" > /dev/null || { echo "No configuration files found in $SUB" ; exit 1 ; } @@ -90,6 +96,7 @@ if ((CLEANER)); then opt_add NO_LCD_CONTRAST_WARNING opt_add NO_MICROPROBE_WARNING opt_add NO_CONFIGURATION_EMBEDDING_WARNING + opt_add NO_HOMING_CURRENT_WARNING fi FNAME=("-name" "marlin_config.json" \ @@ -97,6 +104,8 @@ FNAME=("-name" "marlin_config.json" \ "-o" "-name" "schema.json" \ "-o" "-name" "schema.yml") +BNAME=("-name" "*.bin" "-o" "-name" "*.hex") + # If EXPNUM is set then apply to the config before build if [[ $EXPNUM ]]; then opt_set CONFIG_EXPORT $EXPNUM @@ -104,9 +113,11 @@ if [[ $EXPNUM ]]; then find ./.pio/build \( "${FNAME[@]}" \) -exec rm "{}" \; fi +((ARCHIVE)) && find ./.pio/build \( "${BNAME[@]}" \) -exec rm "{}" \; + set +e -echo "Building the firmware now..." +echo "Building example $CONFIG ..." "$HERE/mftest" -s -a -n1 ; ERR=$? [[ $ERR -eq 0 ]] && echo "Success" || echo "Failed" @@ -114,16 +125,18 @@ echo "Building the firmware now..." set -e # Copy exports back to the configs -if [[ $EXPNUM ]]; then - echo "Exporting $EXPNUM" +if [[ -n $EXPNUM ]]; then + annc "Exporting $EXPNUM" [[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$SUB"/Config.h ; } find ./.pio/build/ "${FNAME[@]}" -exec cp "{}" "$SUB" \; fi +((ARCHIVE)) && { annc "Archiving" ; find ./.pio/build \( "${BNAME[@]}" \) -exec cp "{}" "$SUB" \; ; } + # Exit with error unless --nofail is set [[ $ERR -gt 0 && -z $NOFAIL ]] && exit $ERR # Reveal the configs after the build, if requested -((REVEAL)) && { echo "Revealing $SUB" ; open "$SUB" ; } +((REVEAL)) && { annc "Revealing $SUB" ; open "$SUB" ; } exit 0 From bb73c335a52f629ee75697e87efd5a4a70fc57a1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 26 Aug 2024 12:24:09 -0500 Subject: [PATCH 05/18] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Ender-3=20S1=20Plus?= =?UTF-8?q?=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/lcd/extui/dgus_e3s1pro/DGUSSDCardHandler.h | 2 +- Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Data.h | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 78164ade7b3e..633efc1e2f8b 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1206,7 +1206,7 @@ #if !HAS_MARLINUI_HD44780 #undef LCD_INFO_SCREEN_STYLE #endif -#if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI) +#if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI, DGUS_LCD_UI_E3S1PRO) #undef LCD_LANGUAGE #endif diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSSDCardHandler.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSSDCardHandler.h index 884418427183..22fb4894964e 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSSDCardHandler.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSSDCardHandler.h @@ -22,7 +22,7 @@ #pragma once #include -#include "../../../sd/cardreader.h" +#include "../../../sd/SdFatConfig.h" #define DGUS_E3S1PRO_BASIC_SDCARD_MAX_FILES 20 #define DGUS_E3S1PRO_BASIC_SDCARD_FILES_PER_PAGE 5 diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Data.h b/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Data.h index 237cec779587..05f9a1db43e6 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Data.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/config/DGUS_Data.h @@ -23,6 +23,13 @@ #include +#include "../../../../inc/MarlinConfigPre.h" + +#ifndef LCD_LANGUAGE + #define LCD_LANGUAGE en + #warning "LCD_LANGUAGE not defined, defaulting to English." +#endif + namespace DGUS_Data { // RX constants From 90e5826256018b351e16fbdcc3dbbc0073343ccf Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 26 Aug 2024 12:02:22 -0500 Subject: [PATCH 06/18] =?UTF-8?q?=F0=9F=94=A7=20No=20"base"=20needed=20for?= =?UTF-8?q?=20minimal=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/BaseConfiguration.h | 1331 ----------- Marlin/src/inc/BaseConfiguration_adv.h | 2491 -------------------- Marlin/src/inc/MarlinConfigPre.h | 11 +- Marlin/src/inc/Warnings.cpp | 2 +- buildroot/share/scripts/makeBaseConfigs.py | 97 - 5 files changed, 5 insertions(+), 3927 deletions(-) delete mode 100644 Marlin/src/inc/BaseConfiguration.h delete mode 100644 Marlin/src/inc/BaseConfiguration_adv.h delete mode 100755 buildroot/share/scripts/makeBaseConfigs.py diff --git a/Marlin/src/inc/BaseConfiguration.h b/Marlin/src/inc/BaseConfiguration.h deleted file mode 100644 index 0a8229bb6369..000000000000 --- a/Marlin/src/inc/BaseConfiguration.h +++ /dev/null @@ -1,1331 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * BaseConfiguration.h - Generated using makeBaseConfigs.py - */ - -#ifndef CONFIGURATION_H_VERSION - #define CONFIGURATION_H_VERSION 02010300 -#endif -#ifndef STRING_CONFIG_H_AUTHOR - #define STRING_CONFIG_H_AUTHOR "(none, default config)" -#endif -#ifndef MOTHERBOARD - #define MOTHERBOARD BOARD_RAMPS_14_EFB -#endif -#ifndef SERIAL_PORT - #define SERIAL_PORT 0 -#endif -#ifndef BAUDRATE - #define BAUDRATE 250000 -#endif -#ifndef X_DRIVER_TYPE - #define X_DRIVER_TYPE A4988 -#endif -#ifndef Y_DRIVER_TYPE - #define Y_DRIVER_TYPE A4988 -#endif -#ifndef Z_DRIVER_TYPE - #define Z_DRIVER_TYPE A4988 -#endif -#ifndef E0_DRIVER_TYPE - #define E0_DRIVER_TYPE A4988 -#endif -#ifdef I_DRIVER_TYPE - #ifndef AXIS4_NAME - #define AXIS4_NAME 'A' - #endif -#endif -#ifdef J_DRIVER_TYPE - #ifndef AXIS5_NAME - #define AXIS5_NAME 'B' - #endif -#endif -#ifdef K_DRIVER_TYPE - #ifndef AXIS6_NAME - #define AXIS6_NAME 'C' - #endif -#endif -#ifdef U_DRIVER_TYPE - #ifndef AXIS7_NAME - #define AXIS7_NAME 'U' - #endif -#endif -#ifdef V_DRIVER_TYPE - #ifndef AXIS8_NAME - #define AXIS8_NAME 'V' - #endif -#endif -#ifdef W_DRIVER_TYPE - #ifndef AXIS9_NAME - #define AXIS9_NAME 'W' - #endif -#endif -#ifndef EXTRUDERS - #define EXTRUDERS 1 -#endif -#ifndef DEFAULT_NOMINAL_FILAMENT_DIA - #define DEFAULT_NOMINAL_FILAMENT_DIA 1.75 -#endif -#if ENABLED(SWITCHING_EXTRUDER) - #ifndef SWITCHING_EXTRUDER_SERVO_NR - #define SWITCHING_EXTRUDER_SERVO_NR 0 - #endif - #ifndef SWITCHING_EXTRUDER_SERVO_ANGLES - #define SWITCHING_EXTRUDER_SERVO_ANGLES { 0, 90 } - #endif - #if EXTRUDERS > 3 - #ifndef SWITCHING_EXTRUDER_E23_SERVO_NR - #define SWITCHING_EXTRUDER_E23_SERVO_NR 1 - #endif - #endif -#endif -#if ENABLED(SWITCHING_NOZZLE) - #ifndef SWITCHING_NOZZLE_SERVO_NR - #define SWITCHING_NOZZLE_SERVO_NR 0 - #endif - #ifndef SWITCHING_NOZZLE_SERVO_ANGLES - #define SWITCHING_NOZZLE_SERVO_ANGLES { 0, 90 } - #endif - #ifndef SWITCHING_NOZZLE_SERVO_DWELL - #define SWITCHING_NOZZLE_SERVO_DWELL 2500 - #endif -#endif -#if ANY(PARKING_EXTRUDER, MAGNETIC_PARKING_EXTRUDER) - #ifndef PARKING_EXTRUDER_PARKING_X - #define PARKING_EXTRUDER_PARKING_X { -78, 184 } - #endif - #ifndef PARKING_EXTRUDER_GRAB_DISTANCE - #define PARKING_EXTRUDER_GRAB_DISTANCE 1 - #endif - #if ENABLED(PARKING_EXTRUDER) - #ifndef PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE - #define PARKING_EXTRUDER_SOLENOIDS_PINS_ACTIVE LOW - #endif - #ifndef PARKING_EXTRUDER_SOLENOIDS_DELAY - #define PARKING_EXTRUDER_SOLENOIDS_DELAY 250 - #endif - #elif ENABLED(MAGNETIC_PARKING_EXTRUDER) - #ifndef MPE_FAST_SPEED - #define MPE_FAST_SPEED 9000 - #endif - #ifndef MPE_SLOW_SPEED - #define MPE_SLOW_SPEED 4500 - #endif - #ifndef MPE_TRAVEL_DISTANCE - #define MPE_TRAVEL_DISTANCE 10 - #endif - #ifndef MPE_COMPENSATION - #define MPE_COMPENSATION 0 - #endif - #endif -#endif -#if ANY(SWITCHING_TOOLHEAD, MAGNETIC_SWITCHING_TOOLHEAD, ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #ifndef SWITCHING_TOOLHEAD_Y_POS - #define SWITCHING_TOOLHEAD_Y_POS 235 - #endif - #ifndef SWITCHING_TOOLHEAD_Y_SECURITY - #define SWITCHING_TOOLHEAD_Y_SECURITY 10 - #endif - #ifndef SWITCHING_TOOLHEAD_Y_CLEAR - #define SWITCHING_TOOLHEAD_Y_CLEAR 60 - #endif - #ifndef SWITCHING_TOOLHEAD_X_POS - #define SWITCHING_TOOLHEAD_X_POS { 215, 0 } - #endif - #if ENABLED(SWITCHING_TOOLHEAD) - #ifndef SWITCHING_TOOLHEAD_SERVO_NR - #define SWITCHING_TOOLHEAD_SERVO_NR 2 - #endif - #ifndef SWITCHING_TOOLHEAD_SERVO_ANGLES - #define SWITCHING_TOOLHEAD_SERVO_ANGLES { 0, 180 } - #endif - #elif ENABLED(MAGNETIC_SWITCHING_TOOLHEAD) - #ifndef SWITCHING_TOOLHEAD_Y_RELEASE - #define SWITCHING_TOOLHEAD_Y_RELEASE 5 - #endif - #ifndef SWITCHING_TOOLHEAD_X_SECURITY - #define SWITCHING_TOOLHEAD_X_SECURITY { 90, 150 } - #endif - #if ENABLED(PRIME_BEFORE_REMOVE) - #ifndef SWITCHING_TOOLHEAD_PRIME_MM - #define SWITCHING_TOOLHEAD_PRIME_MM 20 - #endif - #ifndef SWITCHING_TOOLHEAD_RETRACT_MM - #define SWITCHING_TOOLHEAD_RETRACT_MM 10 - #endif - #ifndef SWITCHING_TOOLHEAD_PRIME_FEEDRATE - #define SWITCHING_TOOLHEAD_PRIME_FEEDRATE 300 - #endif - #ifndef SWITCHING_TOOLHEAD_RETRACT_FEEDRATE - #define SWITCHING_TOOLHEAD_RETRACT_FEEDRATE 2400 - #endif - #endif - #elif ENABLED(ELECTROMAGNETIC_SWITCHING_TOOLHEAD) - #ifndef SWITCHING_TOOLHEAD_Z_HOP - #define SWITCHING_TOOLHEAD_Z_HOP 2 - #endif - #endif -#endif -#if ENABLED(MIXING_EXTRUDER) - #ifndef MIXING_STEPPERS - #define MIXING_STEPPERS 2 - #endif - #ifndef MIXING_VIRTUAL_TOOLS - #define MIXING_VIRTUAL_TOOLS 16 - #endif -#endif -#if ENABLED(PSU_CONTROL) - #ifndef PSU_ACTIVE_STATE - #define PSU_ACTIVE_STATE LOW - #endif - #ifndef PS_EDM_RESPONSE - #define PS_EDM_RESPONSE 250 - #endif - #if ENABLED(AUTO_POWER_CONTROL) - #ifndef POWER_TIMEOUT - #define POWER_TIMEOUT 30 - #endif - #endif -#endif -#ifndef TEMP_SENSOR_0 - #define TEMP_SENSOR_0 1 -#endif -#ifndef TEMP_SENSOR_1 - #define TEMP_SENSOR_1 0 -#endif -#ifndef TEMP_SENSOR_2 - #define TEMP_SENSOR_2 0 -#endif -#ifndef TEMP_SENSOR_3 - #define TEMP_SENSOR_3 0 -#endif -#ifndef TEMP_SENSOR_4 - #define TEMP_SENSOR_4 0 -#endif -#ifndef TEMP_SENSOR_5 - #define TEMP_SENSOR_5 0 -#endif -#ifndef TEMP_SENSOR_6 - #define TEMP_SENSOR_6 0 -#endif -#ifndef TEMP_SENSOR_7 - #define TEMP_SENSOR_7 0 -#endif -#ifndef TEMP_SENSOR_BED - #define TEMP_SENSOR_BED 1 -#endif -#ifndef TEMP_SENSOR_PROBE - #define TEMP_SENSOR_PROBE 0 -#endif -#ifndef TEMP_SENSOR_CHAMBER - #define TEMP_SENSOR_CHAMBER 0 -#endif -#ifndef TEMP_SENSOR_COOLER - #define TEMP_SENSOR_COOLER 0 -#endif -#ifndef TEMP_SENSOR_BOARD - #define TEMP_SENSOR_BOARD 0 -#endif -#ifndef TEMP_SENSOR_SOC - #define TEMP_SENSOR_SOC 0 -#endif -#ifndef TEMP_SENSOR_REDUNDANT - #define TEMP_SENSOR_REDUNDANT 0 -#endif -#ifndef DUMMY_THERMISTOR_998_VALUE - #define DUMMY_THERMISTOR_998_VALUE 25 -#endif -#ifndef DUMMY_THERMISTOR_999_VALUE - #define DUMMY_THERMISTOR_999_VALUE 100 -#endif -#if TEMP_SENSOR_IS_MAX_TC(0) - #ifndef MAX31865_SENSOR_OHMS_0 - #define MAX31865_SENSOR_OHMS_0 100 - #endif - #ifndef MAX31865_CALIBRATION_OHMS_0 - #define MAX31865_CALIBRATION_OHMS_0 430 - #endif -#endif -#if TEMP_SENSOR_IS_MAX_TC(1) - #ifndef MAX31865_SENSOR_OHMS_1 - #define MAX31865_SENSOR_OHMS_1 100 - #endif - #ifndef MAX31865_CALIBRATION_OHMS_1 - #define MAX31865_CALIBRATION_OHMS_1 430 - #endif -#endif -#if TEMP_SENSOR_IS_MAX_TC(2) - #ifndef MAX31865_SENSOR_OHMS_2 - #define MAX31865_SENSOR_OHMS_2 100 - #endif - #ifndef MAX31865_CALIBRATION_OHMS_2 - #define MAX31865_CALIBRATION_OHMS_2 430 - #endif -#endif -#if HAS_E_TEMP_SENSOR - #ifndef TEMP_RESIDENCY_TIME - #define TEMP_RESIDENCY_TIME 10 - #endif - #ifndef TEMP_WINDOW - #define TEMP_WINDOW 1 - #endif - #ifndef TEMP_HYSTERESIS - #define TEMP_HYSTERESIS 3 - #endif -#endif -#if TEMP_SENSOR_BED - #ifndef TEMP_BED_RESIDENCY_TIME - #define TEMP_BED_RESIDENCY_TIME 10 - #endif - #ifndef TEMP_BED_WINDOW - #define TEMP_BED_WINDOW 1 - #endif - #ifndef TEMP_BED_HYSTERESIS - #define TEMP_BED_HYSTERESIS 3 - #endif -#endif -#if TEMP_SENSOR_CHAMBER - #ifndef TEMP_CHAMBER_RESIDENCY_TIME - #define TEMP_CHAMBER_RESIDENCY_TIME 10 - #endif - #ifndef TEMP_CHAMBER_WINDOW - #define TEMP_CHAMBER_WINDOW 1 - #endif - #ifndef TEMP_CHAMBER_HYSTERESIS - #define TEMP_CHAMBER_HYSTERESIS 3 - #endif -#endif -#if TEMP_SENSOR_REDUNDANT - #ifndef TEMP_SENSOR_REDUNDANT_SOURCE - #define TEMP_SENSOR_REDUNDANT_SOURCE E1 - #endif - #ifndef TEMP_SENSOR_REDUNDANT_TARGET - #define TEMP_SENSOR_REDUNDANT_TARGET E0 - #endif - #ifndef TEMP_SENSOR_REDUNDANT_MAX_DIFF - #define TEMP_SENSOR_REDUNDANT_MAX_DIFF 10 - #endif -#endif -#ifndef HEATER_0_MINTEMP - #define HEATER_0_MINTEMP 5 -#endif -#ifndef HEATER_1_MINTEMP - #define HEATER_1_MINTEMP 5 -#endif -#ifndef HEATER_2_MINTEMP - #define HEATER_2_MINTEMP 5 -#endif -#ifndef HEATER_3_MINTEMP - #define HEATER_3_MINTEMP 5 -#endif -#ifndef HEATER_4_MINTEMP - #define HEATER_4_MINTEMP 5 -#endif -#ifndef HEATER_5_MINTEMP - #define HEATER_5_MINTEMP 5 -#endif -#ifndef HEATER_6_MINTEMP - #define HEATER_6_MINTEMP 5 -#endif -#ifndef HEATER_7_MINTEMP - #define HEATER_7_MINTEMP 5 -#endif -#ifndef BED_MINTEMP - #define BED_MINTEMP 5 -#endif -#ifndef CHAMBER_MINTEMP - #define CHAMBER_MINTEMP 5 -#endif -#ifndef HEATER_0_MAXTEMP - #define HEATER_0_MAXTEMP 275 -#endif -#ifndef HEATER_1_MAXTEMP - #define HEATER_1_MAXTEMP 275 -#endif -#ifndef HEATER_2_MAXTEMP - #define HEATER_2_MAXTEMP 275 -#endif -#ifndef HEATER_3_MAXTEMP - #define HEATER_3_MAXTEMP 275 -#endif -#ifndef HEATER_4_MAXTEMP - #define HEATER_4_MAXTEMP 275 -#endif -#ifndef HEATER_5_MAXTEMP - #define HEATER_5_MAXTEMP 275 -#endif -#ifndef HEATER_6_MAXTEMP - #define HEATER_6_MAXTEMP 275 -#endif -#ifndef HEATER_7_MAXTEMP - #define HEATER_7_MAXTEMP 275 -#endif -#ifndef BED_MAXTEMP - #define BED_MAXTEMP 150 -#endif -#ifndef CHAMBER_MAXTEMP - #define CHAMBER_MAXTEMP 60 -#endif -#ifndef HOTEND_OVERSHOOT - #define HOTEND_OVERSHOOT 15 -#endif -#ifndef BED_OVERSHOOT - #define BED_OVERSHOOT 10 -#endif -#ifndef COOLER_OVERSHOOT - #define COOLER_OVERSHOOT 2 -#endif -#ifndef PID_MAX - #define PID_MAX 255 -#endif -#ifndef PID_K1 - #define PID_K1 0.95 -#endif -#if ENABLED(PIDTEMP) - #if ENABLED(PID_PARAMS_PER_HOTEND) - #ifndef DEFAULT_Kp_LIST - #define DEFAULT_Kp_LIST { 22.20, 22.20 } - #endif - #ifndef DEFAULT_Ki_LIST - #define DEFAULT_Ki_LIST { 1.08, 1.08 } - #endif - #ifndef DEFAULT_Kd_LIST - #define DEFAULT_Kd_LIST { 114.00, 114.00 } - #endif - #else - #ifndef DEFAULT_Kp - #define DEFAULT_Kp 22.20 - #endif - #ifndef DEFAULT_Ki - #define DEFAULT_Ki 1.08 - #endif - #ifndef DEFAULT_Kd - #define DEFAULT_Kd 114.00 - #endif - #endif -#else - #ifndef BANG_MAX - #define BANG_MAX 255 - #endif -#endif -#if ENABLED(MPCTEMP) - #ifndef MPC_MAX - #define MPC_MAX 255 - #endif - #ifndef MPC_HEATER_POWER - #define MPC_HEATER_POWER { 40.0f } - #endif - #ifndef MPC_BLOCK_HEAT_CAPACITY - #define MPC_BLOCK_HEAT_CAPACITY { 16.7f } - #endif - #ifndef MPC_SENSOR_RESPONSIVENESS - #define MPC_SENSOR_RESPONSIVENESS { 0.22f } - #endif - #ifndef MPC_AMBIENT_XFER_COEFF - #define MPC_AMBIENT_XFER_COEFF { 0.068f } - #endif - #if ENABLED(MPC_INCLUDE_FAN) - #ifndef MPC_AMBIENT_XFER_COEFF_FAN255 - #define MPC_AMBIENT_XFER_COEFF_FAN255 { 0.097f } - #endif - #endif - #ifndef FILAMENT_HEAT_CAPACITY_PERMM - #define FILAMENT_HEAT_CAPACITY_PERMM { 5.6e-3f } - #endif - #ifndef MPC_SMOOTHING_FACTOR - #define MPC_SMOOTHING_FACTOR 0.5f - #endif - #ifndef MPC_MIN_AMBIENT_CHANGE - #define MPC_MIN_AMBIENT_CHANGE 1.0f - #endif - #ifndef MPC_STEADYSTATE - #define MPC_STEADYSTATE 0.5f - #endif - #ifndef MPC_TUNING_POS - #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } - #endif - #ifndef MPC_TUNING_END_Z - #define MPC_TUNING_END_Z 10.0f - #endif -#endif -#ifndef MAX_BED_POWER - #define MAX_BED_POWER 255 -#endif -#if ENABLED(PIDTEMPBED) - #ifndef DEFAULT_bedKp - #define DEFAULT_bedKp 10.00 - #endif - #ifndef DEFAULT_bedKi - #define DEFAULT_bedKi .023 - #endif - #ifndef DEFAULT_bedKd - #define DEFAULT_bedKd 305.4 - #endif -#else -#endif -#ifndef MAX_CHAMBER_POWER - #define MAX_CHAMBER_POWER 255 -#endif -#if ENABLED(PIDTEMPCHAMBER) - #ifndef MIN_CHAMBER_POWER - #define MIN_CHAMBER_POWER 0 - #endif - #ifndef DEFAULT_chamberKp - #define DEFAULT_chamberKp 37.04 - #endif - #ifndef DEFAULT_chamberKi - #define DEFAULT_chamberKi 1.40 - #endif - #ifndef DEFAULT_chamberKd - #define DEFAULT_chamberKd 655.17 - #endif -#endif -#if ANY(PIDTEMP, PIDTEMPBED, PIDTEMPCHAMBER) - #ifndef PID_FUNCTIONAL_RANGE - #define PID_FUNCTIONAL_RANGE 10 - #endif -#endif -#ifndef EXTRUDE_MINTEMP - #define EXTRUDE_MINTEMP 170 -#endif -#ifndef EXTRUDE_MAXLENGTH - #define EXTRUDE_MAXLENGTH 200 -#endif -#if ENABLED(POLARGRAPH) - #ifndef POLARGRAPH_MAX_BELT_LEN - #define POLARGRAPH_MAX_BELT_LEN 1035.0 - #endif - #ifndef DEFAULT_SEGMENTS_PER_SECOND - #define DEFAULT_SEGMENTS_PER_SECOND 5 - #endif -#endif -#if ENABLED(DELTA) - #ifndef DEFAULT_SEGMENTS_PER_SECOND - #define DEFAULT_SEGMENTS_PER_SECOND 200 - #endif - #if ENABLED(DELTA_AUTO_CALIBRATION) - #ifndef DELTA_CALIBRATION_DEFAULT_POINTS - #define DELTA_CALIBRATION_DEFAULT_POINTS 4 - #endif - #endif - #if ANY(DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - #ifndef PROBE_MANUALLY_STEP - #define PROBE_MANUALLY_STEP 0.05 - #endif - #endif - #ifndef PRINTABLE_RADIUS - #define PRINTABLE_RADIUS 140.0 - #endif - #ifndef DELTA_MAX_RADIUS - #define DELTA_MAX_RADIUS 140.0 - #endif - #ifndef DELTA_DIAGONAL_ROD - #define DELTA_DIAGONAL_ROD 250.0 - #endif - #ifndef DELTA_HEIGHT - #define DELTA_HEIGHT 250.00 - #endif - #ifndef DELTA_ENDSTOP_ADJ - #define DELTA_ENDSTOP_ADJ { 0.0, 0.0, 0.0 } - #endif - #ifndef DELTA_RADIUS - #define DELTA_RADIUS 124.0 - #endif - #ifndef DELTA_TOWER_ANGLE_TRIM - #define DELTA_TOWER_ANGLE_TRIM { 0.0, 0.0, 0.0 } - #endif -#endif -#if ANY(MORGAN_SCARA, MP_SCARA) - #ifndef DEFAULT_SEGMENTS_PER_SECOND - #define DEFAULT_SEGMENTS_PER_SECOND 200 - #endif - #ifndef SCARA_LINKAGE_1 - #define SCARA_LINKAGE_1 150 - #endif - #ifndef SCARA_LINKAGE_2 - #define SCARA_LINKAGE_2 150 - #endif - #ifndef SCARA_OFFSET_X - #define SCARA_OFFSET_X 100 - #endif - #ifndef SCARA_OFFSET_Y - #define SCARA_OFFSET_Y -56 - #endif - #if ENABLED(MORGAN_SCARA) - #ifndef MIDDLE_DEAD_ZONE_R - #define MIDDLE_DEAD_ZONE_R 0 - #endif - #elif ENABLED(MP_SCARA) - #ifndef SCARA_OFFSET_THETA1 - #define SCARA_OFFSET_THETA1 12 - #endif - #ifndef SCARA_OFFSET_THETA2 - #define SCARA_OFFSET_THETA2 131 - #endif - #endif -#endif -#if ENABLED(AXEL_TPARA) - #ifndef DEFAULT_SEGMENTS_PER_SECOND - #define DEFAULT_SEGMENTS_PER_SECOND 200 - #endif - #ifndef TPARA_LINKAGE_1 - #define TPARA_LINKAGE_1 120 - #endif - #ifndef TPARA_LINKAGE_2 - #define TPARA_LINKAGE_2 120 - #endif - #ifndef TPARA_OFFSET_X - #define TPARA_OFFSET_X 0 - #endif - #ifndef TPARA_OFFSET_Y - #define TPARA_OFFSET_Y 0 - #endif - #ifndef TPARA_OFFSET_Z - #define TPARA_OFFSET_Z 0 - #endif - #ifndef MIDDLE_DEAD_ZONE_R - #define MIDDLE_DEAD_ZONE_R 0 - #endif -#endif -#if ENABLED(POLAR) - #ifndef DEFAULT_SEGMENTS_PER_SECOND - #define DEFAULT_SEGMENTS_PER_SECOND 180 - #endif - #ifndef PRINTABLE_RADIUS - #define PRINTABLE_RADIUS 82.0f - #endif - #ifndef POLAR_FAST_RADIUS - #define POLAR_FAST_RADIUS 3.0f - #endif - #ifndef POLAR_CENTER_OFFSET - #define POLAR_CENTER_OFFSET 0.0f - #endif -#endif -#ifndef X_MIN_ENDSTOP_HIT_STATE - #define X_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef X_MAX_ENDSTOP_HIT_STATE - #define X_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef Y_MIN_ENDSTOP_HIT_STATE - #define Y_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef Y_MAX_ENDSTOP_HIT_STATE - #define Y_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef Z_MIN_ENDSTOP_HIT_STATE - #define Z_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef Z_MAX_ENDSTOP_HIT_STATE - #define Z_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef I_MIN_ENDSTOP_HIT_STATE - #define I_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef I_MAX_ENDSTOP_HIT_STATE - #define I_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef J_MIN_ENDSTOP_HIT_STATE - #define J_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef J_MAX_ENDSTOP_HIT_STATE - #define J_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef K_MIN_ENDSTOP_HIT_STATE - #define K_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef K_MAX_ENDSTOP_HIT_STATE - #define K_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef U_MIN_ENDSTOP_HIT_STATE - #define U_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef U_MAX_ENDSTOP_HIT_STATE - #define U_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef V_MIN_ENDSTOP_HIT_STATE - #define V_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef V_MAX_ENDSTOP_HIT_STATE - #define V_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef W_MIN_ENDSTOP_HIT_STATE - #define W_MIN_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef W_MAX_ENDSTOP_HIT_STATE - #define W_MAX_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef Z_MIN_PROBE_ENDSTOP_HIT_STATE - #define Z_MIN_PROBE_ENDSTOP_HIT_STATE HIGH -#endif -#ifndef DEFAULT_AXIS_STEPS_PER_UNIT - #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 } -#endif -#ifndef DEFAULT_MAX_FEEDRATE - #define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 } -#endif -#if ENABLED(LIMITED_MAX_FR_EDITING) - #ifndef MAX_FEEDRATE_EDIT_VALUES - #define MAX_FEEDRATE_EDIT_VALUES { 600, 600, 10, 50 } - #endif -#endif -#ifndef DEFAULT_MAX_ACCELERATION - #define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 } -#endif -#if ENABLED(LIMITED_MAX_ACCEL_EDITING) - #ifndef MAX_ACCEL_EDIT_VALUES - #define MAX_ACCEL_EDIT_VALUES { 6000, 6000, 200, 20000 } - #endif -#endif -#ifndef DEFAULT_ACCELERATION - #define DEFAULT_ACCELERATION 3000 -#endif -#ifndef DEFAULT_RETRACT_ACCELERATION - #define DEFAULT_RETRACT_ACCELERATION 3000 -#endif -#ifndef DEFAULT_TRAVEL_ACCELERATION - #define DEFAULT_TRAVEL_ACCELERATION 3000 -#endif -#if ENABLED(CLASSIC_JERK) - #ifndef DEFAULT_XJERK - #define DEFAULT_XJERK 10.0 - #endif - #ifndef DEFAULT_YJERK - #define DEFAULT_YJERK 10.0 - #endif - #ifndef DEFAULT_ZJERK - #define DEFAULT_ZJERK 0.3 - #endif - #ifndef DEFAULT_EJERK - #define DEFAULT_EJERK 5.0 - #endif - #if ENABLED(LIMITED_JERK_EDITING) - #ifndef MAX_JERK_EDIT_VALUES - #define MAX_JERK_EDIT_VALUES { 20, 20, 0.6, 10 } - #endif - #endif -#endif -#if DISABLED(CLASSIC_JERK) - #ifndef JUNCTION_DEVIATION_MM - #define JUNCTION_DEVIATION_MM 0.013 - #endif -#endif -#if ENABLED(MAGLEV4) - #ifndef MAGLEV_TRIGGER_DELAY - #define MAGLEV_TRIGGER_DELAY 15 - #endif -#endif -#if ENABLED(TOUCH_MI_PROBE) - #ifndef TOUCH_MI_RETRACT_Z - #define TOUCH_MI_RETRACT_Z 0.5 - #endif -#endif -#if ENABLED(RACK_AND_PINION_PROBE) - #ifndef Z_PROBE_DEPLOY_X - #define Z_PROBE_DEPLOY_X X_MIN_POS - #endif - #ifndef Z_PROBE_RETRACT_X - #define Z_PROBE_RETRACT_X X_MAX_POS - #endif -#endif -#if ENABLED(MAG_MOUNTED_PROBE) - #ifndef PROBE_DEPLOY_FEEDRATE - #define PROBE_DEPLOY_FEEDRATE (133*60) - #endif - #ifndef PROBE_STOW_FEEDRATE - #define PROBE_STOW_FEEDRATE (133*60) - #endif - #ifndef MAG_MOUNTED_DEPLOY_1 - #define MAG_MOUNTED_DEPLOY_1 { PROBE_DEPLOY_FEEDRATE, { 245, 114, 30 } } - #endif - #ifndef MAG_MOUNTED_DEPLOY_2 - #define MAG_MOUNTED_DEPLOY_2 { PROBE_DEPLOY_FEEDRATE, { 210, 114, 30 } } - #endif - #ifndef MAG_MOUNTED_DEPLOY_3 - #define MAG_MOUNTED_DEPLOY_3 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } - #endif - #ifndef MAG_MOUNTED_DEPLOY_4 - #define MAG_MOUNTED_DEPLOY_4 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } - #endif - #ifndef MAG_MOUNTED_DEPLOY_5 - #define MAG_MOUNTED_DEPLOY_5 { PROBE_DEPLOY_FEEDRATE, { 0, 0, 0 } } - #endif - #ifndef MAG_MOUNTED_STOW_1 - #define MAG_MOUNTED_STOW_1 { PROBE_STOW_FEEDRATE, { 245, 114, 20 } } - #endif - #ifndef MAG_MOUNTED_STOW_2 - #define MAG_MOUNTED_STOW_2 { PROBE_STOW_FEEDRATE, { 245, 114, 0 } } - #endif - #ifndef MAG_MOUNTED_STOW_3 - #define MAG_MOUNTED_STOW_3 { PROBE_STOW_FEEDRATE, { 230, 114, 0 } } - #endif - #ifndef MAG_MOUNTED_STOW_4 - #define MAG_MOUNTED_STOW_4 { PROBE_STOW_FEEDRATE, { 210, 114, 20 } } - #endif - #ifndef MAG_MOUNTED_STOW_5 - #define MAG_MOUNTED_STOW_5 { PROBE_STOW_FEEDRATE, { 0, 0, 0 } } - #endif -#endif -#if ENABLED(DUET_SMART_EFFECTOR) - #ifndef SMART_EFFECTOR_MOD_PIN - #define SMART_EFFECTOR_MOD_PIN -1 - #endif -#endif -#if ENABLED(Z_PROBE_ALLEN_KEY) - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1 - #define Z_PROBE_ALLEN_KEY_DEPLOY_1 { 30.0, PRINTABLE_RADIUS, 100.0 } - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE - #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE XY_PROBE_FEEDRATE - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2 - #define Z_PROBE_ALLEN_KEY_DEPLOY_2 { 0.0, PRINTABLE_RADIUS, 100.0 } - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE - #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE (XY_PROBE_FEEDRATE)/10 - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3 - #define Z_PROBE_ALLEN_KEY_DEPLOY_3 { 0.0, (PRINTABLE_RADIUS) * 0.75, 100.0 } - #endif - #ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE - #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE XY_PROBE_FEEDRATE - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1 - #define Z_PROBE_ALLEN_KEY_STOW_1 { -64.0, 56.0, 23.0 } - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE - #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE XY_PROBE_FEEDRATE - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2 - #define Z_PROBE_ALLEN_KEY_STOW_2 { -64.0, 56.0, 3.0 } - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE - #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE (XY_PROBE_FEEDRATE)/10 - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3 - #define Z_PROBE_ALLEN_KEY_STOW_3 { -64.0, 56.0, 50.0 } - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE - #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE XY_PROBE_FEEDRATE - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4 - #define Z_PROBE_ALLEN_KEY_STOW_4 { 0.0, 0.0, 50.0 } - #endif - #ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE - #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE XY_PROBE_FEEDRATE - #endif -#endif -#ifndef NOZZLE_TO_PROBE_OFFSET - #define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 } -#endif -#ifndef PROBING_TOOL - #define PROBING_TOOL 0 -#endif -#ifndef PROBING_MARGIN - #define PROBING_MARGIN 10 -#endif -#ifndef XY_PROBE_FEEDRATE - #define XY_PROBE_FEEDRATE (133*60) -#endif -#ifndef Z_PROBE_FEEDRATE_FAST - #define Z_PROBE_FEEDRATE_FAST (4*60) -#endif -#ifndef Z_PROBE_FEEDRATE_SLOW - #define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2) -#endif -#if ENABLED(PROBE_ACTIVATION_SWITCH) - #ifndef PROBE_ACTIVATION_SWITCH_STATE - #define PROBE_ACTIVATION_SWITCH_STATE LOW - #endif -#endif -#if ENABLED(PROBE_TARE) - #ifndef PROBE_TARE_TIME - #define PROBE_TARE_TIME 200 - #endif - #ifndef PROBE_TARE_DELAY - #define PROBE_TARE_DELAY 200 - #endif - #ifndef PROBE_TARE_STATE - #define PROBE_TARE_STATE HIGH - #endif -#endif -#ifndef Z_CLEARANCE_DEPLOY_PROBE - #define Z_CLEARANCE_DEPLOY_PROBE 10 -#endif -#ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES 5 -#endif -#ifndef Z_CLEARANCE_MULTI_PROBE - #define Z_CLEARANCE_MULTI_PROBE 5 -#endif -#ifndef Z_PROBE_ERROR_TOLERANCE - #define Z_PROBE_ERROR_TOLERANCE 3 -#endif -#ifndef Z_PROBE_LOW_POINT - #define Z_PROBE_LOW_POINT -2 -#endif -#if ENABLED(PREHEAT_BEFORE_PROBING) - #ifndef PROBING_NOZZLE_TEMP - #define PROBING_NOZZLE_TEMP 120 - #endif - #ifndef PROBING_BED_TEMP - #define PROBING_BED_TEMP 50 - #endif -#endif -#ifndef X_ENABLE_ON - #define X_ENABLE_ON 0 -#endif -#ifndef Y_ENABLE_ON - #define Y_ENABLE_ON 0 -#endif -#ifndef Z_ENABLE_ON - #define Z_ENABLE_ON 0 -#endif -#ifndef E_ENABLE_ON - #define E_ENABLE_ON 0 -#endif -#ifndef INVERT_X_DIR - #define INVERT_X_DIR false -#endif -#ifndef INVERT_Y_DIR - #define INVERT_Y_DIR true -#endif -#ifndef INVERT_Z_DIR - #define INVERT_Z_DIR false -#endif -#ifndef INVERT_E0_DIR - #define INVERT_E0_DIR false -#endif -#ifndef INVERT_E1_DIR - #define INVERT_E1_DIR false -#endif -#ifndef INVERT_E2_DIR - #define INVERT_E2_DIR false -#endif -#ifndef INVERT_E3_DIR - #define INVERT_E3_DIR false -#endif -#ifndef INVERT_E4_DIR - #define INVERT_E4_DIR false -#endif -#ifndef INVERT_E5_DIR - #define INVERT_E5_DIR false -#endif -#ifndef INVERT_E6_DIR - #define INVERT_E6_DIR false -#endif -#ifndef INVERT_E7_DIR - #define INVERT_E7_DIR false -#endif -#ifndef X_HOME_DIR - #define X_HOME_DIR -1 -#endif -#ifndef Y_HOME_DIR - #define Y_HOME_DIR -1 -#endif -#ifndef Z_HOME_DIR - #define Z_HOME_DIR -1 -#endif -#ifndef X_BED_SIZE - #define X_BED_SIZE 200 -#endif -#ifndef Y_BED_SIZE - #define Y_BED_SIZE 200 -#endif -#ifndef X_MIN_POS - #define X_MIN_POS 0 -#endif -#ifndef Y_MIN_POS - #define Y_MIN_POS 0 -#endif -#ifndef Z_MIN_POS - #define Z_MIN_POS 0 -#endif -#ifndef X_MAX_POS - #define X_MAX_POS X_BED_SIZE -#endif -#ifndef Y_MAX_POS - #define Y_MAX_POS Y_BED_SIZE -#endif -#ifndef Z_MAX_POS - #define Z_MAX_POS 200 -#endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #ifndef FIL_RUNOUT_ENABLED_DEFAULT - #define FIL_RUNOUT_ENABLED_DEFAULT true - #endif - #ifndef NUM_RUNOUT_SENSORS - #define NUM_RUNOUT_SENSORS 1 - #endif - #ifndef FIL_RUNOUT_STATE - #define FIL_RUNOUT_STATE LOW - #endif - #ifndef FILAMENT_RUNOUT_SCRIPT - #define FILAMENT_RUNOUT_SCRIPT "M600" - #endif - #ifdef FILAMENT_RUNOUT_DISTANCE_MM - #if ENABLED(FILAMENT_MOTION_SENSOR) - #if ENABLED(FILAMENT_SWITCH_AND_MOTION) - #ifndef NUM_MOTION_SENSORS - #define NUM_MOTION_SENSORS 1 - #endif - #endif - #endif - #endif -#endif -#if ENABLED(PREHEAT_BEFORE_LEVELING) - #ifndef LEVELING_NOZZLE_TEMP - #define LEVELING_NOZZLE_TEMP 120 - #endif - #ifndef LEVELING_BED_TEMP - #define LEVELING_BED_TEMP 50 - #endif -#endif -#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL, PROBE_MANUALLY) - #ifndef MANUAL_PROBE_START_Z - #define MANUAL_PROBE_START_Z 0.2 - #endif -#endif -#if ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL) - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - #ifndef DEFAULT_LEVELING_FADE_HEIGHT - #define DEFAULT_LEVELING_FADE_HEIGHT 10.0 - #endif - #endif - #ifndef LEVELED_SEGMENT_LENGTH - #define LEVELED_SEGMENT_LENGTH 5.0 - #endif - #if ENABLED(G26_MESH_VALIDATION) - #ifndef MESH_TEST_NOZZLE_SIZE - #define MESH_TEST_NOZZLE_SIZE 0.4 - #endif - #ifndef MESH_TEST_LAYER_HEIGHT - #define MESH_TEST_LAYER_HEIGHT 0.2 - #endif - #ifndef MESH_TEST_HOTEND_TEMP - #define MESH_TEST_HOTEND_TEMP 205 - #endif - #ifndef MESH_TEST_BED_TEMP - #define MESH_TEST_BED_TEMP 60 - #endif - #ifndef G26_XY_FEEDRATE - #define G26_XY_FEEDRATE 20 - #endif - #ifndef G26_XY_FEEDRATE_TRAVEL - #define G26_XY_FEEDRATE_TRAVEL 100 - #endif - #ifndef G26_RETRACT_MULTIPLIER - #define G26_RETRACT_MULTIPLIER 1.0 - #endif - #endif -#endif -#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) - #ifndef GRID_MAX_POINTS_X - #define GRID_MAX_POINTS_X 3 - #endif - #ifndef GRID_MAX_POINTS_Y - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - #endif - #if ENABLED(AUTO_BED_LEVELING_BILINEAR) - #if ENABLED(ABL_BILINEAR_SUBDIVISION) - #ifndef BILINEAR_SUBDIVISIONS - #define BILINEAR_SUBDIVISIONS 3 - #endif - #endif - #endif -#elif ENABLED(AUTO_BED_LEVELING_UBL) - #ifndef MESH_INSET - #define MESH_INSET 1 - #endif - #ifndef GRID_MAX_POINTS_X - #define GRID_MAX_POINTS_X 10 - #endif - #ifndef GRID_MAX_POINTS_Y - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - #endif - #if ENABLED(AVOID_OBSTACLES) - #ifndef CLIP_W - #define CLIP_W 23 - #endif - #ifndef CLIP_H - #define CLIP_H 14 - #endif - #ifndef OBSTACLE1 - #define OBSTACLE1 { (X_BED_SIZE) / 4 - (CLIP_W) / 2, 0, (X_BED_SIZE) / 4 + (CLIP_W) / 2, CLIP_H } - #endif - #ifndef OBSTACLE2 - #define OBSTACLE2 { (X_BED_SIZE) * 3 / 4 - (CLIP_W) / 2, 0, (X_BED_SIZE) * 3 / 4 + (CLIP_W) / 2, CLIP_H } - #endif - #ifndef OBSTACLE3 - #define OBSTACLE3 { (X_BED_SIZE) / 4 - (CLIP_W) / 2, (Y_BED_SIZE) - (CLIP_H), (X_BED_SIZE) / 4 + (CLIP_W) / 2, Y_BED_SIZE } - #endif - #ifndef OBSTACLE4 - #define OBSTACLE4 { (X_BED_SIZE) * 3 / 4 - (CLIP_W) / 2, (Y_BED_SIZE) - (CLIP_H), (X_BED_SIZE) * 3 / 4 + (CLIP_W) / 2, Y_BED_SIZE } - #endif - #ifndef G29J_MESH_TILT_MARGIN - #define G29J_MESH_TILT_MARGIN ((CLIP_H) + 1) - #endif - #endif -#elif ENABLED(MESH_BED_LEVELING) - #ifndef MESH_INSET - #define MESH_INSET 10 - #endif - #ifndef GRID_MAX_POINTS_X - #define GRID_MAX_POINTS_X 3 - #endif - #ifndef GRID_MAX_POINTS_Y - #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X - #endif -#endif -#if ENABLED(LCD_BED_LEVELING) - #ifndef MESH_EDIT_Z_STEP - #define MESH_EDIT_Z_STEP 0.025 - #endif - #ifndef LCD_PROBE_Z_RANGE - #define LCD_PROBE_Z_RANGE 4 - #endif -#endif -#if ENABLED(LCD_BED_TRAMMING) - #ifndef BED_TRAMMING_INSET_LFRB - #define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } - #endif - #ifndef BED_TRAMMING_HEIGHT - #define BED_TRAMMING_HEIGHT 0.0 - #endif - #ifndef BED_TRAMMING_Z_HOP - #define BED_TRAMMING_Z_HOP 4.0 - #endif - #if ENABLED(BED_TRAMMING_USE_PROBE) - #ifndef BED_TRAMMING_PROBE_TOLERANCE - #define BED_TRAMMING_PROBE_TOLERANCE 0.1 - #endif - #endif - #ifndef BED_TRAMMING_LEVELING_ORDER - #define BED_TRAMMING_LEVELING_ORDER { LF, RF, RB, LB } - #endif -#endif -#if ENABLED(Z_SAFE_HOMING) - #ifndef Z_SAFE_HOMING_X_POINT - #define Z_SAFE_HOMING_X_POINT X_CENTER - #endif - #ifndef Z_SAFE_HOMING_Y_POINT - #define Z_SAFE_HOMING_Y_POINT Y_CENTER - #endif -#endif -#ifndef HOMING_FEEDRATE_MM_M - #define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) } -#endif -#if ENABLED(SKEW_CORRECTION) - #ifndef XY_DIAG_AC - #define XY_DIAG_AC 282.8427124746 - #endif - #ifndef XY_DIAG_BD - #define XY_DIAG_BD 282.8427124746 - #endif - #ifndef XY_SIDE_AD - #define XY_SIDE_AD 200 - #endif - #if ENABLED(SKEW_CORRECTION_FOR_Z) - #ifndef XZ_DIAG_AC - #define XZ_DIAG_AC 282.8427124746 - #endif - #ifndef XZ_DIAG_BD - #define XZ_DIAG_BD 282.8427124746 - #endif - #ifndef YZ_DIAG_AC - #define YZ_DIAG_AC 282.8427124746 - #endif - #ifndef YZ_DIAG_BD - #define YZ_DIAG_BD 282.8427124746 - #endif - #ifndef YZ_SIDE_AD - #define YZ_SIDE_AD 200 - #endif - #endif -#endif -#ifndef DEFAULT_KEEPALIVE_INTERVAL - #define DEFAULT_KEEPALIVE_INTERVAL 2 -#endif -#ifndef PREHEAT_1_LABEL - #define PREHEAT_1_LABEL "PLA" -#endif -#ifndef PREHEAT_1_TEMP_HOTEND - #define PREHEAT_1_TEMP_HOTEND 180 -#endif -#ifndef PREHEAT_1_TEMP_BED - #define PREHEAT_1_TEMP_BED 70 -#endif -#ifndef PREHEAT_1_TEMP_CHAMBER - #define PREHEAT_1_TEMP_CHAMBER 35 -#endif -#ifndef PREHEAT_1_FAN_SPEED - #define PREHEAT_1_FAN_SPEED 0 -#endif -#ifndef PREHEAT_2_LABEL - #define PREHEAT_2_LABEL "ABS" -#endif -#ifndef PREHEAT_2_TEMP_HOTEND - #define PREHEAT_2_TEMP_HOTEND 240 -#endif -#ifndef PREHEAT_2_TEMP_BED - #define PREHEAT_2_TEMP_BED 110 -#endif -#ifndef PREHEAT_2_TEMP_CHAMBER - #define PREHEAT_2_TEMP_CHAMBER 35 -#endif -#ifndef PREHEAT_2_FAN_SPEED - #define PREHEAT_2_FAN_SPEED 0 -#endif -#if ENABLED(NOZZLE_PARK_FEATURE) - #ifndef NOZZLE_PARK_POINT - #define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 20 } - #endif - #ifndef NOZZLE_PARK_MOVE - #define NOZZLE_PARK_MOVE 0 - #endif - #ifndef NOZZLE_PARK_Z_RAISE_MIN - #define NOZZLE_PARK_Z_RAISE_MIN 2 - #endif - #ifndef NOZZLE_PARK_XY_FEEDRATE - #define NOZZLE_PARK_XY_FEEDRATE 100 - #endif - #ifndef NOZZLE_PARK_Z_FEEDRATE - #define NOZZLE_PARK_Z_FEEDRATE 5 - #endif -#endif -#if ENABLED(NOZZLE_CLEAN_FEATURE) - #ifndef NOZZLE_CLEAN_DEFAULT_PATTERN - #define NOZZLE_CLEAN_DEFAULT_PATTERN 0 - #endif - #ifndef NOZZLE_CLEAN_STROKES - #define NOZZLE_CLEAN_STROKES 12 - #endif - #if ENABLED(NOZZLE_CLEAN_PATTERN_ZIGZAG) - #ifndef NOZZLE_CLEAN_TRIANGLES - #define NOZZLE_CLEAN_TRIANGLES 3 - #endif - #endif - #ifndef NOZZLE_CLEAN_START_POINT - #define NOZZLE_CLEAN_START_POINT { { 30, 30, (Z_MIN_POS + 1) } } - #endif - #ifndef NOZZLE_CLEAN_END_POINT - #define NOZZLE_CLEAN_END_POINT { { 100, 60, (Z_MIN_POS + 1) } } - #endif - #if ENABLED(NOZZLE_CLEAN_PATTERN_CIRCLE) - #ifndef NOZZLE_CLEAN_CIRCLE_RADIUS - #define NOZZLE_CLEAN_CIRCLE_RADIUS 6.5 - #endif - #ifndef NOZZLE_CLEAN_CIRCLE_FN - #define NOZZLE_CLEAN_CIRCLE_FN 10 - #endif - #ifndef NOZZLE_CLEAN_CIRCLE_MIDDLE - #define NOZZLE_CLEAN_CIRCLE_MIDDLE NOZZLE_CLEAN_START_POINT - #endif - #endif - #ifndef NOZZLE_CLEAN_MIN_TEMP - #define NOZZLE_CLEAN_MIN_TEMP 170 - #endif -#endif -#if ENABLED(PRINTCOUNTER) - #ifndef PRINTCOUNTER_SAVE_INTERVAL - #define PRINTCOUNTER_SAVE_INTERVAL 60 - #endif -#endif -#if ENABLED(PASSWORD_FEATURE) - #ifndef PASSWORD_LENGTH - #define PASSWORD_LENGTH 4 - #endif -#endif -#ifndef LCD_LANGUAGE - #define LCD_LANGUAGE en -#endif -#ifndef DISPLAY_CHARSET_HD44780 - #define DISPLAY_CHARSET_HD44780 JAPANESE -#endif -#ifndef LCD_INFO_SCREEN_STYLE - #define LCD_INFO_SCREEN_STYLE 0 -#endif -#if ENABLED(ENCODER_NOISE_FILTER) - #ifndef ENCODER_SAMPLES - #define ENCODER_SAMPLES 10 - #endif -#endif -#if ENABLED(TFT_GENERIC) - #ifndef TFT_DRIVER - #define TFT_DRIVER AUTO - #endif -#endif -#if ENABLED(TFT_COLOR_UI) - #ifndef TFT_FONT - #define TFT_FONT NOTOSANS - #endif - #ifndef TFT_THEME - #define TFT_THEME BLACK_MARLIN - #endif -#endif -#if ENABLED(TOUCH_SCREEN) - #ifndef BUTTON_DELAY_EDIT - #define BUTTON_DELAY_EDIT 50 - #endif - #ifndef BUTTON_DELAY_MENU - #define BUTTON_DELAY_MENU 250 - #endif -#endif -#ifndef SOFT_PWM_SCALE - #define SOFT_PWM_SCALE 0 -#endif -#if ANY(RGB_LED, RGBW_LED, PCA9632) - #if ENABLED(RGB_STARTUP_TEST) - #ifndef RGB_STARTUP_TEST_INNER_MS - #define RGB_STARTUP_TEST_INNER_MS 10 - #endif - #endif -#endif -#if ENABLED(NEOPIXEL_LED) - #ifndef NEOPIXEL_TYPE - #define NEOPIXEL_TYPE NEO_GRBW - #endif - #ifndef NEOPIXEL_PIXELS - #define NEOPIXEL_PIXELS 30 - #endif - #ifndef NEOPIXEL_BRIGHTNESS - #define NEOPIXEL_BRIGHTNESS 127 - #endif - #if ENABLED(NEOPIXEL2_SEPARATE) - #ifndef NEOPIXEL2_PIXELS - #define NEOPIXEL2_PIXELS 15 - #endif - #ifndef NEOPIXEL2_BRIGHTNESS - #define NEOPIXEL2_BRIGHTNESS 127 - #endif - #ifndef NEOPIXEL_M150_DEFAULT - #define NEOPIXEL_M150_DEFAULT -1 - #endif - #else - #endif -#endif -#ifndef SERVO_DELAY - #define SERVO_DELAY { 300 } -#endif diff --git a/Marlin/src/inc/BaseConfiguration_adv.h b/Marlin/src/inc/BaseConfiguration_adv.h deleted file mode 100644 index a60464791d59..000000000000 --- a/Marlin/src/inc/BaseConfiguration_adv.h +++ /dev/null @@ -1,2491 +0,0 @@ -/** - * Marlin 3D Printer Firmware - * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] - * - * Based on Sprinter and grbl. - * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ -#pragma once - -/** - * BaseConfiguration_adv.h - Generated using makeBaseConfigs.py - */ - -#ifndef CONFIGURATION_ADV_H_VERSION - #define CONFIGURATION_ADV_H_VERSION 02010300 -#endif -#ifndef THERMOCOUPLE_MAX_ERRORS - #define THERMOCOUPLE_MAX_ERRORS 15 -#endif -#if TEMP_SENSOR_0 == 1000 - #ifndef HOTEND0_PULLUP_RESISTOR_OHMS - #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND0_RESISTANCE_25C_OHMS - #define HOTEND0_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND0_BETA - #define HOTEND0_BETA 3950 - #endif - #ifndef HOTEND0_SH_C_COEFF - #define HOTEND0_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_1 == 1000 - #ifndef HOTEND1_PULLUP_RESISTOR_OHMS - #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND1_RESISTANCE_25C_OHMS - #define HOTEND1_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND1_BETA - #define HOTEND1_BETA 3950 - #endif - #ifndef HOTEND1_SH_C_COEFF - #define HOTEND1_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_2 == 1000 - #ifndef HOTEND2_PULLUP_RESISTOR_OHMS - #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND2_RESISTANCE_25C_OHMS - #define HOTEND2_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND2_BETA - #define HOTEND2_BETA 3950 - #endif - #ifndef HOTEND2_SH_C_COEFF - #define HOTEND2_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_3 == 1000 - #ifndef HOTEND3_PULLUP_RESISTOR_OHMS - #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND3_RESISTANCE_25C_OHMS - #define HOTEND3_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND3_BETA - #define HOTEND3_BETA 3950 - #endif - #ifndef HOTEND3_SH_C_COEFF - #define HOTEND3_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_4 == 1000 - #ifndef HOTEND4_PULLUP_RESISTOR_OHMS - #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND4_RESISTANCE_25C_OHMS - #define HOTEND4_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND4_BETA - #define HOTEND4_BETA 3950 - #endif - #ifndef HOTEND4_SH_C_COEFF - #define HOTEND4_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_5 == 1000 - #ifndef HOTEND5_PULLUP_RESISTOR_OHMS - #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND5_RESISTANCE_25C_OHMS - #define HOTEND5_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND5_BETA - #define HOTEND5_BETA 3950 - #endif - #ifndef HOTEND5_SH_C_COEFF - #define HOTEND5_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_6 == 1000 - #ifndef HOTEND6_PULLUP_RESISTOR_OHMS - #define HOTEND6_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND6_RESISTANCE_25C_OHMS - #define HOTEND6_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND6_BETA - #define HOTEND6_BETA 3950 - #endif - #ifndef HOTEND6_SH_C_COEFF - #define HOTEND6_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_7 == 1000 - #ifndef HOTEND7_PULLUP_RESISTOR_OHMS - #define HOTEND7_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef HOTEND7_RESISTANCE_25C_OHMS - #define HOTEND7_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef HOTEND7_BETA - #define HOTEND7_BETA 3950 - #endif - #ifndef HOTEND7_SH_C_COEFF - #define HOTEND7_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_BED == 1000 - #ifndef BED_PULLUP_RESISTOR_OHMS - #define BED_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef BED_RESISTANCE_25C_OHMS - #define BED_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef BED_BETA - #define BED_BETA 3950 - #endif - #ifndef BED_SH_C_COEFF - #define BED_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_CHAMBER == 1000 - #ifndef CHAMBER_PULLUP_RESISTOR_OHMS - #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef CHAMBER_RESISTANCE_25C_OHMS - #define CHAMBER_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef CHAMBER_BETA - #define CHAMBER_BETA 3950 - #endif - #ifndef CHAMBER_SH_C_COEFF - #define CHAMBER_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_COOLER == 1000 - #ifndef COOLER_PULLUP_RESISTOR_OHMS - #define COOLER_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef COOLER_RESISTANCE_25C_OHMS - #define COOLER_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef COOLER_BETA - #define COOLER_BETA 3950 - #endif - #ifndef COOLER_SH_C_COEFF - #define COOLER_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_PROBE == 1000 - #ifndef PROBE_PULLUP_RESISTOR_OHMS - #define PROBE_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef PROBE_RESISTANCE_25C_OHMS - #define PROBE_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef PROBE_BETA - #define PROBE_BETA 3950 - #endif - #ifndef PROBE_SH_C_COEFF - #define PROBE_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_BOARD == 1000 - #ifndef BOARD_PULLUP_RESISTOR_OHMS - #define BOARD_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef BOARD_RESISTANCE_25C_OHMS - #define BOARD_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef BOARD_BETA - #define BOARD_BETA 3950 - #endif - #ifndef BOARD_SH_C_COEFF - #define BOARD_SH_C_COEFF 0 - #endif -#endif -#if TEMP_SENSOR_REDUNDANT == 1000 - #ifndef REDUNDANT_PULLUP_RESISTOR_OHMS - #define REDUNDANT_PULLUP_RESISTOR_OHMS 4700 - #endif - #ifndef REDUNDANT_RESISTANCE_25C_OHMS - #define REDUNDANT_RESISTANCE_25C_OHMS 100000 - #endif - #ifndef REDUNDANT_BETA - #define REDUNDANT_BETA 3950 - #endif - #ifndef REDUNDANT_SH_C_COEFF - #define REDUNDANT_SH_C_COEFF 0 - #endif -#endif -#if ENABLED(HEPHESTOS2_HEATED_BED_KIT) - #ifndef HEATER_BED_INVERTING - #define HEATER_BED_INVERTING true - #endif -#endif -#if DISABLED(PIDTEMPBED) - #ifndef BED_CHECK_INTERVAL - #define BED_CHECK_INTERVAL 5000 - #endif - #if ENABLED(BED_LIMIT_SWITCHING) - #ifndef BED_HYSTERESIS - #define BED_HYSTERESIS 2 - #endif - #endif -#endif -#if DISABLED(PIDTEMPCHAMBER) - #ifndef CHAMBER_CHECK_INTERVAL - #define CHAMBER_CHECK_INTERVAL 5000 - #endif - #if ENABLED(CHAMBER_LIMIT_SWITCHING) - #ifndef CHAMBER_HYSTERESIS - #define CHAMBER_HYSTERESIS 2 - #endif - #endif -#endif -#if TEMP_SENSOR_CHAMBER - #if ENABLED(CHAMBER_FAN) - #ifndef CHAMBER_FAN_MODE - #define CHAMBER_FAN_MODE 2 - #endif - #if CHAMBER_FAN_MODE == 0 - #ifndef CHAMBER_FAN_BASE - #define CHAMBER_FAN_BASE 255 - #endif - #elif CHAMBER_FAN_MODE == 1 - #ifndef CHAMBER_FAN_BASE - #define CHAMBER_FAN_BASE 128 - #endif - #ifndef CHAMBER_FAN_FACTOR - #define CHAMBER_FAN_FACTOR 25 - #endif - #elif CHAMBER_FAN_MODE == 2 - #ifndef CHAMBER_FAN_BASE - #define CHAMBER_FAN_BASE 128 - #endif - #ifndef CHAMBER_FAN_FACTOR - #define CHAMBER_FAN_FACTOR 25 - #endif - #elif CHAMBER_FAN_MODE == 3 - #ifndef CHAMBER_FAN_BASE - #define CHAMBER_FAN_BASE 128 - #endif - #ifndef CHAMBER_FAN_FACTOR - #define CHAMBER_FAN_FACTOR 25 - #endif - #endif - #endif - #if ENABLED(CHAMBER_VENT) - #ifndef CHAMBER_VENT_SERVO_NR - #define CHAMBER_VENT_SERVO_NR 1 - #endif - #ifndef HIGH_EXCESS_HEAT_LIMIT - #define HIGH_EXCESS_HEAT_LIMIT 5 - #endif - #ifndef LOW_EXCESS_HEAT_LIMIT - #define LOW_EXCESS_HEAT_LIMIT 3 - #endif - #ifndef MIN_COOLING_SLOPE_TIME_CHAMBER_VENT - #define MIN_COOLING_SLOPE_TIME_CHAMBER_VENT 20 - #endif - #ifndef MIN_COOLING_SLOPE_DEG_CHAMBER_VENT - #define MIN_COOLING_SLOPE_DEG_CHAMBER_VENT 1.5 - #endif - #endif -#endif -#if TEMP_SENSOR_COOLER - #ifndef COOLER_MINTEMP - #define COOLER_MINTEMP 8 - #endif - #ifndef COOLER_MAXTEMP - #define COOLER_MAXTEMP 26 - #endif - #ifndef COOLER_DEFAULT_TEMP - #define COOLER_DEFAULT_TEMP 16 - #endif - #ifndef TEMP_COOLER_HYSTERESIS - #define TEMP_COOLER_HYSTERESIS 1 - #endif - #ifndef COOLER_PIN - #define COOLER_PIN 8 - #endif - #ifndef COOLER_INVERTING - #define COOLER_INVERTING false - #endif - #ifndef TEMP_COOLER_PIN - #define TEMP_COOLER_PIN 15 - #endif - #ifndef COOLER_FAN_INDEX - #define COOLER_FAN_INDEX 0 - #endif - #if ENABLED(COOLER_FAN) - #ifndef COOLER_FAN_BASE - #define COOLER_FAN_BASE 100 - #endif - #ifndef COOLER_FAN_FACTOR - #define COOLER_FAN_FACTOR 25 - #endif - #endif -#endif -#if TEMP_SENSOR_BOARD - #ifndef BOARD_MINTEMP - #define BOARD_MINTEMP 8 - #endif - #ifndef BOARD_MAXTEMP - #define BOARD_MAXTEMP 70 - #endif -#endif -#if TEMP_SENSOR_SOC - #ifndef SOC_MAXTEMP - #define SOC_MAXTEMP 85 - #endif -#endif -#if ALL(HAS_HOTEND, THERMAL_PROTECTION_HOTENDS) - #ifndef THERMAL_PROTECTION_PERIOD - #define THERMAL_PROTECTION_PERIOD 40 - #endif - #ifndef THERMAL_PROTECTION_HYSTERESIS - #define THERMAL_PROTECTION_HYSTERESIS 4 - #endif - #ifndef WATCH_TEMP_PERIOD - #define WATCH_TEMP_PERIOD 40 - #endif - #ifndef WATCH_TEMP_INCREASE - #define WATCH_TEMP_INCREASE 2 - #endif -#endif -#if TEMP_SENSOR_BED && ENABLED(THERMAL_PROTECTION_BED) - #ifndef THERMAL_PROTECTION_BED_PERIOD - #define THERMAL_PROTECTION_BED_PERIOD 20 - #endif - #ifndef THERMAL_PROTECTION_BED_HYSTERESIS - #define THERMAL_PROTECTION_BED_HYSTERESIS 2 - #endif - #ifndef WATCH_BED_TEMP_PERIOD - #define WATCH_BED_TEMP_PERIOD 60 - #endif - #ifndef WATCH_BED_TEMP_INCREASE - #define WATCH_BED_TEMP_INCREASE 2 - #endif -#endif -#if TEMP_SENSOR_CHAMBER && ENABLED(THERMAL_PROTECTION_CHAMBER) - #ifndef THERMAL_PROTECTION_CHAMBER_PERIOD - #define THERMAL_PROTECTION_CHAMBER_PERIOD 20 - #endif - #ifndef THERMAL_PROTECTION_CHAMBER_HYSTERESIS - #define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 - #endif - #ifndef WATCH_CHAMBER_TEMP_PERIOD - #define WATCH_CHAMBER_TEMP_PERIOD 60 - #endif - #ifndef WATCH_CHAMBER_TEMP_INCREASE - #define WATCH_CHAMBER_TEMP_INCREASE 2 - #endif -#endif -#if TEMP_SENSOR_COOLER && ENABLED(THERMAL_PROTECTION_COOLER) - #ifndef THERMAL_PROTECTION_COOLER_PERIOD - #define THERMAL_PROTECTION_COOLER_PERIOD 10 - #endif - #ifndef THERMAL_PROTECTION_COOLER_HYSTERESIS - #define THERMAL_PROTECTION_COOLER_HYSTERESIS 3 - #endif - #ifndef WATCH_COOLER_TEMP_PERIOD - #define WATCH_COOLER_TEMP_PERIOD 60 - #endif - #ifndef WATCH_COOLER_TEMP_INCREASE - #define WATCH_COOLER_TEMP_INCREASE 3 - #endif -#endif -#if ENABLED(PIDTEMP) - #if ENABLED(PID_EXTRUSION_SCALING) - #ifndef DEFAULT_Kc - #define DEFAULT_Kc (100) - #endif - #ifndef LPQ_MAX_LEN - #define LPQ_MAX_LEN 50 - #endif - #endif - #if ENABLED(PID_FAN_SCALING) - #if ENABLED(PID_FAN_SCALING_ALTERNATIVE_DEFINITION) - #ifndef PID_FAN_SCALING_AT_FULL_SPEED - #define PID_FAN_SCALING_AT_FULL_SPEED 13.0 - #endif - #ifndef PID_FAN_SCALING_AT_MIN_SPEED - #define PID_FAN_SCALING_AT_MIN_SPEED 6.0 - #endif - #ifndef PID_FAN_SCALING_MIN_SPEED - #define PID_FAN_SCALING_MIN_SPEED 10.0 - #endif - #ifndef DEFAULT_Kf - #define DEFAULT_Kf (255.0*PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEED*PID_FAN_SCALING_MIN_SPEED)/(255.0-PID_FAN_SCALING_MIN_SPEED) - #endif - #ifndef PID_FAN_SCALING_LIN_FACTOR - #define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0 - #endif - #else - #ifndef PID_FAN_SCALING_LIN_FACTOR - #define PID_FAN_SCALING_LIN_FACTOR (0) - #endif - #ifndef DEFAULT_Kf - #define DEFAULT_Kf 10 - #endif - #ifndef PID_FAN_SCALING_MIN_SPEED - #define PID_FAN_SCALING_MIN_SPEED 10 - #endif - #endif - #endif -#endif -#if ENABLED(AUTOTEMP) - #ifndef AUTOTEMP_OLDWEIGHT - #define AUTOTEMP_OLDWEIGHT 0.98 - #endif - #ifndef AUTOTEMP_MIN - #define AUTOTEMP_MIN 210 - #endif - #ifndef AUTOTEMP_MAX - #define AUTOTEMP_MAX 250 - #endif - #ifndef AUTOTEMP_FACTOR - #define AUTOTEMP_FACTOR 0.1f - #endif - #if ENABLED(AUTOTEMP_PROPORTIONAL) - #ifndef AUTOTEMP_MIN_P - #define AUTOTEMP_MIN_P 0 - #endif - #ifndef AUTOTEMP_MAX_P - #define AUTOTEMP_MAX_P 5 - #endif - #ifndef AUTOTEMP_FACTOR_P - #define AUTOTEMP_FACTOR_P 1 - #endif - #endif -#endif -#if ENABLED(EXTRUDER_RUNOUT_PREVENT) - #ifndef EXTRUDER_RUNOUT_MINTEMP - #define EXTRUDER_RUNOUT_MINTEMP 190 - #endif - #ifndef EXTRUDER_RUNOUT_SECONDS - #define EXTRUDER_RUNOUT_SECONDS 30 - #endif - #ifndef EXTRUDER_RUNOUT_SPEED - #define EXTRUDER_RUNOUT_SPEED 1500 - #endif - #ifndef EXTRUDER_RUNOUT_EXTRUDE - #define EXTRUDER_RUNOUT_EXTRUDE 5 - #endif -#endif -#if ENABLED(HOTEND_IDLE_TIMEOUT) - #ifndef HOTEND_IDLE_TIMEOUT_SEC - #define HOTEND_IDLE_TIMEOUT_SEC (5*60) - #endif - #ifndef HOTEND_IDLE_MIN_TRIGGER - #define HOTEND_IDLE_MIN_TRIGGER 180 - #endif - #ifndef HOTEND_IDLE_NOZZLE_TARGET - #define HOTEND_IDLE_NOZZLE_TARGET 0 - #endif - #ifndef HOTEND_IDLE_BED_TARGET - #define HOTEND_IDLE_BED_TARGET 0 - #endif -#endif -#ifndef TEMP_SENSOR_AD595_OFFSET - #define TEMP_SENSOR_AD595_OFFSET 0.0 -#endif -#ifndef TEMP_SENSOR_AD595_GAIN - #define TEMP_SENSOR_AD595_GAIN 1.0 -#endif -#ifndef TEMP_SENSOR_AD8495_OFFSET - #define TEMP_SENSOR_AD8495_OFFSET 0.0 -#endif -#ifndef TEMP_SENSOR_AD8495_GAIN - #define TEMP_SENSOR_AD8495_GAIN 1.0 -#endif -#if ENABLED(USE_CONTROLLER_FAN) - #ifndef CONTROLLERFAN_SPEED_MIN - #define CONTROLLERFAN_SPEED_MIN 0 - #endif - #ifndef CONTROLLERFAN_SPEED_ACTIVE - #define CONTROLLERFAN_SPEED_ACTIVE 255 - #endif - #ifndef CONTROLLERFAN_SPEED_IDLE - #define CONTROLLERFAN_SPEED_IDLE 0 - #endif - #ifndef CONTROLLERFAN_IDLE_TIME - #define CONTROLLERFAN_IDLE_TIME 60 - #endif -#endif -#if ENABLED(FAST_PWM_FAN) - #ifndef FAST_PWM_FAN_FREQUENCY - #ifdef __AVR__ - #ifndef FAST_PWM_FAN_FREQUENCY - #define FAST_PWM_FAN_FREQUENCY ((F_CPU) / (2 * 255 * 1)) - #endif - #else - #ifndef FAST_PWM_FAN_FREQUENCY - #define FAST_PWM_FAN_FREQUENCY 1000U - #endif - #endif - #endif -#endif -#ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN -1 -#endif -#ifndef E1_AUTO_FAN_PIN - #define E1_AUTO_FAN_PIN -1 -#endif -#ifndef E2_AUTO_FAN_PIN - #define E2_AUTO_FAN_PIN -1 -#endif -#ifndef E3_AUTO_FAN_PIN - #define E3_AUTO_FAN_PIN -1 -#endif -#ifndef E4_AUTO_FAN_PIN - #define E4_AUTO_FAN_PIN -1 -#endif -#ifndef E5_AUTO_FAN_PIN - #define E5_AUTO_FAN_PIN -1 -#endif -#ifndef E6_AUTO_FAN_PIN - #define E6_AUTO_FAN_PIN -1 -#endif -#ifndef E7_AUTO_FAN_PIN - #define E7_AUTO_FAN_PIN -1 -#endif -#ifndef CHAMBER_AUTO_FAN_PIN - #define CHAMBER_AUTO_FAN_PIN -1 -#endif -#ifndef COOLER_AUTO_FAN_PIN - #define COOLER_AUTO_FAN_PIN -1 -#endif -#ifndef EXTRUDER_AUTO_FAN_TEMPERATURE - #define EXTRUDER_AUTO_FAN_TEMPERATURE 50 -#endif -#ifndef EXTRUDER_AUTO_FAN_SPEED - #define EXTRUDER_AUTO_FAN_SPEED 255 -#endif -#ifndef CHAMBER_AUTO_FAN_TEMPERATURE - #define CHAMBER_AUTO_FAN_TEMPERATURE 30 -#endif -#ifndef CHAMBER_AUTO_FAN_SPEED - #define CHAMBER_AUTO_FAN_SPEED 255 -#endif -#ifndef COOLER_AUTO_FAN_TEMPERATURE - #define COOLER_AUTO_FAN_TEMPERATURE 18 -#endif -#ifndef COOLER_AUTO_FAN_SPEED - #define COOLER_AUTO_FAN_SPEED 255 -#endif -#ifndef FANMUX0_PIN - #define FANMUX0_PIN -1 -#endif -#ifndef FANMUX1_PIN - #define FANMUX1_PIN -1 -#endif -#ifndef FANMUX2_PIN - #define FANMUX2_PIN -1 -#endif -#if ENABLED(CASE_LIGHT_ENABLE) - #ifndef INVERT_CASE_LIGHT - #define INVERT_CASE_LIGHT false - #endif - #ifndef CASE_LIGHT_DEFAULT_ON - #define CASE_LIGHT_DEFAULT_ON true - #endif - #ifndef CASE_LIGHT_DEFAULT_BRIGHTNESS - #define CASE_LIGHT_DEFAULT_BRIGHTNESS 105 - #endif - #if ANY(CASE_LIGHT_USE_NEOPIXEL, CASE_LIGHT_USE_RGB_LED) - #ifndef CASE_LIGHT_DEFAULT_COLOR - #define CASE_LIGHT_DEFAULT_COLOR { 255, 255, 255, 255 } - #endif - #endif -#endif -#if ENABLED(DUAL_X_CARRIAGE) - #ifndef X1_MIN_POS - #define X1_MIN_POS X_MIN_POS - #endif - #ifndef X1_MAX_POS - #define X1_MAX_POS X_BED_SIZE - #endif - #ifndef X2_MIN_POS - #define X2_MIN_POS 80 - #endif - #ifndef X2_MAX_POS - #define X2_MAX_POS 353 - #endif - #ifndef X2_HOME_POS - #define X2_HOME_POS X2_MAX_POS - #endif - #ifndef DEFAULT_DUAL_X_CARRIAGE_MODE - #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_AUTO_PARK_MODE - #endif - #ifndef DEFAULT_DUPLICATION_X_OFFSET - #define DEFAULT_DUPLICATION_X_OFFSET 100 - #endif -#endif -#if HAS_X2_STEPPER && DISABLED(DUAL_X_CARRIAGE) - #if ENABLED(X_DUAL_ENDSTOPS) - #ifndef X2_ENDSTOP_ADJUSTMENT - #define X2_ENDSTOP_ADJUSTMENT 0 - #endif - #endif -#endif -#if HAS_Y2_STEPPER - #if ENABLED(Y_DUAL_ENDSTOPS) - #ifndef Y2_ENDSTOP_ADJUSTMENT - #define Y2_ENDSTOP_ADJUSTMENT 0 - #endif - #endif -#endif -#ifdef Z2_DRIVER_TYPE - #if ENABLED(Z_MULTI_ENDSTOPS) - #ifndef Z2_ENDSTOP_ADJUSTMENT - #define Z2_ENDSTOP_ADJUSTMENT 0 - #endif - #endif - #ifdef Z3_DRIVER_TYPE - #if ENABLED(Z_MULTI_ENDSTOPS) - #ifndef Z3_ENDSTOP_ADJUSTMENT - #define Z3_ENDSTOP_ADJUSTMENT 0 - #endif - #endif - #endif - #ifdef Z4_DRIVER_TYPE - #if ENABLED(Z_MULTI_ENDSTOPS) - #ifndef Z4_ENDSTOP_ADJUSTMENT - #define Z4_ENDSTOP_ADJUSTMENT 0 - #endif - #endif - #endif -#endif -#ifndef HOMING_BUMP_MM - #define HOMING_BUMP_MM { 5, 5, 2 } -#endif -#ifndef HOMING_BUMP_DIVISOR - #define HOMING_BUMP_DIVISOR { 2, 2, 4 } -#endif -#if ENABLED(BLTOUCH) - #ifdef BLTOUCH_HS_MODE - #ifndef BLTOUCH_HS_EXTRA_CLEARANCE - #define BLTOUCH_HS_EXTRA_CLEARANCE 7 - #endif - #endif -#endif -#if ENABLED(Z_STEPPER_AUTO_ALIGN) - #ifndef Z_STEPPER_ALIGN_STEPPER_XY - #ifndef Z_STEPPER_ALIGN_AMP - #define Z_STEPPER_ALIGN_AMP 1.0 - #endif - #endif - #ifndef G34_MAX_GRADE - #define G34_MAX_GRADE 5 - #endif - #ifndef Z_STEPPER_ALIGN_ITERATIONS - #define Z_STEPPER_ALIGN_ITERATIONS 5 - #endif - #ifndef Z_STEPPER_ALIGN_ACC - #define Z_STEPPER_ALIGN_ACC 0.02 - #endif -#endif -#if ENABLED(ASSISTED_TRAMMING) - #ifndef TRAMMING_POINT_XY - #define TRAMMING_POINT_XY { { 20, 20 }, { 180, 20 }, { 180, 180 }, { 20, 180 } } - #endif - #ifndef TRAMMING_POINT_NAME_1 - #define TRAMMING_POINT_NAME_1 "Front-Left" - #endif - #ifndef TRAMMING_POINT_NAME_2 - #define TRAMMING_POINT_NAME_2 "Front-Right" - #endif - #ifndef TRAMMING_POINT_NAME_3 - #define TRAMMING_POINT_NAME_3 "Back-Right" - #endif - #ifndef TRAMMING_POINT_NAME_4 - #define TRAMMING_POINT_NAME_4 "Back-Left" - #endif - #ifndef TRAMMING_SCREW_THREAD - #define TRAMMING_SCREW_THREAD 30 - #endif -#endif -#if ENABLED(FT_MOTION) - #ifndef FTM_DEFAULT_DYNFREQ_MODE - #define FTM_DEFAULT_DYNFREQ_MODE dynFreqMode_DISABLED - #endif - #ifndef FTM_DEFAULT_SHAPER_X - #define FTM_DEFAULT_SHAPER_X ftMotionShaper_NONE - #endif - #ifndef FTM_DEFAULT_SHAPER_Y - #define FTM_DEFAULT_SHAPER_Y ftMotionShaper_NONE - #endif - #ifndef FTM_SHAPING_DEFAULT_FREQ_X - #define FTM_SHAPING_DEFAULT_FREQ_X 37.0f - #endif - #ifndef FTM_SHAPING_DEFAULT_FREQ_Y - #define FTM_SHAPING_DEFAULT_FREQ_Y 37.0f - #endif - #ifndef FTM_LINEAR_ADV_DEFAULT_ENA - #define FTM_LINEAR_ADV_DEFAULT_ENA false - #endif - #ifndef FTM_LINEAR_ADV_DEFAULT_K - #define FTM_LINEAR_ADV_DEFAULT_K 0 - #endif - #ifndef FTM_SHAPING_ZETA_X - #define FTM_SHAPING_ZETA_X 0.1f - #endif - #ifndef FTM_SHAPING_ZETA_Y - #define FTM_SHAPING_ZETA_Y 0.1f - #endif - #ifndef FTM_SHAPING_V_TOL_X - #define FTM_SHAPING_V_TOL_X 0.05f - #endif - #ifndef FTM_SHAPING_V_TOL_Y - #define FTM_SHAPING_V_TOL_Y 0.05f - #endif - #if ENABLED(FTM_UNIFIED_BWS) - #ifndef FTM_BW_SIZE - #define FTM_BW_SIZE 100 - #endif - #else - #ifndef FTM_WINDOW_SIZE - #define FTM_WINDOW_SIZE 200 - #endif - #ifndef FTM_BATCH_SIZE - #define FTM_BATCH_SIZE 100 - #endif - #endif - #ifndef FTM_FS - #define FTM_FS 1000 - #endif - #ifndef FTM_TS - #define FTM_TS 0.001f - #endif - #if DISABLED(COREXY) - #ifndef FTM_STEPPER_FS - #define FTM_STEPPER_FS 20000 - #endif - #ifndef FTM_STEPPERCMD_BUFF_SIZE - #define FTM_STEPPERCMD_BUFF_SIZE 3000 - #endif - #else - #ifndef FTM_STEPPER_FS - #define FTM_STEPPER_FS 30000 - #endif - #ifndef FTM_STEPPERCMD_BUFF_SIZE - #define FTM_STEPPERCMD_BUFF_SIZE 6000 - #endif - #endif - #ifndef FTM_STEPS_PER_UNIT_TIME - #define FTM_STEPS_PER_UNIT_TIME (FTM_STEPPER_FS / FTM_FS) - #endif - #ifndef FTM_CTS_COMPARE_VAL - #define FTM_CTS_COMPARE_VAL (FTM_STEPS_PER_UNIT_TIME / 2) - #endif - #ifndef FTM_MIN_TICKS - #define FTM_MIN_TICKS ((STEPPER_TIMER_RATE) / (FTM_STEPPER_FS)) - #endif - #ifndef FTM_MIN_SHAPE_FREQ - #define FTM_MIN_SHAPE_FREQ 10 - #endif - #ifndef FTM_RATIO - #define FTM_RATIO (FTM_FS / FTM_MIN_SHAPE_FREQ) - #endif - #ifndef FTM_ZMAX - #define FTM_ZMAX (FTM_RATIO * 2) - #endif -#endif -#if ANY(INPUT_SHAPING_X, INPUT_SHAPING_Y, INPUT_SHAPING_Z) - #if ENABLED(INPUT_SHAPING_X) - #ifndef SHAPING_FREQ_X - #define SHAPING_FREQ_X 40.0 - #endif - #ifndef SHAPING_ZETA_X - #define SHAPING_ZETA_X 0.15 - #endif - #endif - #if ENABLED(INPUT_SHAPING_Y) - #ifndef SHAPING_FREQ_Y - #define SHAPING_FREQ_Y 40.0 - #endif - #ifndef SHAPING_ZETA_Y - #define SHAPING_ZETA_Y 0.15 - #endif - #endif - #if ENABLED(INPUT_SHAPING_Z) - #ifndef SHAPING_FREQ_Z - #define SHAPING_FREQ_Z 40.0 - #endif - #ifndef SHAPING_ZETA_Z - #define SHAPING_ZETA_Z 0.15 - #endif - #endif -#endif -#ifndef AXIS_RELATIVE_MODES - #define AXIS_RELATIVE_MODES { false, false, false, false } -#endif -#ifndef STEP_STATE_X - #define STEP_STATE_X HIGH -#endif -#ifndef STEP_STATE_Y - #define STEP_STATE_Y HIGH -#endif -#ifndef STEP_STATE_Z - #define STEP_STATE_Z HIGH -#endif -#ifndef STEP_STATE_I - #define STEP_STATE_I HIGH -#endif -#ifndef STEP_STATE_J - #define STEP_STATE_J HIGH -#endif -#ifndef STEP_STATE_K - #define STEP_STATE_K HIGH -#endif -#ifndef STEP_STATE_U - #define STEP_STATE_U HIGH -#endif -#ifndef STEP_STATE_V - #define STEP_STATE_V HIGH -#endif -#ifndef STEP_STATE_W - #define STEP_STATE_W HIGH -#endif -#ifndef STEP_STATE_E - #define STEP_STATE_E HIGH -#endif -#ifndef DEFAULT_STEPPER_TIMEOUT_SEC - #define DEFAULT_STEPPER_TIMEOUT_SEC 120 -#endif -#ifndef DEFAULT_MINIMUMFEEDRATE - #define DEFAULT_MINIMUMFEEDRATE 0.0 -#endif -#ifndef DEFAULT_MINTRAVELFEEDRATE - #define DEFAULT_MINTRAVELFEEDRATE 0.0 -#endif -#ifndef DEFAULT_MINSEGMENTTIME - #define DEFAULT_MINSEGMENTTIME 20000 -#endif -#if ENABLED(SLOWDOWN) - #ifndef SLOWDOWN_DIVISOR - #define SLOWDOWN_DIVISOR 2 - #endif -#endif -#ifdef XY_FREQUENCY_LIMIT - #ifndef XY_FREQUENCY_MIN_PERCENT - #define XY_FREQUENCY_MIN_PERCENT 5 - #endif -#endif -#if ENABLED(BACKLASH_COMPENSATION) - #ifndef BACKLASH_DISTANCE_MM - #define BACKLASH_DISTANCE_MM { 0, 0, 0 } - #endif - #ifndef BACKLASH_CORRECTION - #define BACKLASH_CORRECTION 0.0 - #endif - #if ENABLED(BACKLASH_GCODE) - #if ENABLED(MEASURE_BACKLASH_WHEN_PROBING) - #ifndef BACKLASH_MEASUREMENT_LIMIT - #define BACKLASH_MEASUREMENT_LIMIT 0.5 - #endif - #ifndef BACKLASH_MEASUREMENT_RESOLUTION - #define BACKLASH_MEASUREMENT_RESOLUTION 0.005 - #endif - #ifndef BACKLASH_MEASUREMENT_FEEDRATE - #define BACKLASH_MEASUREMENT_FEEDRATE Z_PROBE_FEEDRATE_SLOW - #endif - #endif - #endif -#endif -#if ENABLED(CALIBRATION_GCODE) - #ifndef CALIBRATION_FEEDRATE_SLOW - #define CALIBRATION_FEEDRATE_SLOW 60 - #endif - #ifndef CALIBRATION_FEEDRATE_FAST - #define CALIBRATION_FEEDRATE_FAST 1200 - #endif - #ifndef CALIBRATION_FEEDRATE_TRAVEL - #define CALIBRATION_FEEDRATE_TRAVEL 3000 - #endif - #ifndef CALIBRATION_NOZZLE_TIP_HEIGHT - #define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 - #endif - #ifndef CALIBRATION_NOZZLE_OUTER_DIAMETER - #define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 - #endif - #ifndef CALIBRATION_OBJECT_CENTER - #define CALIBRATION_OBJECT_CENTER { 264.0, -22.0, -2.0 } - #endif - #ifndef CALIBRATION_OBJECT_DIMENSIONS - #define CALIBRATION_OBJECT_DIMENSIONS { 10.0, 10.0, 10.0 } - #endif - #ifndef CALIBRATION_PIN - #ifndef CALIBRATION_PIN_INVERTING - #define CALIBRATION_PIN_INVERTING false - #endif - #endif -#endif -#ifndef MULTISTEPPING_LIMIT - #define MULTISTEPPING_LIMIT 16 -#endif -#ifndef MICROSTEP_MODES - #define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } -#endif -#if ANY(DIGIPOT_MCP4018, DIGIPOT_MCP4451) - #ifndef DIGIPOT_I2C_NUM_CHANNELS - #define DIGIPOT_I2C_NUM_CHANNELS 8 - #endif - #ifndef DIGIPOT_I2C_MOTOR_CURRENTS - #define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } - #endif -#endif -#if HAS_MANUAL_MOVE_MENU - #ifndef MANUAL_FEEDRATE - #define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } - #endif - #ifndef FINE_MANUAL_MOVE - #define FINE_MANUAL_MOVE 0.025 - #endif -#endif -#if ENABLED(ENCODER_RATE_MULTIPLIER) - #ifndef ENCODER_10X_STEPS_PER_SEC - #define ENCODER_10X_STEPS_PER_SEC 30 - #endif - #ifndef ENCODER_100X_STEPS_PER_SEC - #define ENCODER_100X_STEPS_PER_SEC 80 - #endif -#endif -#if ENABLED(BEEP_ON_FEEDRATE_CHANGE) - #ifndef FEEDRATE_CHANGE_BEEP_DURATION - #define FEEDRATE_CHANGE_BEEP_DURATION 10 - #endif - #ifndef FEEDRATE_CHANGE_BEEP_FREQUENCY - #define FEEDRATE_CHANGE_BEEP_FREQUENCY 440 - #endif -#endif -#if HAS_MARLINUI_MENU - #if HAS_BED_PROBE - #if ENABLED(X_AXIS_TWIST_COMPENSATION) - #ifndef XATC_START_Z - #define XATC_START_Z 0.0 - #endif - #ifndef XATC_MAX_POINTS - #define XATC_MAX_POINTS 3 - #endif - #ifndef XATC_Y_POSITION - #define XATC_Y_POSITION Y_CENTER - #endif - #ifndef XATC_Z_OFFSETS - #define XATC_Z_OFFSETS { 0, 0, 0 } - #endif - #endif - #endif - #ifndef MANUAL_MOVE_DISTANCE_MM - #define MANUAL_MOVE_DISTANCE_MM 10, 1.0, 0.1 - #endif - #ifndef MANUAL_MOVE_DISTANCE_IN - #define MANUAL_MOVE_DISTANCE_IN 0.100, 0.010, 0.001 - #endif - #ifndef MANUAL_MOVE_DISTANCE_DEG - #define MANUAL_MOVE_DISTANCE_DEG 90, 45, 22.5, 5, 1 - #endif -#endif -#if HAS_DISPLAY - #if ENABLED(SHOW_BOOTSCREEN) - #ifndef BOOTSCREEN_TIMEOUT - #define BOOTSCREEN_TIMEOUT 3000 - #endif - #endif - #if ENABLED(LED_CONTROL_MENU) - #if ENABLED(LED_COLOR_PRESETS) - #ifndef LED_USER_PRESET_RED - #define LED_USER_PRESET_RED 255 - #endif - #ifndef LED_USER_PRESET_GREEN - #define LED_USER_PRESET_GREEN 128 - #endif - #ifndef LED_USER_PRESET_BLUE - #define LED_USER_PRESET_BLUE 0 - #endif - #ifndef LED_USER_PRESET_WHITE - #define LED_USER_PRESET_WHITE 255 - #endif - #ifndef LED_USER_PRESET_BRIGHTNESS - #define LED_USER_PRESET_BRIGHTNESS 255 - #endif - #endif - #if ENABLED(NEO2_COLOR_PRESETS) - #ifndef NEO2_USER_PRESET_RED - #define NEO2_USER_PRESET_RED 255 - #endif - #ifndef NEO2_USER_PRESET_GREEN - #define NEO2_USER_PRESET_GREEN 128 - #endif - #ifndef NEO2_USER_PRESET_BLUE - #define NEO2_USER_PRESET_BLUE 0 - #endif - #ifndef NEO2_USER_PRESET_WHITE - #define NEO2_USER_PRESET_WHITE 255 - #endif - #ifndef NEO2_USER_PRESET_BRIGHTNESS - #define NEO2_USER_PRESET_BRIGHTNESS 255 - #endif - #endif - #endif -#endif -#if HAS_FEEDRATE_EDIT - #ifndef SPEED_EDIT_MIN - #define SPEED_EDIT_MIN 10 - #endif - #ifndef SPEED_EDIT_MAX - #define SPEED_EDIT_MAX 999 - #endif -#endif -#if HAS_FLOW_EDIT - #ifndef FLOW_EDIT_MIN - #define FLOW_EDIT_MIN 10 - #endif - #ifndef FLOW_EDIT_MAX - #define FLOW_EDIT_MAX 999 - #endif -#endif -#if HAS_DISPLAY && ANY(HAS_MEDIA, SET_PROGRESS_MANUALLY) - #if ANY(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL) - #if ENABLED(LCD_PROGRESS_BAR) - #ifndef PROGRESS_BAR_BAR_TIME - #define PROGRESS_BAR_BAR_TIME 2000 - #endif - #ifndef PROGRESS_BAR_MSG_TIME - #define PROGRESS_BAR_MSG_TIME 3000 - #endif - #ifndef PROGRESS_MSG_EXPIRE - #define PROGRESS_MSG_EXPIRE 0 - #endif - #endif - #endif -#endif -#if HAS_MEDIA - #ifndef SD_PROCEDURE_DEPTH - #define SD_PROCEDURE_DEPTH 1 - #endif - #ifndef SD_FINISHED_STEPPERRELEASE - #define SD_FINISHED_STEPPERRELEASE true - #endif - #ifndef SD_FINISHED_RELEASECOMMAND - #define SD_FINISHED_RELEASECOMMAND "M84" - #endif - #ifndef EVENT_GCODE_SD_ABORT - #define EVENT_GCODE_SD_ABORT "G28XY" - #endif - #if ENABLED(PRINTER_EVENT_LEDS) - #ifndef PE_LEDS_COMPLETED_TIME - #define PE_LEDS_COMPLETED_TIME (30*60) - #endif - #endif - #if ENABLED(POWER_LOSS_RECOVERY) - #ifndef PLR_ENABLED_DEFAULT - #define PLR_ENABLED_DEFAULT false - #endif - #ifndef POWER_LOSS_MIN_Z_CHANGE - #define POWER_LOSS_MIN_Z_CHANGE 0.05 - #endif - #endif - #if ENABLED(SDCARD_SORT_ALPHA) - #ifndef SDSORT_REVERSE - #define SDSORT_REVERSE false - #endif - #ifndef SDSORT_LIMIT - #define SDSORT_LIMIT 40 - #endif - #ifndef SDSORT_FOLDERS - #define SDSORT_FOLDERS -1 - #endif - #ifndef SDSORT_GCODE - #define SDSORT_GCODE false - #endif - #ifndef SDSORT_USES_RAM - #define SDSORT_USES_RAM false - #endif - #ifndef SDSORT_USES_STACK - #define SDSORT_USES_STACK false - #endif - #ifndef SDSORT_CACHE_NAMES - #define SDSORT_CACHE_NAMES false - #endif - #ifndef SDSORT_DYNAMIC_RAM - #define SDSORT_DYNAMIC_RAM false - #endif - #ifndef SDSORT_CACHE_VFATS - #define SDSORT_CACHE_VFATS 2 - #endif - #endif - #if ENABLED(USB_FLASH_DRIVE_SUPPORT) - #if DISABLED(USE_OTG_USB_HOST) - #ifndef USB_CS_PIN - #define USB_CS_PIN SDSS - #endif - #ifndef USB_INTR_PIN - #define USB_INTR_PIN SD_DETECT_PIN - #endif - #endif - #endif - #if ENABLED(SD_FIRMWARE_UPDATE) - #ifndef SD_FIRMWARE_UPDATE_EEPROM_ADDR - #define SD_FIRMWARE_UPDATE_EEPROM_ADDR 0x1FF - #endif - #ifndef SD_FIRMWARE_UPDATE_ACTIVE_VALUE - #define SD_FIRMWARE_UPDATE_ACTIVE_VALUE 0xF0 - #endif - #ifndef SD_FIRMWARE_UPDATE_INACTIVE_VALUE - #define SD_FIRMWARE_UPDATE_INACTIVE_VALUE 0xFF - #endif - #endif - #if ENABLED(MULTI_VOLUME) - #ifndef DEFAULT_VOLUME - #define DEFAULT_VOLUME SV_SD_ONBOARD - #endif - #ifndef DEFAULT_SHARED_VOLUME - #define DEFAULT_SHARED_VOLUME SV_USB_FLASH_DRIVE - #endif - #endif -#endif -#if HAS_MARLINUI_U8GLIB - #if IS_U8GLIB_ST7920 - #if ENABLED(LIGHTWEIGHT_UI) - #ifndef STATUS_EXPIRE_SECONDS - #define STATUS_EXPIRE_SECONDS 20 - #endif - #endif - #endif -#endif -#if HAS_DGUS_LCD - #ifndef LCD_BAUDRATE - #define LCD_BAUDRATE 115200 - #endif - #ifndef DGUS_RX_BUFFER_SIZE - #define DGUS_RX_BUFFER_SIZE 128 - #endif - #ifndef DGUS_TX_BUFFER_SIZE - #define DGUS_TX_BUFFER_SIZE 48 - #endif - #ifndef DGUS_UPDATE_INTERVAL_MS - #define DGUS_UPDATE_INTERVAL_MS 500 - #endif - #if DGUS_UI_IS(FYSETC, MKS, HIPRECY) - #if ENABLED(DGUS_FILAMENT_LOADUNLOAD) - #ifndef DGUS_FILAMENT_PURGE_LENGTH - #define DGUS_FILAMENT_PURGE_LENGTH 10 - #endif - #ifndef DGUS_FILAMENT_LOAD_LENGTH_PER_TIME - #define DGUS_FILAMENT_LOAD_LENGTH_PER_TIME 0.5 - #endif - #endif - #if ENABLED(DGUS_UI_WAITING) - #ifndef DGUS_UI_WAITING_STATUS - #define DGUS_UI_WAITING_STATUS 10 - #endif - #ifndef DGUS_UI_WAITING_STATUS_PERIOD - #define DGUS_UI_WAITING_STATUS_PERIOD 8 - #endif - #endif - #elif DGUS_UI_IS(E3S1PRO) - #ifndef DGUS_AUTOSCROLL_START_CYCLES - #define DGUS_AUTOSCROLL_START_CYCLES 1 - #endif - #ifndef DGUS_AUTOSCROLL_END_CYCLES - #define DGUS_AUTOSCROLL_END_CYCLES 1 - #endif - #endif -#endif -#if ENABLED(TOUCH_UI_FTDI_EVE) - #if ENABLED(OTHER_PIN_LAYOUT) - #ifndef CLCD_MOD_RESET - #define CLCD_MOD_RESET 9 - #endif - #ifndef CLCD_SPI_CS - #define CLCD_SPI_CS 10 - #endif - #if ENABLED(CLCD_USE_SOFT_SPI) - #ifndef CLCD_SOFT_SPI_MOSI - #define CLCD_SOFT_SPI_MOSI 11 - #endif - #ifndef CLCD_SOFT_SPI_MISO - #define CLCD_SOFT_SPI_MISO 12 - #endif - #ifndef CLCD_SOFT_SPI_SCLK - #define CLCD_SOFT_SPI_SCLK 13 - #endif - #endif - #endif -#endif -#if HAS_ADC_BUTTONS - #ifndef ADC_BUTTON_DEBOUNCE_DELAY - #define ADC_BUTTON_DEBOUNCE_DELAY 16 - #endif -#endif -#if ENABLED(BABYSTEPPING) - #ifndef BABYSTEP_MULTIPLICATOR_Z - #define BABYSTEP_MULTIPLICATOR_Z 1 - #endif - #ifndef BABYSTEP_MULTIPLICATOR_XY - #define BABYSTEP_MULTIPLICATOR_XY 1 - #endif - #if ENABLED(DOUBLECLICK_FOR_Z_BABYSTEPPING) - #ifndef DOUBLECLICK_MAX_INTERVAL - #define DOUBLECLICK_MAX_INTERVAL 1250 - #endif - #if ENABLED(MOVE_Z_WHEN_IDLE) - #ifndef MOVE_Z_IDLE_MULTIPLICATOR - #define MOVE_Z_IDLE_MULTIPLICATOR 1 - #endif - #endif - #endif -#endif -#if ENABLED(LIN_ADVANCE) - #if ENABLED(DISTINCT_E_FACTORS) - #ifndef ADVANCE_K - #define ADVANCE_K { 0.22 } - #endif - #else - #ifndef ADVANCE_K - #define ADVANCE_K 0.22 - #endif - #endif -#endif -#if ENABLED(G29_RETRY_AND_RECOVER) - #ifndef G29_MAX_RETRIES - #define G29_MAX_RETRIES 3 - #endif - #ifndef G29_SUCCESS_COMMANDS - #define G29_SUCCESS_COMMANDS "M117 Bed leveling done." - #endif - #ifndef G29_RECOVER_COMMANDS - #define G29_RECOVER_COMMANDS "M117 Probe failed. Rewiping.\nG28\nG12 P0 S12 T0" - #endif - #ifndef G29_FAILURE_COMMANDS - #define G29_FAILURE_COMMANDS "M117 Bed leveling failed.\nG0 Z10\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nM300 P25 S880\nM300 P50 S0\nG4 S1" - #endif -#endif -#if ANY(PTC_PROBE, PTC_BED, PTC_HOTEND) - #if ENABLED(PTC_PROBE) - #ifndef PTC_PROBE_START - #define PTC_PROBE_START 30 - #endif - #ifndef PTC_PROBE_RES - #define PTC_PROBE_RES 5 - #endif - #ifndef PTC_PROBE_COUNT - #define PTC_PROBE_COUNT 10 - #endif - #ifndef PTC_PROBE_ZOFFS - #define PTC_PROBE_ZOFFS { 0 } - #endif - #endif - #if ENABLED(PTC_BED) - #ifndef PTC_BED_START - #define PTC_BED_START 60 - #endif - #ifndef PTC_BED_RES - #define PTC_BED_RES 5 - #endif - #ifndef PTC_BED_COUNT - #define PTC_BED_COUNT 10 - #endif - #ifndef PTC_BED_ZOFFS - #define PTC_BED_ZOFFS { 0 } - #endif - #endif - #if ENABLED(PTC_HOTEND) - #ifndef PTC_HOTEND_START - #define PTC_HOTEND_START 180 - #endif - #ifndef PTC_HOTEND_RES - #define PTC_HOTEND_RES 5 - #endif - #ifndef PTC_HOTEND_COUNT - #define PTC_HOTEND_COUNT 20 - #endif - #ifndef PTC_HOTEND_ZOFFS - #define PTC_HOTEND_ZOFFS { 0 } - #endif - #endif - #if ALL(PTC_PROBE, PTC_BED) - #ifndef PTC_PARK_POS - #define PTC_PARK_POS { 0, 0, 100 } - #endif - #ifndef PTC_PROBE_POS - #define PTC_PROBE_POS { 90, 100 } - #endif - #ifndef PTC_PROBE_TEMP - #define PTC_PROBE_TEMP 30 - #endif - #ifndef PTC_PROBE_HEATING_OFFSET - #define PTC_PROBE_HEATING_OFFSET 0.5 - #endif - #endif -#endif -#if ENABLED(ARC_SUPPORT) - #ifndef MIN_ARC_SEGMENT_MM - #define MIN_ARC_SEGMENT_MM 0.1 - #endif - #ifndef MAX_ARC_SEGMENT_MM - #define MAX_ARC_SEGMENT_MM 1.0 - #endif - #ifndef MIN_CIRCLE_SEGMENTS - #define MIN_CIRCLE_SEGMENTS 72 - #endif - #ifndef N_ARC_CORRECTION - #define N_ARC_CORRECTION 25 - #endif -#endif -#if ENABLED(G38_PROBE_TARGET) - #ifndef G38_MINIMUM_MOVE - #define G38_MINIMUM_MOVE 0.0275 - #endif -#endif -#ifndef MIN_STEPS_PER_SEGMENT - #define MIN_STEPS_PER_SEGMENT 6 -#endif -#if ALL(HAS_MEDIA, DIRECT_STEPPING) - #ifndef BLOCK_BUFFER_SIZE - #define BLOCK_BUFFER_SIZE 8 - #endif -#elif HAS_MEDIA - #ifndef BLOCK_BUFFER_SIZE - #define BLOCK_BUFFER_SIZE 16 - #endif -#else - #ifndef BLOCK_BUFFER_SIZE - #define BLOCK_BUFFER_SIZE 16 - #endif -#endif -#ifndef MAX_CMD_SIZE - #define MAX_CMD_SIZE 96 -#endif -#ifndef BUFSIZE - #define BUFSIZE 4 -#endif -#ifndef TX_BUFFER_SIZE - #define TX_BUFFER_SIZE 0 -#endif -#ifndef PROPORTIONAL_FONT_RATIO - #define PROPORTIONAL_FONT_RATIO 1.0 -#endif -#if ENABLED(FWRETRACT) - #if ENABLED(FWRETRACT_AUTORETRACT) - #ifndef MIN_AUTORETRACT - #define MIN_AUTORETRACT 0.1 - #endif - #ifndef MAX_AUTORETRACT - #define MAX_AUTORETRACT 10.0 - #endif - #endif - #ifndef RETRACT_LENGTH - #define RETRACT_LENGTH 3 - #endif - #ifndef RETRACT_LENGTH_SWAP - #define RETRACT_LENGTH_SWAP 13 - #endif - #ifndef RETRACT_FEEDRATE - #define RETRACT_FEEDRATE 45 - #endif - #ifndef RETRACT_ZRAISE - #define RETRACT_ZRAISE 0 - #endif - #ifndef RETRACT_RECOVER_LENGTH - #define RETRACT_RECOVER_LENGTH 0 - #endif - #ifndef RETRACT_RECOVER_LENGTH_SWAP - #define RETRACT_RECOVER_LENGTH_SWAP 0 - #endif - #ifndef RETRACT_RECOVER_FEEDRATE - #define RETRACT_RECOVER_FEEDRATE 8 - #endif - #ifndef RETRACT_RECOVER_FEEDRATE_SWAP - #define RETRACT_RECOVER_FEEDRATE_SWAP 8 - #endif -#endif -#if HAS_MULTI_EXTRUDER - #ifndef TOOLCHANGE_ZRAISE - #define TOOLCHANGE_ZRAISE 2 - #endif - #if ENABLED(TOOLCHANGE_FILAMENT_SWAP) - #ifndef TOOLCHANGE_FS_LENGTH - #define TOOLCHANGE_FS_LENGTH 12 - #endif - #ifndef TOOLCHANGE_FS_EXTRA_RESUME_LENGTH - #define TOOLCHANGE_FS_EXTRA_RESUME_LENGTH 0 - #endif - #ifndef TOOLCHANGE_FS_RETRACT_SPEED - #define TOOLCHANGE_FS_RETRACT_SPEED (50*60) - #endif - #ifndef TOOLCHANGE_FS_UNRETRACT_SPEED - #define TOOLCHANGE_FS_UNRETRACT_SPEED (25*60) - #endif - #ifndef TOOLCHANGE_FS_EXTRA_PRIME - #define TOOLCHANGE_FS_EXTRA_PRIME 0 - #endif - #ifndef TOOLCHANGE_FS_PRIME_SPEED - #define TOOLCHANGE_FS_PRIME_SPEED (4.6*60) - #endif - #ifndef TOOLCHANGE_FS_WIPE_RETRACT - #define TOOLCHANGE_FS_WIPE_RETRACT 0 - #endif - #ifndef TOOLCHANGE_FS_FAN - #define TOOLCHANGE_FS_FAN -1 - #endif - #ifndef TOOLCHANGE_FS_FAN_SPEED - #define TOOLCHANGE_FS_FAN_SPEED 255 - #endif - #ifndef TOOLCHANGE_FS_FAN_TIME - #define TOOLCHANGE_FS_FAN_TIME 10 - #endif - #endif - #if ENABLED(TOOLCHANGE_PARK) - #ifndef TOOLCHANGE_PARK_XY - #define TOOLCHANGE_PARK_XY { X_MIN_POS + 10, Y_MIN_POS + 10 } - #endif - #ifndef TOOLCHANGE_PARK_XY_FEEDRATE - #define TOOLCHANGE_PARK_XY_FEEDRATE 6000 - #endif - #endif -#endif -#if ENABLED(ADVANCED_PAUSE_FEATURE) - #ifndef PAUSE_PARK_RETRACT_FEEDRATE - #define PAUSE_PARK_RETRACT_FEEDRATE 60 - #endif - #ifndef PAUSE_PARK_RETRACT_LENGTH - #define PAUSE_PARK_RETRACT_LENGTH 2 - #endif - #ifndef FILAMENT_CHANGE_UNLOAD_FEEDRATE - #define FILAMENT_CHANGE_UNLOAD_FEEDRATE 10 - #endif - #ifndef FILAMENT_CHANGE_UNLOAD_ACCEL - #define FILAMENT_CHANGE_UNLOAD_ACCEL 25 - #endif - #ifndef FILAMENT_CHANGE_UNLOAD_LENGTH - #define FILAMENT_CHANGE_UNLOAD_LENGTH 100 - #endif - #ifndef FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE - #define FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE 6 - #endif - #ifndef FILAMENT_CHANGE_SLOW_LOAD_LENGTH - #define FILAMENT_CHANGE_SLOW_LOAD_LENGTH 0 - #endif - #ifndef FILAMENT_CHANGE_FAST_LOAD_FEEDRATE - #define FILAMENT_CHANGE_FAST_LOAD_FEEDRATE 6 - #endif - #ifndef FILAMENT_CHANGE_FAST_LOAD_ACCEL - #define FILAMENT_CHANGE_FAST_LOAD_ACCEL 25 - #endif - #ifndef FILAMENT_CHANGE_FAST_LOAD_LENGTH - #define FILAMENT_CHANGE_FAST_LOAD_LENGTH 0 - #endif - #ifndef ADVANCED_PAUSE_PURGE_FEEDRATE - #define ADVANCED_PAUSE_PURGE_FEEDRATE 3 - #endif - #ifndef ADVANCED_PAUSE_PURGE_LENGTH - #define ADVANCED_PAUSE_PURGE_LENGTH 50 - #endif - #ifndef ADVANCED_PAUSE_RESUME_PRIME - #define ADVANCED_PAUSE_RESUME_PRIME 0 - #endif - #ifndef FILAMENT_UNLOAD_PURGE_RETRACT - #define FILAMENT_UNLOAD_PURGE_RETRACT 13 - #endif - #ifndef FILAMENT_UNLOAD_PURGE_DELAY - #define FILAMENT_UNLOAD_PURGE_DELAY 5000 - #endif - #ifndef FILAMENT_UNLOAD_PURGE_LENGTH - #define FILAMENT_UNLOAD_PURGE_LENGTH 8 - #endif - #ifndef FILAMENT_UNLOAD_PURGE_FEEDRATE - #define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 - #endif - #ifndef PAUSE_PARK_NOZZLE_TIMEOUT - #define PAUSE_PARK_NOZZLE_TIMEOUT 45 - #endif - #ifndef FILAMENT_CHANGE_ALERT_BEEPS - #define FILAMENT_CHANGE_ALERT_BEEPS 10 - #endif -#endif -#if HAS_TRINAMIC_CONFIG - #ifndef HOLD_MULTIPLIER - #define HOLD_MULTIPLIER 0.5 - #endif - #ifndef INTERPOLATE - #define INTERPOLATE true - #endif - #if AXIS_IS_TMC_CONFIG(X) - #ifndef X_CURRENT - #define X_CURRENT 800 - #endif - #ifndef X_CURRENT_HOME - #define X_CURRENT_HOME X_CURRENT - #endif - #ifndef X_MICROSTEPS - #define X_MICROSTEPS 16 - #endif - #ifndef X_RSENSE - #define X_RSENSE 0.11 - #endif - #ifndef X_CHAIN_POS - #define X_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(X2) - #ifndef X2_CURRENT - #define X2_CURRENT X_CURRENT - #endif - #ifndef X2_CURRENT_HOME - #define X2_CURRENT_HOME X_CURRENT_HOME - #endif - #ifndef X2_MICROSTEPS - #define X2_MICROSTEPS X_MICROSTEPS - #endif - #ifndef X2_RSENSE - #define X2_RSENSE X_RSENSE - #endif - #ifndef X2_CHAIN_POS - #define X2_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(Y) - #ifndef Y_CURRENT - #define Y_CURRENT 800 - #endif - #ifndef Y_CURRENT_HOME - #define Y_CURRENT_HOME Y_CURRENT - #endif - #ifndef Y_MICROSTEPS - #define Y_MICROSTEPS 16 - #endif - #ifndef Y_RSENSE - #define Y_RSENSE 0.11 - #endif - #ifndef Y_CHAIN_POS - #define Y_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(Y2) - #ifndef Y2_CURRENT - #define Y2_CURRENT Y_CURRENT - #endif - #ifndef Y2_CURRENT_HOME - #define Y2_CURRENT_HOME Y_CURRENT_HOME - #endif - #ifndef Y2_MICROSTEPS - #define Y2_MICROSTEPS Y_MICROSTEPS - #endif - #ifndef Y2_RSENSE - #define Y2_RSENSE Y_RSENSE - #endif - #ifndef Y2_CHAIN_POS - #define Y2_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(Z) - #ifndef Z_CURRENT - #define Z_CURRENT 800 - #endif - #ifndef Z_CURRENT_HOME - #define Z_CURRENT_HOME Z_CURRENT - #endif - #ifndef Z_MICROSTEPS - #define Z_MICROSTEPS 16 - #endif - #ifndef Z_RSENSE - #define Z_RSENSE 0.11 - #endif - #ifndef Z_CHAIN_POS - #define Z_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(Z2) - #ifndef Z2_CURRENT - #define Z2_CURRENT Z_CURRENT - #endif - #ifndef Z2_CURRENT_HOME - #define Z2_CURRENT_HOME Z_CURRENT_HOME - #endif - #ifndef Z2_MICROSTEPS - #define Z2_MICROSTEPS Z_MICROSTEPS - #endif - #ifndef Z2_RSENSE - #define Z2_RSENSE Z_RSENSE - #endif - #ifndef Z2_CHAIN_POS - #define Z2_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(Z3) - #ifndef Z3_CURRENT - #define Z3_CURRENT Z_CURRENT - #endif - #ifndef Z3_CURRENT_HOME - #define Z3_CURRENT_HOME Z_CURRENT_HOME - #endif - #ifndef Z3_MICROSTEPS - #define Z3_MICROSTEPS Z_MICROSTEPS - #endif - #ifndef Z3_RSENSE - #define Z3_RSENSE Z_RSENSE - #endif - #ifndef Z3_CHAIN_POS - #define Z3_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(Z4) - #ifndef Z4_CURRENT - #define Z4_CURRENT Z_CURRENT - #endif - #ifndef Z4_CURRENT_HOME - #define Z4_CURRENT_HOME Z_CURRENT_HOME - #endif - #ifndef Z4_MICROSTEPS - #define Z4_MICROSTEPS Z_MICROSTEPS - #endif - #ifndef Z4_RSENSE - #define Z4_RSENSE Z_RSENSE - #endif - #ifndef Z4_CHAIN_POS - #define Z4_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(I) - #ifndef I_CURRENT - #define I_CURRENT 800 - #endif - #ifndef I_CURRENT_HOME - #define I_CURRENT_HOME I_CURRENT - #endif - #ifndef I_MICROSTEPS - #define I_MICROSTEPS 16 - #endif - #ifndef I_RSENSE - #define I_RSENSE 0.11 - #endif - #ifndef I_CHAIN_POS - #define I_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(J) - #ifndef J_CURRENT - #define J_CURRENT 800 - #endif - #ifndef J_CURRENT_HOME - #define J_CURRENT_HOME J_CURRENT - #endif - #ifndef J_MICROSTEPS - #define J_MICROSTEPS 16 - #endif - #ifndef J_RSENSE - #define J_RSENSE 0.11 - #endif - #ifndef J_CHAIN_POS - #define J_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(K) - #ifndef K_CURRENT - #define K_CURRENT 800 - #endif - #ifndef K_CURRENT_HOME - #define K_CURRENT_HOME K_CURRENT - #endif - #ifndef K_MICROSTEPS - #define K_MICROSTEPS 16 - #endif - #ifndef K_RSENSE - #define K_RSENSE 0.11 - #endif - #ifndef K_CHAIN_POS - #define K_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(U) - #ifndef U_CURRENT - #define U_CURRENT 800 - #endif - #ifndef U_CURRENT_HOME - #define U_CURRENT_HOME U_CURRENT - #endif - #ifndef U_MICROSTEPS - #define U_MICROSTEPS 8 - #endif - #ifndef U_RSENSE - #define U_RSENSE 0.11 - #endif - #ifndef U_CHAIN_POS - #define U_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(V) - #ifndef V_CURRENT - #define V_CURRENT 800 - #endif - #ifndef V_CURRENT_HOME - #define V_CURRENT_HOME V_CURRENT - #endif - #ifndef V_MICROSTEPS - #define V_MICROSTEPS 8 - #endif - #ifndef V_RSENSE - #define V_RSENSE 0.11 - #endif - #ifndef V_CHAIN_POS - #define V_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(W) - #ifndef W_CURRENT - #define W_CURRENT 800 - #endif - #ifndef W_CURRENT_HOME - #define W_CURRENT_HOME W_CURRENT - #endif - #ifndef W_MICROSTEPS - #define W_MICROSTEPS 8 - #endif - #ifndef W_RSENSE - #define W_RSENSE 0.11 - #endif - #ifndef W_CHAIN_POS - #define W_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E0) - #ifndef E0_CURRENT - #define E0_CURRENT 800 - #endif - #ifndef E0_MICROSTEPS - #define E0_MICROSTEPS 16 - #endif - #ifndef E0_RSENSE - #define E0_RSENSE 0.11 - #endif - #ifndef E0_CHAIN_POS - #define E0_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E1) - #ifndef E1_CURRENT - #define E1_CURRENT E0_CURRENT - #endif - #ifndef E1_MICROSTEPS - #define E1_MICROSTEPS E0_MICROSTEPS - #endif - #ifndef E1_RSENSE - #define E1_RSENSE E0_RSENSE - #endif - #ifndef E1_CHAIN_POS - #define E1_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E2) - #ifndef E2_CURRENT - #define E2_CURRENT E0_CURRENT - #endif - #ifndef E2_MICROSTEPS - #define E2_MICROSTEPS E0_MICROSTEPS - #endif - #ifndef E2_RSENSE - #define E2_RSENSE E0_RSENSE - #endif - #ifndef E2_CHAIN_POS - #define E2_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E3) - #ifndef E3_CURRENT - #define E3_CURRENT E0_CURRENT - #endif - #ifndef E3_MICROSTEPS - #define E3_MICROSTEPS E0_MICROSTEPS - #endif - #ifndef E3_RSENSE - #define E3_RSENSE E0_RSENSE - #endif - #ifndef E3_CHAIN_POS - #define E3_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E4) - #ifndef E4_CURRENT - #define E4_CURRENT E0_CURRENT - #endif - #ifndef E4_MICROSTEPS - #define E4_MICROSTEPS E0_MICROSTEPS - #endif - #ifndef E4_RSENSE - #define E4_RSENSE E0_RSENSE - #endif - #ifndef E4_CHAIN_POS - #define E4_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E5) - #ifndef E5_CURRENT - #define E5_CURRENT E0_CURRENT - #endif - #ifndef E5_MICROSTEPS - #define E5_MICROSTEPS E0_MICROSTEPS - #endif - #ifndef E5_RSENSE - #define E5_RSENSE E0_RSENSE - #endif - #ifndef E5_CHAIN_POS - #define E5_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E6) - #ifndef E6_CURRENT - #define E6_CURRENT E0_CURRENT - #endif - #ifndef E6_MICROSTEPS - #define E6_MICROSTEPS E0_MICROSTEPS - #endif - #ifndef E6_RSENSE - #define E6_RSENSE E0_RSENSE - #endif - #ifndef E6_CHAIN_POS - #define E6_CHAIN_POS -1 - #endif - #endif - #if AXIS_IS_TMC_CONFIG(E7) - #ifndef E7_CURRENT - #define E7_CURRENT E0_CURRENT - #endif - #ifndef E7_MICROSTEPS - #define E7_MICROSTEPS E0_MICROSTEPS - #endif - #ifndef E7_RSENSE - #define E7_RSENSE E0_RSENSE - #endif - #ifndef E7_CHAIN_POS - #define E7_CHAIN_POS -1 - #endif - #endif - #ifndef CHOPPER_TIMING - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V - #endif - #if ENABLED(MONITOR_DRIVER_STATUS) - #ifndef CURRENT_STEP_DOWN - #define CURRENT_STEP_DOWN 50 - #endif - #endif - #ifndef X_HYBRID_THRESHOLD - #define X_HYBRID_THRESHOLD 100 - #endif - #ifndef X2_HYBRID_THRESHOLD - #define X2_HYBRID_THRESHOLD 100 - #endif - #ifndef Y_HYBRID_THRESHOLD - #define Y_HYBRID_THRESHOLD 100 - #endif - #ifndef Y2_HYBRID_THRESHOLD - #define Y2_HYBRID_THRESHOLD 100 - #endif - #ifndef Z_HYBRID_THRESHOLD - #define Z_HYBRID_THRESHOLD 3 - #endif - #ifndef Z2_HYBRID_THRESHOLD - #define Z2_HYBRID_THRESHOLD 3 - #endif - #ifndef Z3_HYBRID_THRESHOLD - #define Z3_HYBRID_THRESHOLD 3 - #endif - #ifndef Z4_HYBRID_THRESHOLD - #define Z4_HYBRID_THRESHOLD 3 - #endif - #ifndef I_HYBRID_THRESHOLD - #define I_HYBRID_THRESHOLD 3 - #endif - #ifndef J_HYBRID_THRESHOLD - #define J_HYBRID_THRESHOLD 3 - #endif - #ifndef K_HYBRID_THRESHOLD - #define K_HYBRID_THRESHOLD 3 - #endif - #ifndef U_HYBRID_THRESHOLD - #define U_HYBRID_THRESHOLD 3 - #endif - #ifndef V_HYBRID_THRESHOLD - #define V_HYBRID_THRESHOLD 3 - #endif - #ifndef W_HYBRID_THRESHOLD - #define W_HYBRID_THRESHOLD 3 - #endif - #ifndef E0_HYBRID_THRESHOLD - #define E0_HYBRID_THRESHOLD 30 - #endif - #ifndef E1_HYBRID_THRESHOLD - #define E1_HYBRID_THRESHOLD 30 - #endif - #ifndef E2_HYBRID_THRESHOLD - #define E2_HYBRID_THRESHOLD 30 - #endif - #ifndef E3_HYBRID_THRESHOLD - #define E3_HYBRID_THRESHOLD 30 - #endif - #ifndef E4_HYBRID_THRESHOLD - #define E4_HYBRID_THRESHOLD 30 - #endif - #ifndef E5_HYBRID_THRESHOLD - #define E5_HYBRID_THRESHOLD 30 - #endif - #ifndef E6_HYBRID_THRESHOLD - #define E6_HYBRID_THRESHOLD 30 - #endif - #ifndef E7_HYBRID_THRESHOLD - #define E7_HYBRID_THRESHOLD 30 - #endif - #if ANY(SENSORLESS_HOMING, SENSORLESS_PROBING) - #ifndef X_STALL_SENSITIVITY - #define X_STALL_SENSITIVITY 8 - #endif - #ifndef X2_STALL_SENSITIVITY - #define X2_STALL_SENSITIVITY X_STALL_SENSITIVITY - #endif - #ifndef Y_STALL_SENSITIVITY - #define Y_STALL_SENSITIVITY 8 - #endif - #ifndef Y2_STALL_SENSITIVITY - #define Y2_STALL_SENSITIVITY Y_STALL_SENSITIVITY - #endif - #endif - #ifndef TMC_ADV() - #define TMC_ADV() { } - #endif -#endif -#if ENABLED(EXPERIMENTAL_I2CBUS) - #ifndef I2C_SLAVE_ADDRESS - #define I2C_SLAVE_ADDRESS 0 - #endif -#endif -#if ENABLED(PHOTO_GCODE) - #ifdef PHOTO_PULSES_US - #ifndef PHOTO_PULSE_DELAY_US - #define PHOTO_PULSE_DELAY_US 13 - #endif - #endif -#endif -#if ANY(SPINDLE_FEATURE, LASER_FEATURE) - #ifndef SPINDLE_LASER_ACTIVE_STATE - #define SPINDLE_LASER_ACTIVE_STATE LOW - #endif - #if ENABLED(SPINDLE_LASER_USE_PWM) - #ifndef SPINDLE_LASER_PWM_INVERT - #define SPINDLE_LASER_PWM_INVERT false - #endif - #ifndef SPINDLE_LASER_FREQUENCY - #define SPINDLE_LASER_FREQUENCY 2500 - #endif - #endif - #if ENABLED(AIR_EVACUATION) - #ifndef AIR_EVACUATION_ACTIVE - #define AIR_EVACUATION_ACTIVE LOW - #endif - #endif - #if ENABLED(AIR_ASSIST) - #ifndef AIR_ASSIST_ACTIVE - #define AIR_ASSIST_ACTIVE LOW - #endif - #endif - #ifdef SPINDLE_SERVO - #ifndef SPINDLE_SERVO_NR - #define SPINDLE_SERVO_NR 0 - #endif - #ifndef SPINDLE_SERVO_MIN - #define SPINDLE_SERVO_MIN 10 - #endif - #endif - #ifndef CUTTER_POWER_UNIT - #define CUTTER_POWER_UNIT PWM255 - #endif - #if ENABLED(SPINDLE_FEATURE) - #ifndef SPINDLE_INVERT_DIR - #define SPINDLE_INVERT_DIR false - #endif - #ifndef SPINDLE_LASER_POWERUP_DELAY - #define SPINDLE_LASER_POWERUP_DELAY 5000 - #endif - #ifndef SPINDLE_LASER_POWERDOWN_DELAY - #define SPINDLE_LASER_POWERDOWN_DELAY 5000 - #endif - #if ENABLED(SPINDLE_LASER_USE_PWM) - #ifndef SPEED_POWER_INTERCEPT - #define SPEED_POWER_INTERCEPT 0 - #endif - #ifndef SPEED_POWER_MIN - #define SPEED_POWER_MIN 5000 - #endif - #ifndef SPEED_POWER_MAX - #define SPEED_POWER_MAX 30000 - #endif - #ifndef SPEED_POWER_STARTUP - #define SPEED_POWER_STARTUP 25000 - #endif - #endif - #else - #if ENABLED(SPINDLE_LASER_USE_PWM) - #ifndef SPEED_POWER_INTERCEPT - #define SPEED_POWER_INTERCEPT 0 - #endif - #ifndef SPEED_POWER_MIN - #define SPEED_POWER_MIN 0 - #endif - #ifndef SPEED_POWER_MAX - #define SPEED_POWER_MAX 100 - #endif - #ifndef SPEED_POWER_STARTUP - #define SPEED_POWER_STARTUP 80 - #endif - #endif - #ifndef LASER_TEST_PULSE_MIN - #define LASER_TEST_PULSE_MIN 1 - #endif - #ifndef LASER_TEST_PULSE_MAX - #define LASER_TEST_PULSE_MAX 999 - #endif - #ifndef SPINDLE_LASER_POWERUP_DELAY - #define SPINDLE_LASER_POWERUP_DELAY 50 - #endif - #ifndef SPINDLE_LASER_POWERDOWN_DELAY - #define SPINDLE_LASER_POWERDOWN_DELAY 50 - #endif - #ifndef LASER_SAFETY_TIMEOUT_MS - #define LASER_SAFETY_TIMEOUT_MS 1000 - #endif - #if ENABLED(I2C_AMMETER) - #ifndef I2C_AMMETER_IMAX - #define I2C_AMMETER_IMAX 0.1 - #endif - #ifndef I2C_AMMETER_SHUNT_RESISTOR - #define I2C_AMMETER_SHUNT_RESISTOR 0.1 - #endif - #endif - #if ENABLED(LASER_COOLANT_FLOW_METER) - #ifndef FLOWMETER_PIN - #define FLOWMETER_PIN 20 - #endif - #ifndef FLOWMETER_PPL - #define FLOWMETER_PPL 5880 - #endif - #ifndef FLOWMETER_INTERVAL - #define FLOWMETER_INTERVAL 1000 - #endif - #if ENABLED(FLOWMETER_SAFETY) - #ifndef FLOWMETER_MIN_LITERS_PER_MINUTE - #define FLOWMETER_MIN_LITERS_PER_MINUTE 1.5 - #endif - #endif - #endif - #endif -#endif -#if ENABLED(COOLANT_CONTROL) - #ifndef COOLANT_MIST_INVERT - #define COOLANT_MIST_INVERT false - #endif - #ifndef COOLANT_FLOOD_INVERT - #define COOLANT_FLOOD_INVERT false - #endif -#endif -#if ENABLED(FILAMENT_WIDTH_SENSOR) - #ifndef FILAMENT_SENSOR_EXTRUDER_NUM - #define FILAMENT_SENSOR_EXTRUDER_NUM 0 - #endif - #ifndef MEASUREMENT_DELAY_CM - #define MEASUREMENT_DELAY_CM 14 - #endif - #ifndef FILWIDTH_ERROR_MARGIN - #define FILWIDTH_ERROR_MARGIN 1.0 - #endif - #ifndef MAX_MEASUREMENT_DELAY - #define MAX_MEASUREMENT_DELAY 20 - #endif - #ifndef DEFAULT_MEASURED_FILAMENT_DIA - #define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA - #endif -#endif -#if ENABLED(POWER_MONITOR_CURRENT) - #ifndef POWER_MONITOR_VOLTS_PER_AMP - #define POWER_MONITOR_VOLTS_PER_AMP 0.05000 - #endif - #ifndef POWER_MONITOR_CURRENT_OFFSET - #define POWER_MONITOR_CURRENT_OFFSET 0 - #endif - #ifndef POWER_MONITOR_FIXED_VOLTAGE - #define POWER_MONITOR_FIXED_VOLTAGE 13.6 - #endif -#endif -#if ENABLED(POWER_MONITOR_VOLTAGE) - #ifndef POWER_MONITOR_VOLTS_PER_VOLT - #define POWER_MONITOR_VOLTS_PER_VOLT 0.077933 - #endif - #ifndef POWER_MONITOR_VOLTAGE_OFFSET - #define POWER_MONITOR_VOLTAGE_OFFSET 0 - #endif -#endif -#if DISABLED(NO_VOLUMETRICS) - #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) - #ifndef DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT - #define DEFAULT_VOLUMETRIC_EXTRUDER_LIMIT 0.00 - #endif - #ifndef VOLUMETRIC_EXTRUDER_LIMIT_MAX - #define VOLUMETRIC_EXTRUDER_LIMIT_MAX 20 - #endif - #endif -#endif -#if ENABLED(GCODE_MACROS) - #ifndef GCODE_MACROS_SLOTS - #define GCODE_MACROS_SLOTS 5 - #endif - #ifndef GCODE_MACROS_SLOT_SIZE - #define GCODE_MACROS_SLOT_SIZE 50 - #endif -#endif -#if ENABLED(CUSTOM_MENU_MAIN) - #ifndef CUSTOM_MENU_MAIN_SCRIPT_DONE - #define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done" - #endif - #ifndef MAIN_MENU_ITEM_1_DESC - #define MAIN_MENU_ITEM_1_DESC "Home & UBL Info" - #endif - #ifndef MAIN_MENU_ITEM_1_GCODE - #define MAIN_MENU_ITEM_1_GCODE "G28\nG29 W" - #endif - #ifndef MAIN_MENU_ITEM_2_DESC - #define MAIN_MENU_ITEM_2_DESC "Preheat for " PREHEAT_1_LABEL - #endif - #ifndef MAIN_MENU_ITEM_2_GCODE - #define MAIN_MENU_ITEM_2_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) - #endif -#endif -#if ENABLED(CUSTOM_MENU_CONFIG) - #ifndef CUSTOM_MENU_CONFIG_SCRIPT_DONE - #define CUSTOM_MENU_CONFIG_SCRIPT_DONE "M117 Wireless Script Done" - #endif - #ifndef CONFIG_MENU_ITEM_1_DESC - #define CONFIG_MENU_ITEM_1_DESC "Wifi ON" - #endif - #ifndef CONFIG_MENU_ITEM_1_GCODE - #define CONFIG_MENU_ITEM_1_GCODE "M118 [ESP110] WIFI-STA pwd=12345678" - #endif - #ifndef CONFIG_MENU_ITEM_2_DESC - #define CONFIG_MENU_ITEM_2_DESC "Bluetooth ON" - #endif - #ifndef CONFIG_MENU_ITEM_2_GCODE - #define CONFIG_MENU_ITEM_2_GCODE "M118 [ESP110] BT pwd=12345678" - #endif -#endif -#if ENABLED(CUSTOM_USER_BUTTONS) - #if PIN_EXISTS(BUTTON1) - #ifndef BUTTON1_HIT_STATE - #define BUTTON1_HIT_STATE LOW - #endif - #ifndef BUTTON1_WHEN_PRINTING - #define BUTTON1_WHEN_PRINTING false - #endif - #ifndef BUTTON1_GCODE - #define BUTTON1_GCODE "G28" - #endif - #ifndef BUTTON1_DESC - #define BUTTON1_DESC "Homing" - #endif - #endif - #if PIN_EXISTS(BUTTON2) - #ifndef BUTTON2_HIT_STATE - #define BUTTON2_HIT_STATE LOW - #endif - #ifndef BUTTON2_WHEN_PRINTING - #define BUTTON2_WHEN_PRINTING false - #endif - #ifndef BUTTON2_GCODE - #define BUTTON2_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND) - #endif - #ifndef BUTTON2_DESC - #define BUTTON2_DESC "Preheat for " PREHEAT_1_LABEL - #endif - #endif - #if PIN_EXISTS(BUTTON3) - #ifndef BUTTON3_HIT_STATE - #define BUTTON3_HIT_STATE LOW - #endif - #ifndef BUTTON3_WHEN_PRINTING - #define BUTTON3_WHEN_PRINTING false - #endif - #ifndef BUTTON3_GCODE - #define BUTTON3_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND) - #endif - #ifndef BUTTON3_DESC - #define BUTTON3_DESC "Preheat for " PREHEAT_2_LABEL - #endif - #endif -#endif -#if ENABLED(I2C_POSITION_ENCODERS) - #ifndef I2CPE_ENCODER_CNT - #define I2CPE_ENCODER_CNT 1 - #endif - #ifndef I2CPE_ENC_1_ADDR - #define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X - #endif - #ifndef I2CPE_ENC_1_AXIS - #define I2CPE_ENC_1_AXIS X_AXIS - #endif - #ifndef I2CPE_ENC_1_TYPE - #define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR - #endif - #ifndef I2CPE_ENC_1_TICKS_UNIT - #define I2CPE_ENC_1_TICKS_UNIT 2048 - #endif - #ifndef I2CPE_ENC_1_EC_METHOD - #define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP - #endif - #ifndef I2CPE_ENC_1_EC_THRESH - #define I2CPE_ENC_1_EC_THRESH 0.10 - #endif - #ifndef I2CPE_ENC_2_ADDR - #define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y - #endif - #ifndef I2CPE_ENC_2_AXIS - #define I2CPE_ENC_2_AXIS Y_AXIS - #endif - #ifndef I2CPE_ENC_2_TYPE - #define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR - #endif - #ifndef I2CPE_ENC_2_TICKS_UNIT - #define I2CPE_ENC_2_TICKS_UNIT 2048 - #endif - #ifndef I2CPE_ENC_2_EC_METHOD - #define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP - #endif - #ifndef I2CPE_ENC_2_EC_THRESH - #define I2CPE_ENC_2_EC_THRESH 0.10 - #endif - #ifndef I2CPE_ENC_3_ADDR - #define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z - #endif - #ifndef I2CPE_ENC_3_AXIS - #define I2CPE_ENC_3_AXIS Z_AXIS - #endif - #ifndef I2CPE_ENC_4_ADDR - #define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E - #endif - #ifndef I2CPE_ENC_4_AXIS - #define I2CPE_ENC_4_AXIS E_AXIS - #endif - #ifndef I2CPE_ENC_5_ADDR - #define I2CPE_ENC_5_ADDR 34 - #endif - #ifndef I2CPE_ENC_5_AXIS - #define I2CPE_ENC_5_AXIS E_AXIS - #endif - #ifndef I2CPE_DEF_TYPE - #define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR - #endif - #ifndef I2CPE_DEF_ENC_TICKS_UNIT - #define I2CPE_DEF_ENC_TICKS_UNIT 2048 - #endif - #ifndef I2CPE_DEF_TICKS_REV - #define I2CPE_DEF_TICKS_REV (16 * 200) - #endif - #ifndef I2CPE_DEF_EC_METHOD - #define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE - #endif - #ifndef I2CPE_DEF_EC_THRESH - #define I2CPE_DEF_EC_THRESH 0.1 - #endif - #ifndef I2CPE_TIME_TRUSTED - #define I2CPE_TIME_TRUSTED 10000 - #endif - #ifndef I2CPE_MIN_UPD_TIME_MS - #define I2CPE_MIN_UPD_TIME_MS 4 - #endif -#endif -#if ENABLED(JOYSTICK) - #ifndef JOY_X_PIN - #define JOY_X_PIN 5 - #endif - #ifndef JOY_Y_PIN - #define JOY_Y_PIN 10 - #endif - #ifndef JOY_Z_PIN - #define JOY_Z_PIN 12 - #endif - #ifndef JOY_EN_PIN - #define JOY_EN_PIN 44 - #endif - #ifndef JOY_X_LIMITS - #define JOY_X_LIMITS { 5600, 8190-100, 8190+100, 10800 } - #endif - #ifndef JOY_Y_LIMITS - #define JOY_Y_LIMITS { 5600, 8250-100, 8250+100, 11000 } - #endif - #ifndef JOY_Z_LIMITS - #define JOY_Z_LIMITS { 4800, 8080-100, 8080+100, 11550 } - #endif -#endif -#if ENABLED(MECHANICAL_GANTRY_CALIBRATION) - #ifndef GANTRY_CALIBRATION_CURRENT - #define GANTRY_CALIBRATION_CURRENT 600 - #endif - #ifndef GANTRY_CALIBRATION_EXTRA_HEIGHT - #define GANTRY_CALIBRATION_EXTRA_HEIGHT 15 - #endif - #ifndef GANTRY_CALIBRATION_FEEDRATE - #define GANTRY_CALIBRATION_FEEDRATE 500 - #endif - #ifndef GANTRY_CALIBRATION_COMMANDS_POST - #define GANTRY_CALIBRATION_COMMANDS_POST "G28" - #endif -#endif -#if ENABLED(FREEZE_FEATURE) - #ifndef FREEZE_STATE - #define FREEZE_STATE LOW - #endif -#endif -#if ENABLED(MAX7219_DEBUG) - #ifndef MAX7219_CLK_PIN - #define MAX7219_CLK_PIN 64 - #endif - #ifndef MAX7219_DIN_PIN - #define MAX7219_DIN_PIN 57 - #endif - #ifndef MAX7219_LOAD_PIN - #define MAX7219_LOAD_PIN 44 - #endif - #ifndef MAX7219_INIT_TEST - #define MAX7219_INIT_TEST 2 - #endif - #ifndef MAX7219_NUMBER_UNITS - #define MAX7219_NUMBER_UNITS 1 - #endif - #ifndef MAX7219_ROTATE - #define MAX7219_ROTATE 0 - #endif - #ifndef MAX7219_DEBUG_PLANNER_HEAD - #define MAX7219_DEBUG_PLANNER_HEAD 2 - #endif - #ifndef MAX7219_DEBUG_PLANNER_TAIL - #define MAX7219_DEBUG_PLANNER_TAIL 4 - #endif - #ifndef MAX7219_DEBUG_PLANNER_QUEUE - #define MAX7219_DEBUG_PLANNER_QUEUE 0 - #endif - #ifndef MAX7219_DEBUG_PROFILE - #define MAX7219_DEBUG_PROFILE 6 - #endif -#endif -#if HAS_ETHERNET - #ifndef MAC_ADDRESS - #define MAC_ADDRESS { 0xDE, 0xAD, 0xBE, 0xEF, 0xF0, 0x0D } - #endif -#endif -#if !(HAS_PRUSA_MMU1) && (HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3) - - #ifndef MMU2_SERIAL_PORT - #define MMU2_SERIAL_PORT 2 - #endif - #ifndef MMU_BAUD - #define MMU_BAUD 115200 - #endif - #if HAS_PRUSA_MMU2 - #ifndef MMU2_FILAMENT_RUNOUT_SCRIPT - #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" - #endif - #endif - #ifndef MMU2_FILAMENTCHANGE_EJECT_FEED - #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 - #endif - #ifndef MMU2_EXTRUDER_PTFE_LENGTH - #define MMU2_EXTRUDER_PTFE_LENGTH 42.3 - #endif - #ifndef MMU2_EXTRUDER_HEATBREAK_LENGTH - #define MMU2_EXTRUDER_HEATBREAK_LENGTH 17.7 - #endif - #ifndef MMU2_LOAD_TO_NOZZLE_SEQUENCE - #define MMU2_LOAD_TO_NOZZLE_SEQUENCE { MMU2_EXTRUDER_PTFE_LENGTH, MMM_TO_MMS(810) }, { MMU2_EXTRUDER_HEATBREAK_LENGTH, MMM_TO_MMS(198) } - #endif - #ifndef MMU2_RAMMING_SEQUENCE - #define MMU2_RAMMING_SEQUENCE { 0.2816, MMM_TO_MMS(1339.0) }, { 0.3051, MMM_TO_MMS(1451.0) }, { 0.3453, MMM_TO_MMS(1642.0) }, { 0.3990, MMM_TO_MMS(1897.0) }, { 0.4761, MMM_TO_MMS(2264.0) }, { 0.5767, MMM_TO_MMS(2742.0) }, { 0.5691, MMM_TO_MMS(3220.0) }, { 0.1081, MMM_TO_MMS(3220.0) }, { 0.7644, MMM_TO_MMS(3635.0) }, { 0.8248, MMM_TO_MMS(3921.0) }, { 0.8483, MMM_TO_MMS(4033.0) }, { -15.0, MMM_TO_MMS(6000.0) }, { -24.5, MMM_TO_MMS(1200.0) }, { -7.0, MMM_TO_MMS( 600.0) }, { -3.5, MMM_TO_MMS( 360.0) }, { 20.0, MMM_TO_MMS( 454.0) }, { -20.0, MMM_TO_MMS( 303.0) }, { -35.0, MMM_TO_MMS(2000.0) } - #endif - #if HAS_PRUSA_MMU2S - #ifndef MMU2_C0_RETRY - #define MMU2_C0_RETRY 5 - #endif - #ifndef MMU2_CAN_LOAD_FEEDRATE - #define MMU2_CAN_LOAD_FEEDRATE 800 - #endif - #ifndef MMU2_CAN_LOAD_SEQUENCE - #define MMU2_CAN_LOAD_SEQUENCE { 5.0, MMU2_CAN_LOAD_FEEDRATE }, { 15.0, MMU2_CAN_LOAD_FEEDRATE }, { -10.0, MMU2_CAN_LOAD_FEEDRATE } - #endif - #ifndef MMU2_CAN_LOAD_RETRACT - #define MMU2_CAN_LOAD_RETRACT 6.0 - #endif - #ifndef MMU2_CAN_LOAD_DEVIATION - #define MMU2_CAN_LOAD_DEVIATION 0.8 - #endif - #ifndef MMU2_CAN_LOAD_INCREMENT - #define MMU2_CAN_LOAD_INCREMENT 0.2 - #endif - #ifndef MMU2_CAN_LOAD_INCREMENT_SEQUENCE - #define MMU2_CAN_LOAD_INCREMENT_SEQUENCE { -MMU2_CAN_LOAD_INCREMENT, MMU2_CAN_LOAD_FEEDRATE } - #endif - #elif HAS_PRUSA_MMU3 - #ifndef MMU2_MAX_RETRIES - #define MMU2_MAX_RETRIES 3 - #endif - #ifndef MMU2_LOAD_TO_NOZZLE_LENGTH - #define MMU2_LOAD_TO_NOZZLE_LENGTH 87.0 + 5.0 - #endif - #ifndef MMU2_FILAMENT_SENSOR_POSITION - #define MMU2_FILAMENT_SENSOR_POSITION 0 - #endif - #ifndef MMU2_LOAD_DISTANCE_PAST_GEARS - #define MMU2_LOAD_DISTANCE_PAST_GEARS 5 - #endif - #ifndef MMU2_TOOL_CHANGE_LOAD_LENGTH - #define MMU2_TOOL_CHANGE_LOAD_LENGTH MMU2_FILAMENT_SENSOR_POSITION + MMU2_LOAD_DISTANCE_PAST_GEARS - #endif - #ifndef MMU2_LOAD_TO_NOZZLE_FEED_RATE - #define MMU2_LOAD_TO_NOZZLE_FEED_RATE 20.0 - #endif - #ifndef MMU2_UNLOAD_TO_FINDA_FEED_RATE - #define MMU2_UNLOAD_TO_FINDA_FEED_RATE 120.0 - #endif - #ifndef MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE - #define MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE 50.0 - #endif - #ifndef MMU2_VERIFY_LOAD_TO_NOZZLE_TWEAK - #define MMU2_VERIFY_LOAD_TO_NOZZLE_TWEAK -5.0 - #endif - #ifndef MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH - #define MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH 80.0 - #endif - #ifndef MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE - #define MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE 80.0 - #endif - #ifndef MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH - #define MMU2_CHECK_FILAMENT_PRESENCE_EXTRUSION_LENGTH (MMU2_EXTRUDER_PTFE_LENGTH + MMU2_EXTRUDER_HEATBREAK_LENGTH + MMU2_VERIFY_LOAD_TO_NOZZLE_TWEAK + MMU2_FILAMENT_SENSOR_POSITION) - #endif - #else - #if ENABLED(MMU_EXTRUDER_SENSOR) - #ifndef MMU_LOADING_ATTEMPTS_NR - #define MMU_LOADING_ATTEMPTS_NR 5 - #endif - #endif - #endif -#endif -#if ENABLED(PRINTCOUNTER) - #ifndef SERVICE_WARNING_BUZZES - #define SERVICE_WARNING_BUZZES 3 - #endif -#endif diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index 4750a2e3f678..5ea7a49944a2 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -26,8 +26,9 @@ #endif #if __has_include("../../Config.h") - #define USE_BASE_CONFIGS 1 #include "../../Config.h" +#else + #define USE_STD_CONFIGS 1 #endif // @@ -42,9 +43,7 @@ #include "../core/macros.h" #include "../core/boards.h" -#if USE_BASE_CONFIGS - #include "BaseConfiguration.h" -#else +#if USE_STD_CONFIGS #include "../../Configuration.h" #endif @@ -64,9 +63,7 @@ #include "../core/drivers.h" -#if USE_BASE_CONFIGS - #include "BaseConfiguration_adv.h" -#else +#if USE_STD_CONFIGS #include "../../Configuration_adv.h" #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 52dc1444f5f5..f10408dd9c44 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -60,7 +60,7 @@ #endif #endif -#if USE_BASE_CONFIGS +#if !USE_STD_CONFIGS #if __has_include("../../Configuration.h") #define HAS_IGNORED_CONFIGS #elif __has_include("../../Configuration_adv.h") diff --git a/buildroot/share/scripts/makeBaseConfigs.py b/buildroot/share/scripts/makeBaseConfigs.py deleted file mode 100755 index c1d4a990fe6b..000000000000 --- a/buildroot/share/scripts/makeBaseConfigs.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python3 -# -# makeBaseConfigs.py -# -# Create "base" config files that can be overridden by a minimal config file. -# The intention is to include base config files as part of the Marlin package -# so users can use a minimal configuration with the familiar header format. -# This provides an Arduino-compatible way to apply configurations without the -# complications that come from a plain config.ini solution. -# -import re -from pathlib import Path - -def make_base_configs(): - no_disabled = True - - # Create a regex to match options and capture line parts - define_patt = re.compile(r'^(\s*)((//\s*)?#define\s+)([A-Z0-9_]+\b(\(\))?)(\s*)(.*?)(\s*)(//.*)?$', re.IGNORECASE) - ifndef_patt = re.compile(r'^(\s*#ifndef\s*.*?)(\s*//.*)?$', re.IGNORECASE) - ifstat_patt = re.compile(r'^(\s*#(((if|ifn?def|elif)\s*.*?)|else|endif))(\s*//.*)?$', re.IGNORECASE) - coment_patt = re.compile(r'/\*.*?\*/', re.DOTALL) - contin_patt = re.compile(r'\\\n\s*') - - # Wrap all config options in #ifndef - for file in ('Configuration.h', 'Configuration_adv.h'): - fullpath = Path('Marlin', file) - fulltext = fullpath.read_text(encoding='utf-8') - fulltext = coment_patt.sub('', fulltext) - fulltext = contin_patt.sub(' ', fulltext) - - is_ifndef = False - - lines_out = [] - for line in fulltext.split('\n'): - - was_ifndef = is_ifndef # Previous line was #ifndef? - is_ifndef = ifndef_patt.match(line) # This line is #ifndef? - - m = ifstat_patt.match(line) - if m: lines_out += [m[1]] ; continue - - m = define_patt.match(line) - if m: - if no_disabled and line.strip().startswith('//'): continue - - name = m[4] - if name in ('CONFIG_EXAMPLES_DIR', 'CONFIG_EXPORT'): continue - if name.startswith('_'): continue - - if not was_ifndef: lines_out += [f'{m[1]}#ifndef {name}'] - - entab = '' if was_ifndef else ' ' - indented = f'{entab}{m[1]}{m[2]}{m[4]} {m[7]}'.rstrip() - lines_out += [indented] - - if not was_ifndef: lines_out += [f'{m[1]}#endif'] - - # Final text needs some additional cleanup to remove empty blocks - empty_patt = re.compile(r'(\s*#if.+)(\n\s*#el.+)*(\n\s*#endif.*)') - ifelse_patt = re.compile(r'(\s*#(el)?if\s+)(.+)\n\s*#else') - ifelif_patt = re.compile(r'(\s*#if\s+)(.+)\n\s*#elif\s*(.+)') - noforc_patt = re.compile(r'\s*#ifndef\s+([A-Z0-9_]+)\n\s*#define \1\n\s*#endif') - - out_text = '\n'.join(lines_out) - while True: - old_text = out_text - out_text = ifelse_patt.sub(r'\1!(\3)', out_text) - out_text = ifelif_patt.sub(r'\1!(\2) && (\3)\n', out_text) - out_text = noforc_patt.sub('', out_text) - out_text = empty_patt.sub('', out_text) - if out_text == old_text: break - - # Store the final result to Marlin/src/inc/BaseConfiguration.h BaseConfiguration_adv.h - outname = f'Base{file}' - outpath = Path('Marlin', 'src', 'inc', outname) - - with outpath.open('w') as outfile: - - from datetime import datetime - header_tpl = Path('buildroot', 'share', 'extras', 'file_header.h').read_text(encoding='utf-8') - header_tpl = re.sub(r'(\(c\))\s*\d+\s*(MarlinFirmware)', rf'\1 {datetime.now().year} \2', header_tpl) - header_tpl = re.sub(r'\*/\n+/\*\*', '*/\n#pragma once\n\n/**', header_tpl) - header_tpl = header_tpl.replace(r'$(filename)', f"{outname} - Generated using makeBaseConfigs.py") - - outfile.write(header_tpl + out_text + '\n') - -# Always run from the command line. -# Later we can add a "minimal" flag to config to do this automatically. -if __name__ == "__main__": - import sys - args = sys.argv[1:] - if len(args) > 0: - print(f"Usage: {sys.argv[0]}") - elif not Path('Marlin', 'src').is_dir(): - print(f"Please run {sys.argv[0]} from the root of the Marlin workspace.") - else: - make_base_configs() From fe56f5d3a679a68a1c9b4e1aea08ddc232078c88 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 26 Aug 2024 12:58:04 -0500 Subject: [PATCH 07/18] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Impro?= =?UTF-8?q?ve=20build=5Fexample?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/build_all_examples | 38 ++++----- buildroot/bin/build_example | 85 ++++++++++++------- .../share/PlatformIO/scripts/signature.py | 2 +- 3 files changed, 75 insertions(+), 50 deletions(-) diff --git a/buildroot/bin/build_all_examples b/buildroot/bin/build_all_examples index ccfc461c7678..a236afbf7cbb 100755 --- a/buildroot/bin/build_all_examples +++ b/buildroot/bin/build_all_examples @@ -51,13 +51,13 @@ LIMIT=1000 while getopts 'aB:b:ce:fdhl:npr:sv-:' OFLAG; do case "${OFLAG}" in a) ARCHIVE=1 ; bugout "Archiving" ;; - B) OPATH="$OPTARG" ; bugout "Base: $OPATH" ;; + B) OPATH=$OPTARG ; bugout "Base: $OPATH" ;; b) BRANCH=$OPTARG ; bugout "Branch: $BRANCH" ;; f) NOFAIL=1 ; bugout "Continue on Fail" ;; - r) ISRES=1 ; FIRST_CONF="$OPTARG" ; bugout "Resume: $FIRST_CONF" ;; + r) ISRES=1 ; FIRST_CONF=$OPTARG ; bugout "Resume: $FIRST_CONF" ;; c) CONTINUE=1 ; bugout "Continue" ;; s) CONTSKIP=1 ; bugout "Continue, skipping" ;; - e) CEXPORT="$OPTARG" ; bugout "Export $CEXPORT" ;; + e) CEXPORT=$OPTARG ; bugout "Export $CEXPORT" ;; h) EXIT_USAGE=1 ; break ;; l) LIMIT=$OPTARG ; bugout "Limit to $LIMIT build(s)" ;; d|v) DEBUG=1 ; bugout "Debug ON" ;; @@ -66,13 +66,13 @@ while getopts 'aB:b:ce:fdhl:npr:sv-:' OFLAG; do -) IFS="=" read -r ONAM OVAL <<< "$OPTARG" case "$ONAM" in archive) ARCHIVE=1 ; bugout "Archiving" ;; - base) OPATH="$OVAL" ; bugout "Base: $OPATH" ;; + base) OPATH=$OVAL ; bugout "Base: $OPATH" ;; branch) BRANCH=$OVAL ; bugout "Branch: $BRANCH" ;; nofail) NOFAIL=1 ; bugout "Continue on Fail" ;; - resume) ISRES=1 ; FIRST_CONF="$OVAL" ; bugout "Resume: $FIRST_CONF" ;; + resume) ISRES=1 ; FIRST_CONF=$OVAL ; bugout "Resume: $FIRST_CONF" ;; continue) CONTINUE=1 ; bugout "Continue" ;; skip) CONTSKIP=1 ; bugout "Continue, skipping" ;; - export) CEXPORT="$OVAL"; bugout "Export $EXPORT" ;; + export) CEXPORT=$OVAL ; bugout "Export $EXPORT" ;; limit) LIMIT=$OVAL ; bugout "Limit to $LIMIT build(s)" ;; help) [[ -z "$OVAL" ]] || perror "option can't take value $OVAL" $ONAM ; EXIT_USAGE=1 ;; debug) DEBUG=1 ; bugout "Debug ON" ;; @@ -98,7 +98,7 @@ echo "Restore your configs with 'git checkout -f' or 'git reset --hard HEAD'." echo [[ -n $PURGE ]] && rm -f "$STAT_FILE" -[[ -z $FIRST_CONF && -f $STAT_FILE ]] && IFS='*' read BRANCH FIRST_CONF <"$STAT_FILE" +[[ -z $FIRST_CONF && -f "$STAT_FILE" ]] && IFS='*' read BRANCH FIRST_CONF <"$STAT_FILE" # If -c is given start from the last attempted build if ((CONTINUE)); then @@ -126,29 +126,29 @@ fi # Create a temporary folder inside .pio if [[ -n $OPATH ]]; then - TMP=$OPATH - [[ -d "$TMP" ]] || { echo "Given base -B $TMP not found." ; exit ; } + [[ -d "$OPATH" ]] || { echo "Given base -B $OPATH not found." ; exit ; } else # Make a Configurations temporary folder if needed - TMP=./.pio/build-$BRANCH - [[ -d "$TMP" ]] || mkdir -p $TMP + OPATH=./.pio/build-$BRANCH + [[ -d "$OPATH" ]] || mkdir -p "$OPATH" # Download the specified Configurations branch if needed - if [[ ! -e "$TMP/README.md" ]]; then - echo "Fetching Configurations from GitHub to $TMP" - git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$TMP" || { echo "Failed to clone the configuration repository"; exit ; } + if [[ ! -e "$OPATH/README.md" ]]; then + echo "Fetching Configurations from GitHub to $OPATH" + git clone --depth=1 --single-branch --branch "$BRANCH" $GITREPO "$OPATH" || { echo "Failed to clone the configuration repository"; exit ; } fi fi # Build echo -e "=====================\nProceed with builds...\n=====================" shopt -s nullglob +shopt -s globstar IFS=' ' -CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/config/examples/*/*/*/ "$TMP"/config/examples/*/*/*/*/ | grep -vE ".+\.(\w+)$" ) +CONF_TREE=$( ls -d "$OPATH"/config/examples/**/ | grep -vE ".+\.(\w+)$" ) for CONF in $CONF_TREE ; do # Get a config's directory name - DIR=$( echo $CONF | "$SED" "s|$TMP/config/examples/||" ) + DIR=$( echo "$CONF" | "$SED" "s|$OPATH/config/examples/||" ) # If looking for a config, skip others [[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue @@ -159,10 +159,10 @@ for CONF in $CONF_TREE ; do [[ $SKIP_CONF ]] && { unset SKIP_CONF ; continue ; } # At least one config file is required here - compgen -G "${CONF}Con*.h" > /dev/null || continue + compgen -G "${CONF}Configuration*.h" > /dev/null || continue # Command arguments for 'build_example' - CARGS=("-b" "$TMP" "-c" "$DIR") + CARGS=("-b" "$OPATH" "-c" "$DIR") # Exporting? Add -e argument ((CEXPORT)) && CARGS+=("-e" "$CEXPORT") @@ -174,7 +174,7 @@ for CONF in $CONF_TREE ; do ((ARCHIVE)) && CARGS+=("-a") # Build or print build command for --nobuild - if [[ $DRYRUN ]]; then + if ((DRYRUN)); then echo -e "\033[0;32m[DRYRUN] build_example ${CARGS[@]}\033[0m" else # Remember where we are in case of failure diff --git a/buildroot/bin/build_example b/buildroot/bin/build_example index d796a5587bad..412f53f1aa64 100755 --- a/buildroot/bin/build_example +++ b/buildroot/bin/build_example @@ -19,19 +19,20 @@ source "$HERE/mfutil" annc() { echo -e "\033[0;32m$1\033[0m" ; } # Get arguments -CLEANER=1 -ALLOW="" -ARCHIVE="" -BASE="" -CONFIG="" -REVEAL="" -EXPNUM="" -NOFAIL="" +BUILD=./.pio/build +CLEANER= +ALLOW= +ARCHIVE= +BASE= +CONFIG= +REVEAL= +EXPNUM= +NOFAIL= while getopts 'ab:c:e:hinr-:' OFLAG; do case "${OFLAG}" in a) ARCHIVE=1 ;; - b) BASE="$OPTARG" ;; - c) CONFIG="$OPTARG" ;; + b) BASE="${OPTARG%/}" ;; + c) CONFIG="${OPTARG%/}" ;; e) EXPNUM="$OPTARG" ;; h) EXIT_USAGE=1 ; break ;; n) NOFAIL=1 ;; @@ -40,8 +41,8 @@ while getopts 'ab:c:e:hinr-:' OFLAG; do case "$ONAM" in archive) ARCHIVE=1 ;; allow) ALLOW=1 ;; - base) BASE="$OVAL" ;; - config) CONFIG="$OVAL" ;; + base) BASE="${OVAL%/}" ;; + config) CONFIG="${OVAL%/}" ;; export) EXPNUM="$OVAL" ;; help) EXIT_USAGE=1 ; break ;; nofail) NOFAIL=1 ;; @@ -52,28 +53,32 @@ while getopts 'ab:c:e:hinr-:' OFLAG; do esac done +# Must be called from another script (or with --allow) [[ $ALLOW || $SHLVL -gt 2 ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; } +# -b|--base and -c|--config are required +[[ -z $BASE ]] && { echo "-b|--base is required" ; exit 1 ; } +[[ -z $CONFIG ]] && { echo "-c|--config is required" ; exit 1 ; } + # Make sure the examples exist SUB1="$BASE/config/examples" -[[ -d "$SUB1" ]] || { echo "--base $BASE doesn't contain config/examples" ; exit 1 ; } +[[ -d "$SUB1" ]] || { echo "-b|--base $BASE doesn't contain config/examples" ; exit 1 ; } # Make sure the specific config folder exists SUB="$SUB1/$CONFIG" -[[ -d "$SUB" ]] || { echo "--config $CONFIG doesn't exist" ; exit 1 ; } +[[ -d "$SUB" ]] || { echo "-c|--config $CONFIG doesn't exist" ; exit 1 ; } -compgen -G "${SUB}Con*.h" > /dev/null || { echo "No configuration files found in $SUB" ; exit 1 ; } +# ...and contains Configuration.h or Configuration_adv.h +[[ -n $(compgen -G "$SUB/Configuration*.h") ]] || { echo "No configuration files found in $SUB" ; exit 1 ; } -# Delete any previous exported configs -rm -f Marlin/Config.h Marlin/Config-export.h +# Delete any config files from previous builds +rm -f Marlin/_Bootscreen.h Marlin/_Statusscreen.h +# Copy configurations into the Marlin folder echo "Getting configuration files from $SUB" -cp "$BASE/config/default"/*.h Marlin/ -cp "$SUB"/Config.h Marlin/ 2>/dev/null -cp "$SUB"/Configuration.h Marlin/ 2>/dev/null -cp "$SUB"/Configuration_adv.h Marlin/ 2>/dev/null -cp "$SUB"/_Bootscreen.h Marlin/ 2>/dev/null -cp "$SUB"/_Statusscreen.h Marlin/ 2>/dev/null +cp "$BASE/config/default"/*.h "$SUB"/*.h Marlin/ 2>/dev/null + +rm -f Marlin/Config.h Marlin/Config-export.h set -e @@ -99,28 +104,35 @@ if ((CLEANER)); then opt_add NO_HOMING_CURRENT_WARNING fi -FNAME=("-name" "marlin_config.json" \ +ENAME=("-name" "marlin_config.json" \ "-o" "-name" "config.ini" \ "-o" "-name" "schema.json" \ "-o" "-name" "schema.yml") -BNAME=("-name" "*.bin" "-o" "-name" "*.hex") +BNAME=("-type" "f" \ + "-name" 'firmware*.hex' \ + "-o" "-name" "firmware*.bin" \ + "-o" "-name" "project*.bin" \ + "-o" "-name" "Robin*.bin" \ + "-o" "-name" "main_*.bin") + +mkdir -p "$BUILD" # If EXPNUM is set then apply to the config before build if [[ $EXPNUM ]]; then opt_set CONFIG_EXPORT $EXPNUM # Clean up old exports - find ./.pio/build \( "${FNAME[@]}" \) -exec rm "{}" \; + find "$BUILD" \( "${ENAME[@]}" \) -exec rm "{}" \; fi -((ARCHIVE)) && find ./.pio/build \( "${BNAME[@]}" \) -exec rm "{}" \; +((ARCHIVE)) && find "$BUILD" \( "${BNAME[@]}" \) -exec rm "{}" \; set +e echo "Building example $CONFIG ..." "$HERE/mftest" -s -a -n1 ; ERR=$? -[[ $ERR -eq 0 ]] && echo "Success" || echo "Failed" +((ERR)) && echo "Failed" || echo "Success" set -e @@ -128,10 +140,23 @@ set -e if [[ -n $EXPNUM ]]; then annc "Exporting $EXPNUM" [[ -f Marlin/Config-export.h ]] && { cp Marlin/Config-export.h "$SUB"/Config.h ; } - find ./.pio/build/ "${FNAME[@]}" -exec cp "{}" "$SUB" \; + find "$BUILD" "${ENAME[@]}" -exec cp "{}" "$SUB" \; fi -((ARCHIVE)) && { annc "Archiving" ; find ./.pio/build \( "${BNAME[@]}" \) -exec cp "{}" "$SUB" \; ; } +if ((ARCHIVE)); then + annc "Archiving" + find "$BUILD" \( "${BNAME[@]}" \) -exec sh -c ' + SUB="$1" + shift 1 + for file in "$@"; do + cd "$(dirname "$file")" + base=$(basename "$file") + tar -czf "$SUB/$base.tar.gz" "$base" + rm "$base" + cd - >/dev/null + done + ' sh "$SUB" {} + +fi # Exit with error unless --nofail is set [[ $ERR -gt 0 && -z $NOFAIL ]] && exit $ERR diff --git a/buildroot/share/PlatformIO/scripts/signature.py b/buildroot/share/PlatformIO/scripts/signature.py index 1a6c262dbab0..046f02dd3eb8 100755 --- a/buildroot/share/PlatformIO/scripts/signature.py +++ b/buildroot/share/PlatformIO/scripts/signature.py @@ -216,7 +216,7 @@ def tryint(key): if not conf_schema: exit(1) # Start with a preferred @section ordering - preorder = ('info','machine','extruder','stepper drivers','geometry','homing','endstops','probes','lcd','interface','host','reporting') + preorder = ('info','user','machine','extruder','bed temp','fans','stepper drivers','geometry','homing','endstops','probes','lcd','interface','host','reporting') sections = { key:{} for key in preorder } # Group options by schema @section From 9e87af70b7fabe964f57e126b350e9432f20ef87 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Tue, 27 Aug 2024 00:24:38 +0000 Subject: [PATCH 08/18] [cron] Bump distribution date (2024-08-27) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index a63f22011f2c..2cd9de6cb157 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-08-26" +//#define STRING_DISTRIBUTION_DATE "2024-08-27" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 9b98462291e3..d1b7e1776880 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-08-26" + #define STRING_DISTRIBUTION_DATE "2024-08-27" #endif /** From 94e9f26544d77d22c67a8973a4b480411ecfe7d6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 28 Aug 2024 00:41:09 -0500 Subject: [PATCH 09/18] =?UTF-8?q?=F0=9F=9A=B8=20Purge=20PLR=20on=20power-o?= =?UTF-8?q?ff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/control/M80_M81.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index 3f0264994e77..e86e26731379 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -84,6 +84,8 @@ void GcodeSuite::M81() { ZERO(thermalManager.saved_fan_speed); #endif + TERN_(POWER_LOSS_RECOVERY, recovery.purge()); // Clear PLR on intentional shutdown + safe_delay(1000); // Wait 1 second before switching off LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF "."); From b53e14c7f8709fddecd365c191ceb7f4f2ac4fdd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 28 Aug 2024 00:42:11 -0500 Subject: [PATCH 10/18] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Guard?= =?UTF-8?q?=20queue=20advance=5Fr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/queue.cpp | 4 ++-- Marlin/src/gcode/queue.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 6b34a3b46b04..34754500456e 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -101,7 +101,7 @@ void GCodeQueue::RingBuffer::commit_command(const bool skip_ok commands[index_w].skip_ok = skip_ok; TERN_(HAS_MULTI_SERIAL, commands[index_w].port = serial_ind); TERN_(POWER_LOSS_RECOVERY, recovery.commit_sdpos(index_w)); - advance_pos(index_w, 1); + advance_w(); } /** @@ -702,7 +702,7 @@ void GCodeQueue::advance() { #endif // HAS_MEDIA // The queue may be reset by a command handler or by code invoked by idle() within a handler - ring_buffer.advance_pos(ring_buffer.index_r, -1); + ring_buffer.advance_r(); } #if ENABLED(BUFFER_MONITORING) diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 07e08493d1de..3779cfc4ad89 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -78,6 +78,8 @@ class GCodeQueue { inline void clear() { length = index_r = index_w = 0; } void advance_pos(uint8_t &p, const int inc) { if (++p >= BUFSIZE) p = 0; length += inc; } + inline void advance_w() { advance_pos(index_w, 1); } + inline void advance_r() { if (length) advance_pos(index_r, -1); } void commit_command(const bool skip_ok OPTARG(HAS_MULTI_SERIAL, serial_index_t serial_ind=serial_index_t()) From 4f159a94cd4cb368fa407c82c4a9114f7ab2f1f8 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 28 Aug 2024 06:08:14 +0000 Subject: [PATCH 11/18] [cron] Bump distribution date (2024-08-28) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 2cd9de6cb157..4fbe83e5a9d9 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-08-27" +//#define STRING_DISTRIBUTION_DATE "2024-08-28" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index d1b7e1776880..66434f5c46a2 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-08-27" + #define STRING_DISTRIBUTION_DATE "2024-08-28" #endif /** From cf46d1880cb4f47906d2e0aa0bbcdede53e4e0df Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 28 Aug 2024 15:46:53 -0500 Subject: [PATCH 12/18] =?UTF-8?q?=F0=9F=9A=B8=20Purge=20PLR=20on=20power-o?= =?UTF-8?q?ff=20(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/control/M80_M81.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index e86e26731379..8a52d49d9a53 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -34,6 +34,10 @@ #include "../../feature/power.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../feature/powerloss.h" +#endif + #if HAS_SUICIDE #include "../../MarlinCore.h" #endif From 934fc52d064731df1af984561d1dd564b68c4d7f Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 29 Aug 2024 00:25:00 +0000 Subject: [PATCH 13/18] [cron] Bump distribution date (2024-08-29) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 4fbe83e5a9d9..cb46ecf89795 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-08-28" +//#define STRING_DISTRIBUTION_DATE "2024-08-29" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 66434f5c46a2..cd40c83ba2d8 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-08-28" + #define STRING_DISTRIBUTION_DATE "2024-08-29" #endif /** From 8ac0f1479648649c40873fecd9deec7396238f82 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 28 Aug 2024 20:41:12 -0500 Subject: [PATCH 14/18] =?UTF-8?q?=F0=9F=AA=A0=20More=20granular=20sub-opti?= =?UTF-8?q?ons=20undef=20(#27373)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration.h | 2 +- Marlin/src/HAL/SAMD51/HAL.h | 10 + Marlin/src/inc/Conditionals_LCD.h | 1202 +--------------------------- Marlin/src/inc/Conditionals_adv.h | 88 +- Marlin/src/inc/Conditionals_axes.h | 698 ++++++++++++++++ Marlin/src/inc/Conditionals_etc.h | 664 +++++++++++++++ Marlin/src/inc/Conditionals_post.h | 11 +- Marlin/src/inc/MarlinConfigPre.h | 2 + 8 files changed, 1445 insertions(+), 1232 deletions(-) create mode 100644 Marlin/src/inc/Conditionals_axes.h create mode 100644 Marlin/src/inc/Conditionals_etc.h diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d926d4fc84ed..afa37cd131af 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -106,7 +106,7 @@ /** * Select a third serial port on the board to use for communication with the host. - * Currently only supported for AVR, DUE, LPC1768/9 and STM32/STM32F1 + * Currently supported for AVR, DUE, SAMD51, LPC1768/9, STM32/STM32F1/HC32, and Teensy 4.x * :[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9] */ //#define SERIAL_PORT_3 1 diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index c96401fd9750..c43d1b591bd5 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -69,6 +69,16 @@ #endif #endif + #ifdef SERIAL_PORT_3 + #if SERIAL_PORT_3 == -1 + #define MYSERIAL3 MSerial0 + #elif WITHIN(SERIAL_PORT_3, 0, 3) + #define MYSERIAL3 MSERIAL(SERIAL_PORT_3) + #else + #error "SERIAL_PORT_3 must be from 0 to 3. You can also use -1 if the board supports Native USB." + #endif + #endif + #ifdef MMU2_SERIAL_PORT #if MMU2_SERIAL_PORT == -1 #define MMU2_SERIAL MSerial0 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 633efc1e2f8b..1d2704d8a66a 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -26,598 +26,35 @@ * Conditionals that need to be set before Configuration_adv.h or pins.h */ -#ifndef STRING_CONFIG_H_AUTHOR - #define STRING_CONFIG_H_AUTHOR "(anonymous)" -#endif - -/** - * Extruders have some combination of stepper motors and hotends - * so we separate these concepts into the defines: - * - * EXTRUDERS - Number of Selectable Tools - * HOTENDS - Number of hotends, whether connected or separate - * E_STEPPERS - Number of actual E stepper motors - * E_MANUAL - Number of E steppers for LCD move options - * - * These defines must be simple constants for use in REPEAT, etc. - */ -#if EXTRUDERS - #define HAS_EXTRUDERS 1 - #if EXTRUDERS > 1 - #define HAS_MULTI_EXTRUDER 1 - #endif - #define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E)) -#else - #undef EXTRUDERS - #define EXTRUDERS 0 - #undef TEMP_SENSOR_0 - #undef TEMP_SENSOR_1 - #undef TEMP_SENSOR_2 - #undef TEMP_SENSOR_3 - #undef TEMP_SENSOR_4 - #undef TEMP_SENSOR_5 - #undef TEMP_SENSOR_6 - #undef TEMP_SENSOR_7 - #undef SINGLENOZZLE - #undef SWITCHING_EXTRUDER - #undef MECHANICAL_SWITCHING_EXTRUDER - #undef SWITCHING_NOZZLE - #undef MECHANICAL_SWITCHING_NOZZLE - #undef MIXING_EXTRUDER - #undef HOTEND_IDLE_TIMEOUT - #undef DISABLE_E - #undef PREVENT_LENGTHY_EXTRUDE - #undef FILAMENT_RUNOUT_SENSOR - #undef FILAMENT_RUNOUT_DISTANCE_MM - #undef DISABLE_OTHER_EXTRUDERS - #undef THERMAL_PROTECTION_HYSTERESIS - #undef THERMAL_PROTECTION_PERIOD -#endif - -#define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N) -#define E_TERN_(N) TERN_(HAS_MULTI_EXTRUDER, N) -#define E_TERN0(N) TERN0(HAS_MULTI_EXTRUDER, N) - -#if ANY(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER) - #define HAS_SWITCHING_EXTRUDER 1 -#endif -#if ANY(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE) - #define HAS_SWITCHING_NOZZLE 1 -#endif - -/** - * Multi-Material-Unit supported models - */ -#ifdef MMU_MODEL - #define HAS_MMU 1 - #define SINGLENOZZLE - - #define _PRUSA_MMU1 1 - #define _PRUSA_MMU2 2 - #define _PRUSA_MMU2S 3 - #define _PRUSA_MMU3 4 - #define _EXTENDABLE_EMU_MMU2 12 - #define _EXTENDABLE_EMU_MMU2S 13 - #define _EXTENDABLE_EMU_MMU3 14 - #define _MMU CAT(_,MMU_MODEL) - - #if _MMU == _PRUSA_MMU1 - #define HAS_PRUSA_MMU1 1 - #elif _MMU % 10 == _PRUSA_MMU2 - #define HAS_PRUSA_MMU2 1 - #elif _MMU % 10 == _PRUSA_MMU2S - #define HAS_PRUSA_MMU2 1 - #define HAS_PRUSA_MMU2S 1 - #elif _MMU % 10 == _PRUSA_MMU3 - #define HAS_PRUSA_MMU3 1 - #endif - #if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S - #define HAS_EXTENDABLE_MMU 1 - #endif - - #undef _MMU - #undef _PRUSA_MMU1 - #undef _PRUSA_MMU2 - #undef _PRUSA_MMU2S - #undef _PRUSA_MMU3 - #undef _EXTENDABLE_EMU_MMU2 - #undef _EXTENDABLE_EMU_MMU2S - #undef _EXTENDABLE_EMU_MMU3 -#endif - -#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0 - - #define E_STEPPERS 2 - #define E_MANUAL 1 - -#elif HAS_SWITCHING_EXTRUDER // One stepper for every two EXTRUDERS - - #if EXTRUDERS > 4 - #define E_STEPPERS 3 - #elif EXTRUDERS > 2 - #define E_STEPPERS 2 - #else - #define E_STEPPERS 1 - #endif - -#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally - - #define E_STEPPERS MIXING_STEPPERS - #define E_MANUAL 1 - #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 - - #define E_STEPPERS EXTRUDERS - #define E_MANUAL EXTRUDERS - -#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3 // Průša Multi-Material Unit v2/v3 - - #define E_STEPPERS 1 - #define E_MANUAL 1 - -#endif - -// Default E steppers / manual motion is one per extruder -#ifndef E_STEPPERS - #define E_STEPPERS EXTRUDERS -#endif -#ifndef E_MANUAL - #define E_MANUAL EXTRUDERS -#endif - -// Number of hotends... -#if ANY(SINGLENOZZLE, MIXING_EXTRUDER) // Only one for singlenozzle or mixing extruder - #define HOTENDS 1 -#elif HAS_SWITCHING_EXTRUDER && !HAS_SWITCHING_NOZZLE // One for each pair of abstract "extruders" - #define HOTENDS E_STEPPERS -#elif TEMP_SENSOR_0 - #define HOTENDS EXTRUDERS // One per extruder if at least one heater exists -#else - #define HOTENDS 0 // A machine with no hotends at all can still extrude -#endif - -// At least one hotend... -#if HOTENDS - #define HAS_HOTEND 1 - #ifndef HOTEND_OVERSHOOT - #define HOTEND_OVERSHOOT 15 - #endif -#endif - -// More than one hotend... -#if HOTENDS > 1 - #define HAS_MULTI_HOTEND 1 - #define HAS_HOTEND_OFFSET 1 - #ifndef HOTEND_OFFSET_X - #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Y - #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder - #endif - #ifndef HOTEND_OFFSET_Z - #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder - #endif -#else - #undef HOTEND_OFFSET_X - #undef HOTEND_OFFSET_Y - #undef HOTEND_OFFSET_Z +// Support for SD Card and other file storage +#if ENABLED(SDSUPPORT) + #define HAS_MEDIA 1 #endif // -// Remove irrelevant Configuration.h settings +// Serial Port Info // - -// Clean up E-stepper-based settings... -#if E_STEPPERS <= 7 - #undef INVERT_E7_DIR - #undef E7_DRIVER_TYPE - #if E_STEPPERS <= 6 - #undef INVERT_E6_DIR - #undef E6_DRIVER_TYPE - #if E_STEPPERS <= 5 - #undef INVERT_E5_DIR - #undef E5_DRIVER_TYPE - #if E_STEPPERS <= 4 - #undef INVERT_E4_DIR - #undef E4_DRIVER_TYPE - #if E_STEPPERS <= 3 - #undef INVERT_E3_DIR - #undef E3_DRIVER_TYPE - #if E_STEPPERS <= 2 - #undef INVERT_E2_DIR - #undef E2_DRIVER_TYPE - #if E_STEPPERS <= 1 - #undef INVERT_E1_DIR - #undef E1_DRIVER_TYPE - #if E_STEPPERS == 0 - #undef INVERT_E0_DIR - #undef E0_DRIVER_TYPE - #endif - #endif - #endif - #endif - #endif - #endif - #endif -#endif - -// Clean up unused temperature sensors and sub-options - -#if !TEMP_SENSOR_0 - #undef TEMP_SENSOR_0 -#endif -#if !TEMP_SENSOR_1 - #undef TEMP_SENSOR_1 -#endif -#if !TEMP_SENSOR_2 - #undef TEMP_SENSOR_2 -#endif -#if !TEMP_SENSOR_3 - #undef TEMP_SENSOR_3 -#endif -#if !TEMP_SENSOR_4 - #undef TEMP_SENSOR_4 -#endif -#if !TEMP_SENSOR_5 - #undef TEMP_SENSOR_5 -#endif -#if !TEMP_SENSOR_6 - #undef TEMP_SENSOR_6 -#endif -#if !TEMP_SENSOR_7 - #undef TEMP_SENSOR_7 -#endif - -#if TEMP_SENSOR_BED - #define HAS_HEATED_BED 1 -#else - #undef TEMP_SENSOR_BED - #undef THERMAL_PROTECTION_BED_HYSTERESIS - #undef THERMAL_PROTECTION_BED_PERIOD - #undef MAX_BED_POWER -#endif -#if !TEMP_SENSOR_CHAMBER - #undef TEMP_SENSOR_CHAMBER - #undef THERMAL_PROTECTION_CHAMBER_HYSTERESIS - #undef THERMAL_PROTECTION_CHAMBER_PERIOD - #undef CHAMBER_AUTO_FAN_PIN - #undef CHAMBER_AUTO_FAN_SPEED - #undef CHAMBER_AUTO_FAN_TEMPERATURE - #undef MAX_CHAMBER_POWER -#endif -#if !TEMP_SENSOR_COOLER - #undef TEMP_SENSOR_COOLER - #undef COOLER_AUTO_FAN_PIN - #undef COOLER_AUTO_FAN_SPEED - #undef COOLER_AUTO_FAN_TEMPERATURE -#endif -#if !TEMP_SENSOR_PROBE - #undef TEMP_SENSOR_PROBE -#endif -#if !TEMP_SENSOR_REDUNDANT - #undef TEMP_SENSOR_REDUNDANT -#endif -#if !TEMP_SENSOR_BOARD - #undef TEMP_SENSOR_BOARD -#endif -#if !TEMP_SENSOR_SOC - #undef TEMP_SENSOR_SOC -#endif -#if !SOFT_PWM_SCALE - #undef SOFT_PWM_SCALE -#endif - -/** - * Number of Linear Axes (e.g., XYZIJKUVW) - * All the logical axes except for the tool (E) axis - */ -#ifdef NUM_AXES - #undef NUM_AXES - #define NUM_AXES_WARNING 1 -#endif - -#ifdef W_DRIVER_TYPE - #define NUM_AXES 9 -#elif defined(V_DRIVER_TYPE) - #define NUM_AXES 8 -#elif defined(U_DRIVER_TYPE) - #define NUM_AXES 7 -#elif defined(K_DRIVER_TYPE) - #define NUM_AXES 6 -#elif defined(J_DRIVER_TYPE) - #define NUM_AXES 5 -#elif defined(I_DRIVER_TYPE) - #define NUM_AXES 4 -#elif defined(Z_DRIVER_TYPE) - #define NUM_AXES 3 -#elif defined(Y_DRIVER_TYPE) - #define NUM_AXES 2 -#elif defined(X_DRIVER_TYPE) - #define NUM_AXES 1 -#else - #define NUM_AXES 0 -#endif -#if NUM_AXES >= 1 - #define HAS_X_AXIS 1 - #define HAS_A_AXIS 1 - #if NUM_AXES >= XY - #define HAS_Y_AXIS 1 - #define HAS_B_AXIS 1 - #if NUM_AXES >= XYZ - #define HAS_Z_AXIS 1 - #define HAS_C_AXIS 1 - #if NUM_AXES >= 4 - #define HAS_I_AXIS 1 - #if NUM_AXES >= 5 - #define HAS_J_AXIS 1 - #if NUM_AXES >= 6 - #define HAS_K_AXIS 1 - #if NUM_AXES >= 7 - #define HAS_U_AXIS 1 - #if NUM_AXES >= 8 - #define HAS_V_AXIS 1 - #if NUM_AXES >= 9 - #define HAS_W_AXIS 1 - #endif - #endif - #endif - #endif - #endif - #endif - #endif - #endif -#endif - -#if HAS_Z_AXIS - #ifdef Z4_DRIVER_TYPE - #define NUM_Z_STEPPERS 4 - #elif defined(Z3_DRIVER_TYPE) - #define NUM_Z_STEPPERS 3 - #elif defined(Z2_DRIVER_TYPE) - #define NUM_Z_STEPPERS 2 +#ifdef SERIAL_PORT_2 + #define HAS_MULTI_SERIAL 1 + #ifdef SERIAL_PORT_3 + #define NUM_SERIAL 3 #else - #define NUM_Z_STEPPERS 1 + #define NUM_SERIAL 2 #endif -#endif - -#if !HAS_X_AXIS - #undef AVOID_OBSTACLES - #undef X2_DRIVER_TYPE - #undef X_ENABLE_ON - #undef DISABLE_X - #undef INVERT_X_DIR - #undef X_HOME_DIR - #undef X_MIN_POS - #undef X_MAX_POS - #undef MANUAL_X_HOME_POS - #undef MIN_SOFTWARE_ENDSTOPS - #undef MAX_SOFTWARE_ENDSTOPS - #undef MIN_SOFTWARE_ENDSTOP_X - #undef MAX_SOFTWARE_ENDSTOP_X -#endif - -#if !HAS_Y_AXIS - #undef AVOID_OBSTACLES - #undef Y2_DRIVER_TYPE - #undef Y_ENABLE_ON - #undef DISABLE_Y - #undef INVERT_Y_DIR - #undef Y_HOME_DIR - #undef Y_MIN_POS - #undef Y_MAX_POS - #undef MANUAL_Y_HOME_POS - #undef MIN_SOFTWARE_ENDSTOP_Y - #undef MAX_SOFTWARE_ENDSTOP_Y -#endif - -#if !HAS_Z_AXIS - #undef Z2_DRIVER_TYPE - #undef Z3_DRIVER_TYPE - #undef Z4_DRIVER_TYPE - #undef Z_ENABLE_ON - #undef DISABLE_Z - #undef INVERT_Z_DIR - #undef Z_HOME_DIR - #undef Z_MIN_POS - #undef Z_MAX_POS - #undef MANUAL_Z_HOME_POS - #undef Z_SAFE_HOMING - #undef MIN_SOFTWARE_ENDSTOP_Z - #undef MAX_SOFTWARE_ENDSTOP_Z -#endif - -#if !HAS_I_AXIS - #undef I_ENABLE_ON - #undef DISABLE_I - #undef INVERT_I_DIR - #undef I_HOME_DIR - #undef I_MIN_POS - #undef I_MAX_POS - #undef MANUAL_I_HOME_POS - #undef MIN_SOFTWARE_ENDSTOP_I - #undef MAX_SOFTWARE_ENDSTOP_I -#endif - -#if !HAS_J_AXIS - #undef J_ENABLE_ON - #undef DISABLE_J - #undef INVERT_J_DIR - #undef J_HOME_DIR - #undef J_MIN_POS - #undef J_MAX_POS - #undef MANUAL_J_HOME_POS - #undef MIN_SOFTWARE_ENDSTOP_J - #undef MAX_SOFTWARE_ENDSTOP_J -#endif - -#if !HAS_K_AXIS - #undef K_ENABLE_ON - #undef DISABLE_K - #undef INVERT_K_DIR - #undef K_HOME_DIR - #undef K_MIN_POS - #undef K_MAX_POS - #undef MANUAL_K_HOME_POS - #undef MIN_SOFTWARE_ENDSTOP_K - #undef MAX_SOFTWARE_ENDSTOP_K -#endif - -#if !HAS_U_AXIS - #undef U_ENABLE_ON - #undef DISABLE_U - #undef INVERT_U_DIR - #undef U_HOME_DIR - #undef U_MIN_POS - #undef U_MAX_POS - #undef MANUAL_U_HOME_POS - #undef MIN_SOFTWARE_ENDSTOP_U - #undef MAX_SOFTWARE_ENDSTOP_U -#endif - -#if !HAS_V_AXIS - #undef V_ENABLE_ON - #undef DISABLE_V - #undef INVERT_V_DIR - #undef V_HOME_DIR - #undef V_MIN_POS - #undef V_MAX_POS - #undef MANUAL_V_HOME_POS - #undef MIN_SOFTWARE_ENDSTOP_V - #undef MAX_SOFTWARE_ENDSTOP_V -#endif - -#if !HAS_W_AXIS - #undef W_ENABLE_ON - #undef DISABLE_W - #undef INVERT_W_DIR - #undef W_HOME_DIR - #undef W_MIN_POS - #undef W_MAX_POS - #undef MANUAL_W_HOME_POS - #undef MIN_SOFTWARE_ENDSTOP_W - #undef MAX_SOFTWARE_ENDSTOP_W -#endif - -#define _OR_HAS_DA(A) ENABLED(DISABLE_##A) || -#if MAP(_OR_HAS_DA, X, Y, Z, I, J, K, U, V, W) 0 - #define HAS_DISABLE_MAIN_AXES 1 -#endif -#if HAS_DISABLE_MAIN_AXES || ENABLED(DISABLE_E) - #define HAS_DISABLE_AXES 1 -#endif -#undef _OR_HAS_DA - -#ifdef X2_DRIVER_TYPE - #define HAS_X2_STEPPER 1 -#endif -#ifdef Y2_DRIVER_TYPE - #define HAS_Y2_STEPPER 1 -#endif - -/** - * Number of Primary Linear Axes (e.g., XYZ) - * X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2, Z2, Z3, Z4) - */ -#if NUM_AXES >= 3 - #define PRIMARY_LINEAR_AXES 3 -#else - #define PRIMARY_LINEAR_AXES NUM_AXES -#endif - -/** - * Number of Secondary Axes (e.g., IJKUVW) - * All linear/rotational axes between XYZ and E. - */ -#define SECONDARY_AXES SUB3(NUM_AXES) - -/** - * Number of Rotational Axes (e.g., IJK) - * All axes for which AXIS*_ROTATES is defined. - * For these axes, positions are specified in angular degrees. - */ -#if ENABLED(AXIS9_ROTATES) - #define ROTATIONAL_AXES 6 -#elif ENABLED(AXIS8_ROTATES) - #define ROTATIONAL_AXES 5 -#elif ENABLED(AXIS7_ROTATES) - #define ROTATIONAL_AXES 4 -#elif ENABLED(AXIS6_ROTATES) - #define ROTATIONAL_AXES 3 -#elif ENABLED(AXIS5_ROTATES) - #define ROTATIONAL_AXES 2 -#elif ENABLED(AXIS4_ROTATES) - #define ROTATIONAL_AXES 1 +#elif defined(SERIAL_PORT) + #define NUM_SERIAL 1 #else - #define ROTATIONAL_AXES 0 -#endif - -#if ROTATIONAL_AXES - #define HAS_ROTATIONAL_AXES 1 + #define NUM_SERIAL 0 + #undef BAUD_RATE_GCODE #endif - -/** - * Number of Secondary Linear Axes (e.g., UVW) - * All secondary axes for which AXIS*_ROTATES is not defined. - * Excluding primary axes and excluding duplicate axes (X2, Y2, Z2, Z3, Z4) - */ -#define SECONDARY_LINEAR_AXES (NUM_AXES - PRIMARY_LINEAR_AXES - ROTATIONAL_AXES) - -/** - * Number of Logical Axes (e.g., XYZIJKUVWE) - * All logical axes that can be commanded directly by G-code. - * Delta maps stepper-specific values to ABC steppers. - */ -#if HAS_EXTRUDERS - #define LOGICAL_AXES INCREMENT(NUM_AXES) -#else - #define LOGICAL_AXES NUM_AXES +#if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 || SERIAL_PORT_3 == -1 + #define HAS_USB_SERIAL 1 #endif - -/** - * DISTINCT_E_FACTORS is set to give extruders (some) individual settings. - * - * DISTINCT_AXES is the number of distinct addressable axes (not steppers). - * Includes all linear axes plus all distinguished extruders. - * The default behavior is to treat all extruders as a single E axis - * with shared motion and temperature settings. - * - * DISTINCT_E is the number of distinguished extruders. By default this - * will be 1 which indicates all extruders share the same settings. - * - * E_INDEX_N(E) should be used to get the E index of any item that might be - * distinguished. - */ -#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 - #define DISTINCT_AXES (NUM_AXES + E_STEPPERS) - #define DISTINCT_E E_STEPPERS - #define E_INDEX_N(E) (E) -#else - #undef DISTINCT_E_FACTORS - #define DISTINCT_AXES LOGICAL_AXES - #define DISTINCT_E 1 - #define E_INDEX_N(E) 0 +#ifdef RS485_SERIAL_PORT + #define HAS_RS485_SERIAL 1 #endif - -// Helper macros for extruder and hotend arrays -#define _EXTRUDER_LOOP(E) for (int8_t E = 0; E < EXTRUDERS; E++) -#define EXTRUDER_LOOP() _EXTRUDER_LOOP(e) -#define _HOTEND_LOOP(H) for (int8_t H = 0; H < HOTENDS; H++) -#define HOTEND_LOOP() _HOTEND_LOOP(e) - -#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) -#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1) -#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V) -#define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1) - -// Support for SD Card and other file storage -#if ENABLED(SDSUPPORT) - #define HAS_MEDIA 1 +#if SERIAL_PORT_2 == -2 + #define HAS_ETHERNET 1 #endif /** @@ -1209,508 +646,8 @@ #if NONE(HAS_MARLINUI_U8GLIB, HAS_TFT_LVGL_UI, DGUS_LCD_UI_E3S1PRO) #undef LCD_LANGUAGE #endif - -/** - * Disable unused SINGLENOZZLE sub-options - */ -#if DISABLED(SINGLENOZZLE) - #undef SINGLENOZZLE_STANDBY_TEMP -#endif -#if !ALL(HAS_FAN, SINGLENOZZLE) - #undef SINGLENOZZLE_STANDBY_FAN -#endif - -// No inactive extruders with SWITCHING_NOZZLE or Průša MMU1 or just 1 E stepper exists -#if HAS_SWITCHING_NOZZLE || HAS_PRUSA_MMU1 || E_STEPPERS < 2 - #undef DISABLE_OTHER_EXTRUDERS -#endif - -// Switching extruder has its own servo? -#if ENABLED(SWITCHING_EXTRUDER) && (!HAS_SWITCHING_NOZZLE || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR) - #define DO_SWITCH_EXTRUDER 1 -#endif - -/** - * The BLTouch Probe emulates a servo probe - * and uses "special" angles for its state. - */ -#if ENABLED(BLTOUCH) && !defined(Z_PROBE_SERVO_NR) - #define Z_PROBE_SERVO_NR 0 -#endif - -/** - * Set a flag for a servo probe (or BLTouch) - */ -#ifdef Z_PROBE_SERVO_NR - #define HAS_Z_SERVO_PROBE 1 -#endif -#if ANY(HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE) - #define HAS_SERVO_ANGLES 1 -#endif -#if !HAS_SERVO_ANGLES - #undef EDITABLE_SERVO_ANGLES -#endif - -/** - * Set flags for any form of bed probe - */ -#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, HAS_Z_SERVO_PROBE, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2) - #define HAS_STOWABLE_PROBE 1 -#endif -#if ANY(HAS_STOWABLE_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE) - #define HAS_BED_PROBE 1 -#endif - -// Probing tool change -#if !HAS_MULTI_EXTRUDER - #undef PROBING_TOOL -#endif -#if HAS_BED_PROBE && defined(PROBING_TOOL) - #define DO_TOOLCHANGE_FOR_PROBING 1 -#endif - -/** - * Fill in undefined Filament Sensor options - */ -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - #if NUM_RUNOUT_SENSORS >= 1 - #ifndef FIL_RUNOUT1_STATE - #define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT1_PULLUP - #define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT1_PULLDOWN - #define FIL_RUNOUT1_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_RUNOUT_SENSORS >= 2 - #ifndef FIL_RUNOUT2_STATE - #define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT2_PULLUP - #define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT2_PULLDOWN - #define FIL_RUNOUT2_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_RUNOUT_SENSORS >= 3 - #ifndef FIL_RUNOUT3_STATE - #define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT3_PULLUP - #define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT3_PULLDOWN - #define FIL_RUNOUT3_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_RUNOUT_SENSORS >= 4 - #ifndef FIL_RUNOUT4_STATE - #define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT4_PULLUP - #define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT4_PULLDOWN - #define FIL_RUNOUT4_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_RUNOUT_SENSORS >= 5 - #ifndef FIL_RUNOUT5_STATE - #define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT5_PULLUP - #define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT5_PULLDOWN - #define FIL_RUNOUT5_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_RUNOUT_SENSORS >= 6 - #ifndef FIL_RUNOUT6_STATE - #define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT6_PULLUP - #define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT6_PULLDOWN - #define FIL_RUNOUT6_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_RUNOUT_SENSORS >= 7 - #ifndef FIL_RUNOUT7_STATE - #define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT7_PULLUP - #define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT7_PULLDOWN - #define FIL_RUNOUT7_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_RUNOUT_SENSORS >= 8 - #ifndef FIL_RUNOUT8_STATE - #define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_RUNOUT8_PULLUP - #define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_RUNOUT8_PULLDOWN - #define FIL_RUNOUT8_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif -#endif // FILAMENT_RUNOUT_SENSOR - -#if ENABLED(FILAMENT_SWITCH_AND_MOTION) - #if NUM_MOTION_SENSORS >= 1 - #ifndef FIL_MOTION1_STATE - #define FIL_MOTION1_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION1_PULLUP - #define FIL_MOTION1_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION1_PULLDOWN - #define FIL_MOTION1_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_MOTION_SENSORS >= 2 - #ifndef FIL_MOTION2_STATE - #define FIL_MOTION2_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION2_PULLUP - #define FIL_MOTION2_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION2_PULLDOWN - #define FIL_MOTION2_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_MOTION_SENSORS >= 3 - #ifndef FIL_MOTION3_STATE - #define FIL_MOTION3_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION3_PULLUP - #define FIL_MOTION3_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION3_PULLDOWN - #define FIL_MOTION3_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_MOTION_SENSORS >= 4 - #ifndef FIL_MOTION4_STATE - #define FIL_MOTION4_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION4_PULLUP - #define FIL_MOTION4_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION4_PULLDOWN - #define FIL_MOTION4_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_MOTION_SENSORS >= 5 - #ifndef FIL_MOTION5_STATE - #define FIL_MOTION5_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION5_PULLUP - #define FIL_MOTION5_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION5_PULLDOWN - #define FIL_MOTION5_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_MOTION_SENSORS >= 6 - #ifndef FIL_MOTION6_STATE - #define FIL_MOTION6_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION6_PULLUP - #define FIL_MOTION6_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION6_PULLDOWN - #define FIL_MOTION6_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_MOTION_SENSORS >= 7 - #ifndef FIL_MOTION7_STATE - #define FIL_MOTION7_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION7_PULLUP - #define FIL_MOTION7_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION7_PULLDOWN - #define FIL_MOTION7_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif - #if NUM_MOTION_SENSORS >= 8 - #ifndef FIL_MOTION8_STATE - #define FIL_MOTION8_STATE FIL_RUNOUT_STATE - #endif - #ifndef FIL_MOTION8_PULLUP - #define FIL_MOTION8_PULLUP FIL_RUNOUT_PULLUP - #endif - #ifndef FIL_MOTION8_PULLDOWN - #define FILMOTION8_PULLDOWN FIL_RUNOUT_PULLDOWN - #endif - #endif -#endif // FILAMENT_SWITCH_AND_MOTION - -// Homing to Min or Max -#if HAS_X_AXIS - #if X_HOME_DIR > 0 - #define X_HOME_TO_MAX 1 - #elif X_HOME_DIR < 0 - #define X_HOME_TO_MIN 1 - #endif -#endif -#if HAS_Y_AXIS - #if Y_HOME_DIR > 0 - #define Y_HOME_TO_MAX 1 - #elif Y_HOME_DIR < 0 - #define Y_HOME_TO_MIN 1 - #endif -#endif -#if HAS_Z_AXIS - #if Z_HOME_DIR > 0 - #define Z_HOME_TO_MAX 1 - #elif Z_HOME_DIR < 0 - #define Z_HOME_TO_MIN 1 - #endif -#endif -#if HAS_I_AXIS - #if I_HOME_DIR > 0 - #define I_HOME_TO_MAX 1 - #elif I_HOME_DIR < 0 - #define I_HOME_TO_MIN 1 - #endif -#endif -#if HAS_J_AXIS - #if J_HOME_DIR > 0 - #define J_HOME_TO_MAX 1 - #elif J_HOME_DIR < 0 - #define J_HOME_TO_MIN 1 - #endif -#endif -#if HAS_K_AXIS - #if K_HOME_DIR > 0 - #define K_HOME_TO_MAX 1 - #elif K_HOME_DIR < 0 - #define K_HOME_TO_MIN 1 - #endif -#endif -#if HAS_U_AXIS - #if U_HOME_DIR > 0 - #define U_HOME_TO_MAX 1 - #elif U_HOME_DIR < 0 - #define U_HOME_TO_MIN 1 - #endif -#endif -#if HAS_V_AXIS - #if V_HOME_DIR > 0 - #define V_HOME_TO_MAX 1 - #elif V_HOME_DIR < 0 - #define V_HOME_TO_MIN 1 - #endif -#endif -#if HAS_W_AXIS - #if W_HOME_DIR > 0 - #define W_HOME_TO_MAX 1 - #elif W_HOME_DIR < 0 - #define W_HOME_TO_MIN 1 - #endif -#endif - -/** - * Conditionals based on the type of Bed Probe - */ -#if HAS_BED_PROBE - #if ALL(DELTA, SENSORLESS_PROBING) - #define HAS_DELTA_SENSORLESS_PROBING 1 - #else - #define HAS_REAL_BED_PROBE 1 - #endif - #if HAS_REAL_BED_PROBE && NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_SPI_SENSORLESS) - #define NEED_Z_MIN_PROBE_PIN 1 - #endif - #if Z_HOME_TO_MIN && (!NEED_Z_MIN_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING)) - #define HOMING_Z_WITH_PROBE 1 - #endif - #if DISABLED(NOZZLE_AS_PROBE) - #define HAS_PROBE_XY_OFFSET 1 - #endif - #if ANY(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE) - #define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe - #endif - #ifndef Z_PROBE_ERROR_TOLERANCE - #define Z_PROBE_ERROR_TOLERANCE Z_CLEARANCE_MULTI_PROBE - #endif - #if MULTIPLE_PROBING > 1 - #if EXTRA_PROBING > 0 - #define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING) - #else - #define TOTAL_PROBING MULTIPLE_PROBING - #endif - #endif -#else - // Clear probe pin settings when no probe is selected - #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN - #undef USE_PROBE_FOR_Z_HOMING - #undef Z_MIN_PROBE_REPEATABILITY_TEST - #undef HOMING_Z_WITH_PROBE - #undef Z_CLEARANCE_MULTI_PROBE - #undef Z_PROBE_ERROR_TOLERANCE - #undef Z_AFTER_PROBING - #undef Z_PROBE_LOW_POINT - #undef MULTIPLE_PROBING - #undef EXTRA_PROBING - #undef PROBE_OFFSET_ZMIN - #undef PROBE_OFFSET_ZMAX - #undef PAUSE_BEFORE_DEPLOY_STOW - #undef PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED - #undef PROBING_HEATERS_OFF - #undef WAIT_FOR_BED_HEATER - #undef WAIT_FOR_HOTEND - #undef PROBING_FANS_OFF - #undef PROBING_ESTEPPERS_OFF - #undef PROBING_STEPPERS_OFF - #undef DELAY_BEFORE_PROBING - #undef PREHEAT_BEFORE_PROBING - #undef PROBING_NOZZLE_TEMP - #undef PROBING_BED_TEMP - #undef NOZZLE_TO_PROBE_OFFSET -#endif - -#if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X) - #define HOME_Y_BEFORE_X -#endif - -#if Z_HOME_TO_MAX && DISABLED(Z_SAFE_HOMING) - #define HOME_Z_FIRST // If homing away from BED do Z first -#endif - -/** - * Conditionals based on the type of Bed Leveling - */ -#if ENABLED(AUTO_BED_LEVELING_UBL) - #undef LCD_BED_LEVELING - #if ANY(DELTA, SEGMENT_LEVELED_MOVES) - #define UBL_SEGMENTED 1 - #endif -#endif -#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) - #define ABL_PLANAR 1 -#endif -#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) - #define ABL_USES_GRID 1 -#endif -#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_3POINT) - #define HAS_ABL_NOT_UBL 1 -#endif -#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING) - #define HAS_MESH 1 -#endif -#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT) - #define NEEDS_THREE_PROBE_POINTS 1 -#endif -#if ANY(HAS_ABL_NOT_UBL, AUTO_BED_LEVELING_UBL) - #define HAS_ABL_OR_UBL 1 - #if DISABLED(PROBE_MANUALLY) - #define HAS_AUTOLEVEL 1 - #endif -#endif -#if ANY(HAS_ABL_OR_UBL, MESH_BED_LEVELING) - #define HAS_LEVELING 1 - #if DISABLED(AUTO_BED_LEVELING_UBL) - #define PLANNER_LEVELING 1 - #endif -#endif -#if !HAS_LEVELING - #undef RESTORE_LEVELING_AFTER_G28 - #undef ENABLE_LEVELING_AFTER_G28 - #undef G29_RETRY_AND_RECOVER -#endif -#if !HAS_LEVELING || ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) - #undef PROBE_MANUALLY -#endif -#if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING) - #define PROBE_SELECTED 1 -#endif - -#if !HAS_MESH - #undef MESH_INSET -#endif - -#if NONE(PROBE_SELECTED, AUTO_BED_LEVELING_UBL) - #undef Z_CLEARANCE_BETWEEN_PROBES -#endif - -#if NONE(PROBE_SELECTED, DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) - #undef PROBING_MARGIN - #undef PROBING_MARGIN_LEFT - #undef PROBING_MARGIN_RIGHT - #undef PROBING_MARGIN_FRONT - #undef PROBING_MARGIN_BACK - #undef XY_PROBE_FEEDRATE -#endif - -#if !(ANY(HAS_BED_PROBE, HAS_LEVELING) || ALL(AUTO_BED_LEVELING_UBL, HAS_MARLINUI_MENU)) - #undef Z_CLEARANCE_DEPLOY_PROBE -#endif - -#if !(ANY(HAS_BED_PROBE, BACKLASH_GCODE) || (ENABLED(EXTENSIBLE_UI) && ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL))) - #undef Z_PROBE_FEEDRATE_FAST - #undef Z_PROBE_FEEDRATE_SLOW -#endif - -/** - * Z_CLEARANCE_FOR_HOMING - */ -#ifndef Z_CLEARANCE_FOR_HOMING - #ifdef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_FOR_HOMING Z_CLEARANCE_BETWEEN_PROBES - #else - #define Z_CLEARANCE_FOR_HOMING 5 - #endif -#endif - -/** - * Z_CLEARANCE_BETWEEN_PROBES - */ -#if PROBE_SELECTED || (HAS_MARLINUI_MENU && ANY(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)) - #ifndef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_BETWEEN_PROBES Z_CLEARANCE_FOR_HOMING - #endif -#endif - -/** - * Z_CLEARANCE_BETWEEN_MANUAL_PROBES / Z_CLEARANCE_MULTI_PROBE - */ -#if PROBE_SELECTED - #if ANY(MESH_BED_LEVELING, PROBE_MANUALLY) - #if Z_CLEARANCE_BETWEEN_PROBES > Z_CLEARANCE_FOR_HOMING - #define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_BETWEEN_PROBES - #else - #define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_FOR_HOMING - #endif - #endif - #ifndef Z_CLEARANCE_MULTI_PROBE - #ifdef Z_CLEARANCE_BETWEEN_PROBES - #define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES - #else - #define Z_CLEARANCE_MULTI_PROBE 5 - #endif - #endif -#endif -#if TOTAL_PROBING < 2 - #undef Z_CLEARANCE_MULTI_PROBE -#endif - -#if DISABLED(ENABLE_LEVELING_FADE_HEIGHT) - #undef DEFAULT_LEVELING_FADE_HEIGHT -#endif - -#ifdef GRID_MAX_POINTS_X - #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) - #define GRID_LOOP(A,B) for (uint8_t A = 0; A < GRID_MAX_POINTS_X; ++A) for (uint8_t B = 0; B < GRID_MAX_POINTS_Y; ++B) +#if DISABLED(MPC_AUTOTUNE) + #undef MPC_AUTOTUNE_MENU #endif // Slim menu optimizations @@ -1726,99 +663,6 @@ #define HAS_FEEDRATE_EDIT 1 #endif -/** - * CoreXY, CoreXZ, and CoreYZ - and their reverse - */ -#if ANY(COREXY, COREYX) - #define CORE_IS_XY 1 -#endif -#if ANY(COREXZ, COREZX) - #define CORE_IS_XZ 1 -#endif -#if ANY(COREYZ, COREZY) - #define CORE_IS_YZ 1 -#endif -#if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ - #define IS_CORE 1 - #if CORE_IS_XY - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS - #elif CORE_IS_XZ - #define CORE_AXIS_1 A_AXIS - #define NORMAL_AXIS Y_AXIS - #define CORE_AXIS_2 C_AXIS - #elif CORE_IS_YZ - #define NORMAL_AXIS X_AXIS - #define CORE_AXIS_1 B_AXIS - #define CORE_AXIS_2 C_AXIS - #endif - #define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n)) -#elif ANY(MARKFORGED_XY, MARKFORGED_YX) - // Markforged kinematics - #define CORE_AXIS_1 A_AXIS - #define CORE_AXIS_2 B_AXIS - #define NORMAL_AXIS Z_AXIS -#endif - -#if ANY(MORGAN_SCARA, MP_SCARA, AXEL_TPARA) - #define IS_SCARA 1 - #define IS_KINEMATIC 1 -#elif ANY(DELTA, POLARGRAPH, POLAR) - #define IS_KINEMATIC 1 -#else - #define IS_CARTESIAN 1 - #if !IS_CORE - #define IS_FULL_CARTESIAN 1 - #endif -#endif - -#if DISABLED(DELTA) - #undef DELTA_HOME_TO_SAFE_ZONE -#endif - -// -// Serial Port Info -// -#ifdef SERIAL_PORT_2 - #define HAS_MULTI_SERIAL 1 - #ifdef SERIAL_PORT_3 - #define NUM_SERIAL 3 - #else - #define NUM_SERIAL 2 - #endif -#elif defined(SERIAL_PORT) - #define NUM_SERIAL 1 -#else - #define NUM_SERIAL 0 - #undef BAUD_RATE_GCODE -#endif -#if SERIAL_PORT == -1 || SERIAL_PORT_2 == -1 || SERIAL_PORT_3 == -1 - #define HAS_USB_SERIAL 1 -#endif -#ifdef RS485_SERIAL_PORT - #define HAS_RS485_SERIAL 1 -#endif -#if SERIAL_PORT_2 == -2 - #define HAS_ETHERNET 1 -#endif - -/** - * This setting is also used by M109 when trying to calculate - * a ballpark safe margin to prevent wait-forever situation. - */ -#ifndef EXTRUDE_MINTEMP - #define EXTRUDE_MINTEMP 170 -#endif - -#if ANY(PID_DEBUG, PID_BED_DEBUG, PID_CHAMBER_DEBUG) - #define HAS_PID_DEBUG 1 -#endif - -#if DISABLED(MPC_AUTOTUNE) - #undef MPC_AUTOTUNE_MENU -#endif - /** * TFT Displays * @@ -2031,7 +875,3 @@ #if LED_POWEROFF_TIMEOUT > 0 #define HAS_LED_POWEROFF_TIMEOUT 1 #endif - -#if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE) - #define SPI_FLASH_BACKUP 1 -#endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 4675051c5f05..234f146e7bf4 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -108,7 +108,6 @@ //#define LCD_SHOW_E_TOTAL #define NO_WORKSPACE_OFFSETS #define NO_HOME_OFFSETS - #undef AUTOTEMP #undef CALIBRATION_MEASURE_LEFT #undef CALIBRATION_MEASURE_RIGHT #undef CALIBRATION_MEASURE_XMAX @@ -295,17 +294,9 @@ #undef HEATER_1_MAXTEMP #undef HEATER_1_MINTEMP #if HOTENDS < 1 - #undef AUTOTEMP #undef E0_AUTO_FAN_PIN #undef HEATER_0_MAXTEMP #undef HEATER_0_MINTEMP - #undef PID_PARAMS_PER_HOTEND - #undef PIDTEMP - #undef MPCTEMP - #undef PREVENT_COLD_EXTRUSION - #undef THERMAL_PROTECTION_HOTENDS - #undef THERMAL_PROTECTION_PERIOD - #undef WATCH_TEMP_PERIOD #endif #endif #endif @@ -825,44 +816,50 @@ #undef TEMP_SENSOR_AD8495_OFFSET #endif -#if !HAS_HOTEND +#if !ALL(HAS_X_AXIS, HAS_HOTEND) + #undef AUTOTEMP +#endif +#if DISABLED(THERMAL_PROTECTION_HOTENDS) #undef THERMAL_PROTECTION_PERIOD #undef THERMAL_PROTECTION_HYSTERESIS #undef WATCH_TEMP_PERIOD #undef WATCH_TEMP_INCREASE - #undef ADAPTIVE_FAN_SLOWING - #undef REPORT_ADAPTIVE_FAN_SLOWING - #undef TEMP_TUNING_MAINTAIN_FAN +#endif +#if !ALL(HAS_HOTEND, PIDTEMP) + #undef PID_PARAMS_PER_HOTEND #endif #if !TEMP_SENSOR_BED - #undef THERMAL_PROTECTION_BED + #undef BED_MINTEMP + #undef BED_MAXTEMP +#endif +#if DISABLED(THERMAL_PROTECTION_BED) #undef THERMAL_PROTECTION_BED_PERIOD #undef THERMAL_PROTECTION_BED_HYSTERESIS #undef WATCH_BED_TEMP_PERIOD #undef WATCH_BED_TEMP_INCREASE - #undef BED_MINTEMP - #undef BED_MAXTEMP #endif #if !TEMP_SENSOR_CHAMBER - #undef THERMAL_PROTECTION_CHAMBER + #undef CHAMBER_MINTEMP + #undef CHAMBER_MAXTEMP +#endif +#if DISABLED(THERMAL_PROTECTION_CHAMBER) #undef THERMAL_PROTECTION_CHAMBER_PERIOD #undef THERMAL_PROTECTION_CHAMBER_HYSTERESIS #undef WATCH_CHAMBER_TEMP_PERIOD #undef WATCH_CHAMBER_TEMP_INCREASE - #undef CHAMBER_MINTEMP - #undef CHAMBER_MAXTEMP #endif #if !TEMP_SENSOR_COOLER - #undef THERMAL_PROTECTION_COOLER + #undef COOLER_MINTEMP + #undef COOLER_MAXTEMP +#endif +#if DISABLED(THERMAL_PROTECTION_COOLER) #undef THERMAL_PROTECTION_COOLER_PERIOD #undef THERMAL_PROTECTION_COOLER_HYSTERESIS #undef WATCH_COOLER_TEMP_PERIOD #undef WATCH_COOLER_TEMP_INCREASE - #undef COOLER_MINTEMP - #undef COOLER_MAXTEMP #endif #if HAS_MULTI_EXTRUDER || HAS_MULTI_HOTEND || HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3 || (ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1) @@ -1406,6 +1403,27 @@ #endif #endif +// Multi-Stepping Limit +#ifndef MULTISTEPPING_LIMIT + #define MULTISTEPPING_LIMIT 128 + #define MULTISTEPPING_LIMIT_WARNING 1 +#endif + +// One redundant cooling fan by default +#if defined(REDUNDANT_PART_COOLING_FAN) && !defined(NUM_REDUNDANT_FANS) + #define NUM_REDUNDANT_FANS 1 +#endif + +// Power-Loss Recovery +#if ENABLED(POWER_LOSS_RECOVERY) + #ifdef PLR_BED_THRESHOLD + #define HAS_PLR_BED_THRESHOLD 1 + #endif + #if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) + #define HAS_PLR_UI_FLAG 1 // recovery.ui_flag_resume + #endif +#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 @@ -1413,7 +1431,7 @@ #undef TC_GCODE_USE_GLOBAL_Z #endif -// TOOLCHANGE_MIGRATION_FEATURE - Clean up after sloppy auto config +// Clean up for TOOLCHANGE_MIGRATION_FEATURE #if DISABLED(TOOLCHANGE_MIGRATION_FEATURE) #undef MIGRATION_ZRAISE #undef MIGRATION_FS_EXTRA_PRIME @@ -1422,7 +1440,8 @@ #undef MIGRATION_FS_FAN_TIME #undef TOOLCHANGE_MIGRATION_DO_PARK #endif -// TOOLCHANGE_PARK - Clean up after sloppy auto config + +// Clean up for TOOLCHANGE_PARK #if DISABLED(TOOLCHANGE_PARK) #undef TOOLCHANGE_PARK_XY #undef TOOLCHANGE_PARK_XY_FEEDRATE @@ -1431,17 +1450,6 @@ #undef TOOLCHANGE_MIGRATION_DO_PARK #endif -// Multi-Stepping Limit -#ifndef MULTISTEPPING_LIMIT - #define MULTISTEPPING_LIMIT 128 - #define MULTISTEPPING_LIMIT_WARNING 1 -#endif - -// One redundant cooling fan by default -#if defined(REDUNDANT_PART_COOLING_FAN) && !defined(NUM_REDUNDANT_FANS) - #define NUM_REDUNDANT_FANS 1 -#endif - // Clean up if only mm units are used #if DISABLED(INCH_MODE_SUPPORT) #undef MANUAL_MOVE_DISTANCE_IN @@ -1451,13 +1459,3 @@ #if !HAS_ROTATIONAL_AXES #undef MANUAL_MOVE_DISTANCE_DEG #endif - -// Power-Loss Recovery -#if ENABLED(POWER_LOSS_RECOVERY) - #ifdef PLR_BED_THRESHOLD - #define HAS_PLR_BED_THRESHOLD 1 - #endif - #if ANY(DWIN_CREALITY_LCD, DWIN_LCD_PROUI) - #define HAS_PLR_UI_FLAG 1 // recovery.ui_flag_resume - #endif -#endif diff --git a/Marlin/src/inc/Conditionals_axes.h b/Marlin/src/inc/Conditionals_axes.h new file mode 100644 index 000000000000..5a79d2f3eb97 --- /dev/null +++ b/Marlin/src/inc/Conditionals_axes.h @@ -0,0 +1,698 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Conditionals_axes.h + * Conditionals that need to be set before Configuration_adv.h or pins.h + */ + +/** + * Extruders have some combination of stepper motors and hotends + * so we separate these concepts into the defines: + * + * EXTRUDERS - Number of Selectable Tools + * HOTENDS - Number of hotends, whether connected or separate + * E_STEPPERS - Number of actual E stepper motors + * E_MANUAL - Number of E steppers for LCD move options + * + * These defines must be simple constants for use in REPEAT, etc. + */ +#if EXTRUDERS + #define HAS_EXTRUDERS 1 + #if EXTRUDERS > 1 + #define HAS_MULTI_EXTRUDER 1 + #endif + #define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E)) +#else + #undef EXTRUDERS + #define EXTRUDERS 0 +#endif + +#define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N) +#define E_TERN_(N) TERN_(HAS_MULTI_EXTRUDER, N) +#define E_TERN0(N) TERN0(HAS_MULTI_EXTRUDER, N) + +#if ANY(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER) + #define HAS_SWITCHING_EXTRUDER 1 +#endif +#if ANY(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE) + #define HAS_SWITCHING_NOZZLE 1 +#endif + +/** + * Multi-Material-Unit supported models + */ +#ifdef MMU_MODEL + #define HAS_MMU 1 + #define SINGLENOZZLE + + #define _PRUSA_MMU1 1 + #define _PRUSA_MMU2 2 + #define _PRUSA_MMU2S 3 + #define _PRUSA_MMU3 4 + #define _EXTENDABLE_EMU_MMU2 12 + #define _EXTENDABLE_EMU_MMU2S 13 + #define _EXTENDABLE_EMU_MMU3 14 + #define _MMU CAT(_,MMU_MODEL) + + #if _MMU == _PRUSA_MMU1 + #define HAS_PRUSA_MMU1 1 + #elif _MMU % 10 == _PRUSA_MMU2 + #define HAS_PRUSA_MMU2 1 + #elif _MMU % 10 == _PRUSA_MMU2S + #define HAS_PRUSA_MMU2 1 + #define HAS_PRUSA_MMU2S 1 + #elif _MMU % 10 == _PRUSA_MMU3 + #define HAS_PRUSA_MMU3 1 + #endif + #if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S + #define HAS_EXTENDABLE_MMU 1 + #endif + + #undef _MMU + #undef _PRUSA_MMU1 + #undef _PRUSA_MMU2 + #undef _PRUSA_MMU2S + #undef _PRUSA_MMU3 + #undef _EXTENDABLE_EMU_MMU2 + #undef _EXTENDABLE_EMU_MMU2S + #undef _EXTENDABLE_EMU_MMU3 +#endif + +#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0 + + #define E_STEPPERS 2 + #define E_MANUAL 1 + +#elif HAS_SWITCHING_EXTRUDER // One stepper for every two EXTRUDERS + + #if EXTRUDERS > 4 + #define E_STEPPERS 3 + #elif EXTRUDERS > 2 + #define E_STEPPERS 2 + #else + #define E_STEPPERS 1 + #endif + +#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally + + #define E_STEPPERS MIXING_STEPPERS + #define E_MANUAL 1 + #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 + + #define E_STEPPERS EXTRUDERS + #define E_MANUAL EXTRUDERS + +#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3 // Průša Multi-Material Unit v2/v3 + + #define E_STEPPERS 1 + #define E_MANUAL 1 + +#endif + +// Default E steppers / manual motion is one per extruder +#ifndef E_STEPPERS + #define E_STEPPERS EXTRUDERS +#endif +#ifndef E_MANUAL + #define E_MANUAL EXTRUDERS +#endif + +// Number of hotends... +#if ANY(SINGLENOZZLE, MIXING_EXTRUDER) // Only one for singlenozzle or mixing extruder + #define HOTENDS 1 +#elif HAS_SWITCHING_EXTRUDER && !HAS_SWITCHING_NOZZLE // One for each pair of abstract "extruders" + #define HOTENDS E_STEPPERS +#elif TEMP_SENSOR_0 + #define HOTENDS EXTRUDERS // One per extruder if at least one heater exists +#else + #define HOTENDS 0 // A machine with no hotends at all can still extrude +#endif + +// At least one hotend... +#if HOTENDS + #define HAS_HOTEND 1 + #ifndef HOTEND_OVERSHOOT + #define HOTEND_OVERSHOOT 15 + #endif +#endif + +// More than one hotend... +#if HOTENDS > 1 + #define HAS_MULTI_HOTEND 1 + #define HAS_HOTEND_OFFSET 1 + #ifndef HOTEND_OFFSET_X + #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder + #endif + #ifndef HOTEND_OFFSET_Y + #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder + #endif + #ifndef HOTEND_OFFSET_Z + #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder + #endif +#endif + +/** + * Number of Linear Axes (e.g., XYZIJKUVW) + * All the logical axes except for the tool (E) axis + */ +#ifdef NUM_AXES + #undef NUM_AXES + #define NUM_AXES_WARNING 1 +#endif + +#ifdef W_DRIVER_TYPE + #define NUM_AXES 9 +#elif defined(V_DRIVER_TYPE) + #define NUM_AXES 8 +#elif defined(U_DRIVER_TYPE) + #define NUM_AXES 7 +#elif defined(K_DRIVER_TYPE) + #define NUM_AXES 6 +#elif defined(J_DRIVER_TYPE) + #define NUM_AXES 5 +#elif defined(I_DRIVER_TYPE) + #define NUM_AXES 4 +#elif defined(Z_DRIVER_TYPE) + #define NUM_AXES 3 +#elif defined(Y_DRIVER_TYPE) + #define NUM_AXES 2 +#elif defined(X_DRIVER_TYPE) + #define NUM_AXES 1 +#else + #define NUM_AXES 0 +#endif +#if NUM_AXES >= 1 + #define HAS_X_AXIS 1 + #define HAS_A_AXIS 1 + #if NUM_AXES >= XY + #define HAS_Y_AXIS 1 + #define HAS_B_AXIS 1 + #if NUM_AXES >= XYZ + #define HAS_Z_AXIS 1 + #define HAS_C_AXIS 1 + #if NUM_AXES >= 4 + #define HAS_I_AXIS 1 + #if NUM_AXES >= 5 + #define HAS_J_AXIS 1 + #if NUM_AXES >= 6 + #define HAS_K_AXIS 1 + #if NUM_AXES >= 7 + #define HAS_U_AXIS 1 + #if NUM_AXES >= 8 + #define HAS_V_AXIS 1 + #if NUM_AXES >= 9 + #define HAS_W_AXIS 1 + #endif + #endif + #endif + #endif + #endif + #endif + #endif + #endif +#endif + +#if HAS_Z_AXIS + #ifdef Z4_DRIVER_TYPE + #define NUM_Z_STEPPERS 4 + #elif defined(Z3_DRIVER_TYPE) + #define NUM_Z_STEPPERS 3 + #elif defined(Z2_DRIVER_TYPE) + #define NUM_Z_STEPPERS 2 + #else + #define NUM_Z_STEPPERS 1 + #endif +#endif + +#if !HAS_X_AXIS + #undef AVOID_OBSTACLES + #undef X2_DRIVER_TYPE + #undef X_ENABLE_ON + #undef DISABLE_X + #undef INVERT_X_DIR + #undef X_HOME_DIR + #undef X_MIN_POS + #undef X_MAX_POS + #undef MANUAL_X_HOME_POS + #undef MIN_SOFTWARE_ENDSTOPS + #undef MAX_SOFTWARE_ENDSTOPS + #undef MIN_SOFTWARE_ENDSTOP_X + #undef MAX_SOFTWARE_ENDSTOP_X +#endif + +#if !HAS_Y_AXIS + #undef AVOID_OBSTACLES + #undef Y2_DRIVER_TYPE + #undef Y_ENABLE_ON + #undef DISABLE_Y + #undef INVERT_Y_DIR + #undef Y_HOME_DIR + #undef Y_MIN_POS + #undef Y_MAX_POS + #undef MANUAL_Y_HOME_POS + #undef MIN_SOFTWARE_ENDSTOP_Y + #undef MAX_SOFTWARE_ENDSTOP_Y +#endif + +#if !HAS_Z_AXIS + #undef Z2_DRIVER_TYPE + #undef Z3_DRIVER_TYPE + #undef Z4_DRIVER_TYPE + #undef Z_ENABLE_ON + #undef DISABLE_Z + #undef INVERT_Z_DIR + #undef Z_HOME_DIR + #undef Z_MIN_POS + #undef Z_MAX_POS + #undef MANUAL_Z_HOME_POS + #undef Z_SAFE_HOMING + #undef MIN_SOFTWARE_ENDSTOP_Z + #undef MAX_SOFTWARE_ENDSTOP_Z +#endif + +#if !HAS_I_AXIS + #undef I_ENABLE_ON + #undef DISABLE_I + #undef INVERT_I_DIR + #undef I_HOME_DIR + #undef I_MIN_POS + #undef I_MAX_POS + #undef MANUAL_I_HOME_POS + #undef MIN_SOFTWARE_ENDSTOP_I + #undef MAX_SOFTWARE_ENDSTOP_I +#endif + +#if !HAS_J_AXIS + #undef J_ENABLE_ON + #undef DISABLE_J + #undef INVERT_J_DIR + #undef J_HOME_DIR + #undef J_MIN_POS + #undef J_MAX_POS + #undef MANUAL_J_HOME_POS + #undef MIN_SOFTWARE_ENDSTOP_J + #undef MAX_SOFTWARE_ENDSTOP_J +#endif + +#if !HAS_K_AXIS + #undef K_ENABLE_ON + #undef DISABLE_K + #undef INVERT_K_DIR + #undef K_HOME_DIR + #undef K_MIN_POS + #undef K_MAX_POS + #undef MANUAL_K_HOME_POS + #undef MIN_SOFTWARE_ENDSTOP_K + #undef MAX_SOFTWARE_ENDSTOP_K +#endif + +#if !HAS_U_AXIS + #undef U_ENABLE_ON + #undef DISABLE_U + #undef INVERT_U_DIR + #undef U_HOME_DIR + #undef U_MIN_POS + #undef U_MAX_POS + #undef MANUAL_U_HOME_POS + #undef MIN_SOFTWARE_ENDSTOP_U + #undef MAX_SOFTWARE_ENDSTOP_U +#endif + +#if !HAS_V_AXIS + #undef V_ENABLE_ON + #undef DISABLE_V + #undef INVERT_V_DIR + #undef V_HOME_DIR + #undef V_MIN_POS + #undef V_MAX_POS + #undef MANUAL_V_HOME_POS + #undef MIN_SOFTWARE_ENDSTOP_V + #undef MAX_SOFTWARE_ENDSTOP_V +#endif + +#if !HAS_W_AXIS + #undef W_ENABLE_ON + #undef DISABLE_W + #undef INVERT_W_DIR + #undef W_HOME_DIR + #undef W_MIN_POS + #undef W_MAX_POS + #undef MANUAL_W_HOME_POS + #undef MIN_SOFTWARE_ENDSTOP_W + #undef MAX_SOFTWARE_ENDSTOP_W +#endif + +// Clean up E-stepper-based settings... +#if E_STEPPERS <= 7 + #undef INVERT_E7_DIR + #undef E7_DRIVER_TYPE + #if E_STEPPERS <= 6 + #undef INVERT_E6_DIR + #undef E6_DRIVER_TYPE + #if E_STEPPERS <= 5 + #undef INVERT_E5_DIR + #undef E5_DRIVER_TYPE + #if E_STEPPERS <= 4 + #undef INVERT_E4_DIR + #undef E4_DRIVER_TYPE + #if E_STEPPERS <= 3 + #undef INVERT_E3_DIR + #undef E3_DRIVER_TYPE + #if E_STEPPERS <= 2 + #undef INVERT_E2_DIR + #undef E2_DRIVER_TYPE + #if E_STEPPERS <= 1 + #undef INVERT_E1_DIR + #undef E1_DRIVER_TYPE + #if E_STEPPERS == 0 + #undef INVERT_E0_DIR + #undef E0_DRIVER_TYPE + #endif + #endif + #endif + #endif + #endif + #endif + #endif +#endif + +#define _OR_HAS_DA(A) ENABLED(DISABLE_##A) || +#if MAP(_OR_HAS_DA, X, Y, Z, I, J, K, U, V, W) 0 + #define HAS_DISABLE_MAIN_AXES 1 +#endif +#if HAS_DISABLE_MAIN_AXES || ENABLED(DISABLE_E) + #define HAS_DISABLE_AXES 1 +#endif +#undef _OR_HAS_DA + +#ifdef X2_DRIVER_TYPE + #define HAS_X2_STEPPER 1 +#endif +#ifdef Y2_DRIVER_TYPE + #define HAS_Y2_STEPPER 1 +#endif + +/** + * Number of Primary Linear Axes (e.g., XYZ) + * X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2, Z2, Z3, Z4) + */ +#if NUM_AXES >= 3 + #define PRIMARY_LINEAR_AXES 3 +#else + #define PRIMARY_LINEAR_AXES NUM_AXES +#endif + +/** + * Number of Secondary Axes (e.g., IJKUVW) + * All linear/rotational axes between XYZ and E. + */ +#define SECONDARY_AXES SUB3(NUM_AXES) + +/** + * Number of Rotational Axes (e.g., IJK) + * All axes for which AXIS*_ROTATES is defined. + * For these axes, positions are specified in angular degrees. + */ +#if ENABLED(AXIS9_ROTATES) + #define ROTATIONAL_AXES 6 +#elif ENABLED(AXIS8_ROTATES) + #define ROTATIONAL_AXES 5 +#elif ENABLED(AXIS7_ROTATES) + #define ROTATIONAL_AXES 4 +#elif ENABLED(AXIS6_ROTATES) + #define ROTATIONAL_AXES 3 +#elif ENABLED(AXIS5_ROTATES) + #define ROTATIONAL_AXES 2 +#elif ENABLED(AXIS4_ROTATES) + #define ROTATIONAL_AXES 1 +#else + #define ROTATIONAL_AXES 0 +#endif + +#if ROTATIONAL_AXES + #define HAS_ROTATIONAL_AXES 1 +#endif + +/** + * Number of Secondary Linear Axes (e.g., UVW) + * All secondary axes for which AXIS*_ROTATES is not defined. + * Excluding primary axes and excluding duplicate axes (X2, Y2, Z2, Z3, Z4) + */ +#define SECONDARY_LINEAR_AXES (NUM_AXES - PRIMARY_LINEAR_AXES - ROTATIONAL_AXES) + +/** + * Number of Logical Axes (e.g., XYZIJKUVWE) + * All logical axes that can be commanded directly by G-code. + * Delta maps stepper-specific values to ABC steppers. + */ +#if HAS_EXTRUDERS + #define LOGICAL_AXES INCREMENT(NUM_AXES) +#else + #define LOGICAL_AXES NUM_AXES +#endif + +/** + * DISTINCT_E_FACTORS is set to give extruders (some) individual settings. + * + * DISTINCT_AXES is the number of distinct addressable axes (not steppers). + * Includes all linear axes plus all distinguished extruders. + * The default behavior is to treat all extruders as a single E axis + * with shared motion and temperature settings. + * + * DISTINCT_E is the number of distinguished extruders. By default this + * will be 1 which indicates all extruders share the same settings. + * + * E_INDEX_N(E) should be used to get the E index of any item that might be + * distinguished. + */ +#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1 + #define DISTINCT_AXES (NUM_AXES + E_STEPPERS) + #define DISTINCT_E E_STEPPERS + #define E_INDEX_N(E) (E) +#else + #undef DISTINCT_E_FACTORS + #define DISTINCT_AXES LOGICAL_AXES + #define DISTINCT_E 1 + #define E_INDEX_N(E) 0 +#endif + +// Helper macros for extruder and hotend arrays +#define _EXTRUDER_LOOP(E) for (int8_t E = 0; E < EXTRUDERS; E++) +#define EXTRUDER_LOOP() _EXTRUDER_LOOP(e) +#define _HOTEND_LOOP(H) for (int8_t H = 0; H < HOTENDS; H++) +#define HOTEND_LOOP() _HOTEND_LOOP(e) + +#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) +#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1) +#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V) +#define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1) + +/** + * Extruders have some combination of stepper motors and hotends + * so we separate these concepts into the defines: + * + * EXTRUDERS - Number of Selectable Tools + * HOTENDS - Number of hotends, whether connected or separate + * E_STEPPERS - Number of actual E stepper motors + * E_MANUAL - Number of E steppers for LCD move options + * + * These defines must be simple constants for use in REPEAT, etc. + */ +#if EXTRUDERS + #define HAS_EXTRUDERS 1 + #if EXTRUDERS > 1 + #define HAS_MULTI_EXTRUDER 1 + #endif + #define E_AXIS_N(E) AxisEnum(E_AXIS + E_INDEX_N(E)) +#else + #undef EXTRUDERS + #define EXTRUDERS 0 + #undef TEMP_SENSOR_0 + #undef TEMP_SENSOR_1 + #undef TEMP_SENSOR_2 + #undef TEMP_SENSOR_3 + #undef TEMP_SENSOR_4 + #undef TEMP_SENSOR_5 + #undef TEMP_SENSOR_6 + #undef TEMP_SENSOR_7 + #undef SINGLENOZZLE + #undef SWITCHING_EXTRUDER + #undef MECHANICAL_SWITCHING_EXTRUDER + #undef SWITCHING_NOZZLE + #undef MECHANICAL_SWITCHING_NOZZLE + #undef MIXING_EXTRUDER + #undef HOTEND_IDLE_TIMEOUT + #undef DISABLE_E + #undef PREVENT_LENGTHY_EXTRUDE + #undef FILAMENT_RUNOUT_SENSOR + #undef FILAMENT_RUNOUT_DISTANCE_MM + #undef DISABLE_OTHER_EXTRUDERS +#endif + +#define E_OPTARG(N) OPTARG(HAS_MULTI_EXTRUDER, N) +#define E_TERN_(N) TERN_(HAS_MULTI_EXTRUDER, N) +#define E_TERN0(N) TERN0(HAS_MULTI_EXTRUDER, N) + +#if ANY(SWITCHING_EXTRUDER, MECHANICAL_SWITCHING_EXTRUDER) + #define HAS_SWITCHING_EXTRUDER 1 +#endif +#if ANY(SWITCHING_NOZZLE, MECHANICAL_SWITCHING_NOZZLE) + #define HAS_SWITCHING_NOZZLE 1 +#endif + +/** + * Multi-Material-Unit supported models + */ +#ifdef MMU_MODEL + #define HAS_MMU 1 + #define SINGLENOZZLE + + #define _PRUSA_MMU1 1 + #define _PRUSA_MMU2 2 + #define _PRUSA_MMU2S 3 + #define _PRUSA_MMU3 4 + #define _EXTENDABLE_EMU_MMU2 12 + #define _EXTENDABLE_EMU_MMU2S 13 + #define _EXTENDABLE_EMU_MMU3 14 + #define _MMU CAT(_,MMU_MODEL) + + #if _MMU == _PRUSA_MMU1 + #define HAS_PRUSA_MMU1 1 + #elif _MMU % 10 == _PRUSA_MMU2 + #define HAS_PRUSA_MMU2 1 + #elif _MMU % 10 == _PRUSA_MMU2S + #define HAS_PRUSA_MMU2 1 + #define HAS_PRUSA_MMU2S 1 + #elif _MMU % 10 == _PRUSA_MMU3 + #define HAS_PRUSA_MMU3 1 + #endif + #if _MMU == _EXTENDABLE_EMU_MMU2 || _MMU == _EXTENDABLE_EMU_MMU2S + #define HAS_EXTENDABLE_MMU 1 + #endif + + #undef _MMU + #undef _PRUSA_MMU1 + #undef _PRUSA_MMU2 + #undef _PRUSA_MMU2S + #undef _PRUSA_MMU3 + #undef _EXTENDABLE_EMU_MMU2 + #undef _EXTENDABLE_EMU_MMU2S + #undef _EXTENDABLE_EMU_MMU3 +#endif + +#if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0 + + #define E_STEPPERS 2 + #define E_MANUAL 1 + +#elif HAS_SWITCHING_EXTRUDER // One stepper for every two EXTRUDERS + + #if EXTRUDERS > 4 + #define E_STEPPERS 3 + #elif EXTRUDERS > 2 + #define E_STEPPERS 2 + #else + #define E_STEPPERS 1 + #endif + +#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally + + #define E_STEPPERS MIXING_STEPPERS + #define E_MANUAL 1 + #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 + + #define E_STEPPERS EXTRUDERS + #define E_MANUAL EXTRUDERS + +#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3 // Průša Multi-Material Unit v2/v3 + + #define E_STEPPERS 1 + #define E_MANUAL 1 + +#endif + +// Default E steppers / manual motion is one per extruder +#ifndef E_STEPPERS + #define E_STEPPERS EXTRUDERS +#endif +#ifndef E_MANUAL + #define E_MANUAL EXTRUDERS +#endif + +// Number of hotends... +#if ANY(SINGLENOZZLE, MIXING_EXTRUDER) // Only one for singlenozzle or mixing extruder + #define HOTENDS 1 +#elif HAS_SWITCHING_EXTRUDER && !HAS_SWITCHING_NOZZLE // One for each pair of abstract "extruders" + #define HOTENDS E_STEPPERS +#elif TEMP_SENSOR_0 + #define HOTENDS EXTRUDERS // One per extruder if at least one heater exists +#else + #define HOTENDS 0 // A machine with no hotends at all can still extrude +#endif + +// At least one hotend... +#if HOTENDS + #define HAS_HOTEND 1 + #ifndef HOTEND_OVERSHOOT + #define HOTEND_OVERSHOOT 15 + #endif +#else + #undef MPCTEMP + #undef PIDTEMP + #undef PREVENT_COLD_EXTRUSION + #undef THERMAL_PROTECTION_HOTENDS +#endif + +// More than one hotend... +#if HOTENDS > 1 + #define HAS_MULTI_HOTEND 1 + #define HAS_HOTEND_OFFSET 1 + #ifndef HOTEND_OFFSET_X + #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder + #endif + #ifndef HOTEND_OFFSET_Y + #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder + #endif + #ifndef HOTEND_OFFSET_Z + #define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder + #endif +#else + #undef HOTEND_OFFSET_X + #undef HOTEND_OFFSET_Y + #undef HOTEND_OFFSET_Z +#endif diff --git a/Marlin/src/inc/Conditionals_etc.h b/Marlin/src/inc/Conditionals_etc.h new file mode 100644 index 000000000000..90002af3c8b3 --- /dev/null +++ b/Marlin/src/inc/Conditionals_etc.h @@ -0,0 +1,664 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#pragma once + +/** + * Conditionals_etc.h + * Conditionals that need to be set before Configuration_adv.h or pins.h + */ + +#ifndef STRING_CONFIG_H_AUTHOR + #define STRING_CONFIG_H_AUTHOR "(anonymous)" +#endif + +// +// Remove irrelevant Configuration.h settings +// + +// Clean up unused temperature sensors and sub-options + +#if !TEMP_SENSOR_0 + #undef TEMP_SENSOR_0 +#endif +#if !TEMP_SENSOR_1 + #undef TEMP_SENSOR_1 +#endif +#if !TEMP_SENSOR_2 + #undef TEMP_SENSOR_2 +#endif +#if !TEMP_SENSOR_3 + #undef TEMP_SENSOR_3 +#endif +#if !TEMP_SENSOR_4 + #undef TEMP_SENSOR_4 +#endif +#if !TEMP_SENSOR_5 + #undef TEMP_SENSOR_5 +#endif +#if !TEMP_SENSOR_6 + #undef TEMP_SENSOR_6 +#endif +#if !TEMP_SENSOR_7 + #undef TEMP_SENSOR_7 +#endif + +#if !TEMP_SENSOR_BED + #undef TEMP_SENSOR_BED + #undef THERMAL_PROTECTION_BED + #undef MAX_BED_POWER +#endif +#if !TEMP_SENSOR_CHAMBER + #undef TEMP_SENSOR_CHAMBER + #undef THERMAL_PROTECTION_CHAMBER + #undef CHAMBER_AUTO_FAN_PIN + #undef MAX_CHAMBER_POWER +#endif +#if !TEMP_SENSOR_COOLER + #undef TEMP_SENSOR_COOLER + #undef THERMAL_PROTECTION_COOLER + #undef COOLER_AUTO_FAN_PIN +#endif +#if !TEMP_SENSOR_PROBE + #undef TEMP_SENSOR_PROBE +#endif +#if !TEMP_SENSOR_REDUNDANT + #undef TEMP_SENSOR_REDUNDANT +#endif +#if !TEMP_SENSOR_BOARD + #undef TEMP_SENSOR_BOARD +#endif +#if !TEMP_SENSOR_SOC + #undef TEMP_SENSOR_SOC +#endif +#if !SOFT_PWM_SCALE + #undef SOFT_PWM_SCALE +#endif + +/** + * Disable unused SINGLENOZZLE sub-options + */ +#if DISABLED(SINGLENOZZLE) + #undef SINGLENOZZLE_STANDBY_TEMP +#endif +#if !ALL(HAS_FAN, SINGLENOZZLE) + #undef SINGLENOZZLE_STANDBY_FAN +#endif + +// No inactive extruders with SWITCHING_NOZZLE or Průša MMU1 or just 1 E stepper exists +#if HAS_SWITCHING_NOZZLE || HAS_PRUSA_MMU1 || E_STEPPERS < 2 + #undef DISABLE_OTHER_EXTRUDERS +#endif + +// Switching extruder has its own servo? +#if ENABLED(SWITCHING_EXTRUDER) && (!HAS_SWITCHING_NOZZLE || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR) + #define DO_SWITCH_EXTRUDER 1 +#endif + +/** + * The BLTouch Probe emulates a servo probe + * and uses "special" angles for its state. + */ +#if ENABLED(BLTOUCH) && !defined(Z_PROBE_SERVO_NR) + #define Z_PROBE_SERVO_NR 0 +#endif + +/** + * Set a flag for a servo probe (or BLTouch) + */ +#ifdef Z_PROBE_SERVO_NR + #define HAS_Z_SERVO_PROBE 1 +#endif +#if ANY(HAS_Z_SERVO_PROBE, SWITCHING_EXTRUDER, SWITCHING_NOZZLE) + #define HAS_SERVO_ANGLES 1 +#endif +#if !HAS_SERVO_ANGLES + #undef EDITABLE_SERVO_ANGLES +#endif + +/** + * Set flags for any form of bed probe + */ +#if ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, HAS_Z_SERVO_PROBE, SOLENOID_PROBE, Z_PROBE_SLED, RACK_AND_PINION_PROBE, SENSORLESS_PROBING, MAGLEV4, MAG_MOUNTED_PROBE, BIQU_MICROPROBE_V1, BIQU_MICROPROBE_V2) + #define HAS_STOWABLE_PROBE 1 +#endif +#if ANY(HAS_STOWABLE_PROBE, FIX_MOUNTED_PROBE, BD_SENSOR, NOZZLE_AS_PROBE) + #define HAS_BED_PROBE 1 +#endif + +// Probing tool change +#if !HAS_MULTI_EXTRUDER + #undef PROBING_TOOL +#endif +#if HAS_BED_PROBE && defined(PROBING_TOOL) + #define DO_TOOLCHANGE_FOR_PROBING 1 +#endif + +/** + * Fill in undefined Filament Sensor options + */ +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if NUM_RUNOUT_SENSORS >= 1 + #ifndef FIL_RUNOUT1_STATE + #define FIL_RUNOUT1_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT1_PULLUP + #define FIL_RUNOUT1_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT1_PULLDOWN + #define FIL_RUNOUT1_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 2 + #ifndef FIL_RUNOUT2_STATE + #define FIL_RUNOUT2_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT2_PULLUP + #define FIL_RUNOUT2_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT2_PULLDOWN + #define FIL_RUNOUT2_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 3 + #ifndef FIL_RUNOUT3_STATE + #define FIL_RUNOUT3_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT3_PULLUP + #define FIL_RUNOUT3_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT3_PULLDOWN + #define FIL_RUNOUT3_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 4 + #ifndef FIL_RUNOUT4_STATE + #define FIL_RUNOUT4_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT4_PULLUP + #define FIL_RUNOUT4_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT4_PULLDOWN + #define FIL_RUNOUT4_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 5 + #ifndef FIL_RUNOUT5_STATE + #define FIL_RUNOUT5_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT5_PULLUP + #define FIL_RUNOUT5_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT5_PULLDOWN + #define FIL_RUNOUT5_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 6 + #ifndef FIL_RUNOUT6_STATE + #define FIL_RUNOUT6_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT6_PULLUP + #define FIL_RUNOUT6_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT6_PULLDOWN + #define FIL_RUNOUT6_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 7 + #ifndef FIL_RUNOUT7_STATE + #define FIL_RUNOUT7_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT7_PULLUP + #define FIL_RUNOUT7_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT7_PULLDOWN + #define FIL_RUNOUT7_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_RUNOUT_SENSORS >= 8 + #ifndef FIL_RUNOUT8_STATE + #define FIL_RUNOUT8_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_RUNOUT8_PULLUP + #define FIL_RUNOUT8_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_RUNOUT8_PULLDOWN + #define FIL_RUNOUT8_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif +#endif // FILAMENT_RUNOUT_SENSOR + +#if ENABLED(FILAMENT_SWITCH_AND_MOTION) + #if NUM_MOTION_SENSORS >= 1 + #ifndef FIL_MOTION1_STATE + #define FIL_MOTION1_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION1_PULLUP + #define FIL_MOTION1_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION1_PULLDOWN + #define FIL_MOTION1_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_MOTION_SENSORS >= 2 + #ifndef FIL_MOTION2_STATE + #define FIL_MOTION2_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION2_PULLUP + #define FIL_MOTION2_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION2_PULLDOWN + #define FIL_MOTION2_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_MOTION_SENSORS >= 3 + #ifndef FIL_MOTION3_STATE + #define FIL_MOTION3_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION3_PULLUP + #define FIL_MOTION3_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION3_PULLDOWN + #define FIL_MOTION3_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_MOTION_SENSORS >= 4 + #ifndef FIL_MOTION4_STATE + #define FIL_MOTION4_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION4_PULLUP + #define FIL_MOTION4_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION4_PULLDOWN + #define FIL_MOTION4_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_MOTION_SENSORS >= 5 + #ifndef FIL_MOTION5_STATE + #define FIL_MOTION5_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION5_PULLUP + #define FIL_MOTION5_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION5_PULLDOWN + #define FIL_MOTION5_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_MOTION_SENSORS >= 6 + #ifndef FIL_MOTION6_STATE + #define FIL_MOTION6_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION6_PULLUP + #define FIL_MOTION6_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION6_PULLDOWN + #define FIL_MOTION6_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_MOTION_SENSORS >= 7 + #ifndef FIL_MOTION7_STATE + #define FIL_MOTION7_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION7_PULLUP + #define FIL_MOTION7_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION7_PULLDOWN + #define FIL_MOTION7_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif + #if NUM_MOTION_SENSORS >= 8 + #ifndef FIL_MOTION8_STATE + #define FIL_MOTION8_STATE FIL_RUNOUT_STATE + #endif + #ifndef FIL_MOTION8_PULLUP + #define FIL_MOTION8_PULLUP FIL_RUNOUT_PULLUP + #endif + #ifndef FIL_MOTION8_PULLDOWN + #define FILMOTION8_PULLDOWN FIL_RUNOUT_PULLDOWN + #endif + #endif +#endif // FILAMENT_SWITCH_AND_MOTION + +// Homing to Min or Max +#if HAS_X_AXIS + #if X_HOME_DIR > 0 + #define X_HOME_TO_MAX 1 + #elif X_HOME_DIR < 0 + #define X_HOME_TO_MIN 1 + #endif +#endif +#if HAS_Y_AXIS + #if Y_HOME_DIR > 0 + #define Y_HOME_TO_MAX 1 + #elif Y_HOME_DIR < 0 + #define Y_HOME_TO_MIN 1 + #endif +#endif +#if HAS_Z_AXIS + #if Z_HOME_DIR > 0 + #define Z_HOME_TO_MAX 1 + #elif Z_HOME_DIR < 0 + #define Z_HOME_TO_MIN 1 + #endif +#endif +#if HAS_I_AXIS + #if I_HOME_DIR > 0 + #define I_HOME_TO_MAX 1 + #elif I_HOME_DIR < 0 + #define I_HOME_TO_MIN 1 + #endif +#endif +#if HAS_J_AXIS + #if J_HOME_DIR > 0 + #define J_HOME_TO_MAX 1 + #elif J_HOME_DIR < 0 + #define J_HOME_TO_MIN 1 + #endif +#endif +#if HAS_K_AXIS + #if K_HOME_DIR > 0 + #define K_HOME_TO_MAX 1 + #elif K_HOME_DIR < 0 + #define K_HOME_TO_MIN 1 + #endif +#endif +#if HAS_U_AXIS + #if U_HOME_DIR > 0 + #define U_HOME_TO_MAX 1 + #elif U_HOME_DIR < 0 + #define U_HOME_TO_MIN 1 + #endif +#endif +#if HAS_V_AXIS + #if V_HOME_DIR > 0 + #define V_HOME_TO_MAX 1 + #elif V_HOME_DIR < 0 + #define V_HOME_TO_MIN 1 + #endif +#endif +#if HAS_W_AXIS + #if W_HOME_DIR > 0 + #define W_HOME_TO_MAX 1 + #elif W_HOME_DIR < 0 + #define W_HOME_TO_MIN 1 + #endif +#endif + +/** + * Conditionals based on the type of Bed Probe + */ +#if HAS_BED_PROBE + #if ALL(DELTA, SENSORLESS_PROBING) + #define HAS_DELTA_SENSORLESS_PROBING 1 + #else + #define HAS_REAL_BED_PROBE 1 + #endif + #if HAS_REAL_BED_PROBE && NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, Z_SPI_SENSORLESS) + #define NEED_Z_MIN_PROBE_PIN 1 + #endif + #if Z_HOME_TO_MIN && (!NEED_Z_MIN_PROBE_PIN || ENABLED(USE_PROBE_FOR_Z_HOMING)) + #define HOMING_Z_WITH_PROBE 1 + #endif + #if DISABLED(NOZZLE_AS_PROBE) + #define HAS_PROBE_XY_OFFSET 1 + #endif + #if ANY(Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE) + #define PROBE_TRIGGERED_WHEN_STOWED_TEST 1 // Extra test for Allen Key Probe + #endif + #ifndef Z_PROBE_ERROR_TOLERANCE + #define Z_PROBE_ERROR_TOLERANCE Z_CLEARANCE_MULTI_PROBE + #endif + #if MULTIPLE_PROBING > 1 + #if EXTRA_PROBING > 0 + #define TOTAL_PROBING (MULTIPLE_PROBING + EXTRA_PROBING) + #else + #define TOTAL_PROBING MULTIPLE_PROBING + #endif + #endif +#else + // Clear probe pin settings when no probe is selected + #undef Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN + #undef USE_PROBE_FOR_Z_HOMING + #undef Z_MIN_PROBE_REPEATABILITY_TEST + #undef HOMING_Z_WITH_PROBE + #undef Z_CLEARANCE_MULTI_PROBE + #undef Z_PROBE_ERROR_TOLERANCE + #undef Z_AFTER_PROBING + #undef Z_PROBE_LOW_POINT + #undef MULTIPLE_PROBING + #undef EXTRA_PROBING + #undef PROBE_OFFSET_ZMIN + #undef PROBE_OFFSET_ZMAX + #undef PAUSE_BEFORE_DEPLOY_STOW + #undef PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED + #undef PROBING_HEATERS_OFF + #undef WAIT_FOR_BED_HEATER + #undef WAIT_FOR_HOTEND + #undef PROBING_FANS_OFF + #undef PROBING_ESTEPPERS_OFF + #undef PROBING_STEPPERS_OFF + #undef DELAY_BEFORE_PROBING + #undef PREHEAT_BEFORE_PROBING + #undef PROBING_NOZZLE_TEMP + #undef PROBING_BED_TEMP + #undef NOZZLE_TO_PROBE_OFFSET +#endif + +#if ENABLED(BELTPRINTER) && !defined(HOME_Y_BEFORE_X) + #define HOME_Y_BEFORE_X +#endif + +#if Z_HOME_TO_MAX && DISABLED(Z_SAFE_HOMING) + #define HOME_Z_FIRST // If homing away from BED do Z first +#endif + +/** + * Conditionals based on the type of Bed Leveling + */ +#if ENABLED(AUTO_BED_LEVELING_UBL) + #undef LCD_BED_LEVELING + #if ANY(DELTA, SEGMENT_LEVELED_MOVES) + #define UBL_SEGMENTED 1 + #endif +#endif +#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_3POINT) + #define ABL_PLANAR 1 +#endif +#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) + #define ABL_USES_GRID 1 +#endif +#if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_3POINT) + #define HAS_ABL_NOT_UBL 1 +#endif +#if ANY(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING) + #define HAS_MESH 1 +#endif +#if ANY(AUTO_BED_LEVELING_UBL, AUTO_BED_LEVELING_3POINT) + #define NEEDS_THREE_PROBE_POINTS 1 +#endif +#if ANY(HAS_ABL_NOT_UBL, AUTO_BED_LEVELING_UBL) + #define HAS_ABL_OR_UBL 1 + #if DISABLED(PROBE_MANUALLY) + #define HAS_AUTOLEVEL 1 + #endif +#endif +#if ANY(HAS_ABL_OR_UBL, MESH_BED_LEVELING) + #define HAS_LEVELING 1 + #if DISABLED(AUTO_BED_LEVELING_UBL) + #define PLANNER_LEVELING 1 + #endif +#endif +#if !HAS_LEVELING + #undef RESTORE_LEVELING_AFTER_G28 + #undef ENABLE_LEVELING_AFTER_G28 + #undef G29_RETRY_AND_RECOVER +#endif +#if !HAS_LEVELING || ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL) + #undef PROBE_MANUALLY +#endif +#if ANY(HAS_BED_PROBE, PROBE_MANUALLY, MESH_BED_LEVELING) + #define PROBE_SELECTED 1 +#endif + +#if !HAS_MESH + #undef MESH_INSET +#endif + +#if NONE(PROBE_SELECTED, AUTO_BED_LEVELING_UBL) + #undef Z_CLEARANCE_BETWEEN_PROBES +#endif + +#if NONE(PROBE_SELECTED, DELTA_AUTO_CALIBRATION, DELTA_CALIBRATION_MENU) + #undef PROBING_MARGIN + #undef PROBING_MARGIN_LEFT + #undef PROBING_MARGIN_RIGHT + #undef PROBING_MARGIN_FRONT + #undef PROBING_MARGIN_BACK + #undef XY_PROBE_FEEDRATE +#endif + +#if !(ANY(HAS_BED_PROBE, HAS_LEVELING) || ALL(AUTO_BED_LEVELING_UBL, HAS_MARLINUI_MENU)) + #undef Z_CLEARANCE_DEPLOY_PROBE +#endif + +#if !(ANY(HAS_BED_PROBE, BACKLASH_GCODE) || (ENABLED(EXTENSIBLE_UI) && ANY(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL))) + #undef Z_PROBE_FEEDRATE_FAST + #undef Z_PROBE_FEEDRATE_SLOW +#endif + +/** + * Z_CLEARANCE_FOR_HOMING + */ +#ifndef Z_CLEARANCE_FOR_HOMING + #ifdef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_FOR_HOMING Z_CLEARANCE_BETWEEN_PROBES + #else + #define Z_CLEARANCE_FOR_HOMING 5 + #endif +#endif + +/** + * Z_CLEARANCE_BETWEEN_PROBES + */ +#if PROBE_SELECTED || (HAS_MARLINUI_MENU && ANY(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)) + #ifndef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_BETWEEN_PROBES Z_CLEARANCE_FOR_HOMING + #endif +#endif + +/** + * Z_CLEARANCE_BETWEEN_MANUAL_PROBES / Z_CLEARANCE_MULTI_PROBE + */ +#if PROBE_SELECTED + #if ANY(MESH_BED_LEVELING, PROBE_MANUALLY) + #if Z_CLEARANCE_BETWEEN_PROBES > Z_CLEARANCE_FOR_HOMING + #define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_BETWEEN_PROBES + #else + #define Z_CLEARANCE_BETWEEN_MANUAL_PROBES Z_CLEARANCE_FOR_HOMING + #endif + #endif + #ifndef Z_CLEARANCE_MULTI_PROBE + #ifdef Z_CLEARANCE_BETWEEN_PROBES + #define Z_CLEARANCE_MULTI_PROBE Z_CLEARANCE_BETWEEN_PROBES + #else + #define Z_CLEARANCE_MULTI_PROBE 5 + #endif + #endif +#endif +#if TOTAL_PROBING < 2 + #undef Z_CLEARANCE_MULTI_PROBE +#endif + +#if DISABLED(ENABLE_LEVELING_FADE_HEIGHT) + #undef DEFAULT_LEVELING_FADE_HEIGHT +#endif + +#ifdef GRID_MAX_POINTS_X + #define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y)) + #define GRID_LOOP(A,B) for (uint8_t A = 0; A < GRID_MAX_POINTS_X; ++A) for (uint8_t B = 0; B < GRID_MAX_POINTS_Y; ++B) +#endif + +/** + * CoreXY, CoreXZ, and CoreYZ - and their reverse + */ +#if ANY(COREXY, COREYX) + #define CORE_IS_XY 1 +#endif +#if ANY(COREXZ, COREZX) + #define CORE_IS_XZ 1 +#endif +#if ANY(COREYZ, COREZY) + #define CORE_IS_YZ 1 +#endif +#if CORE_IS_XY || CORE_IS_XZ || CORE_IS_YZ + #define IS_CORE 1 + #if CORE_IS_XY + #define CORE_AXIS_1 A_AXIS + #define CORE_AXIS_2 B_AXIS + #define NORMAL_AXIS Z_AXIS + #elif CORE_IS_XZ + #define CORE_AXIS_1 A_AXIS + #define NORMAL_AXIS Y_AXIS + #define CORE_AXIS_2 C_AXIS + #elif CORE_IS_YZ + #define NORMAL_AXIS X_AXIS + #define CORE_AXIS_1 B_AXIS + #define CORE_AXIS_2 C_AXIS + #endif + #define CORESIGN(n) (ANY(COREYX, COREZX, COREZY) ? (-(n)) : (n)) +#elif ANY(MARKFORGED_XY, MARKFORGED_YX) + // Markforged kinematics + #define CORE_AXIS_1 A_AXIS + #define CORE_AXIS_2 B_AXIS + #define NORMAL_AXIS Z_AXIS +#endif + +#if ANY(MORGAN_SCARA, MP_SCARA, AXEL_TPARA) + #define IS_SCARA 1 + #define IS_KINEMATIC 1 +#elif ANY(DELTA, POLARGRAPH, POLAR) + #define IS_KINEMATIC 1 +#else + #define IS_CARTESIAN 1 + #if !IS_CORE + #define IS_FULL_CARTESIAN 1 + #endif +#endif + +#if DISABLED(DELTA) + #undef DELTA_HOME_TO_SAFE_ZONE +#endif + +/** + * This setting is also used by M109 when trying to calculate + * a ballpark safe margin to prevent wait-forever situation. + */ +#ifndef EXTRUDE_MINTEMP + #define EXTRUDE_MINTEMP 170 +#endif + +#if ANY(PID_DEBUG, PID_BED_DEBUG, PID_CHAMBER_DEBUG) + #define HAS_PID_DEBUG 1 +#endif + +#if ALL(SPI_FLASH, HAS_MEDIA, MARLIN_DEV_MODE) + #define SPI_FLASH_BACKUP 1 +#endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 1028814c3167..5724b3bc8b08 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2643,10 +2643,6 @@ #endif // Thermal protection -#if !HAS_HEATED_BED - #undef THERMAL_PROTECTION_BED - #undef THERMAL_PROTECTION_BED_PERIOD -#endif #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 #define WATCH_HOTENDS 1 #endif @@ -3194,8 +3190,13 @@ /** * Heater, Fan, and Probe interactions */ -#if !HAS_FAN +#if !ALL(HAS_HOTEND, HAS_FAN) #undef ADAPTIVE_FAN_SLOWING +#endif +#if DISABLED(ADAPTIVE_FAN_SLOWING) + #undef REPORT_ADAPTIVE_FAN_SLOWING +#endif +#if DISABLED(ADAPTIVE_FAN_SLOWING) || NONE(MPCTEMP, PIDTEMP) #undef TEMP_TUNING_MAINTAIN_FAN #endif #if !ALL(HAS_BED_PROBE, HAS_FAN) diff --git a/Marlin/src/inc/MarlinConfigPre.h b/Marlin/src/inc/MarlinConfigPre.h index 5ea7a49944a2..5ded14f703c1 100644 --- a/Marlin/src/inc/MarlinConfigPre.h +++ b/Marlin/src/inc/MarlinConfigPre.h @@ -55,7 +55,9 @@ #include "Version.h" +#include "Conditionals_axes.h" #include "Conditionals_LCD.h" +#include "Conditionals_etc.h" #ifndef __MARLIN_DEPS__ #include HAL_PATH(.., inc/Conditionals_LCD.h) From dabe3749837230ccb247d571c26a1d8b441fab53 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 30 Aug 2024 00:25:03 +0000 Subject: [PATCH 15/18] [cron] Bump distribution date (2024-08-30) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index cb46ecf89795..36e21880dd0f 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-08-29" +//#define STRING_DISTRIBUTION_DATE "2024-08-30" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index cd40c83ba2d8..9334b350d9ab 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-08-29" + #define STRING_DISTRIBUTION_DATE "2024-08-30" #endif /** From 528a1ad3e04f1189651e4de764affbc48c403fe7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Aug 2024 15:36:00 -0500 Subject: [PATCH 16/18] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Move?= =?UTF-8?q?=20Uncrustify=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/uncrust | 2 +- buildroot/share/{extras => uncrustify}/file_header.h | 0 buildroot/share/{extras => uncrustify}/func_header.h | 0 buildroot/share/{extras => uncrustify}/uncrustify.cfg | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename buildroot/share/{extras => uncrustify}/file_header.h (100%) rename buildroot/share/{extras => uncrustify}/func_header.h (100%) rename buildroot/share/{extras => uncrustify}/uncrustify.cfg (100%) diff --git a/buildroot/bin/uncrust b/buildroot/bin/uncrust index 7c894174b8b5..db4c3fb03f60 100755 --- a/buildroot/bin/uncrust +++ b/buildroot/bin/uncrust @@ -7,7 +7,7 @@ TMPDIR=`mktemp -d` HERE=`dirname "$0"` # Reformat a single file to tmp/ -if uncrustify -l CPP -c "$HERE/../share/extras/uncrustify.cfg" -f "$1" >$TMPDIR/uncrustify.out ; then +if uncrustify -l CPP -c "$HERE/../share/uncrustify/uncrustify.cfg" -f "$1" >$TMPDIR/uncrustify.out ; then cp "$TMPDIR/uncrustify.out" "$1" ; # Replace the original file else echo "Something went wrong with uncrustify." diff --git a/buildroot/share/extras/file_header.h b/buildroot/share/uncrustify/file_header.h similarity index 100% rename from buildroot/share/extras/file_header.h rename to buildroot/share/uncrustify/file_header.h diff --git a/buildroot/share/extras/func_header.h b/buildroot/share/uncrustify/func_header.h similarity index 100% rename from buildroot/share/extras/func_header.h rename to buildroot/share/uncrustify/func_header.h diff --git a/buildroot/share/extras/uncrustify.cfg b/buildroot/share/uncrustify/uncrustify.cfg similarity index 100% rename from buildroot/share/extras/uncrustify.cfg rename to buildroot/share/uncrustify/uncrustify.cfg From 21fddc1cc8efec2f74984097fc0e541b4b65b553 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Aug 2024 15:36:55 -0500 Subject: [PATCH 17/18] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Updat?= =?UTF-8?q?e=20image2bin=20with=20"transparency"=20color?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/scripts/gen-tft-image.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/buildroot/share/scripts/gen-tft-image.py b/buildroot/share/scripts/gen-tft-image.py index d00f980fb016..95471a991286 100644 --- a/buildroot/share/scripts/gen-tft-image.py +++ b/buildroot/share/scripts/gen-tft-image.py @@ -26,30 +26,31 @@ from PIL import Image def image2bin(image, output_file): + print(f"Converting image with dimensions {image.size[0]}x{image.size[1]}...") if output_file.endswith(('.c', '.cpp')): - f = open(output_file, 'wt') is_cpp = True + f = open(output_file, 'wt') f.write("const uint16_t image[%d] = {\n" % (image.size[1] * image.size[0])) else: - f = open(output_file, 'wb') is_cpp = False + f = open(output_file, 'wb') pixs = image.load() for y in range(image.size[1]): + f.write(" ") for x in range(image.size[0]): R = pixs[x, y][0] >> 3 G = pixs[x, y][1] >> 2 B = pixs[x, y][2] >> 3 rgb = (R << 11) | (G << 5) | B + if rgb == 0: rgb = 1 if is_cpp: - strHex = '0x{0:04X}, '.format(rgb) + strHex = " 0x{0:04X},".format(rgb) f.write(strHex) else: f.write(struct.pack("B", (rgb & 0xFF))) f.write(struct.pack("B", (rgb >> 8) & 0xFF)) - if is_cpp: - f.write("\n") - if is_cpp: - f.write("};\n") + if is_cpp: f.write("\n") + if is_cpp: f.write("};\n") f.close() if len(sys.argv) <= 2: From 68a2459808afb1bf21d3cb820607e7eeb0f8a840 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 29 Aug 2024 15:41:08 -0500 Subject: [PATCH 18/18] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20/=20improve=20Marlin?= =?UTF-8?q?=20UI=20and=20Color=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/menu/menu_info.cpp | 2 +- Marlin/src/lcd/menu/menu_item.h | 2 +- Marlin/src/lcd/menu/menu_media.cpp | 2 +- Marlin/src/lcd/menu/menu_motion.cpp | 1 + Marlin/src/lcd/tft/tft_image.cpp | 68 +++++++++--------- Marlin/src/lcd/tft/tft_image.h | 68 +++++++++--------- Marlin/src/lcd/tft/themes/theme_ANET_BLACK.h | 2 + Marlin/src/lcd/tft/themes/theme_BLUE_MARLIN.h | 6 ++ Marlin/src/lcd/tft/themes/theme_default.h | 6 ++ Marlin/src/lcd/tft/ui_1024x600.h | 12 +++- Marlin/src/lcd/tft/ui_320x480.h | 2 +- Marlin/src/lcd/tft/ui_480x272.h | 2 +- Marlin/src/lcd/tft/ui_480x320.h | 2 +- Marlin/src/lcd/tft/ui_common.cpp | 70 ++++++++++++++----- Marlin/src/lcd/tft/ui_common.h | 2 +- 15 files changed, 151 insertions(+), 96 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 4aa45e43f7e0..2db0caa80527 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -213,7 +213,7 @@ void menu_info_board() { START_SCREEN(); STATIC_ITEM_F(F(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT); // MyPrinterController #ifdef BOARD_WEBSITE_URL - STATIC_ITEM_F(F(BOARD_WEBSITE_URL), SS_LEFT); // www.my3dprinter.com + STATIC_ITEM_F(F(BOARD_WEBSITE_URL), SS_CENTER); // www.my3dprinter.com #endif PSTRING_ITEM(MSG_INFO_BAUDRATE, STRINGIFY(BAUDRATE), SS_CENTER); // Baud: 250000 PSTRING_ITEM(MSG_INFO_PROTOCOL, PROTOCOL_VERSION, SS_CENTER); // Protocol: 1.0 diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index bf7e20369515..0a5a5fb44384 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -265,7 +265,7 @@ class MenuItem_bool : public MenuEditItemBase { * MenuItem_::action(arg3...) * * Examples: - * BACK_ITEM(MSG_INFO_SCREEN) + * BACK_ITEM(MSG_PREV_SCREEN) * MenuItem_back::action(flabel, ...) * MenuItem_back::draw(sel, row, flabel, ...) * diff --git a/Marlin/src/lcd/menu/menu_media.cpp b/Marlin/src/lcd/menu/menu_media.cpp index 42ff2b1f2634..f28c0900f089 100644 --- a/Marlin/src/lcd/menu/menu_media.cpp +++ b/Marlin/src/lcd/menu/menu_media.cpp @@ -94,7 +94,7 @@ class MenuItem_sdfolder : public MenuItem_sdbase { static void action(FSTR_P const, CardReader &theCard) { card.cd(theCard.filename); encoderTopLine = 0; - ui.encoderPosition = 2 * (ENCODER_STEPS_PER_MENU_ITEM); + ui.encoderPosition = (card.get_num_items() ? 2 : 1) * (ENCODER_STEPS_PER_MENU_ITEM); ui.screen_changed = true; TERN_(HAS_MARLINUI_U8GLIB, ui.drawing_screen = false); ui.refresh(); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 926d64ccca1a..93c35dea1329 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -501,6 +501,7 @@ void menu_move() { #endif START_MENU(); + BACK_ITEM(MSG_TUNE); #if HAS_X_AXIS SUBMENU_N(X_AXIS, MSG_FTM_CMPN_MODE, menu_ftm_shaper_x); diff --git a/Marlin/src/lcd/tft/tft_image.cpp b/Marlin/src/lcd/tft/tft_image.cpp index 1a5851948d1e..1d287f4ba6b7 100644 --- a/Marlin/src/lcd/tft/tft_image.cpp +++ b/Marlin/src/lcd/tft/tft_image.cpp @@ -30,40 +30,40 @@ const tImage NoLogo = { nullptr, 0, 0, NOCOLORS }; const tImage images[imgCount] = { - TERN(SHOW_BOOTSCREEN, BOOTSCREEN_LOGO, NoLogo), - HotEnd_64x64x4, - Bed_64x64x4, - Bed_Heated_64x64x4, - Chamber_64x64x4, - Chamber_Heated_64x64x4, - Fan0_64x64x4, - Fan_Slow0_64x64x4, - Fan_Slow1_64x64x4, - Fan_Fast0_64x64x4, - Fan_Fast1_64x64x4, - Feedrate_32x32x4, - Flowrate_32x32x4, - SD_64x64x4, - Menu_64x64x4, - Settings_64x64x4, - Directory_32x32x4, - Confirm_64x64x4, - Cancel_64x64x4, - Increase_64x64x4, - Decrease_64x64x4, - Back_32x32x4, - Up_32x32x4, - Down_32x32x4, - Left_32x32x4, - Right_32x32x4, - Refresh_32x32x4, - Leveling_32x32x4, - Slider8x16x4, - Home_64x64x4, - BtnRounded_64x52x4, - BtnRounded_42x39x4, - Time_Elapsed_32x32x4, - Time_Remaining_32x32x4, + TERN(SHOW_BOOTSCREEN, BOOTSCREEN_LOGO, NoLogo), // imgBootScreen + HotEnd_64x64x4, // imgHotEnd + Bed_64x64x4, // imgBed + Bed_Heated_64x64x4, // imgBedHeated + Chamber_64x64x4, // imgChamber + Chamber_Heated_64x64x4, // imgChamberHeated + Fan0_64x64x4, // imgFanIdle + Fan_Slow0_64x64x4, // imgFanSlow0 + Fan_Slow1_64x64x4, // imgFanSlow1 + Fan_Fast0_64x64x4, // imgFanFast0 + Fan_Fast1_64x64x4, // imgFanFast1 + Feedrate_32x32x4, // imgFeedRate + Flowrate_32x32x4, // imgFlowRate + SD_64x64x4, // imgSD + Menu_64x64x4, // imgMenu + Settings_64x64x4, // imgSettings + Directory_32x32x4, // imgDirectory + Confirm_64x64x4, // imgConfirm + Cancel_64x64x4, // imgCancel + Increase_64x64x4, // imgIncrease + Decrease_64x64x4, // imgDecrease + Back_32x32x4, // imgBack + Up_32x32x4, // imgUp + Down_32x32x4, // imgDown + Left_32x32x4, // imgLeft + Right_32x32x4, // imgRight + Refresh_32x32x4, // imgRefresh + Leveling_32x32x4, // imgLeveling + Slider8x16x4, // imgSlider + Home_64x64x4, // imgHome + BtnRounded_64x52x4, // imgBtn52Rounded + BtnRounded_42x39x4, // imgBtn39Rounded + Time_Elapsed_32x32x4, // imgTimeElapsed + Time_Remaining_32x32x4, // imgTimeRemaining }; #endif // HAS_GRAPHICAL_TFT diff --git a/Marlin/src/lcd/tft/tft_image.h b/Marlin/src/lcd/tft/tft_image.h index 06887ff8a69e..3bd9265fcb9c 100644 --- a/Marlin/src/lcd/tft/tft_image.h +++ b/Marlin/src/lcd/tft/tft_image.h @@ -30,40 +30,40 @@ #endif enum MarlinImage : uint8_t { - imgBootScreen = 0x00, - imgHotEnd, - imgBed, - imgBedHeated, - imgChamber, - imgChamberHeated, - imgFanIdle, - imgFanSlow0, - imgFanSlow1, - imgFanFast0, - imgFanFast1, - imgFeedRate, - imgFlowRate, - imgSD, - imgMenu, - imgSettings, - imgDirectory, - imgConfirm, - imgCancel, - imgIncrease, - imgDecrease, - imgBack, - imgUp, - imgDown, - imgLeft, - imgRight, - imgRefresh, - imgLeveling, - imgSlider, - imgHome, - imgBtn52Rounded, - imgBtn39Rounded, - imgTimeElapsed, - imgTimeRemaining, + imgBootScreen = 0x00, // BOOTSCREEN_LOGO / NoLogo + imgHotEnd, // HotEnd_64x64x4 + imgBed, // Bed_64x64x4 + imgBedHeated, // Bed_Heated_64x64x4 + imgChamber, // Chamber_64x64x4 + imgChamberHeated, // Chamber_Heated_64x64x4 + imgFanIdle, // Fan0_64x64x4 + imgFanSlow0, // Fan_Slow0_64x64x4 + imgFanSlow1, // Fan_Slow1_64x64x4 + imgFanFast0, // Fan_Fast0_64x64x4 + imgFanFast1, // Fan_Fast1_64x64x4 + imgFeedRate, // Feedrate_32x32x4 + imgFlowRate, // Flowrate_32x32x4 + imgSD, // SD_64x64x4 + imgMenu, // Menu_64x64x4 + imgSettings, // Settings_64x64x4 + imgDirectory, // Directory_32x32x4 + imgConfirm, // Confirm_64x64x4 + imgCancel, // Cancel_64x64x4 + imgIncrease, // Increase_64x64x4 + imgDecrease, // Decrease_64x64x4 + imgBack, // Back_32x32x4 + imgUp, // Up_32x32x4 + imgDown, // Down_32x32x4 + imgLeft, // Left_32x32x4 + imgRight, // Right_32x32x4 + imgRefresh, // Refresh_32x32x4 + imgLeveling, // Leveling_32x32x4 + imgSlider, // Slider8x16x4 + imgHome, // Home_64x64x4 + imgBtn52Rounded, // BtnRounded_64x52x4 + imgBtn39Rounded, // BtnRounded_42x39x4 + imgTimeElapsed, // Time_Elapsed_32x32x4 + imgTimeRemaining, // Time_Remaining_32x32x4 // Special values - must be at the end! imgCount, noImage = imgCount, diff --git a/Marlin/src/lcd/tft/themes/theme_ANET_BLACK.h b/Marlin/src/lcd/tft/themes/theme_ANET_BLACK.h index 8db729a04b4e..6285f096f11e 100644 --- a/Marlin/src/lcd/tft/themes/theme_ANET_BLACK.h +++ b/Marlin/src/lcd/tft/themes/theme_ANET_BLACK.h @@ -46,6 +46,8 @@ #define COLOR_SD_ENABLED COLOR_CONTROL_ENABLED #define COLOR_SD_DISABLED COLOR_CONTROL_DISABLED #define COLOR_MENU_TEXT COLOR_WHITE +#define COLOR_MENU_STATIC_TEXT COLOR_WHITE +#define COLOR_MENU_BACK_TEXT COLOR_YELLOW #define COLOR_MENU_VALUE_FONT COLOR_ORANGE2 #define COLOR_SLIDER COLOR_ORANGE2 #define COLOR_INCREASE COLOR_WHITE diff --git a/Marlin/src/lcd/tft/themes/theme_BLUE_MARLIN.h b/Marlin/src/lcd/tft/themes/theme_BLUE_MARLIN.h index 9e0a518badb0..850f59a3a687 100644 --- a/Marlin/src/lcd/tft/themes/theme_BLUE_MARLIN.h +++ b/Marlin/src/lcd/tft/themes/theme_BLUE_MARLIN.h @@ -106,6 +106,12 @@ #ifndef COLOR_MENU_TEXT #define COLOR_MENU_TEXT COLOR_YELLOW #endif +#ifndef COLOR_MENU_TEXT + #define COLOR_MENU_STATIC_TEXT COLOR_SILVER +#endif +#ifndef COLOR_MENU_BACK_TEXT + #define COLOR_MENU_BACK_TEXT COLOR_CYAN +#endif #ifndef COLOR_MENU_VALUE #define COLOR_MENU_VALUE COLOR_WHITE #endif diff --git a/Marlin/src/lcd/tft/themes/theme_default.h b/Marlin/src/lcd/tft/themes/theme_default.h index c2e1770904f6..d50c4e79747c 100644 --- a/Marlin/src/lcd/tft/themes/theme_default.h +++ b/Marlin/src/lcd/tft/themes/theme_default.h @@ -104,6 +104,12 @@ #ifndef COLOR_MENU_TEXT #define COLOR_MENU_TEXT COLOR_YELLOW #endif +#ifndef COLOR_MENU_STATIC_TEXT + #define COLOR_MENU_STATIC_TEXT COLOR_SILVER +#endif +#ifndef COLOR_MENU_BACK_TEXT + #define COLOR_MENU_BACK_TEXT COLOR_WHITE +#endif #ifndef COLOR_MENU_VALUE #define COLOR_MENU_VALUE COLOR_WHITE #endif diff --git a/Marlin/src/lcd/tft/ui_1024x600.h b/Marlin/src/lcd/tft/ui_1024x600.h index 05f3fed1ec72..e9753c43a598 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.h +++ b/Marlin/src/lcd/tft/ui_1024x600.h @@ -24,12 +24,20 @@ // -------------------------------- Core Parameters -------------------------------- -#define MENU_TEXT_X 16 +#define MENU_TEXT_X (5 + 32 + 5 + 6) #define MENU_TEXT_Y tft_string.vcenter(MENU_ITEM_HEIGHT) #define MENU_ITEM_ICON_X 5 #define MENU_ITEM_ICON_Y 5 -#define MENU_ITEM_ICON_SPACE 42 +#define MENU_ITEM_ICON_SPACE (5 + 32 + 5) + +#ifndef MENU_ITEM_SUBMENU_ICON_X + #define MENU_ITEM_SUBMENU_ICON_X (TFT_WIDTH - 32 - 32) +#endif + +#ifndef MENU_ITEM_BACK_LINE_SHIFT + #define MENU_ITEM_BACK_LINE_SHIFT -32 +#endif #define MENU_ITEM_HEIGHT 43 #define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) diff --git a/Marlin/src/lcd/tft/ui_320x480.h b/Marlin/src/lcd/tft/ui_320x480.h index 87f6b4ebe48f..17329be37378 100644 --- a/Marlin/src/lcd/tft/ui_320x480.h +++ b/Marlin/src/lcd/tft/ui_320x480.h @@ -29,7 +29,7 @@ #define MENU_ITEM_ICON_X 5 #define MENU_ITEM_ICON_Y 5 -#define MENU_ITEM_ICON_SPACE 42 +#define MENU_ITEM_ICON_SPACE (5 + 32 + 5) #define MENU_ITEM_HEIGHT 43 #define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) diff --git a/Marlin/src/lcd/tft/ui_480x272.h b/Marlin/src/lcd/tft/ui_480x272.h index 83f9e5c21aa4..2f8b985b1be2 100644 --- a/Marlin/src/lcd/tft/ui_480x272.h +++ b/Marlin/src/lcd/tft/ui_480x272.h @@ -29,7 +29,7 @@ #define MENU_ITEM_ICON_X 5 #define MENU_ITEM_ICON_Y 5 -#define MENU_ITEM_ICON_SPACE 42 +#define MENU_ITEM_ICON_SPACE (5 + 32 + 5) #define MENU_ITEM_HEIGHT 36 #define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) diff --git a/Marlin/src/lcd/tft/ui_480x320.h b/Marlin/src/lcd/tft/ui_480x320.h index a16ed8ad2243..4d50263c22a3 100644 --- a/Marlin/src/lcd/tft/ui_480x320.h +++ b/Marlin/src/lcd/tft/ui_480x320.h @@ -29,7 +29,7 @@ #define MENU_ITEM_ICON_X 5 #define MENU_ITEM_ICON_Y 5 -#define MENU_ITEM_ICON_SPACE 42 +#define MENU_ITEM_ICON_SPACE (5 + 32 + 5) #define MENU_ITEM_HEIGHT 43 #define MENU_LINE_HEIGHT (MENU_ITEM_HEIGHT + 2) diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 78eae61062dd..20486a01b7fb 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -222,7 +222,9 @@ void menu_line(const uint8_t row, uint16_t color) { text_line(MENU_TOP_LINE_Y + cursor.y * MENU_LINE_HEIGHT, color); } -void menu_item(const uint8_t row, bool sel ) { +uint16_t menu_item(const uint8_t row, const bool sel) { + const uint16_t lineColor = sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND; + #if ENABLED(TOUCH_SCREEN) if (row == 0) { touch.clear(); @@ -230,11 +232,13 @@ void menu_item(const uint8_t row, bool sel ) { } #endif - menu_line(row, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); + menu_line(row, lineColor); #if ENABLED(TOUCH_SCREEN) const TouchControlType tct = TERN(SINGLE_TOUCH_NAVIGATION, true, sel) ? MENU_CLICK : MENU_ITEM; touch.add_control(tct, 0, MENU_TOP_LINE_Y + row * MENU_LINE_HEIGHT, TFT_WIDTH, MENU_ITEM_HEIGHT, encoderTopLine + row); #endif + + return lineColor; } void add_control(uint16_t x, uint16_t y, TouchControlType control_type, intptr_t data, MarlinImage image, bool is_enabled, uint16_t color_enabled, uint16_t color_disabled) { @@ -319,30 +323,57 @@ void lcd_put_int(const int i) { // Draw a generic menu item with pre_char (if selected) and post_char void MenuItemBase::_draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char pre_char, const char post_char) { - menu_item(row, sel); + const uint16_t lineColor = menu_item(row, sel); const char *string = FTOP(ftpl); + + #ifndef MENU_ITEM_BACK_LINE_SHIFT + #define MENU_ITEM_BACK_LINE_SHIFT 0 + #endif + + int8_t line_shift = 0; + uint16_t color = COLOR_MENU_TEXT; + + // Determine an image to show in the left column MarlinImage image = noImage; - switch (*string) { - case LCD_STR_REFRESH[0]: image = imgRefresh; break; - case LCD_STR_FOLDER[0]: image = imgDirectory; break; + if (pre_char == LCD_STR_UPLEVEL[0]) { + image = imgLeft; + color = COLOR_MENU_BACK_TEXT; + } + else { + switch (*string) { + case LCD_STR_REFRESH[0]: image = imgRefresh; break; + case LCD_STR_FOLDER[0]: image = imgDirectory; break; + } + if (image != noImage) { + line_shift = MENU_ITEM_ICON_SPACE; + string++; + if (*string == ' ') string++; + } } - uint8_t offset = MENU_TEXT_X; + // For narrower screens text-only items align fully left + // For wider screens text aligns on the post-icon column + uint8_t text_x = (TFT_WIDTH >= 480) ? MENU_ITEM_ICON_SPACE : MENU_TEXT_X; if (image != noImage) { - string++; - offset = MENU_ITEM_ICON_SPACE; - tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, image, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); + text_x = MENU_ITEM_ICON_SPACE; + tft.add_image(MENU_ITEM_ICON_X + line_shift, MENU_ITEM_ICON_Y, image, color, lineColor); } + // Add the text content from ftpl tft_string.set(string, itemIndex, itemStringC, itemStringF); + tft.add_text(text_x + line_shift, MENU_TEXT_Y, color, tft_string); - tft.add_text(offset, MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); + #ifndef MENU_ITEM_SUBMENU_ICON_X + #define MENU_ITEM_SUBMENU_ICON_X (TFT_WIDTH - 32) + #endif + if (post_char == LCD_STR_ARROW_RIGHT[0]) + tft.add_image(MENU_ITEM_SUBMENU_ICON_X, MENU_ITEM_ICON_Y, imgRight, color, lineColor); } // Draw a menu item with a (potentially) editable value void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl, const char * const inStr, const bool pgm) { - menu_item(row, sel); + (void)menu_item(row, sel); tft_string.set(ftpl, itemIndex, itemStringC, itemStringF); tft.add_text(MENU_TEXT_X, MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); @@ -354,7 +385,7 @@ void MenuEditItemBase::draw(const bool sel, const uint8_t row, FSTR_P const ftpl // Draw a static item with no left-right margin required. Centered by default. void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t style/*=SS_DEFAULT*/, const char *vstr/*=nullptr*/) { - menu_item(row); + (void)menu_item(row); if (ftpl) tft_string.set(ftpl, itemIndex, itemStringC, itemStringF); @@ -364,7 +395,7 @@ void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t s const bool center = bool(style & SS_CENTER), full = bool(style & SS_FULL); if (!full || !vstr) { if (vstr) tft_string.add(vstr); - tft.add_text(center ? tft_string.center(TFT_WIDTH) : 0, MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); + tft.add_text(center ? tft_string.center(TFT_WIDTH) : 0, MENU_TEXT_Y, COLOR_MENU_STATIC_TEXT, tft_string); return; } @@ -372,21 +403,22 @@ void MenuItem_static::draw(const uint8_t row, FSTR_P const ftpl, const uint8_t s if (*vstr == ':') { tft_string.add(':'); vstr++; } // Left-justified label - tft.add_text(0, MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); + tft.add_text(0, MENU_TEXT_Y, COLOR_MENU_STATIC_TEXT, tft_string); // Right-justified value, after spaces while (*vstr == ' ') vstr++; tft_string.set(vstr); - tft.add_text(TFT_WIDTH - 1 - tft_string.width(), MENU_TEXT_Y, COLOR_MENU_TEXT, tft_string); + tft.add_text(TFT_WIDTH - 1 - tft_string.width(), MENU_TEXT_Y, COLOR_MENU_STATIC_TEXT, tft_string); } #if HAS_MEDIA void MenuItem_sdbase::draw(const bool sel, const uint8_t row, FSTR_P const, CardReader &theCard, const bool isDir) { - menu_item(row, sel); - if (isDir) tft.add_image(MENU_ITEM_ICON_X, MENU_ITEM_ICON_Y, imgDirectory, COLOR_MENU_TEXT, sel ? COLOR_SELECTION_BG : COLOR_BACKGROUND); + const uint16_t lineColor = menu_item(row, sel); + constexpr uint8_t line_shift = (TFT_WIDTH >= 480) ? MENU_ITEM_ICON_SPACE : 0; + if (isDir) tft.add_image(MENU_ITEM_ICON_X + line_shift, MENU_ITEM_ICON_Y, imgDirectory, COLOR_MENU_TEXT, lineColor); uint8_t maxlen = (MENU_ITEM_HEIGHT) - (MENU_TEXT_Y) + 1; - tft.add_text(MENU_ITEM_ICON_SPACE, MENU_TEXT_Y, COLOR_MENU_TEXT, ui.scrolled_filename(theCard, maxlen, sel)); + tft.add_text(MENU_ITEM_ICON_SPACE + line_shift, MENU_TEXT_Y, COLOR_MENU_TEXT, ui.scrolled_filename(theCard, maxlen, sel)); } #endif diff --git a/Marlin/src/lcd/tft/ui_common.h b/Marlin/src/lcd/tft/ui_common.h index 3a67768f352f..bc03ccae4131 100644 --- a/Marlin/src/lcd/tft/ui_common.h +++ b/Marlin/src/lcd/tft/ui_common.h @@ -114,7 +114,7 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink); void text_line(const uint16_t y, uint16_t color=COLOR_BACKGROUND); void menu_line(const uint8_t row, uint16_t color=COLOR_BACKGROUND); -void menu_item(const uint8_t row, bool sel = false); +uint16_t menu_item(const uint8_t row, bool sel = false); typedef void (*screenFunc_t)(); void add_control(