From d3a8a81756de675a03b20ffa262122f41d384022 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 21 Jan 2020 05:21:23 -0600 Subject: [PATCH 01/30] Update mfdoc, mfpub --- buildroot/share/git/mfdoc | 6 ++-- buildroot/share/git/mfpub | 73 ++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 47 deletions(-) diff --git a/buildroot/share/git/mfdoc b/buildroot/share/git/mfdoc index f2a2b08204b6..ce214190164f 100755 --- a/buildroot/share/git/mfdoc +++ b/buildroot/share/git/mfdoc @@ -5,7 +5,7 @@ # Start Jekyll in watch mode to work on Marlin Documentation and preview locally # -[[ $# == 0 ]] || { echo "usage: `basename $0`" 1>&2 ; exit 1; } +[[ $# == 0 ]] || { echo "Usage: `basename $0`" 1>&2 ; exit 1; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" @@ -16,10 +16,8 @@ BRANCH=${INFO[5]} [[ $ORG == "MarlinFirmware" && $REPO == "MarlinDocumentation" ]] || { echo "Wrong repository." 1>&2; exit 1; } opensite() { - which xdg-open >/dev/null && TOOL=xdg-open - which gnome-open >/dev/null && TOOL=gnome-open - which open >/dev/null && TOOL=open URL="http://127.0.0.1:4000/" + OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }') if [ -z "$OPEN" ]; then echo "Can't find a tool to open the URL:" echo $URL diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub index 0f4e18d8b5ac..23e15c7f05c8 100755 --- a/buildroot/share/git/mfpub +++ b/buildroot/share/git/mfpub @@ -5,11 +5,11 @@ # Use Jekyll to generate Marlin Documentation, which is then # git-pushed to Github to publish it to the live site. # This publishes the current branch, and doesn't force -# changes to be pushed to the 'master' branch. Be sure to push -# any permanent changes to 'master'. +# changes to be pushed to the 'master' branch. Be sure to +# push any permanent changes to 'master'. # -[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [branch]" 1>&2 ; exit 1; } +[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1; } MFINFO=$(mfinfo "$@") || exit 1 IFS=' ' read -a INFO <<< "$MFINFO" @@ -18,6 +18,7 @@ FORK=${INFO[1]} REPO=${INFO[2]} TARG=${INFO[3]} BRANCH=${INFO[4]} +CURR=${INFO[5]} if [[ $ORG != "MarlinFirmware" || $REPO != "MarlinDocumentation" ]]; then echo "Wrong repository." @@ -30,34 +31,46 @@ if [[ $BRANCH == "gh-pages" ]]; then fi # Check out the named branch (or stay in current) -git checkout $BRANCH -echo "Stashing any changes to files..." -echo "Don't forget to update and push 'master'!" -# GOJF Card -[[ $(git stash) != "No local "* ]] && HAS_STASH=1 +if [[ $BRANCH != $CURR ]]; then + git checkout $BRANCH + echo "Stashing any changes to files..." + [[ $(git stash) != "No local "* ]] && HAS_STASH=1 +fi COMMIT=$( git log --format="%H" -n 1 ) # Clean out changes and other junk in the branch git clean -d -f +opensite() { + URL="$1" + OPEN=$(echo $(which gnome-open xdg-open open) | awk '{ print $1 }') + if [ -z "$OPEN" ]; then + echo "Can't find a tool to open the URL:" + echo $URL + else + echo "Opening the site in the browser..." + "$OPEN" "$URL" + fi +} + # Push 'master' to the fork and make a proper PR... -if [[ $BRANCH == "master" ]]; then +if [[ $BRANCH == $TARG ]]; then # Don't lose upstream changes! git fetch upstream # Rebase onto latest master - if git rebase upstream/master; then + if git rebase upstream/$TARG; then # Allow working directly with the main fork echo - echo -n "Pushing to origin/master... " + echo -n "Pushing to origin/$TARG... " git push -f origin echo - echo -n "Pushing to upstream/master... " + echo -n "Pushing to upstream/$TARG... " git push -f upstream else @@ -77,18 +90,7 @@ else git push -f origin fi - which xdg-open >/dev/null && TOOL=xdg-open - which gnome-open >/dev/null && TOOL=gnome-open - which open >/dev/null && TOOL=open - URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1" - - if [ -z "$OPEN" ]; then - echo "Can't find a tool to open the URL:" - echo $URL - else - echo "Opening a New PR Form..." - "$OPEN" "$URL" - fi + opensite "https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1" fi @@ -117,27 +119,14 @@ git clean -d -f git checkout gh-pages || { echo "Something went wrong!"; exit 1; } rsync -av ${TMPFOLDER}/ ./ -opensite() { - which xdg-open >/dev/null && TOOL=xdg-open - which gnome-open >/dev/null && TOOL=gnome-open - which open >/dev/null && TOOL=open - URL="http://marlinfw.org/" - if [ -z "$OPEN" ]; then - echo "Can't find a tool to open the URL:" - echo $URL - else - echo "Opening the site in the browser..." - "$OPEN" "$URL" - fi -} - # Commit and push the new live site directly git add --all git commit --message "Built from ${COMMIT}" -git push upstream | { +git push -f origin +git push -f upstream | { while IFS= read -r line do - [[ $line =~ "gh-pages -> gh-pages" ]] && opensite + [[ $line =~ "gh-pages -> gh-pages" ]] && opensite "http://marlinfw.org/" echo "$line" done } @@ -146,6 +135,4 @@ git push upstream | { rm -rf ${TMPFOLDER} # Go back to the branch we started from -git checkout $BRANCH - -[[ $HAS_STASH == 1 ]] && git stash pop +[[ $BRANCH != $CURR ]] && { git checkout $BRANCH ; [[ $HAS_STASH == 1 ]] && git stash pop ; } From fd346c6cd148b5cad06acaa1247265b11152fdd2 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 22 Jan 2020 00:07:17 +0000 Subject: [PATCH 02/30] [cron] Bump distribution date (2020-01-22) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 2f7bb37afd9e..6caa48c0d92b 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 "2020-01-21" + #define STRING_DISTRIBUTION_DATE "2020-01-22" #endif /** From 0eae26a7be8c6798e64067548f3c8f313cdf677e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 22 Jan 2020 01:54:25 -0600 Subject: [PATCH 03/30] Tweak mfpub stashing --- buildroot/share/git/mfpub | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub index 23e15c7f05c8..8ec28ad489a1 100755 --- a/buildroot/share/git/mfpub +++ b/buildroot/share/git/mfpub @@ -33,9 +33,9 @@ fi # Check out the named branch (or stay in current) if [[ $BRANCH != $CURR ]]; then - git checkout $BRANCH echo "Stashing any changes to files..." [[ $(git stash) != "No local "* ]] && HAS_STASH=1 + git checkout $BRANCH fi COMMIT=$( git log --format="%H" -n 1 ) @@ -135,4 +135,4 @@ git push -f upstream | { rm -rf ${TMPFOLDER} # Go back to the branch we started from -[[ $BRANCH != $CURR ]] && { git checkout $BRANCH ; [[ $HAS_STASH == 1 ]] && git stash pop ; } +[[ $BRANCH != $CURR ]] && git checkout $BRANCH && [[ $HAS_STASH == 1 ]] && git stash pop From 342f65eb8ee3bf7472b77fe59d13611950e40591 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 23 Jan 2020 00:07:18 +0000 Subject: [PATCH 04/30] [cron] Bump distribution date (2020-01-23) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 6caa48c0d92b..0f1485f2bb75 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 "2020-01-22" + #define STRING_DISTRIBUTION_DATE "2020-01-23" #endif /** From 2ef6b86ccdc3fdd3fde332f36181f4b2009e15b6 Mon Sep 17 00:00:00 2001 From: Artur Petrzak Date: Thu, 23 Jan 2020 04:52:16 +0100 Subject: [PATCH 05/30] Enable use of latest TMCStepper on MKS Robin Nano (#16652) --- platformio.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 7689aea3c325..9cf2c918ed71 100644 --- a/platformio.ini +++ b/platformio.ini @@ -483,11 +483,14 @@ lib_ignore = Adafruit NeoPixel, SPI [env:mks_robin_nano] platform = ststm32 board = genericSTM32F103VE +platform_packages = tool-stm32duino build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py - ${common.build_flags} -std=gnu++14 + ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 build_unflags = -std=gnu++11 extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano.py src_filter = ${common.default_src_filter} + +lib_deps = + SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip lib_ignore = Adafruit NeoPixel, SPI # From 899db41a5c42e98b2f8c8a2ce0216c6c04b7ae76 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 24 Jan 2020 00:07:21 +0000 Subject: [PATCH 06/30] [cron] Bump distribution date (2020-01-24) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 0f1485f2bb75..278fa14de135 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 "2020-01-23" + #define STRING_DISTRIBUTION_DATE "2020-01-24" #endif /** From 1c042bbaea57e1ec59cc90e58c670914f43cda08 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 May 2019 01:42:33 -0500 Subject: [PATCH 07/30] Convert chars only for enabled languages --- Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp | 599 +++++++++++--------- 1 file changed, 343 insertions(+), 256 deletions(-) diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp index 2c8c029e73cf..a1258a3b1035 100644 --- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp +++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp @@ -100,7 +100,7 @@ static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = { {IV('カ'), 0xB6, 0}, {IV('ガ'), 0xB6, 0xDE}, {IV('キ'), 0xB7, 0}, - {IV('ギ'), 0xB7, 0xDE}, // + {IV('ギ'), 0xB7, 0xDE}, {IV('ク'), 0xB8, 0}, {IV('グ'), 0xB8, 0xDE}, {IV('ケ'), 0xB9, 0}, @@ -416,6 +416,7 @@ static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = { {IV('⎭'), 0x17, 0}, {IV('⎰'), 0x18, 0}, {IV('⎱'), 0x19, 0}, + {IV('⎲'), 0x12, 0}, {IV('⎳'), 0x13, 0}, @@ -488,119 +489,124 @@ static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = { {IV('¾'), 0xF3, 0}, // 00BE {IV('¿'), 0xCD, 0}, // 00BF - {IV('Ё'), 0xA2, 0}, // 0401 - {IV('А'), 'A', 0}, // 0410 - {IV('Б'), 0xA0, 0}, - {IV('В'), 'B', 0}, - {IV('Г'), 0xA1, 0}, - {IV('Д'), 0xE0, 0}, - {IV('Е'), 'E', 0}, - {IV('Ж'), 0xA3, 0}, - {IV('З'), 0xA4, 0}, - {IV('И'), 0xA5, 0}, - {IV('Й'), 0xA6, 0}, - {IV('К'), 'K', 0}, - {IV('Л'), 0xA7, 0}, - {IV('М'), 'M', 0}, - {IV('Н'), 'H', 0}, - {IV('О'), 'O', 0}, - {IV('П'), 0xA8, 0}, - {IV('Р'), 'P', 0}, - {IV('С'), 'C', 0}, - {IV('Т'), 'T', 0}, - {IV('У'), 0xA9, 0}, - {IV('Ф'), 0xAA, 0}, - {IV('Х'), 'X', 0}, - {IV('Ц'), 0xE1, 0}, - {IV('Ч'), 0xAB, 0}, - {IV('Ш'), 0xAC, 0}, - {IV('Щ'), 0xE2, 0}, - {IV('Ъ'), 0xAD, 0}, - {IV('Ы'), 0xAE, 0}, - {IV('Ь'), 'b', 0}, - {IV('Э'), 0xAF, 0}, - {IV('Ю'), 0xB0, 0}, - {IV('Я'), 0xB1, 0}, - {IV('а'), 'a', 0}, - - {IV('б'), 0xB2, 0}, - {IV('в'), 0xB3, 0}, - {IV('г'), 0xB4, 0}, - {IV('д'), 0xE3, 0}, - {IV('е'), 'e', 0}, - {IV('ж'), 0xB6, 0}, - {IV('з'), 0xB7, 0}, - {IV('и'), 0xB8, 0}, - {IV('й'), 0xB9, 0}, - {IV('к'), 0xBA, 0}, //клмноп - {IV('л'), 0xBB, 0}, - {IV('м'), 0xBC, 0}, - {IV('н'), 0xBD, 0}, - {IV('о'), 'o', 0}, - {IV('п'), 0xBE, 0}, - {IV('р'), 'p', 0}, - {IV('с'), 'c', 0}, - {IV('т'), 0xBF, 0}, - - {IV('у'), 'y', 0}, - {IV('ф'), 0xE4, 0}, - {IV('х'), 'x', 0}, - {IV('ц'), 0xE5, 0}, - {IV('ч'), 0xC0, 0}, - {IV('ш'), 0xC1, 0}, - {IV('щ'), 0xE6, 0}, - {IV('ъ'), 0xC2, 0}, - {IV('ы'), 0xC3, 0}, - {IV('ь'), 0xC4, 0}, - {IV('э'), 0xC5, 0}, - {IV('ю'), 0xC6, 0}, - {IV('я'), 0xC7, 0}, // 044F - {IV('ё'), 0xB5, 0}, // 0451 - //{IV(''), 0xC8, 0}, - //{IV(''), 0xC9, 0}, - //{IV(''), 0xCA, 0}, - //{IV(''), 0xCB, 0}, - //{IV(''), 0xCC, 0}, - //{IV(''), 0xCD, 0}, - //{IV(''), 0xCE, 0}, - - //{IV(''), 0xD0, 0}, - //{IV(''), 0xD1, 0}, - //{IV(''), 0xD2, 0}, - //{IV(''), 0xD3, 0}, - //{IV(''), 0xD4, 0}, - //{IV(''), 0xD5, 0}, - //{IV(''), 0xD6, 0}, - //{IV(''), 0xD7, 0}, - //{IV(''), 0xD8, 0}, - //{IV(''), 0xDB, 0}, - //{IV(''), 0xDC, 0}, - //{IV(''), 0xDD, 0}, - //{IV(''), 0xDE, 0}, - //{IV(''), 0xDF, 0}, - - //{IV(''), 0xE7, 0}, - //{IV(''), 0xE8, 0}, - //{IV(''), 0xE9, 0}, - //{IV(''), 0xEA, 0}, - //{IV(''), 0xEB, 0}, - //{IV(''), 0xEC, 0}, - //{IV(''), 0xED, 0}, - //{IV(''), 0xEE, 0}, - //{IV(''), 0xEF, 0}, - - //{IV(''), 0xF4, 0}, - //{IV(''), 0xF5, 0}, - //{IV(''), 0xF6, 0}, - //{IV(''), 0xF7, 0}, - //{IV(''), 0xF8, 0}, - //{IV(''), 0xF9, 0}, - //{IV(''), 0xFA, 0}, - //{IV(''), 0xFB, 0}, - //{IV(''), 0xFC, 0}, - //{IV(''), 0xFD, 0}, - //{IV(''), 0xFE, 0}, - //{IV(''), 0xFF, 0}, + #if ENABLED(DISPLAY_CHARSET_ISO10646_5) + + // Map Cyrillic to HD44780 extended CYRILLIC where possible + {IV('Ё'), 0xA2, 0}, // 0401 + {IV('А'), 'A', 0}, // 0410 + {IV('Б'), 0xA0, 0}, + {IV('В'), 'B', 0}, + {IV('Г'), 0xA1, 0}, + {IV('Д'), 0xE0, 0}, + {IV('Е'), 'E', 0}, + {IV('Ж'), 0xA3, 0}, + {IV('З'), 0xA4, 0}, + {IV('И'), 0xA5, 0}, + {IV('Й'), 0xA6, 0}, + {IV('К'), 'K', 0}, + {IV('Л'), 0xA7, 0}, + {IV('М'), 'M', 0}, + {IV('Н'), 'H', 0}, + {IV('О'), 'O', 0}, + {IV('П'), 0xA8, 0}, + {IV('Р'), 'P', 0}, + {IV('С'), 'C', 0}, + {IV('Т'), 'T', 0}, + {IV('У'), 0xA9, 0}, + {IV('Ф'), 0xAA, 0}, + {IV('Х'), 'X', 0}, + {IV('Ц'), 0xE1, 0}, + {IV('Ч'), 0xAB, 0}, + {IV('Ш'), 0xAC, 0}, + {IV('Щ'), 0xE2, 0}, + {IV('Ъ'), 0xAD, 0}, + {IV('Ы'), 0xAE, 0}, + {IV('Ь'), 'b', 0}, + {IV('Э'), 0xAF, 0}, + {IV('Ю'), 0xB0, 0}, + {IV('Я'), 0xB1, 0}, + {IV('а'), 'a', 0}, + + {IV('б'), 0xB2, 0}, + {IV('в'), 0xB3, 0}, + {IV('г'), 0xB4, 0}, + {IV('д'), 0xE3, 0}, + {IV('е'), 'e', 0}, + {IV('ж'), 0xB6, 0}, + {IV('з'), 0xB7, 0}, + {IV('и'), 0xB8, 0}, + {IV('й'), 0xB9, 0}, + {IV('к'), 0xBA, 0}, //клмноп + {IV('л'), 0xBB, 0}, + {IV('м'), 0xBC, 0}, + {IV('н'), 0xBD, 0}, + {IV('о'), 'o', 0}, + {IV('п'), 0xBE, 0}, + {IV('р'), 'p', 0}, + {IV('с'), 'c', 0}, + {IV('т'), 0xBF, 0}, + + {IV('у'), 'y', 0}, + {IV('ф'), 0xE4, 0}, + {IV('х'), 'x', 0}, + {IV('ц'), 0xE5, 0}, + {IV('ч'), 0xC0, 0}, + {IV('ш'), 0xC1, 0}, + {IV('щ'), 0xE6, 0}, + {IV('ъ'), 0xC2, 0}, + {IV('ы'), 0xC3, 0}, + {IV('ь'), 0xC4, 0}, + {IV('э'), 0xC5, 0}, + {IV('ю'), 0xC6, 0}, + {IV('я'), 0xC7, 0}, // 044F + {IV('ё'), 0xB5, 0}, // 0451 + //{IV(''), 0xC8, 0}, + //{IV(''), 0xC9, 0}, + //{IV(''), 0xCA, 0}, + //{IV(''), 0xCB, 0}, + //{IV(''), 0xCC, 0}, + //{IV(''), 0xCD, 0}, + //{IV(''), 0xCE, 0}, + + //{IV(''), 0xD0, 0}, + //{IV(''), 0xD1, 0}, + //{IV(''), 0xD2, 0}, + //{IV(''), 0xD3, 0}, + //{IV(''), 0xD4, 0}, + //{IV(''), 0xD5, 0}, + //{IV(''), 0xD6, 0}, + //{IV(''), 0xD7, 0}, + //{IV(''), 0xD8, 0}, + //{IV(''), 0xDB, 0}, + //{IV(''), 0xDC, 0}, + //{IV(''), 0xDD, 0}, + //{IV(''), 0xDE, 0}, + //{IV(''), 0xDF, 0}, + + //{IV(''), 0xE7, 0}, + //{IV(''), 0xE8, 0}, + //{IV(''), 0xE9, 0}, + //{IV(''), 0xEA, 0}, + //{IV(''), 0xEB, 0}, + //{IV(''), 0xEC, 0}, + //{IV(''), 0xED, 0}, + //{IV(''), 0xEE, 0}, + //{IV(''), 0xEF, 0}, + + //{IV(''), 0xF4, 0}, + //{IV(''), 0xF5, 0}, + //{IV(''), 0xF6, 0}, + //{IV(''), 0xF7, 0}, + //{IV(''), 0xF8, 0}, + //{IV(''), 0xF9, 0}, + //{IV(''), 0xFA, 0}, + //{IV(''), 0xFB, 0}, + //{IV(''), 0xFC, 0}, + //{IV(''), 0xFD, 0}, + //{IV(''), 0xFE, 0}, + //{IV(''), 0xFF, 0}, + + #endif {IV('↑'), 0xD9, 0}, // 2191 ←↑→↓ {IV('↓'), 0xDA, 0}, // 2193 @@ -613,7 +619,7 @@ static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = { {IV('¢'), 'c', 0}, // A2 {IV('°'), 0x09, 0}, // B0 Marlin special: '°' LCD_STR_DEGREE (0x09) - // map WESTERN code to the plain ASCII + // Map WESTERN code to plain ASCII {IV('Á'), 'A', 0}, // C1 {IV('Â'), 'A', 0}, // C2 {IV('Ã'), 'A', 0}, // C3 @@ -697,147 +703,228 @@ static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = { {IV('ˣ'), 'x', 0}, // 02E3 - {IV('΄'), '\'', 0}, // 0384 - {IV('΅'), '\'', 0}, // 0385 - {IV('Ά'), 'A', 0}, // 0386 - {IV('·'), '.', 0}, // 0387 - {IV('Έ'), 'E', 0}, // 0388 - {IV('Ή'), 'H', 0}, // 0389 - {IV('Ί'), 'I', 0}, // 038A - {IV('Ό'), 'O', 0}, // 038C - {IV('Ύ'), 'Y', 0}, // 038E - {IV('Ώ'), 'O', 0}, // 038F - {IV('ΐ'), 'i', 0}, // 0390 - {IV('Α'), 'A', 0}, // 0391 - {IV('Β'), 'B', 0}, // 0392 - {IV('Γ'), 'T', 0}, // 0393, Gamma - {IV('Δ'), '4', 0}, // 0394, Delta, ◿ - {IV('Ε'), 'E', 0}, // 0395 - {IV('Ζ'), 'Z', 0}, // 0396 - {IV('Η'), 'H', 0}, // 0397 - {IV('Θ'), '0', 0}, // 0398, Theta - {IV('Ι'), 'I', 0}, // 0399 - {IV('Κ'), 'K', 0}, // 039A - {IV('Λ'), '^', 0}, // 039B, Lambda - {IV('Μ'), 'M', 0}, // 039C - {IV('Ν'), 'N', 0}, // 039D - {IV('Ξ'), '3', 0}, // 039E, Xi - {IV('Ο'), 'O', 0}, // 039F - {IV('Π'), 'n', 0}, // 03A0, Pi - {IV('Ρ'), 'P', 0}, // 03A1 - {IV('Σ'), 'E', 0}, // 03A3, Sigma - {IV('Τ'), 'T', 0}, // 03A4 - {IV('Υ'), 'Y', 0}, // 03A5, Upsilon - {IV('Φ'), 'p', 0}, // 03A6, Phi - {IV('Χ'), 'X', 0}, // 03A7 - {IV('Ψ'), 'P', 0}, // 03A8, Psi - {IV('Ω'), 'O', 0}, // 03A9, Omega - {IV('Ϊ'), 'I', 0}, // 03AA - {IV('Ϋ'), 'Y', 0}, // 03AB - {IV('ά'), 'a', 0}, // 03AC - {IV('έ'), 'e', 0}, // 03AD - {IV('ή'), 'n', 0}, // 03AE - {IV('ί'), 'i', 0}, // 03AF - {IV('ΰ'), 'v', 0}, // 03B0 - {IV('α'), 'a', 0}, // 03B1, alpha - {IV('β'), 'B', 0}, // 03B2, beta - {IV('γ'), 'v', 0}, // 03B3, gamma - {IV('δ'), 'd', 0}, // 03B4, delta - {IV('ε'), 'e', 0}, // 03B5, epsilon - {IV('ζ'), 'Z', 0}, // 03B6, zeta - {IV('η'), 'n', 0}, // 03B7, eta - {IV('θ'), '0', 0}, // 03B8, theta - {IV('ι'), 'i', 0}, // 03B9, lota - {IV('κ'), 'k', 0}, // 03BA, kappa - {IV('λ'), 'L', 0}, // 03BB, lambda - {IV('μ'), 'u', 0}, // 03BC, mu - {IV('ν'), 'v', 0}, // 03BD, nu - {IV('ξ'), 'e', 0}, // 03BE, xi - {IV('ο'), 'o', 0}, // 03BF - {IV('π'), 'n', 0}, // 03C0, pi - {IV('ρ'), 'p', 0}, // 03C1, rho - {IV('ς'), 'c', 0}, // 03C2 - {IV('σ'), 'o', 0}, // 03C3, sigma - {IV('τ'), 't', 0}, // 03C4, tau - {IV('υ'), 'v', 0}, // 03C5, upsilon - {IV('φ'), 'p', 0}, // 03C6 - {IV('χ'), 'X', 0}, // 03C7, chi - {IV('ψ'), 'W', 0}, // 03C8, psi - {IV('ω'), 'w', 0}, // 03C9, omega - {IV('ϊ'), 'i', 0}, // 03CA - {IV('ϋ'), 'v', 0}, // 03CB - {IV('ό'), 'o', 0}, // 03CC - {IV('ύ'), 'v', 0}, // 03CD - {IV('ώ'), 'w', 0}, // 03CE - - // map CYRILLIC code to the plain ASCII - {IV('Ё'), 'E', 0}, // 0401 - {IV('А'), 'A', 0}, // 0410 - {IV('Б'), 'b', 0}, // 0411 - {IV('В'), 'B', 0}, // 0412 - {IV('Г'), 'T', 0}, // 0413 - {IV('Д'), 'Q', 0}, // 0414 - {IV('Е'), 'E', 0}, // 0415 - {IV('Ж'), '*', 0}, // 0416 - {IV('З'), 'E', 0}, // 0417 - {IV('И'), 'N', 0}, // 0418 - {IV('Й'), 'N', 0}, // 0419 - {IV('К'), 'K', 0}, // 041A - {IV('Л'), 'T', 0}, // 041B - {IV('М'), 'M', 0}, // 041C - {IV('Н'), 'H', 0}, // 041D - {IV('О'), 'O', 0}, // 041E - {IV('П'), 'n', 0}, // 041F - {IV('Р'), 'P', 0}, // 0420 - {IV('С'), 'C', 0}, // 0421 - {IV('Т'), 'T', 0}, // 0422 - {IV('У'), 'Y', 0}, - {IV('Ф'), 'o', 0}, - {IV('Х'), 'X', 0}, - {IV('Ц'), 'U', 0}, - {IV('Ч'), 'y', 0}, - {IV('Ш'), 'W', 0}, - {IV('Щ'), 'W', 0}, - {IV('Ъ'), 'b', 0}, - {IV('Ы'), 'b', '|'}, - {IV('Ь'), 'b'}, - {IV('Э'), 'e'}, - {IV('Ю'), '|', 'O'}, - {IV('Я'), '9', '|'}, // 042F - - {IV('а'), 'a', 0}, // 0430 - {IV('б'), '6', 0}, // 0431 - {IV('в'), 'B', 0}, // 0432, - {IV('г'), 'r', 0}, // 0433 - {IV('д'), 'a', 0}, // 0434, - {IV('е'), 'e', 0}, // 0435 - {IV('ж'), '*', 0}, // 0436 - {IV('з'), 'e', 0}, // 0437, - {IV('и'), 'u', 0}, // 0438 - {IV('й'), 'u', 0}, // 0439, - {IV('к'), 'k', 0}, // 043A - {IV('л'), 'n', 0}, - {IV('м'), 'm', 0}, - {IV('н'), 'H', 0}, - {IV('о'), 'o', 0}, - {IV('п'), 'n', 0}, - {IV('р'), 'p', 0}, - {IV('с'), 'c', 0}, - {IV('т'), 't', 0}, - {IV('у'), 'y', 0}, - {IV('ф'), 'q', 'p'}, - {IV('х'), 'x', 0}, - {IV('ц'), 'u', 0}, - {IV('ч'), 'y', 0}, - {IV('ш'), 'w', 0}, - {IV('щ'), 'w', 0}, - {IV('ъ'), 'b', 0}, - {IV('ы'), 'b', '|'}, - {IV('ь'), 'b', 0}, - {IV('э'), 'e', 0}, - {IV('ю'), '|', 'o'}, - {IV('я'), 'g', 0}, // 044F - {IV('ё'), 'e', 0}, // 0451 + #if ENABLED(DISPLAY_CHARSET_ISO10646_VI) + + // Map Vietnamese phonetics + + //{IV('à'), 'a', 0}, {IV('À'), 'A', 0}, + {IV('ạ'), 'a', 0}, {IV('Ạ'), 'A', 0}, + {IV('ả'), 'a', 0}, {IV('Ả'), 'A', 0}, + //{IV('ã'), 'a', 0}, {IV('Ã'), 'A', 0}, + //{IV('á'), 'á', 0}, {IV('Á'), 'A', 0}, + {IV('Ạ'), 'A', 0}, + {IV('ă'), 'a', 0}, {IV('Ă'), 'A', 0}, + {IV('ằ'), 'a', 0}, {IV('Ằ'), 'A', 0}, + {IV('ẳ'), 'a', 0}, {IV('Ẳ'), 'A', 0}, + {IV('ẵ'), 'a', 0}, {IV('Ẵ'), 'A', 0}, + {IV('ắ'), 'a', 0}, {IV('Ắ'), 'A', 0}, + {IV('ặ'), 'a', 0}, {IV('Ặ'), 'A', 0}, + {IV('â'), 'a', 0}, {IV('Â'), 'A', 0}, + {IV('ầ'), 'a', 0}, {IV('Ầ'), 'A', 0}, + {IV('ẩ'), 'a', 0}, {IV('Ẩ'), 'A', 0}, + {IV('ẫ'), 'a', 0}, {IV('Ẫ'), 'A', 0}, + {IV('ấ'), 'a', 0}, {IV('Ấ'), 'A', 0}, + {IV('ậ'), 'a', 0}, {IV('Ậ'), 'A', 0}, + //{IV('đ'), 'd', 0}, + {IV('Đ'), 'D', 0}, + {IV('e'), 'e', 0}, {IV('E'), 'E', 0}, + {IV('è'), 'e', 0}, {IV('È'), 'E', 0}, + {IV('ẻ'), 'e', 0}, {IV('Ẻ'), 'E', 0}, + {IV('ẽ'), 'e', 0}, {IV('Ẽ'), 'E', 0}, + {IV('é'), 'e', 0}, {IV('É'), 'E', 0}, + {IV('ẹ'), 'e', 0}, {IV('Ẹ'), 'E', 0}, + {IV('ê'), 'e', 0}, {IV('Ê'), 'E', 0}, + {IV('ề'), 'e', 0}, {IV('Ề'), 'E', 0}, + {IV('ể'), 'e', 0}, {IV('Ể'), 'E', 0}, + {IV('ễ'), 'e', 0}, {IV('Ễ'), 'E', 0}, + {IV('ế'), 'e', 0}, {IV('Ế'), 'E', 0}, + {IV('ệ'), 'e', 0}, {IV('Ệ'), 'E', 0}, + {IV('i'), 'i', 0}, {IV('I'), 'I', 0}, + //{IV('ì'), 'ì', 0}, {IV('Ì'), 'Ì', 0}, + {IV('ỉ'), 'ỉ', 0}, {IV('Ỉ'), 'Ỉ', 0}, + {IV('ĩ'), 'ĩ', 0}, {IV('Ĩ'), 'Ĩ', 0}, + {IV('í'), 'í', 0}, {IV('Í'), 'Í', 0}, + {IV('ị'), 'ị', 0}, {IV('Ị'), 'Ị', 0}, + {IV('o'), 'o', 0}, {IV('O'), 'O', 0}, + {IV('ò'), 'o', 0}, {IV('Ò'), 'O', 0}, + {IV('ỏ'), 'o', 0}, {IV('Ỏ'), 'O', 0}, + {IV('õ'), 'o', 0}, {IV('Õ'), 'O', 0}, + {IV('ó'), 'o', 0}, {IV('Ó'), 'O', 0}, + {IV('ọ'), 'o', 0}, {IV('Ọ'), 'O', 0}, + {IV('ô'), 'o', 0}, {IV('Ô'), 'O', 0}, + {IV('ồ'), 'o', 0}, {IV('Ồ'), 'O', 0}, + {IV('ổ'), 'o', 0}, {IV('Ổ'), 'O', 0}, + {IV('ỗ'), 'o', 0}, {IV('Ỗ'), 'O', 0}, + {IV('ố'), 'o', 0}, {IV('Ố'), 'O', 0}, + {IV('ộ'), 'o', 0}, {IV('Ộ'), 'O', 0}, + {IV('ơ'), 'o', 0}, {IV('Ơ'), 'O', 0}, + {IV('ờ'), 'o', 0}, {IV('Ờ'), 'O', 0}, + {IV('ở'), 'o', 0}, {IV('Ở'), 'O', 0}, + {IV('ỡ'), 'o', 0}, {IV('Ỡ'), 'O', 0}, + {IV('ớ'), 'o', 0}, {IV('Ớ'), 'O', 0}, + {IV('ợ'), 'o', 0}, {IV('Ợ'), 'O', 0}, + {IV('ù'), 'u', 0}, {IV('Ù'), 'U', 0}, + {IV('ủ'), 'u', 0}, {IV('Ủ'), 'U', 0}, + {IV('ũ'), 'u', 0}, {IV('Ũ'), 'U', 0}, + //{IV('ú'), 'u', 0}, {IV('Ú'), 'U', 0}, + {IV('ụ'), 'u', 0}, {IV('Ụ'), 'U', 0}, + {IV('ư'), 'u', 0}, {IV('Ư'), 'U', 0}, + {IV('ừ'), 'u', 0}, {IV('Ừ'), 'U', 0}, + {IV('ử'), 'u', 0}, {IV('Ử'), 'U', 0}, + {IV('ữ'), 'u', 0}, {IV('Ữ'), 'U', 0}, + {IV('ứ'), 'u', 0}, {IV('Ứ'), 'U', 0}, + {IV('ự'), 'u', 0}, {IV('Ự'), 'U', 0}, + {IV('y'), 'y', 0}, {IV('Y'), 'Y', 0}, + + #endif + + #if ENABLED(DISPLAY_CHARSET_ISO10646_GREEK) + + {IV('΄'), '\'', 0}, // 0384 + {IV('΅'), '\'', 0}, // 0385 + {IV('Ά'), 'A', 0}, // 0386 + {IV('·'), '.', 0}, // 0387 + {IV('Έ'), 'E', 0}, // 0388 + {IV('Ή'), 'H', 0}, // 0389 + {IV('Ί'), 'I', 0}, // 038A + {IV('Ό'), 'O', 0}, // 038C + {IV('Ύ'), 'Y', 0}, // 038E + {IV('Ώ'), 'O', 0}, // 038F + {IV('ΐ'), 'i', 0}, // 0390 + {IV('Α'), 'A', 0}, // 0391 + {IV('Β'), 'B', 0}, // 0392 + {IV('Γ'), 'T', 0}, // 0393, Gamma + {IV('Δ'), '4', 0}, // 0394, Delta, ◿ + {IV('Ε'), 'E', 0}, // 0395 + {IV('Ζ'), 'Z', 0}, // 0396 + {IV('Η'), 'H', 0}, // 0397 + {IV('Θ'), '0', 0}, // 0398, Theta + {IV('Ι'), 'I', 0}, // 0399 + {IV('Κ'), 'K', 0}, // 039A + {IV('Λ'), '^', 0}, // 039B, Lambda + {IV('Μ'), 'M', 0}, // 039C + {IV('Ν'), 'N', 0}, // 039D + {IV('Ξ'), '3', 0}, // 039E, Xi + {IV('Ο'), 'O', 0}, // 039F + {IV('Π'), 'n', 0}, // 03A0, Pi + {IV('Ρ'), 'P', 0}, // 03A1 + {IV('Σ'), 'E', 0}, // 03A3, Sigma + {IV('Τ'), 'T', 0}, // 03A4 + {IV('Υ'), 'Y', 0}, // 03A5, Upsilon + {IV('Φ'), 'p', 0}, // 03A6, Phi + {IV('Χ'), 'X', 0}, // 03A7 + {IV('Ψ'), 'P', 0}, // 03A8, Psi + {IV('Ω'), 'O', 0}, // 03A9, Omega + {IV('Ϊ'), 'I', 0}, // 03AA + {IV('Ϋ'), 'Y', 0}, // 03AB + {IV('ά'), 'a', 0}, // 03AC + {IV('έ'), 'e', 0}, // 03AD + {IV('ή'), 'n', 0}, // 03AE + {IV('ί'), 'i', 0}, // 03AF + {IV('ΰ'), 'v', 0}, // 03B0 + {IV('α'), 'a', 0}, // 03B1, alpha + {IV('β'), 'B', 0}, // 03B2, beta + {IV('γ'), 'v', 0}, // 03B3, gamma + {IV('δ'), 'd', 0}, // 03B4, delta + {IV('ε'), 'e', 0}, // 03B5, epsilon + {IV('ζ'), 'Z', 0}, // 03B6, zeta + {IV('η'), 'n', 0}, // 03B7, eta + {IV('θ'), '0', 0}, // 03B8, theta + {IV('ι'), 'i', 0}, // 03B9, lota + {IV('κ'), 'k', 0}, // 03BA, kappa + {IV('λ'), 'L', 0}, // 03BB, lambda + {IV('μ'), 'u', 0}, // 03BC, mu + {IV('ν'), 'v', 0}, // 03BD, nu + {IV('ξ'), 'e', 0}, // 03BE, xi + {IV('ο'), 'o', 0}, // 03BF + {IV('π'), 'n', 0}, // 03C0, pi + {IV('ρ'), 'p', 0}, // 03C1, rho + {IV('ς'), 'c', 0}, // 03C2 + {IV('σ'), 'o', 0}, // 03C3, sigma + {IV('τ'), 't', 0}, // 03C4, tau + {IV('υ'), 'v', 0}, // 03C5, upsilon + {IV('φ'), 'p', 0}, // 03C6 + {IV('χ'), 'X', 0}, // 03C7, chi + {IV('ψ'), 'W', 0}, // 03C8, psi + {IV('ω'), 'w', 0}, // 03C9, omega + {IV('ϊ'), 'i', 0}, // 03CA + {IV('ϋ'), 'v', 0}, // 03CB + {IV('ό'), 'o', 0}, // 03CC + {IV('ύ'), 'v', 0}, // 03CD + {IV('ώ'), 'w', 0}, // 03CE + + #endif + + #if ENABLED(DISPLAY_CHARSET_ISO10646_5) + // Map CYRILLIC code to plain ASCII + {IV('Ё'), 'E', 0}, // 0401 + {IV('А'), 'A', 0}, // 0410 + {IV('Б'), 'b', 0}, // 0411 + {IV('В'), 'B', 0}, // 0412 + {IV('Г'), 'T', 0}, // 0413 + {IV('Д'), 'Q', 0}, // 0414 + {IV('Е'), 'E', 0}, // 0415 + {IV('Ж'), '*', 0}, // 0416 + {IV('З'), 'E', 0}, // 0417 + {IV('И'), 'N', 0}, // 0418 + {IV('Й'), 'N', 0}, // 0419 + {IV('К'), 'K', 0}, // 041A + {IV('Л'), 'T', 0}, // 041B + {IV('М'), 'M', 0}, // 041C + {IV('Н'), 'H', 0}, // 041D + {IV('О'), 'O', 0}, // 041E + {IV('П'), 'n', 0}, // 041F + {IV('Р'), 'P', 0}, // 0420 + {IV('С'), 'C', 0}, // 0421 + {IV('Т'), 'T', 0}, // 0422 + {IV('У'), 'Y', 0}, + {IV('Ф'), 'o', 0}, + {IV('Х'), 'X', 0}, + {IV('Ц'), 'U', 0}, + {IV('Ч'), 'y', 0}, + {IV('Ш'), 'W', 0}, + {IV('Щ'), 'W', 0}, + {IV('Ъ'), 'b', 0}, + {IV('Ы'), 'b', '|'}, + {IV('Ь'), 'b'}, + {IV('Э'), 'e'}, + {IV('Ю'), '|', 'O'}, + {IV('Я'), '9', '|'}, // 042F + + {IV('а'), 'a', 0}, // 0430 + {IV('б'), '6', 0}, // 0431 + {IV('в'), 'B', 0}, // 0432, + {IV('г'), 'r', 0}, // 0433 + {IV('д'), 'a', 0}, // 0434, + {IV('е'), 'e', 0}, // 0435 + {IV('ж'), '*', 0}, // 0436 + {IV('з'), 'e', 0}, // 0437, + {IV('и'), 'u', 0}, // 0438 + {IV('й'), 'u', 0}, // 0439, + {IV('к'), 'k', 0}, // 043A + {IV('л'), 'n', 0}, + {IV('м'), 'm', 0}, + {IV('н'), 'H', 0}, + {IV('о'), 'o', 0}, + {IV('п'), 'n', 0}, + {IV('р'), 'p', 0}, + {IV('с'), 'c', 0}, + {IV('т'), 't', 0}, + {IV('у'), 'y', 0}, + {IV('ф'), 'q', 'p'}, + {IV('х'), 'x', 0}, + {IV('ц'), 'u', 0}, + {IV('ч'), 'y', 0}, + {IV('ш'), 'w', 0}, + {IV('щ'), 'w', 0}, + {IV('ъ'), 'b', 0}, + {IV('ы'), 'b', '|'}, + {IV('ь'), 'b', 0}, + {IV('э'), 'e', 0}, + {IV('ю'), '|', 'o'}, + {IV('я'), 'g', 0}, // 044F + {IV('ё'), 'e', 0}, // 0451 + #endif {IV('•'), '.', 0}, // 2022 · {IV('℞'), 'P', 'x'}, // 211E ℞ Pt ASCII 158 From b7a67f6f7416e016cf9e5970c09bafa1a732a5ce Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 23 Jan 2020 13:45:13 -0600 Subject: [PATCH 08/30] Extra debugging for leveling on/off --- Marlin/src/HAL/HAL_LPC1768/watchdog.cpp | 1 - Marlin/src/feature/bedlevel/bedlevel.cpp | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp index 6d0200e9f1e9..f9518cd25c82 100644 --- a/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/watchdog.cpp @@ -68,5 +68,4 @@ bool watchdog_timed_out() { return TEST(WDT_ReadTimeOutFlag(), 0); } void watchdog_clear_timeout_flag() { WDT_ClrTimeOutFlag(); } #endif // USE_WATCHDOG - #endif // TARGET_LPC1768 diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 0ec5c6bfb35a..547c6af0b32f 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -86,14 +86,18 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { #endif if (planner.leveling_active) { // leveling from on to off + if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling ON", current_position); // change unleveled current_position to physical current_position without moving steppers. planner.apply_leveling(current_position); planner.leveling_active = false; // disable only AFTER calling apply_leveling + if (DEBUGGING(LEVELING)) DEBUG_POS("...Now OFF", current_position); } else { // leveling from off to on + if (DEBUGGING(LEVELING)) DEBUG_POS("Leveling OFF", current_position); planner.leveling_active = true; // enable BEFORE calling unapply_leveling, otherwise ignored // change physical current_position to unleveled current_position without moving steppers. planner.unapply_leveling(current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("...Now ON", current_position); } sync_plan_position(); @@ -180,7 +184,7 @@ void reset_bed_level() { #endif for (uint8_t y = 0; y < sy; y++) { #ifdef SCAD_MESH_OUTPUT - SERIAL_ECHOPGM(" ["); // open sub-array + SERIAL_ECHOPGM(" ["); // open sub-array #else if (y < 10) SERIAL_CHAR(' '); SERIAL_ECHO(int(y)); @@ -207,13 +211,13 @@ void reset_bed_level() { #endif } #ifdef SCAD_MESH_OUTPUT - SERIAL_CHAR(' ', ']'); // close sub-array + SERIAL_CHAR(' ', ']'); // close sub-array if (y < sy - 1) SERIAL_CHAR(','); #endif SERIAL_EOL(); } #ifdef SCAD_MESH_OUTPUT - SERIAL_ECHOPGM("];"); // close 2D array + SERIAL_ECHOPGM("];"); // close 2D array #endif SERIAL_EOL(); } From 86c18ea6e0709a660e0fd9bcc30dcbbc9f39925e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 24 Jan 2020 23:15:49 -0600 Subject: [PATCH 09/30] Bring configs and drivers.h up to date --- Marlin/Configuration.h | 17 ++++++---- Marlin/Configuration_adv.h | 65 +++++++++++++++++++++++++++++++++++--- Marlin/src/core/drivers.h | 2 ++ 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c3847908cec9..355c782e86ba 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -143,7 +143,7 @@ // @section extruder // This defines the number of extruders -// :[1, 2, 3, 4, 5, 6] +// :[1, 2, 3, 4, 5, 6, 7, 8] #define EXTRUDERS 1 // Generally expected filament diameter (1.75, 2.85, 3.0, ...). Used for Volumetric, Filament Width Sensor, etc. @@ -412,6 +412,8 @@ #define TEMP_SENSOR_3 0 #define TEMP_SENSOR_4 0 #define TEMP_SENSOR_5 0 +#define TEMP_SENSOR_6 0 +#define TEMP_SENSOR_7 0 #define TEMP_SENSOR_BED 0 #define TEMP_SENSOR_PROBE 0 #define TEMP_SENSOR_CHAMBER 0 @@ -441,6 +443,8 @@ #define HEATER_3_MINTEMP 5 #define HEATER_4_MINTEMP 5 #define HEATER_5_MINTEMP 5 +#define HEATER_6_MINTEMP 5 +#define HEATER_7_MINTEMP 5 #define BED_MINTEMP 5 // Above this temperature the heater will be switched off. @@ -452,6 +456,8 @@ #define HEATER_3_MAXTEMP 275 #define HEATER_4_MAXTEMP 275 #define HEATER_5_MAXTEMP 275 +#define HEATER_6_MAXTEMP 275 +#define HEATER_7_MAXTEMP 275 #define BED_MAXTEMP 150 //=========================================================================== @@ -678,6 +684,8 @@ //#define E3_DRIVER_TYPE A4988 //#define E4_DRIVER_TYPE A4988 //#define E5_DRIVER_TYPE A4988 +//#define E6_DRIVER_TYPE A4988 +//#define E7_DRIVER_TYPE A4988 // Enable this feature if all enabled endstop pins are interrupt-capable. // This will remove the need to poll the interrupt pins, saving many CPU cycles. @@ -1044,6 +1052,8 @@ #define INVERT_E3_DIR false #define INVERT_E4_DIR false #define INVERT_E5_DIR false +#define INVERT_E6_DIR false +#define INVERT_E7_DIR false // @section homing @@ -1429,11 +1439,6 @@ #define DEFAULT_KEEPALIVE_INTERVAL 2 // Number of seconds between "busy" messages. Set with M113. #define BUSY_WHILE_HEATING // Some hosts require "busy" messages even during heating -// -// M100 Free Memory Watcher -// -//#define M100_FREE_MEMORY_WATCHER // Add M100 (Free Memory Watcher) to debug memory usage - // // G20/G21 Inch mode support // diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 53e98a49766f..7d453e1dae02 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -78,6 +78,18 @@ #define HOTEND5_BETA 3950 // Beta value #endif +#if TEMP_SENSOR_6 == 1000 + #define HOTEND6_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND6_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND6_BETA 3950 // Beta value +#endif + +#if TEMP_SENSOR_7 == 1000 + #define HOTEND7_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND7_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND7_BETA 3950 // Beta value +#endif + #if TEMP_SENSOR_BED == 1000 #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C @@ -185,8 +197,8 @@ /** * Heated chamber watch settings (M141/M191). */ - #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds - #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius + #define WATCH_CHAMBER_TEMP_PERIOD 60 // Seconds + #define WATCH_CHAMBER_TEMP_INCREASE 2 // Degrees Celsius #endif #if ENABLED(PIDTEMP) @@ -2076,6 +2088,20 @@ #define E5_CHAIN_POS -1 #endif + #if AXIS_IS_TMC(E6) + #define E6_CURRENT 800 + #define E6_MICROSTEPS 16 + #define E6_RSENSE 0.11 + #define E6_CHAIN_POS -1 + #endif + + #if AXIS_IS_TMC(E7) + #define E7_CURRENT 800 + #define E7_MICROSTEPS 16 + #define E7_RSENSE 0.11 + #define E7_CHAIN_POS -1 + #endif + /** * Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here. * The default pins can be found in your board's pins file. @@ -2093,6 +2119,8 @@ //#define E3_CS_PIN -1 //#define E4_CS_PIN -1 //#define E5_CS_PIN -1 + //#define E6_CS_PIN -1 + //#define E7_CS_PIN -1 /** * Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160). @@ -2130,6 +2158,8 @@ #define E3_SLAVE_ADDRESS 0 #define E4_SLAVE_ADDRESS 0 #define E5_SLAVE_ADDRESS 0 + #define E6_SLAVE_ADDRESS 0 + #define E7_SLAVE_ADDRESS 0 /** * Software enable @@ -2206,6 +2236,8 @@ #define E3_HYBRID_THRESHOLD 30 #define E4_HYBRID_THRESHOLD 30 #define E5_HYBRID_THRESHOLD 30 + #define E6_HYBRID_THRESHOLD 30 + #define E7_HYBRID_THRESHOLD 30 /** * Use StallGuard2 to home / probe X, Y, Z. @@ -2428,6 +2460,24 @@ #define E5_SLEW_RATE 1 #endif + #if AXIS_IS_L64XX(E6) + #define E6_MICROSTEPS 128 + #define E6_OVERCURRENT 2000 + #define E6_STALLCURRENT 1500 + #define E6_MAX_VOLTAGE 127 + #define E6_CHAIN_POS -1 + #define E6_SLEW_RATE 1 + #endif + + #if AXIS_IS_L64XX(E7) + #define E7_MICROSTEPS 128 + #define E7_OVERCURRENT 2000 + #define E7_STALLCURRENT 1500 + #define E7_MAX_VOLTAGE 127 + #define E7_CHAIN_POS -1 + #define E7_SLEW_RATE 1 + #endif + /** * Monitor L6470 drivers for error conditions like over temperature and over current. * In the case of over temperature Marlin can decrease the drive until the error condition clears. @@ -3013,9 +3063,14 @@ // @section develop -/** - * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins - */ +// +// M100 Free Memory Watcher to debug memory usage +// +//#define M100_FREE_MEMORY_WATCHER + +// +// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe +// //#define PINS_DEBUGGING // Enable Marlin dev mode which adds some special commands diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 0889e713f646..024cdedc9beb 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -72,6 +72,8 @@ #define AXIS_DRIVER_TYPE_E3(T) (E_STEPPERS > 3 && _AXIS_DRIVER_TYPE(E3,T)) #define AXIS_DRIVER_TYPE_E4(T) (E_STEPPERS > 4 && _AXIS_DRIVER_TYPE(E4,T)) #define AXIS_DRIVER_TYPE_E5(T) (E_STEPPERS > 5 && _AXIS_DRIVER_TYPE(E5,T)) +#define AXIS_DRIVER_TYPE_E6(T) (E_STEPPERS > 6 && _AXIS_DRIVER_TYPE(E6,T)) +#define AXIS_DRIVER_TYPE_E7(T) (E_STEPPERS > 7 && _AXIS_DRIVER_TYPE(E7,T)) #define AXIS_DRIVER_TYPE(A,T) AXIS_DRIVER_TYPE_##A(T) From 0d166f9c7dccbf5f1cc243f06e3882c82a4bd86a Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Sat, 25 Jan 2020 02:00:51 -0600 Subject: [PATCH 10/30] Duet Smart Effector support (#16641) --- Marlin/Configuration.h | 7 +++ Marlin/src/MarlinCore.cpp | 4 ++ Marlin/src/gcode/config/M672.cpp | 99 ++++++++++++++++++++++++++++++++ Marlin/src/gcode/gcode.cpp | 46 ++++++++------- Marlin/src/gcode/gcode.h | 7 ++- Marlin/src/pins/pinsDebug_list.h | 3 + 6 files changed, 144 insertions(+), 22 deletions(-) create mode 100644 Marlin/src/gcode/config/M672.cpp diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 355c782e86ba..7f242dce7967 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -915,6 +915,13 @@ #define Z_PROBE_RETRACT_X X_MAX_POS #endif +// Duet Smart Effector (for delta printers) - https://bit.ly/2ul5U7J +// When the pin is defined you can use M672 to set/reset the probe sensivity. +//#define DUET_SMART_EFFECTOR +#if ENABLED(DUET_SMART_EFFECTOR) + #define SMART_EFFECTOR_MOD_PIN -1 // Connect a GPIO pin to the Smart Effector MOD pin +#endif + // // For Z_PROBE_ALLEN_KEY see the Delta example configurations. // diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index a6bb262f8385..7ec6ffb488d2 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -827,6 +827,10 @@ void setup() { L64xxManager.init(); // Set up SPI, init drivers #endif + #if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) + OUT_WRITE(SMART_EFFECTOR_MOD_PIN, LOW); // Put Smart Effector into NORMAL mode + #endif + #if ENABLED(MAX7219_DEBUG) max7219.init(); #endif diff --git a/Marlin/src/gcode/config/M672.cpp b/Marlin/src/gcode/config/M672.cpp new file mode 100644 index 000000000000..ca4b028dc7da --- /dev/null +++ b/Marlin/src/gcode/config/M672.cpp @@ -0,0 +1,99 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) + +#include "../gcode.h" +#include "../../HAL/shared/Delay.h" +#include "../parser.h" + +/** + * M672 - Set/reset Duet Smart Effector sensitivity + * + * One of these is required: + * S - 0-255 + * R - Flag to reset sensitivity to default + */ + +/** + * The Marlin format for the M672 command is different than shown in the Duet Smart Effector + * documentation https://duet3d.dozuki.com/Wiki/Smart_effector_and_carriage_adapters_for_delta_printer + * + * To set custom sensitivity: + * Duet: M672 S105:aaa:bbb + * Marlin: M672 Saaa + * + * (where aaa is the desired sensitivity and bbb is 255 - aaa). + * + * Revert sensitivity to factory settings: + * Duet: M672 S105:131:131 + * Marlin: M672 R + */ + +#define M672_PROGBYTE 105 // magic byte to start programming custom sensitivity +#define M672_ERASEBYTE 131 // magic byte to clear custom sensitivity + +// +// Smart Effector byte send protocol: +// +// 0 0 1 0 ... always 0010 +// b7 b6 b5 b4 ~b4 ... hi bits, NOT last bit +// b3 b2 b1 b0 ~b0 ... lo bits, NOT last bit +// +void M672_send(uint8_t b) { // bit rate requirement: 1KHz +/- 30% + for (uint8_t bits = 0; bits < 14; bits++) { + switch (bits) { + default: { OUT_WRITE(SMART_EFFECTOR_MOD_PIN, !!(b & 0x80)); b <<= 1; break; } // send bit, shift next into place + case 7: + case 12: { OUT_WRITE(SMART_EFFECTOR_MOD_PIN, !!(b & 0x80)); break; } // send bit. no shift + case 8: + case 13: { OUT_WRITE(SMART_EFFECTOR_MOD_PIN, !(b & 0x80)); b <<= 1; break; } // send inverted previous bit + case 0: case 1: // 00 + case 3: { OUT_WRITE(SMART_EFFECTOR_MOD_PIN, LOW); break; } // 0010 + case 2: { OUT_WRITE(SMART_EFFECTOR_MOD_PIN, HIGH); break; } // 001 + } + DELAY_US(1000); + } +} + +void GcodeSuite::M672() { + if (parser.seen('R')) { + M672_send(M672_ERASEBYTE); + M672_send(M672_ERASEBYTE); + } + else if (parser.seenval('S')) { + const int8_t M672_sensitivity = parser.value_byte(); + M672_send(M672_PROGBYTE); + M672_send(M672_sensitivity); + M672_send(255 - M672_sensitivity); + } + else { + SERIAL_ECHO_MSG("!'S' or 'R' parameter required."); + return; + } + + OUT_WRITE(SMART_EFFECTOR_MOD_PIN, LOW); // Keep Smart Effector in NORMAL mode +} + +#endif // SMART_EFFECTOR && SMART_EFFECTOR_MOD_PIN diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 8260db20a68d..7ff86f3149b1 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -562,14 +562,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 206: M206(); break; // M206: Set home offsets #endif - #if ENABLED(DELTA) - case 665: M665(); break; // M665: Set delta configurations - #endif - - #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS - case 666: M666(); break; // M666: Set delta or multiple endstop adjustment - #endif - #if ENABLED(FWRETRACT) case 207: M207(); break; // M207: Set Retract Length, Feedrate, and Z lift case 208: M208(); break; // M208: Set Recover (unretract) Additional Length and Feedrate @@ -714,7 +706,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #if ENABLED(SDSUPPORT) - case 524: M524(); break; // M524: Abort the current SD print job + case 524: M524(); break; // M524: Abort the current SD print job #endif #if ENABLED(SD_ABORT_ON_ENDSTOP_HIT) @@ -725,14 +717,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 575: M575(); break; // M575: Set serial baudrate #endif - #if HAS_BED_PROBE - case 851: M851(); break; // M851: Set Z Probe Z Offset - #endif - - #if ENABLED(SKEW_CORRECTION_GCODE) - case 852: M852(); break; // M852: Set Skew factors - #endif - #if ENABLED(ADVANCED_PAUSE_FEATURE) case 600: M600(); break; // M600: Pause for Filament Change case 603: M603(); break; // M603: Configure Filament Change @@ -742,21 +726,37 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 605: M605(); break; // M605: Set Dual X Carriage movement mode #endif + #if ENABLED(DELTA) + case 665: M665(); break; // M665: Set delta configurations + #endif + + #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS + case 666: M666(); break; // M666: Set delta or multiple endstop adjustment + #endif + + #if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) + case 672: M672(); break; // M672: Set/clear Duet Smart Effector sensitivity + #endif + #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) case 701: M701(); break; // M701: Load Filament case 702: M702(); break; // M702: Unload Filament #endif - #if ENABLED(MAX7219_GCODE) - case 7219: M7219(); break; // M7219: Set LEDs, columns, and rows - #endif - #if ENABLED(GCODE_MACROS) case 810: case 811: case 812: case 813: case 814: case 815: case 816: case 817: case 818: case 819: M810_819(); break; // M810-M819: Define/execute G-code macro #endif + #if HAS_BED_PROBE + case 851: M851(); break; // M851: Set Z Probe Z Offset + #endif + + #if ENABLED(SKEW_CORRECTION_GCODE) + case 852: M852(); break; // M852: Set Skew factors + #endif + #if ENABLED(PROBE_TEMP_COMPENSATION) case 871: M871(); break; // M871: Print/reset/clear first layer temperature offset values #endif @@ -847,6 +847,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 1000: M1000(); break; // M1000: Resume from power-loss #endif + #if ENABLED(MAX7219_GCODE) + case 7219: M7219(); break; // M7219: Set LEDs, columns, and rows + #endif + default: parser.unknown_command_error(); break; } break; diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 0fbfbfc4043f..f7111c6eeca9 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -228,7 +228,8 @@ * M603 - Configure filament change: "M603 T U L". (Requires ADVANCED_PAUSE_FEATURE) * M605 - Set Dual X-Carriage movement mode: "M605 S [X] [R]". (Requires DUAL_X_CARRIAGE) * M665 - Set delta configurations: "M665 H L R S B X Y Z (Requires DELTA) - * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS). + * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops. (Requires [XYZ]_DUAL_ENDSTOPS) + * M672 - Set/Reset Duet Smart Effector's sensitivity. (Requires SMART_EFFECTOR and SMART_EFFECTOR_MOD_PIN) * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M702 - Unload filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) * M810-M819 - Define/execute a G-code macro (Requires GCODE_MACROS) @@ -850,6 +851,10 @@ class GcodeSuite { static void M666(); #endif + #if ENABLED(SMART_EFFECTOR) && PIN_EXISTS(SMART_EFFECTOR_MOD) + static void M672(); + #endif + #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) static void M701(); static void M702(); diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 7de2bad35a03..771ca3da0936 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -1488,3 +1488,6 @@ #if PIN_EXISTS(TOUCH_INT) REPORT_NAME_DIGITAL(__LINE__, TOUCH_INT_PIN) #endif +#if PIN_EXISTS(SMART_EFFECTOR_MOD) + REPORT_NAME_DIGITAL(__LINE__, SMART_EFFECTOR_MOD_PIN) +#endif From 248b7dfa591a34a8aa1c6960944e1a3a468ad1de Mon Sep 17 00:00:00 2001 From: yangwenxiong <46896566+yangwenxiong@users.noreply.github.com> Date: Sat, 25 Jan 2020 16:13:39 +0800 Subject: [PATCH 11/30] BigTreeTech GTR V1.0 / Support 8 extruders, heaters, temp sensors, fans (#16595) --- Marlin/src/HAL/HAL_AVR/fastio.h | 19 +- Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h | 4 + Marlin/src/HAL/HAL_SAMD51/HAL.cpp | 50 ++- Marlin/src/HAL/HAL_STM32F1/HAL.cpp | 18 + Marlin/src/core/drivers.h | 6 +- Marlin/src/core/language.h | 6 + Marlin/src/core/types.h | 6 +- Marlin/src/gcode/control/M42.cpp | 33 +- .../src/gcode/feature/trinamic/M911-M914.cpp | 26 +- Marlin/src/inc/Conditionals_adv.h | 2 + Marlin/src/inc/Conditionals_post.h | 108 ++++- Marlin/src/inc/SanityCheck.h | 104 ++++- Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp | 15 + Marlin/src/lcd/extensible_ui/ui_api.cpp | 4 +- Marlin/src/lcd/extensible_ui/ui_api.h | 2 +- Marlin/src/lcd/language/language_an.h | 2 +- Marlin/src/lcd/language/language_bg.h | 2 +- Marlin/src/lcd/language/language_ca.h | 2 +- Marlin/src/lcd/language/language_cz.h | 6 +- Marlin/src/lcd/language/language_da.h | 2 +- Marlin/src/lcd/language/language_el.h | 2 +- Marlin/src/lcd/language/language_el_gr.h | 2 +- Marlin/src/lcd/language/language_en.h | 6 +- Marlin/src/lcd/language/language_es.h | 4 +- Marlin/src/lcd/language/language_eu.h | 4 +- Marlin/src/lcd/language/language_fi.h | 2 +- Marlin/src/lcd/language/language_fr.h | 6 +- Marlin/src/lcd/language/language_it.h | 6 +- Marlin/src/lcd/language/language_ko_KR.h | 4 +- Marlin/src/lcd/language/language_nl.h | 2 +- Marlin/src/lcd/language/language_pl.h | 4 +- Marlin/src/lcd/language/language_pt.h | 2 +- Marlin/src/lcd/language/language_pt_br.h | 4 +- Marlin/src/lcd/language/language_sk.h | 4 +- Marlin/src/lcd/language/language_tr.h | 4 +- Marlin/src/lcd/language/language_uk.h | 2 +- Marlin/src/lcd/language/language_vi.h | 4 +- Marlin/src/lcd/language/language_zh_CN.h | 4 +- Marlin/src/lcd/language/language_zh_TW.h | 4 +- Marlin/src/lcd/menu/menu.h | 2 +- Marlin/src/lcd/menu/menu_advanced.cpp | 12 + Marlin/src/lcd/menu/menu_info.cpp | 18 + Marlin/src/lcd/menu/menu_temperature.cpp | 77 +++- Marlin/src/lcd/menu/menu_tmc.cpp | 18 + Marlin/src/lcd/menu/menu_tune.cpp | 75 +++- Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 4 +- Marlin/src/libs/L64XX/L64XX_Marlin.h | 2 +- Marlin/src/libs/softspi.h | 7 +- Marlin/src/module/configuration_store.cpp | 44 ++ Marlin/src/module/endstops.cpp | 14 +- Marlin/src/module/planner.cpp | 16 +- Marlin/src/module/stepper.cpp | 104 ++++- Marlin/src/module/stepper/L64xx.h | 34 ++ Marlin/src/module/stepper/TMC26X.h | 16 + Marlin/src/module/stepper/indirection.h | 266 +++++++++++- Marlin/src/module/stepper/trinamic.cpp | 40 ++ Marlin/src/module/stepper/trinamic.h | 28 ++ Marlin/src/module/temperature.cpp | 182 +++++++- Marlin/src/module/temperature.h | 6 + Marlin/src/module/thermistor/thermistors.h | 41 +- Marlin/src/pins/pins.h | 70 ++++ Marlin/src/pins/pinsDebug_list.h | 153 +++++++ Marlin/src/pins/sensitive_pins.h | 104 ++++- Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h | 391 ++++++++++++++++++ .../BIGTREE_SKR_PRO_1v1/PeripheralPins.c | 49 ++- platformio.ini | 33 +- 66 files changed, 2081 insertions(+), 212 deletions(-) create mode 100644 Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h diff --git a/Marlin/src/HAL/HAL_AVR/fastio.h b/Marlin/src/HAL/HAL_AVR/fastio.h index 501a7cdf0616..a36bf468a099 100644 --- a/Marlin/src/HAL/HAL_AVR/fastio.h +++ b/Marlin/src/HAL/HAL_AVR/fastio.h @@ -279,14 +279,25 @@ enum ClockSource2 : char { */ // Determine which harware PWMs are already in use +#define _PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == E6_AUTO_FAN_PIN || P == E7_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN) #if PIN_EXISTS(CONTROLLER_FAN) - #define PWM_CHK_FAN_B(P) (P == CONTROLLER_FAN_PIN || P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN) + #define PWM_CHK_FAN_B(P) (_PWM_CHK_FAN_B(P) || P == CONTROLLER_FAN_PIN) #else - #define PWM_CHK_FAN_B(P) (P == E0_AUTO_FAN_PIN || P == E1_AUTO_FAN_PIN || P == E2_AUTO_FAN_PIN || P == E3_AUTO_FAN_PIN || P == E4_AUTO_FAN_PIN || P == E5_AUTO_FAN_PIN || P == CHAMBER_AUTO_FAN_PIN) + #define PWM_CHK_FAN_B(P) _PWM_CHK_FAN_B(P) #endif -#if ANY_PIN(FAN, FAN1, FAN2) - #if PIN_EXISTS(FAN2) +#if ANY_PIN(FAN, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7) + #if PIN_EXISTS(FAN7) + #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN || P == FAN6_PIN || P == FAN7_PIN) + #elif PIN_EXISTS(FAN6) + #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN || P == FAN6_PIN) + #elif PIN_EXISTS(FAN5) + #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN || P == FAN5_PIN) + #elif PIN_EXISTS(FAN4) + #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN || P == FAN4_PIN) + #elif PIN_EXISTS(FAN3) + #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN || P == FAN3_PIN) + #elif PIN_EXISTS(FAN2) #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN || P == FAN2_PIN) #elif PIN_EXISTS(FAN1) #define PWM_CHK_FAN_A(P) (P == FAN0_PIN || P == FAN1_PIN) diff --git a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h index b32b05eac0ff..ffc70b3452d8 100644 --- a/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h +++ b/Marlin/src/HAL/HAL_LPC1768/inc/SanityCheck.h @@ -46,6 +46,10 @@ #error "TEMP_4_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." #elif _OLD_TEMP_PIN(TEMP_5) #error "TEMP_5_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_6) + #error "TEMP_6_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." +#elif _OLD_TEMP_PIN(TEMP_7) + #error "TEMP_7_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)." #endif #undef _OLD_TEMP_PIN diff --git a/Marlin/src/HAL/HAL_SAMD51/HAL.cpp b/Marlin/src/HAL/HAL_SAMD51/HAL.cpp index b5b62076e87b..6074e4bbd615 100644 --- a/Marlin/src/HAL/HAL_SAMD51/HAL.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/HAL.cpp @@ -59,6 +59,16 @@ #else #define GET_TEMP_5_ADC() -1 #endif +#if HAS_TEMP_ADC_6 + #define GET_TEMP_6_ADC() PIN_TO_ADC(TEMP_6_PIN) +#else + #define GET_TEMP_6_ADC() -1 +#endif +#if HAS_TEMP_ADC_7 + #define GET_TEMP_7_ADC() PIN_TO_ADC(TEMP_7_PIN) +#else + #define GET_TEMP_7_ADC() -1 +#endif #if HAS_TEMP_PROBE #define GET_PROBE_ADC() PIN_TO_ADC(TEMP_PROBE_PIN) #else @@ -85,13 +95,15 @@ #define GET_BUTTONS_ADC() -1 #endif -#define IS_ADC_REQUIRED(n) (GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n \ - || GET_TEMP_3_ADC() == n || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n \ - || GET_PROBE_ADC() == n \ - || GET_BED_ADC() == n \ - || GET_CHAMBER_ADC() == n \ - || GET_FILAMENT_WIDTH_ADC() == n \ - || GET_BUTTONS_ADC() == n) +#define IS_ADC_REQUIRED(n) ( \ + GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n || GET_TEMP_3_ADC() == n \ + || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n || GET_TEMP_6_ADC() == n || GET_TEMP_7_ADC() == n \ + || GET_PROBE_ADC() == n \ + || GET_BED_ADC() == n \ + || GET_CHAMBER_ADC() == n \ + || GET_FILAMENT_WIDTH_ADC() == n \ + || GET_BUTTONS_ADC() == n \ +) #define ADC0_IS_REQUIRED IS_ADC_REQUIRED(0) #define ADC1_IS_REQUIRED IS_ADC_REQUIRED(1) @@ -151,6 +163,12 @@ uint16_t HAL_adc_result; #if GET_TEMP_5_ADC() == 0 TEMP_5_PIN, #endif + #if GET_TEMP_6_ADC() == 0 + TEMP_6_PIN, + #endif + #if GET_TEMP_7_ADC() == 0 + TEMP_7_PIN, + #endif #if GET_PROBE_ADC() == 0 TEMP_PROBE_PIN, #endif @@ -185,6 +203,12 @@ uint16_t HAL_adc_result; #if GET_TEMP_5_ADC() == 1 TEMP_5_PIN, #endif + #if GET_TEMP_6_ADC() == 1 + TEMP_6_PIN, + #endif + #if GET_TEMP_7_ADC() == 1 + TEMP_7_PIN, + #endif #if GET_PROBE_ADC() == 1 TEMP_PROBE_PIN, #endif @@ -227,6 +251,12 @@ uint16_t HAL_adc_result; #if GET_TEMP_5_ADC() == 0 { PIN_TO_INPUTCTRL(TEMP_5_PIN) }, #endif + #if GET_TEMP_6_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_6_PIN) }, + #endif + #if GET_TEMP_7_ADC() == 0 + { PIN_TO_INPUTCTRL(TEMP_7_PIN) }, + #endif #if GET_PROBE_ADC() == 0 { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) }, #endif @@ -270,6 +300,12 @@ uint16_t HAL_adc_result; #if GET_TEMP_5_ADC() == 1 { PIN_TO_INPUTCTRL(TEMP_5_PIN) }, #endif + #if GET_TEMP_6_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_6_PIN) }, + #endif + #if GET_TEMP_7_ADC() == 1 + { PIN_TO_INPUTCTRL(TEMP_7_PIN) }, + #endif #if GET_PROBE_ADC() == 1 { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) }, #endif diff --git a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp index 9dcb77ae4f14..0db0371caee2 100644 --- a/Marlin/src/HAL/HAL_STM32F1/HAL.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/HAL.cpp @@ -118,6 +118,12 @@ const uint8_t adc_pins[] = { #if HAS_TEMP_ADC_5 TEMP_5_PIN, #endif + #if HAS_TEMP_ADC_6 + TEMP_6_PIN, + #endif + #if HAS_TEMP_ADC_7 + TEMP_7_PIN, + #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH_PIN, #endif @@ -160,6 +166,12 @@ enum TEMP_PINS : char { #if HAS_TEMP_ADC_5 TEMP_5, #endif + #if HAS_TEMP_ADC_6 + TEMP_6, + #endif + #if HAS_TEMP_ADC_7 + TEMP_7, + #endif #if ENABLED(FILAMENT_WIDTH_SENSOR) FILWIDTH, #endif @@ -346,6 +358,12 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) { #if HAS_TEMP_ADC_5 case TEMP_5_PIN: pin_index = TEMP_5; break; #endif + #if HAS_TEMP_ADC_6 + case TEMP_6_PIN: pin_index = TEMP_6; break; + #endif + #if HAS_TEMP_ADC_7 + case TEMP_7_PIN: pin_index = TEMP_7; break; + #endif #if HAS_JOY_ADC_X case JOY_X_PIN: pin_index = JOY_X; break; #endif diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 024cdedc9beb..a89578f529bc 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -79,7 +79,8 @@ #define HAS_E_DRIVER(T) ( AXIS_DRIVER_TYPE_E0(T) || AXIS_DRIVER_TYPE_E1(T) \ || AXIS_DRIVER_TYPE_E2(T) || AXIS_DRIVER_TYPE_E3(T) \ - || AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) ) + || AXIS_DRIVER_TYPE_E4(T) || AXIS_DRIVER_TYPE_E5(T) \ + || AXIS_DRIVER_TYPE_E6(T) || AXIS_DRIVER_TYPE_E7(T) ) #define HAS_DRIVER(T) ( AXIS_DRIVER_TYPE_X(T) || AXIS_DRIVER_TYPE_X2(T) \ || AXIS_DRIVER_TYPE_Y(T) || AXIS_DRIVER_TYPE_Y2(T) \ @@ -152,7 +153,8 @@ || AXIS_HAS_##T(Z3) \ || AXIS_HAS_##T(E0) || AXIS_HAS_##T(E1) \ || AXIS_HAS_##T(E2) || AXIS_HAS_##T(E3) \ - || AXIS_HAS_##T(E4) || AXIS_HAS_##T(E5) ) + || AXIS_HAS_##T(E4) || AXIS_HAS_##T(E5) \ + || AXIS_HAS_##T(E6) || AXIS_HAS_##T(E7) ) #define HAS_STEALTHCHOP ANY_AXIS_HAS(STEALTHCHOP) #define HAS_STALLGUARD ANY_AXIS_HAS(STALLGUARD) diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index e7841ae4519c..fe279bae8947 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -359,6 +359,8 @@ #define LCD_STR_N3 "3" #define LCD_STR_N4 "4" #define LCD_STR_N5 "5" + #define LCD_STR_N6 "6" + #define LCD_STR_N7 "7" #else #define LCD_FIRST_TOOL '1' #define LCD_STR_N0 "1" @@ -367,6 +369,8 @@ #define LCD_STR_N3 "4" #define LCD_STR_N4 "5" #define LCD_STR_N5 "6" + #define LCD_STR_N6 "7" + #define LCD_STR_N7 "8" #endif #define LCD_STR_E0 "E" LCD_STR_N0 @@ -375,6 +379,8 @@ #define LCD_STR_E3 "E" LCD_STR_N3 #define LCD_STR_E4 "E" LCD_STR_N4 #define LCD_STR_E5 "E" LCD_STR_N5 +#define LCD_STR_E6 "E" LCD_STR_N6 +#define LCD_STR_E7 "E" LCD_STR_N7 #include "multi_language.h" // Allow multiple languages diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 72578faaaf27..97ce5af5ee64 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -43,11 +43,7 @@ enum AxisEnum : uint8_t { E_AXIS = 3, X_HEAD = 4, Y_HEAD = 5, Z_HEAD = 6, E0_AXIS = 3, - E1_AXIS = 4, - E2_AXIS = 5, - E3_AXIS = 6, - E4_AXIS = 7, - E5_AXIS = 8, + E1_AXIS, E2_AXIS, E3_AXIS, E4_AXIS, E5_AXIS, E6_AXIS, E7_AXIS, ALL_AXES = 0xFE, NO_AXIS = 0xFF }; diff --git a/Marlin/src/gcode/control/M42.cpp b/Marlin/src/gcode/control/M42.cpp index 1e6145f5b5d0..1ee03f890538 100644 --- a/Marlin/src/gcode/control/M42.cpp +++ b/Marlin/src/gcode/control/M42.cpp @@ -47,23 +47,38 @@ void GcodeSuite::M42() { const pin_t pin = GET_PIN_MAP_PIN(pin_index); - if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err(); - - pinMode(pin, OUTPUT); - extDigitalWrite(pin, pin_status); - analogWrite(pin, pin_status); - #if FAN_COUNT > 0 switch (pin) { #if HAS_FAN0 - case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; break; + case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; return; #endif #if HAS_FAN1 - case FAN1_PIN: thermalManager.fan_speed[1] = pin_status; break; + case FAN1_PIN: thermalManager.fan_speed[1] = pin_status; return; #endif #if HAS_FAN2 - case FAN2_PIN: thermalManager.fan_speed[2] = pin_status; break; + case FAN2_PIN: thermalManager.fan_speed[2] = pin_status; return; + #endif + #if HAS_FAN3 + case FAN3_PIN: thermalManager.fan_speed[3] = pin_status; return; + #endif + #if HAS_FAN4 + case FAN4_PIN: thermalManager.fan_speed[4] = pin_status; return; + #endif + #if HAS_FAN5 + case FAN5_PIN: thermalManager.fan_speed[5] = pin_status; return; + #endif + #if HAS_FAN6 + case FAN6_PIN: thermalManager.fan_speed[6] = pin_status; return; + #endif + #if HAS_FAN7 + case FAN7_PIN: thermalManager.fan_speed[7] = pin_status; return; #endif } #endif + + if (!parser.boolval('I') && pin_is_protected(pin)) return protected_pin_err(); + + pinMode(pin, OUTPUT); + extDigitalWrite(pin, pin_status); + analogWrite(pin, pin_status); } diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index f23bfbeaefaf..578deac844f1 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -38,7 +38,7 @@ #define M91x_SOME_X (M91x_USE(X) || M91x_USE(X2)) #define M91x_SOME_Y (M91x_USE(Y) || M91x_USE(Y2)) #define M91x_SOME_Z (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4)) - #define M91x_SOME_E (M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5)) + #define M91x_SOME_E (M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5) || M91x_USE_E(6) || M91x_USE_E(7)) #if !M91x_SOME_X && !M91x_SOME_Y && !M91x_SOME_Z && !M91x_SOME_E #error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160." @@ -91,6 +91,12 @@ #if M91x_USE_E(5) tmc_report_otpw(stepperE5); #endif + #if M91x_USE_E(6) + tmc_report_otpw(stepperE6); + #endif + #if M91x_USE_E(7) + tmc_report_otpw(stepperE7); + #endif } /** @@ -188,6 +194,12 @@ #if M91x_USE_E(5) if (hasNone || eval == 5 || (hasE && eval < 0)) tmc_clear_otpw(stepperE5); #endif + #if M91x_USE_E(6) + if (hasNone || eval == 6 || (hasE && eval < 0)) tmc_clear_otpw(stepperE6); + #endif + #if M91x_USE_E(7) + if (hasNone || eval == 7 || (hasE && eval < 0)) tmc_clear_otpw(stepperE7); + #endif #endif } @@ -263,6 +275,12 @@ #if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5) case 5: TMC_SET_PWMTHRS_E(5); break; #endif + #if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6) + case 6: TMC_SET_PWMTHRS_E(6); break; + #endif + #if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7) + case 7: TMC_SET_PWMTHRS_E(7); break; + #endif } #endif // E_STEPPERS } break; @@ -312,6 +330,12 @@ #if E_STEPPERS > 5 && AXIS_HAS_STEALTHCHOP(E5) TMC_SAY_PWMTHRS_E(5); #endif + #if E_STEPPERS > 6 && AXIS_HAS_STEALTHCHOP(E6) + TMC_SAY_PWMTHRS_E(6); + #endif + #if E_STEPPERS > 7 && AXIS_HAS_STEALTHCHOP(E7) + TMC_SAY_PWMTHRS_E(7); + #endif } } #endif // HYBRID_THRESHOLD diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 4e0fe843907b..00be08433d08 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -34,6 +34,8 @@ #undef TEMP_SENSOR_3 #undef TEMP_SENSOR_4 #undef TEMP_SENSOR_5 + #undef TEMP_SENSOR_6 + #undef TEMP_SENSOR_7 #undef FWRETRACT #undef PIDTEMP #undef AUTOTEMP diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 02e20cdd6eaf..1a2c39ec2588 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -341,7 +341,7 @@ * Temp Sensor defines */ -#define ANY_TEMP_SENSOR_IS(n) (TEMP_SENSOR_0 == (n) || TEMP_SENSOR_1 == (n) || TEMP_SENSOR_2 == (n) || TEMP_SENSOR_3 == (n) || TEMP_SENSOR_4 == (n) || TEMP_SENSOR_5 == (n) || TEMP_SENSOR_BED == (n) || TEMP_SENSOR_PROBE == (n) || TEMP_SENSOR_CHAMBER == (n)) +#define ANY_TEMP_SENSOR_IS(n) (TEMP_SENSOR_0 == (n) || TEMP_SENSOR_1 == (n) || TEMP_SENSOR_2 == (n) || TEMP_SENSOR_3 == (n) || TEMP_SENSOR_4 == (n) || TEMP_SENSOR_5 == (n) || TEMP_SENSOR_6 == (n) || TEMP_SENSOR_7 == (n) || TEMP_SENSOR_BED == (n) || TEMP_SENSOR_PROBE == (n) || TEMP_SENSOR_CHAMBER == (n)) #define HAS_USER_THERMISTORS ANY_TEMP_SENSOR_IS(1000) @@ -483,6 +483,44 @@ #undef HEATER_5_MAXTEMP #endif +#if TEMP_SENSOR_6 == -4 + #define HEATER_6_USES_AD8495 +#elif TEMP_SENSOR_6 == -3 + #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_6." +#elif TEMP_SENSOR_6 == -2 + #error "MAX6675 Thermocouples (-2) not supported for TEMP_SENSOR_6." +#elif TEMP_SENSOR_6 == -1 + #define HEATER_6_USES_AD595 +#elif TEMP_SENSOR_6 > 0 + #define THERMISTOR_HEATER_6 TEMP_SENSOR_6 + #define HEATER_6_USES_THERMISTOR + #if TEMP_SENSOR_6 == 1000 + #define HEATER_6_USER_THERMISTOR + #endif +#else + #undef HEATER_6_MINTEMP + #undef HEATER_6_MAXTEMP +#endif + +#if TEMP_SENSOR_7 == -4 + #define HEATER_7_USES_AD8495 +#elif TEMP_SENSOR_7 == -3 + #error "MAX31855 Thermocouples (-3) not supported for TEMP_SENSOR_7." +#elif TEMP_SENSOR_7 == -2 + #error "MAX7775 Thermocouples (-2) not supported for TEMP_SENSOR_7." +#elif TEMP_SENSOR_7 == -1 + #define HEATER_7_USES_AD595 +#elif TEMP_SENSOR_7 > 0 + #define THERMISTOR_HEATER_7 TEMP_SENSOR_7 + #define HEATER_7_USES_THERMISTOR + #if TEMP_SENSOR_7 == 1000 + #define HEATER_7_USER_THERMISTOR + #endif +#else + #undef HEATER_7_MINTEMP + #undef HEATER_7_MAXTEMP +#endif + #if TEMP_SENSOR_BED == -4 #define HEATER_BED_USES_AD8495 #elif TEMP_SENSOR_BED == -3 @@ -538,8 +576,8 @@ #endif #define HOTEND_USES_THERMISTOR ANY( \ - HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, \ - HEATER_3_USES_THERMISTOR, HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR) + HEATER_0_USES_THERMISTOR, HEATER_1_USES_THERMISTOR, HEATER_2_USES_THERMISTOR, HEATER_3_USES_THERMISTOR, \ + HEATER_4_USES_THERMISTOR, HEATER_5_USES_THERMISTOR, HEATER_6_USES_THERMISTOR, HEATER_7_USES_THERMISTOR ) /** * Default hotend offsets, if not defined @@ -1025,6 +1063,18 @@ #define HAS_E5_MICROSTEPS (PIN_EXISTS(E5_MS1)) #define HAS_SOLENOID_5 (PIN_EXISTS(SOL5)) +#define HAS_E6_ENABLE (PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6))) +#define HAS_E6_DIR (PIN_EXISTS(E6_DIR)) +#define HAS_E6_STEP (PIN_EXISTS(E6_STEP)) +#define HAS_E6_MICROSTEPS (PIN_EXISTS(E6_MS1)) +#define HAS_SOLENOID_6 (PIN_EXISTS(SOL6)) + +#define HAS_E7_ENABLE (PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7))) +#define HAS_E7_DIR (PIN_EXISTS(E7_DIR)) +#define HAS_E7_STEP (PIN_EXISTS(E7_STEP)) +#define HAS_E7_MICROSTEPS (PIN_EXISTS(E7_MS1)) +#define HAS_SOLENOID_7 (PIN_EXISTS(SOL7)) + // Trinamic Stepper Drivers #if HAS_TRINAMIC #define STEALTHCHOP_ENABLED ANY(STEALTHCHOP_XY, STEALTHCHOP_Z, STEALTHCHOP_E) @@ -1095,6 +1145,8 @@ #define HAS_TEMP_ADC_3 HAS_ADC_TEST(3) #define HAS_TEMP_ADC_4 HAS_ADC_TEST(4) #define HAS_TEMP_ADC_5 HAS_ADC_TEST(5) +#define HAS_TEMP_ADC_6 HAS_ADC_TEST(6) +#define HAS_TEMP_ADC_7 HAS_ADC_TEST(7) #define HAS_TEMP_ADC_BED HAS_ADC_TEST(BED) #define HAS_TEMP_ADC_PROBE HAS_ADC_TEST(PROBE) #define HAS_TEMP_ADC_CHAMBER HAS_ADC_TEST(CHAMBER) @@ -1118,6 +1170,8 @@ #define HAS_HEATER_3 (PIN_EXISTS(HEATER_3)) #define HAS_HEATER_4 (PIN_EXISTS(HEATER_4)) #define HAS_HEATER_5 (PIN_EXISTS(HEATER_5)) +#define HAS_HEATER_6 (PIN_EXISTS(HEATER_6)) +#define HAS_HEATER_7 (PIN_EXISTS(HEATER_7)) #define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED)) // Shorthand for common combinations @@ -1146,12 +1200,14 @@ #define HAS_AUTO_FAN_3 (HOTENDS > 3 && PIN_EXISTS(E3_AUTO_FAN)) #define HAS_AUTO_FAN_4 (HOTENDS > 4 && PIN_EXISTS(E4_AUTO_FAN)) #define HAS_AUTO_FAN_5 (HOTENDS > 5 && PIN_EXISTS(E5_AUTO_FAN)) +#define HAS_AUTO_FAN_6 (HOTENDS > 6 && PIN_EXISTS(E6_AUTO_FAN)) +#define HAS_AUTO_FAN_7 (HOTENDS > 7 && PIN_EXISTS(E7_AUTO_FAN)) #define HAS_AUTO_CHAMBER_FAN (HAS_TEMP_CHAMBER && PIN_EXISTS(CHAMBER_AUTO_FAN)) -#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 || HAS_AUTO_FAN_4 || HAS_AUTO_FAN_5 || HAS_AUTO_CHAMBER_FAN) +#define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3 || HAS_AUTO_FAN_4 || HAS_AUTO_FAN_5 || HAS_AUTO_FAN_6 || HAS_AUTO_FAN_7 || HAS_AUTO_CHAMBER_FAN) #define _FANOVERLAP(A,B) (A##_AUTO_FAN_PIN == E##B##_AUTO_FAN_PIN) #if HAS_AUTO_FAN - #define AUTO_CHAMBER_IS_E (_FANOVERLAP(CHAMBER,0) || _FANOVERLAP(CHAMBER,1) || _FANOVERLAP(CHAMBER,2) || _FANOVERLAP(CHAMBER,3) || _FANOVERLAP(CHAMBER,4) || _FANOVERLAP(CHAMBER,5)) + #define AUTO_CHAMBER_IS_E (_FANOVERLAP(CHAMBER,0) || _FANOVERLAP(CHAMBER,1) || _FANOVERLAP(CHAMBER,2) || _FANOVERLAP(CHAMBER,3) || _FANOVERLAP(CHAMBER,4) || _FANOVERLAP(CHAMBER,5) || _FANOVERLAP(CHAMBER,6) || _FANOVERLAP(CHAMBER,7)) #endif #if !HAS_TEMP_SENSOR @@ -1164,8 +1220,14 @@ // Other fans #define HAS_FAN0 (PIN_EXISTS(FAN)) -#define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLER_FAN_PIN != FAN1_PIN && E0_AUTO_FAN_PIN != FAN1_PIN && E1_AUTO_FAN_PIN != FAN1_PIN && E2_AUTO_FAN_PIN != FAN1_PIN && E3_AUTO_FAN_PIN != FAN1_PIN && E4_AUTO_FAN_PIN != FAN1_PIN && E5_AUTO_FAN_PIN != FAN1_PIN) -#define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLER_FAN_PIN != FAN2_PIN && E0_AUTO_FAN_PIN != FAN2_PIN && E1_AUTO_FAN_PIN != FAN2_PIN && E2_AUTO_FAN_PIN != FAN2_PIN && E3_AUTO_FAN_PIN != FAN2_PIN && E4_AUTO_FAN_PIN != FAN2_PIN && E5_AUTO_FAN_PIN != FAN2_PIN) +#define _HAS_FAN(P) (PIN_EXISTS(FAN_##P) && CONTROLLER_FAN_PIN != FAN_##P##_PIN && E0_AUTO_FAN_PIN != FAN_##P##_PIN && E1_AUTO_FAN_PIN != FAN_##P##_PIN && E2_AUTO_FAN_PIN != FAN_##P##_PIN && E3_AUTO_FAN_PIN != FAN_##P##_PIN && E4_AUTO_FAN_PIN != FAN_##P##_PIN && E5_AUTO_FAN_PIN != FAN_##P##_PIN && E6_AUTO_FAN_PIN != FAN_##P##_PIN && E7_AUTO_FAN_PIN != FAN_##P##_PIN) +#define HAS_FAN1 _HAS_FAN(1) +#define HAS_FAN2 _HAS_FAN(2) +#define HAS_FAN3 _HAS_FAN(3) +#define HAS_FAN4 _HAS_FAN(4) +#define HAS_FAN5 _HAS_FAN(5) +#define HAS_FAN6 _HAS_FAN(6) +#define HAS_FAN7 _HAS_FAN(7) #define HAS_CONTROLLER_FAN (PIN_EXISTS(CONTROLLER_FAN)) // Servos @@ -1203,7 +1265,7 @@ #define HAS_MOTOR_CURRENT_PWM ANY_PIN(MOTOR_CURRENT_PWM_X, MOTOR_CURRENT_PWM_Y, MOTOR_CURRENT_PWM_XY, MOTOR_CURRENT_PWM_Z, MOTOR_CURRENT_PWM_E) #define HAS_SOME_Z_MICROSTEPS (HAS_Z_MICROSTEPS || HAS_Z2_MICROSTEPS || HAS_Z3_MICROSTEPS || HAS_Z4_MICROSTEPS) -#define HAS_SOME_E_MICROSTEPS (HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS) +#define HAS_SOME_E_MICROSTEPS (HAS_E0_MICROSTEPS || HAS_E1_MICROSTEPS || HAS_E2_MICROSTEPS || HAS_E3_MICROSTEPS || HAS_E4_MICROSTEPS || HAS_E5_MICROSTEPS || HAS_E6_MICROSTEPS || HAS_E7_MICROSTEPS) #define HAS_MICROSTEPS (HAS_X_MICROSTEPS || HAS_X2_MICROSTEPS || HAS_Y_MICROSTEPS || HAS_Y2_MICROSTEPS || HAS_SOME_Z_MICROSTEPS || HAS_SOME_E_MICROSTEPS) #if HAS_MICROSTEPS @@ -1278,26 +1340,27 @@ #if HAS_HEATER_0 && !defined(HEATER_0_INVERTING) #define HEATER_0_INVERTING false #endif - #if HAS_HEATER_1 && !defined(HEATER_1_INVERTING) #define HEATER_1_INVERTING false #endif - #if HAS_HEATER_2 && !defined(HEATER_2_INVERTING) #define HEATER_2_INVERTING false #endif - #if HAS_HEATER_3 && !defined(HEATER_3_INVERTING) #define HEATER_3_INVERTING false #endif - #if HAS_HEATER_4 && !defined(HEATER_4_INVERTING) #define HEATER_4_INVERTING false #endif - #if HAS_HEATER_5 && !defined(HEATER_5_INVERTING) #define HEATER_5_INVERTING false #endif +#if HAS_HEATER_6 && !defined(HEATER_6_INVERTING) + #define HEATER_6_INVERTING false +#endif +#if HAS_HEATER_7 && !defined(HEATER_7_INVERTING) + #define HEATER_7_INVERTING false +#endif /** * Helper Macros for heaters and extruder fan @@ -1314,6 +1377,12 @@ #define WRITE_HEATER_4(v) WRITE(HEATER_4_PIN, (v) ^ HEATER_4_INVERTING) #if HOTENDS > 5 #define WRITE_HEATER_5(v) WRITE(HEATER_5_PIN, (v) ^ HEATER_5_INVERTING) + #if HOTENDS > 6 + #define WRITE_HEATER_6(v) WRITE(HEATER_6_PIN, (v) ^ HEATER_6_INVERTING) + #if HOTENDS > 7 + #define WRITE_HEATER_7(v) WRITE(HEATER_7_PIN, (v) ^ HEATER_7_INVERTING) + #endif // HOTENDS > 7 + #endif // HOTENDS > 6 #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 @@ -1365,7 +1434,17 @@ #define FAN_INVERTING false #endif -#if HAS_FAN2 +#if HAS_FAN7 + #define FAN_COUNT 8 +#elif HAS_FAN6 + #define FAN_COUNT 7 +#elif HAS_FAN5 + #define FAN_COUNT 6 +#elif HAS_FAN4 + #define FAN_COUNT 5 +#elif HAS_FAN3 + #define FAN_COUNT 4 +#elif HAS_FAN2 #define FAN_COUNT 3 #elif HAS_FAN1 #define FAN_COUNT 2 @@ -1640,7 +1719,6 @@ #define HAS_FIXED_3POINT #endif - /** * Buzzer/Speaker */ diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 1cb946f99dc8..58c284746baf 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -294,19 +294,19 @@ #elif defined(HAVE_L6470DRIVER) #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." #elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) || defined(Z3_IS_TMC) \ - || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) + || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC) || defined(E5_IS_TMC) || defined(E6_IS_TMC) || defined(E7_IS_TMC) #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." #elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) || defined(Z3_IS_TMC26X) \ - || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) + || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X) || defined(E5_IS_TMC26X) || defined(E6_IS_TMC26X) || defined(E7_IS_TMC26X) #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h." #elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) || defined(Z3_IS_TMC2130) \ - || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) + || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130) || defined(E5_IS_TMC2130) || defined(E6_IS_TMC2130) || defined(E7_IS_TMC2130) #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h." #elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) || defined(Z3_IS_TMC2208) \ - || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) + || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208) || defined(E5_IS_TMC2208) || defined(E6_IS_TMC2208) || defined(E7_IS_TMC2208) #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h." #elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) || defined(Z3_IS_L6470) \ - || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470) + || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470) || defined(E5_IS_L6470) || defined(E6_IS_L6470) || defined(E7_IS_L6470) #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h." #elif defined(AUTOMATIC_CURRENT_CONTROL) #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration." @@ -752,8 +752,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS */ #if EXTRUDERS > 1 - #if EXTRUDERS > 6 - #error "Marlin supports a maximum of 6 EXTRUDERS." + #if EXTRUDERS > 8 + #error "Marlin supports a maximum of 8 EXTRUDERS." #endif #if ENABLED(HEATERS_PARALLEL) @@ -1494,6 +1494,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TEMP_SENSOR_4 1000 requires HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS and HOTEND4_BETA in Configuration_adv.h." #elif ENABLED(HEATER_5_USER_THERMISTOR) && !(defined(HOTEND5_PULLUP_RESISTOR_OHMS) && defined(HOTEND5_RESISTANCE_25C_OHMS) && defined(HOTEND5_BETA)) #error "TEMP_SENSOR_5 1000 requires HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS and HOTEND5_BETA in Configuration_adv.h." +#elif ENABLED(HEATER_6_USER_THERMISTOR) && !(defined(HOTEND6_PULLUP_RESISTOR_OHMS) && defined(HOTEND6_RESISTANCE_25C_OHMS) && defined(HOTEND6_BETA)) + #error "TEMP_SENSOR_6 1000 requires HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS and HOTEND6_BETA in Configuration_adv.h." +#elif ENABLED(HEATER_7_USER_THERMISTOR) && !(defined(HOTEND7_PULLUP_RESISTOR_OHMS) && defined(HOTEND7_RESISTANCE_25C_OHMS) && defined(HOTEND7_BETA)) + #error "TEMP_SENSOR_7 1000 requires HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS and HOTEND7_BETA in Configuration_adv.h." #elif ENABLED(HEATER_BED_USER_THERMISTOR) && !(defined(BED_PULLUP_RESISTOR_OHMS) && defined(BED_RESISTANCE_25C_OHMS) && defined(BED_BETA)) #error "TEMP_SENSOR_BED 1000 requires BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS and BED_BETA in Configuration_adv.h." #elif ENABLED(HEATER_CHAMBER_USER_THERMISTOR) && !(defined(CHAMBER_PULLUP_RESISTOR_OHMS) && defined(CHAMBER_RESISTANCE_25C_OHMS) && defined(CHAMBER_BETA)) @@ -1564,13 +1568,45 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #elif !PIN_EXISTS(TEMP_5) #error "TEMP_5_PIN not defined for this board." #endif + #if HOTENDS > 6 + #if TEMP_SENSOR_6 == 0 + #error "TEMP_SENSOR_6 is required with 6 HOTENDS." + #elif !HAS_HEATER_6 + #error "HEATER_6_PIN not defined for this board." + #elif !PIN_EXISTS(TEMP_6) + #error "TEMP_6_PIN not defined for this board." + #endif + #if HOTENDS > 7 + #if TEMP_SENSOR_7 == 0 + #error "TEMP_SENSOR_7 is required with 7 HOTENDS." + #elif !HAS_HEATER_7 + #error "HEATER_7_PIN not defined for this board." + #elif !PIN_EXISTS(TEMP_7) + #error "TEMP_7_PIN not defined for this board." + #endif + #elif TEMP_SENSOR_7 != 0 + #error "TEMP_SENSOR_7 shouldn't be set with only 7 HOTENDS." + #endif + #elif TEMP_SENSOR_6 != 0 + #error "TEMP_SENSOR_6 shouldn't be set with only 6 HOTENDS." + #elif TEMP_SENSOR_7 != 0 + #error "TEMP_SENSOR_7 shouldn't be set with only 6 HOTENDS." + #endif #elif TEMP_SENSOR_5 != 0 #error "TEMP_SENSOR_5 shouldn't be set with only 5 HOTENDS." + #elif TEMP_SENSOR_6 != 0 + #error "TEMP_SENSOR_6 shouldn't be set with only 5 HOTENDS." + #elif TEMP_SENSOR_7 != 0 + #error "TEMP_SENSOR_7 shouldn't be set with only 5 HOTENDS." #endif #elif TEMP_SENSOR_4 != 0 #error "TEMP_SENSOR_4 shouldn't be set with only 4 HOTENDS." #elif TEMP_SENSOR_5 != 0 #error "TEMP_SENSOR_5 shouldn't be set with only 4 HOTENDS." + #elif TEMP_SENSOR_6 != 0 + #error "TEMP_SENSOR_6 shouldn't be set with only 4 HOTENDS." + #elif TEMP_SENSOR_7 != 0 + #error "TEMP_SENSOR_7 shouldn't be set with only 4 HOTENDS." #endif #elif TEMP_SENSOR_3 != 0 #error "TEMP_SENSOR_3 shouldn't be set with only 3 HOTENDS." @@ -1578,6 +1614,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TEMP_SENSOR_4 shouldn't be set with only 3 HOTENDS." #elif TEMP_SENSOR_5 != 0 #error "TEMP_SENSOR_5 shouldn't be set with only 3 HOTENDS." + #elif TEMP_SENSOR_6 != 0 + #error "TEMP_SENSOR_6 shouldn't be set with only 3 HOTENDS." + #elif TEMP_SENSOR_7 != 0 + #error "TEMP_SENSOR_7 shouldn't be set with only 3 HOTENDS." #endif #elif TEMP_SENSOR_2 != 0 #error "TEMP_SENSOR_2 shouldn't be set with only 2 HOTENDS." @@ -1587,6 +1627,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TEMP_SENSOR_4 shouldn't be set with only 2 HOTENDS." #elif TEMP_SENSOR_5 != 0 #error "TEMP_SENSOR_5 shouldn't be set with only 2 HOTENDS." + #elif TEMP_SENSOR_6 != 0 + #error "TEMP_SENSOR_6 shouldn't be set with only 2 HOTENDS." + #elif TEMP_SENSOR_7 != 0 + #error "TEMP_SENSOR_7 shouldn't be set with only 2 HOTENDS." #endif #elif TEMP_SENSOR_1 != 0 && DISABLED(TEMP_SENSOR_1_AS_REDUNDANT) #error "TEMP_SENSOR_1 shouldn't be set with only 1 HOTEND." @@ -1598,6 +1642,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TEMP_SENSOR_4 shouldn't be set with only 1 HOTEND." #elif TEMP_SENSOR_5 != 0 #error "TEMP_SENSOR_5 shouldn't be set with only 1 HOTEND." +#elif TEMP_SENSOR_6 != 0 + #error "TEMP_SENSOR_6 shouldn't be set with only 1 HOTEND." +#elif TEMP_SENSOR_7 != 0 + #error "TEMP_SENSOR_7 shouldn't be set with only 1 HOTEND." #endif #if TEMP_SENSOR_PROBE @@ -1680,6 +1728,16 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if !(PIN_EXISTS(E5_STEP, E5_DIR) && HAS_E5_ENABLE) #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board." #endif + #if E_STEPPERS > 6 + #if !(PIN_EXISTS(E6_STEP, E6_DIR) && HAS_E6_ENABLE) + #error "E6_STEP_PIN, E6_DIR_PIN, or E6_ENABLE_PIN not defined for this board." + #endif + #if E_STEPPERS > 7 + #if !(PIN_EXISTS(E7_STEP, E7_DIR) && HAS_E7_ENABLE) + #error "E7_STEP_PIN, E7_DIR_PIN, or E7_ENABLE_PIN not defined for this board." + #endif + #endif // E_STEPPERS > 7 + #endif // E_STEPPERS > 6 #endif // E_STEPPERS > 5 #endif // E_STEPPERS > 4 #endif // E_STEPPERS > 3 @@ -2008,6 +2066,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "An SPI driven TMC driver on E4 requires E4_CS_PIN." #elif INVALID_TMC_SPI(E5) #error "An SPI driven TMC driver on E5 requires E5_CS_PIN." +#elif INVALID_TMC_SPI(E6) + #error "An SPI driven TMC driver on E6 requires E6_CS_PIN." +#elif INVALID_TMC_SPI(E7) + #error "An SPI driven TMC driver on E7 requires E7_CS_PIN." #endif #undef INVALID_TMC_SPI @@ -2041,6 +2103,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TMC2208 or TMC2209 on E4 requires E4_HARDWARE_SERIAL or E4_SERIAL_(RX|TX)_PIN." #elif INVALID_TMC_UART(E5) #error "TMC2208 or TMC2209 on E5 requires E5_HARDWARE_SERIAL or E5_SERIAL_(RX|TX)_PIN." +#elif INVALID_TMC_UART(E6) + #error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN." +#elif INVALID_TMC_UART(E7) + #error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN." #endif #undef INVALID_TMC_UART @@ -2192,7 +2258,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS || (IN_CHAIN(Z3) && !PIN_EXISTS(Z3_CS)) || (IN_CHAIN(E0) && !PIN_EXISTS(E0_CS)) \ || (IN_CHAIN(E1) && !PIN_EXISTS(E1_CS)) || (IN_CHAIN(E2) && !PIN_EXISTS(E2_CS)) \ || (IN_CHAIN(E3) && !PIN_EXISTS(E3_CS)) || (IN_CHAIN(E4) && !PIN_EXISTS(E4_CS)) \ - || (IN_CHAIN(E5) && !PIN_EXISTS(E5_CS)) + || (IN_CHAIN(E5) && !PIN_EXISTS(E5_CS)) || (IN_CHAIN(E6) && !PIN_EXISTS(E6_CS)) \ + || (IN_CHAIN(E7) && !PIN_EXISTS(E7_CS)) #error "All chained TMC drivers need a CS pin." #else #if IN_CHAIN(X) @@ -2221,6 +2288,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #define CS_COMPARE E4_CS_PIN #elif IN_CHAIN(E5) #define CS_COMPARE E5_CS_PIN + #elif IN_CHAIN(E6) + #define CS_COMPARE E6_CS_PIN + #elif IN_CHAIN(E7) + #define CS_COMPARE E7_CS_PIN #endif #if (IN_CHAIN(X) && X_CS_PIN != CS_COMPARE) || (IN_CHAIN(Y) && Y_CS_PIN != CS_COMPARE) \ || (IN_CHAIN(Z) && Z_CS_PIN != CS_COMPARE) || (IN_CHAIN(X2) && X2_CS_PIN != CS_COMPARE) \ @@ -2228,7 +2299,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS || (IN_CHAIN(Z3) && Z3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E0) && E0_CS_PIN != CS_COMPARE) \ || (IN_CHAIN(E1) && E1_CS_PIN != CS_COMPARE) || (IN_CHAIN(E2) && E2_CS_PIN != CS_COMPARE) \ || (IN_CHAIN(E3) && E3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E4) && E4_CS_PIN != CS_COMPARE) \ - || (IN_CHAIN(E5) && E5_CS_PIN != CS_COMPARE) + || (IN_CHAIN(E5) && E5_CS_PIN != CS_COMPARE) || (IN_CHAIN(E6) && E6_CS_PIN != CS_COMPARE) \ + || (IN_CHAIN(E7) && E7_CS_PIN != CS_COMPARE) #error "All chained TMC drivers must use the same CS pin." #endif #endif @@ -2521,12 +2593,26 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) #error "SPINDLE_LASER_PWM_PIN conflicts with E4_AUTO_FAN_PIN." #elif _PIN_CONFLICT(E5_AUTO_FAN) #error "SPINDLE_LASER_PWM_PIN conflicts with E5_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(E6_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E6_AUTO_FAN_PIN." + #elif _PIN_CONFLICT(E7_AUTO_FAN) + #error "SPINDLE_LASER_PWM_PIN conflicts with E7_AUTO_FAN_PIN." #elif _PIN_CONFLICT(FAN) #error "SPINDLE_LASER_PWM_PIN conflicts with FAN_PIN." #elif _PIN_CONFLICT(FAN1) #error "SPINDLE_LASER_PWM_PIN conflicts with FAN1_PIN." #elif _PIN_CONFLICT(FAN2) #error "SPINDLE_LASER_PWM_PIN conflicts with FAN2_PIN." + #elif _PIN_CONFLICT(FAN3) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN3_PIN." + #elif _PIN_CONFLICT(FAN4) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN4_PIN." + #elif _PIN_CONFLICT(FAN5) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN5_PIN." + #elif _PIN_CONFLICT(FAN6) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN6_PIN." + #elif _PIN_CONFLICT(FAN7) + #error "SPINDLE_LASER_PWM_PIN conflicts with FAN7_PIN." #elif _PIN_CONFLICT(CONTROLLERFAN) #error "SPINDLE_LASER_PWM_PIN conflicts with CONTROLLERFAN_PIN." #elif _PIN_CONFLICT(MOTOR_CURRENT_PWM_XY) diff --git a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp index d6ce8bfdd637..bf57f1dfc259 100644 --- a/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp @@ -1092,6 +1092,21 @@ void MarlinUI::draw_status_screen() { #if HAS_FAN2 || thermalManager.fan_speed[2] #endif + #if HAS_FAN3 + || thermalManager.fan_speed[3] + #endif + #if HAS_FAN4 + || thermalManager.fan_speed[4] + #endif + #if HAS_FAN5 + || thermalManager.fan_speed[5] + #endif + #if HAS_FAN6 + || thermalManager.fan_speed[6] + #endif + #if HAS_FAN7 + || thermalManager.fan_speed[7] + #endif ) leds |= LED_C; #endif // FAN_COUNT > 0 diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index 253017493f28..8c8133f22b52 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -912,7 +912,7 @@ namespace ExtUI { #endif { #if HOTENDS - static constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP); + static constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); const int16_t e = heater - H0; thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e); #endif @@ -924,7 +924,7 @@ namespace ExtUI { value *= TOUCH_UI_LCD_TEMP_SCALING; #endif #if HOTENDS - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP); + constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); const int16_t e = extruder - E0; enableHeater(extruder); thermalManager.setTargetHotend(LROUND(constrain(value, 0, heater_maxtemp[e] - 15)), e); diff --git a/Marlin/src/lcd/extensible_ui/ui_api.h b/Marlin/src/lcd/extensible_ui/ui_api.h index 2180587a1e18..536da132c05a 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.h +++ b/Marlin/src/lcd/extensible_ui/ui_api.h @@ -55,7 +55,7 @@ namespace ExtUI { enum axis_t : uint8_t { X, Y, Z }; enum extruder_t : uint8_t { E0, E1, E2, E3, E4, E5 }; enum heater_t : uint8_t { H0, H1, H2, H3, H4, H5, BED, CHAMBER }; - enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5 }; + enum fan_t : uint8_t { FAN0, FAN1, FAN2, FAN3, FAN4, FAN5, FAN6, FAN7 }; enum result_t : uint8_t { PID_BAD_EXTRUDER_NUM, PID_TEMP_TOO_HIGH, PID_TUNING_TIMEOUT, PID_DONE }; constexpr uint8_t extruderCount = EXTRUDERS; diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 4957dc102ea1..c4fbbe1be65d 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -93,7 +93,7 @@ namespace Language_an { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Boquilla ~"); PROGMEM Language_Str MSG_BED = _UxGT("Base"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ixoriador"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ixoriador ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ixoriador ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); diff --git a/Marlin/src/lcd/language/language_bg.h b/Marlin/src/lcd/language/language_bg.h index 93027da7fefb..19e0b90e52fe 100644 --- a/Marlin/src/lcd/language/language_bg.h +++ b/Marlin/src/lcd/language/language_bg.h @@ -83,7 +83,7 @@ namespace Language_bg { PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Дюза ~"); PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Легло"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Вентилатор"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Вентилатор ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Вентилатор ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Поток"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Поток ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Управление"); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index a1e134622f48..d1cc0cf7bc07 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -94,7 +94,7 @@ namespace Language_ca { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); PROGMEM Language_Str MSG_BED = _UxGT("Llit"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. Ventilador"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventilador ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventilador ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Flux"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flux ~"); PROGMEM Language_Str MSG_VTRAV_MIN = _UxGT("VViatge min"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 1be628965780..6703d300dee9 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -251,10 +251,10 @@ namespace Language_cz { PROGMEM Language_Str MSG_BED = _UxGT("Podložka"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Rychlost vent."); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rychlost vent. ="); - PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ulož. vent. ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rychlost vent. ~"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ulož. vent. ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Rychlost ex. vent."); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rychlost ex. vent. ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rychlost ex. vent. ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Průtok"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Průtok ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Ovládaní"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index 8e25498f48c3..67baf9d2178c 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -84,7 +84,7 @@ namespace Language_da { PROGMEM Language_Str MSG_BED = _UxGT("Plade"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Blæser hastighed"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Blæser hastighed ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Blæser hastighed ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrol"); PROGMEM Language_Str MSG_MIN = _UxGT(" \002 Min"); PROGMEM Language_Str MSG_MAX = _UxGT(" \002 Max"); diff --git a/Marlin/src/lcd/language/language_el.h b/Marlin/src/lcd/language/language_el.h index 1ec9599dbd89..6ebae11576ff 100644 --- a/Marlin/src/lcd/language/language_el.h +++ b/Marlin/src/lcd/language/language_el.h @@ -91,7 +91,7 @@ namespace Language_el { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); PROGMEM Language_Str MSG_BED = _UxGT("Κλίνη"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ταχύτητα ανεμιστήρα"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Ροή"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Ροή ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Έλεγχος"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index c5be7087a968..3e6e07f0bbbf 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -92,7 +92,7 @@ namespace Language_el_gr { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~"); PROGMEM Language_Str MSG_BED = _UxGT("Κλίνη"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ταχύτητα ανεμιστήρα"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ταχύτητα ανεμιστήρα ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Ροή"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Ροή ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Έλεγχος"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 188098e59778..363aff4820da 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -242,10 +242,10 @@ namespace Language_en { PROGMEM Language_Str MSG_BED = _UxGT("Bed"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Enclosure"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan Speed"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Speed ="); - PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Stored Fan ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Speed ~"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Stored Fan ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra Fan Speed"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra Fan Speed ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra Fan Speed ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Flow"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flow ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index ff9a8d2be7d3..83ec5e43315e 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -240,9 +240,9 @@ namespace Language_es { PROGMEM Language_Str MSG_BED = _UxGT("Cama"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Recinto"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Ventilador"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ventilador ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Ventilador ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Vel. Ext. ventilador"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Vel. Ext. ventilador ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Vel. Ext. ventilador ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Flujo"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flujo ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index fe88823f4589..1ef40626d6f3 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -147,9 +147,9 @@ namespace Language_eu { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Pita ~"); PROGMEM Language_Str MSG_BED = _UxGT("Ohea"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Haizagailu abiadura"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Haizagailu abiadura ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Haizagailu abiadura ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Haiz.gehig. abiadura"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Haiz.gehig. abiadura ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Haiz.gehig. abiadura ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxua"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxua ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrola"); diff --git a/Marlin/src/lcd/language/language_fi.h b/Marlin/src/lcd/language/language_fi.h index 93b9f0dff2d3..a9a65709a845 100644 --- a/Marlin/src/lcd/language/language_fi.h +++ b/Marlin/src/lcd/language/language_fi.h @@ -79,7 +79,7 @@ namespace Language_fi { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Suutin ~"); PROGMEM Language_Str MSG_BED = _UxGT("Alusta"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Tuul. nopeus"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tuul. nopeus ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tuul. nopeus ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Virtaus"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Virtaus ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrolli"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index 2506fd89dc1c..2d47744e49de 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -235,10 +235,10 @@ namespace Language_fr { PROGMEM Language_Str MSG_BED = _UxGT("Lit"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Caisson"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vit. ventil. "); // 15 car. max - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vit. ventil. ="); - PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Vit. enreg. ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vit. ventil. ~"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Vit. enreg. ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra ventil. "); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra ventil. ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra ventil. ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Flux"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flux ~"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 7af854ea7563..ea17a076b6a9 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -240,10 +240,10 @@ namespace Language_it { PROGMEM Language_Str MSG_BED = _UxGT("Piatto"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Camera"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. ventola"); // Max 15 characters - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventola ="); // Max 15 characters - PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ventola mem. ="); // Max 15 characters + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventola ~"); // Max 15 characters + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ventola mem. ~"); // Max 15 characters PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Extra vel.vent."); // Max 15 characters - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra v.vent. ="); // Max 15 characters + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Extra v.vent. ~"); // Max 15 characters PROGMEM Language_Str MSG_FLOW = _UxGT("Flusso"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flusso ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Controllo"); diff --git a/Marlin/src/lcd/language/language_ko_KR.h b/Marlin/src/lcd/language/language_ko_KR.h index d736d415f984..7d33ccc5086e 100644 --- a/Marlin/src/lcd/language/language_ko_KR.h +++ b/Marlin/src/lcd/language/language_ko_KR.h @@ -77,9 +77,9 @@ namespace Language_ko_KR { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("노즐 ~"); PROGMEM Language_Str MSG_BED = _UxGT("베드"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("펜 속도"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("펜 속도 ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("펜 속도 ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("엑스트라 펜 속도"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("엑스트라 펜 속도 ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("엑스트라 펜 속도 ~"); PROGMEM Language_Str MSG_TEMPERATURE = _UxGT("온도"); PROGMEM Language_Str MSG_MOTION = _UxGT("동작"); PROGMEM Language_Str MSG_STORE_EEPROM = _UxGT("설정 저장하기"); diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 7a26e1f24f6b..1d9955c811f4 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -99,7 +99,7 @@ namespace Language_nl { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozzle ~"); PROGMEM Language_Str MSG_BED = _UxGT("Bed"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan snelheid"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan snelheid ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan snelheid ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Flow"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Flow ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Control"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index 41559b9d845f..b9bb9541e788 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -240,9 +240,9 @@ namespace Language_pl { PROGMEM Language_Str MSG_BED = _UxGT("Stół"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Obudowa"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Obroty wiatraka"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Obroty wiatraka ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Obroty wiatraka ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Obroty dodatkowego wiatraka"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Obroty dodatkowego wiatraka ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Obroty dodatkowego wiatraka ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Przepływ"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Przepływ ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Ustawienia"); diff --git a/Marlin/src/lcd/language/language_pt.h b/Marlin/src/lcd/language/language_pt.h index ce2fbd944e90..b96839e1f644 100644 --- a/Marlin/src/lcd/language/language_pt.h +++ b/Marlin/src/lcd/language/language_pt.h @@ -89,7 +89,7 @@ namespace Language_pt { PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Bico ~"); PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Base"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. ventoinha"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventoinha ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. ventoinha ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Fluxo"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Fluxo ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Controlo"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index 108af5a5add4..93451bc9712e 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -207,9 +207,9 @@ namespace Language_pt_br { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Bocal ~"); PROGMEM Language_Str MSG_BED = _UxGT("Mesa"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Vel. Ventoinha"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventoinha ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Vel. Ventoinha ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("+Vel. Ventoinha"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("+Vel. Ventoinha ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("+Vel. Ventoinha ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Vazão"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Vazão ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Controle"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index e701408875b3..348751949835 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -243,9 +243,9 @@ namespace Language_sk { PROGMEM Language_Str MSG_BED = _UxGT("Podložka"); PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Rýchlosť vent."); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rýchlosť vent. ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rýchlosť vent. ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Rýchlosť ex. vent."); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rýchlosť ex. vent. ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rýchlosť ex. vent. ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Prietok"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Prietok ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Ovládanie"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index e683e224ab98..e68b62228d24 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -210,9 +210,9 @@ namespace Language_tr { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Nozul ~"); PROGMEM Language_Str MSG_BED = _UxGT("Tabla"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Fan Hızı"); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Hızı ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Fan Hızı ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Ekstra Fan Hızı"); - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Ekstra Fan Hızı ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Ekstra Fan Hızı ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Akış"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Akış ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Kontrol"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 3afe4e96eee6..78e0cf7cfb21 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -92,7 +92,7 @@ namespace Language_uk { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Сопло ~"); PROGMEM Language_Str MSG_BED = _UxGT("Стіл"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Охолодж."); - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Охолодж. ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Охолодж. ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Потік"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Потік ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Налаштування"); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index c12e0e2f6bd4..6a42933c1931 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -210,9 +210,9 @@ namespace Language_vi { PROGMEM Language_Str MSG_NOZZLE_N = _UxGT("Đầu phun ~"); // Nozzle PROGMEM Language_Str MSG_BED = _UxGT("Bàn"); // bed PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Tốc độ quạt"); // fan speed - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tốc độ quạt ="); // fan speed + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Tốc độ quạt ~"); // fan speed PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Tốc độ quạt phụ"); // Extra fan speed - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Tốc độ quạt phụ ="); // Extra fan speed + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Tốc độ quạt phụ ~"); // Extra fan speed PROGMEM Language_Str MSG_FLOW = _UxGT("Lưu Lượng"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("Lưu Lượng ~"); PROGMEM Language_Str MSG_CONTROL = _UxGT("Điều khiển"); // Control diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index e15b0188430f..9a52ac2f8299 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -187,9 +187,9 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 喷嘴 ~"); //"Nozzle" 噴嘴 PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 热床"); //"Bed" PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("风扇速率"); //"Fan speed" - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("风扇速率 ="); //"Fan speed" + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("风扇速率 ~"); //"Fan speed" PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("额外风扇速率"); // "Extra fan speed" - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("额外风扇速率 ="); // "Extra fan speed" + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("额外风扇速率 ~"); // "Extra fan speed" PROGMEM Language_Str MSG_FLOW = _UxGT("挤出速率"); //"Flow" PROGMEM Language_Str MSG_FLOW_N = _UxGT("挤出速率 ~"); //"Flow" PROGMEM Language_Str MSG_CONTROL = _UxGT("控制"); //"Control" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 7d386949114f..92343b3efaf8 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -187,9 +187,9 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴 ~"); PROGMEM Language_Str MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 熱床"); //"Bed" PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("風扇速率"); //"Fan speed" - PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("風扇速率 ="); + PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("風扇速率 ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("額外風扇速率"); // "Extra fan speed" - PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("額外風扇速率 ="); + PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("額外風扇速率 ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("擠出速率"); PROGMEM Language_Str MSG_FLOW_N = _UxGT("擠出速率 ~"); //"Flow" PROGMEM Language_Str MSG_CONTROL = _UxGT("控制"); //"Control" diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index de8d24e1fdda..5c7fc773062d 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -30,7 +30,7 @@ extern int8_t encoderLine, encoderTopLine, screen_items; #if HOTENDS - constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP); + constexpr int16_t heater_maxtemp[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_MAXTEMP, HEATER_1_MAXTEMP, HEATER_2_MAXTEMP, HEATER_3_MAXTEMP, HEATER_4_MAXTEMP, HEATER_5_MAXTEMP, HEATER_6_MAXTEMP, HEATER_7_MAXTEMP); #endif void scroll_screen(const uint8_t limit, const bool is_menu); diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 9b59952b49f1..e24b415155a2 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -245,6 +245,12 @@ void menu_cancelobject(); DEFINE_PIDTEMP_FUNCS(4); #if HOTENDS > 5 DEFINE_PIDTEMP_FUNCS(5); + #if HOTENDS > 6 + DEFINE_PIDTEMP_FUNCS(6); + #if HOTENDS > 7 + DEFINE_PIDTEMP_FUNCS(7); + #endif // HOTENDS > 7 + #endif // HOTENDS > 6 #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 @@ -330,6 +336,12 @@ void menu_cancelobject(); PID_EDIT_MENU_ITEMS(4); #if HOTENDS > 5 PID_EDIT_MENU_ITEMS(5); + #if HOTENDS > 6 + PID_EDIT_MENU_ITEMS(6); + #if HOTENDS > 7 + PID_EDIT_MENU_ITEMS(7); + #endif // HOTENDS > 7 + #endif // HOTENDS > 6 #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 diff --git a/Marlin/src/lcd/menu/menu_info.cpp b/Marlin/src/lcd/menu/menu_info.cpp index 71467093ecde..5bbc8ce7dc93 100644 --- a/Marlin/src/lcd/menu/menu_info.cpp +++ b/Marlin/src/lcd/menu/menu_info.cpp @@ -152,6 +152,24 @@ void menu_info_thermistors() { VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_5_MAXTEMP), SS_LEFT); #endif + #if TEMP_SENSOR_6 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_6 + #include "../thermistornames.h" + STATIC_ITEM_P(PSTR(LCD_STR_E6 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_6_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_6_MAXTEMP), SS_LEFT); + #endif + + #if TEMP_SENSOR_7 != 0 + #undef THERMISTOR_ID + #define THERMISTOR_ID TEMP_SENSOR_7 + #include "../thermistornames.h" + STATIC_ITEM_P(PSTR(LCD_STR_E7 ": " THERMISTOR_NAME), SS_INVERT); + VALUE_ITEM_P(MSG_INFO_MIN_TEMP, STRINGIFY(HEATER_7_MINTEMP), SS_LEFT); + VALUE_ITEM_P(MSG_INFO_MAX_TEMP, STRINGIFY(HEATER_7_MAXTEMP), SS_LEFT); + #endif + #if EXTRUDERS { STATIC_ITEM( diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 2713f9fe7866..d2483b9d3f4f 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -198,33 +198,72 @@ void menu_temperature() { // Fan Speed: // #if FAN_COUNT > 0 + + auto on_fan_update = []{ + thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8); + }; + + #if HAS_FAN1 || HAS_FAN2 || HAS_FAN3 || HAS_FAN4 || HAS_FAN5 || HAS_FAN6 || HAS_FAN7 + auto fan_edit_items = [&](const uint8_t f) { + editable.uint8 = thermalManager.fan_speed[f]; + EDIT_ITEM_FAST_N(percent, f, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, on_fan_update); + #if ENABLED(EXTRA_FAN_SPEED) + EDIT_ITEM_FAST_N(percent, f, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[f], 3, 255); + #endif + }; + #endif + + #define SNFAN(N) (ENABLED(SINGLENOZZLE) && !HAS_FAN##N && EXTRUDERS > N) + #if SNFAN(1) || SNFAN(2) || SNFAN(3) || SNFAN(4) || SNFAN(5) || SNFAN(6) || SNFAN(7) + auto singlenozzle_item = [&](const uint8_t f) { + editable.uint8 = thermalManager.fan_speed[f]; + EDIT_ITEM_FAST_N(percent, f, MSG_STORED_FAN_N, &editable.uint8, 0, 255, on_fan_update); + }; + #endif + #if HAS_FAN0 editable.uint8 = thermalManager.fan_speed[0]; - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); }); + EDIT_ITEM_FAST_N(percent, 0, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, on_fan_update); #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); + EDIT_ITEM_FAST_N(percent, 0, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); #endif #endif #if HAS_FAN1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); + fan_edit_items(1); + #elif SNFAN(1) + singlenozzle_item(1); #endif #if HAS_FAN2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); + fan_edit_items(2); + #elif SNFAN(2) + singlenozzle_item(1); + #endif + #if HAS_FAN3 + fan_edit_items(3); + #elif SNFAN(3) + singlenozzle_item(1); + #endif + #if HAS_FAN4 + fan_edit_items(4); + #elif SNFAN(4) + singlenozzle_item(1); #endif + #if HAS_FAN5 + fan_edit_items(5); + #elif SNFAN(5) + singlenozzle_item(1); + #endif + #if HAS_FAN6 + fan_edit_items(6); + #elif SNFAN(6) + singlenozzle_item(1); + #endif + #if HAS_FAN7 + fan_edit_items(7); + #elif SNFAN(7) + singlenozzle_item(1); + #endif + #endif // FAN_COUNT > 0 #if HAS_TEMP_HOTEND @@ -232,7 +271,7 @@ void menu_temperature() { // // Preheat for Material 1 and 2 // - #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_5 != 0 || HAS_HEATED_BED + #if TEMP_SENSOR_1 != 0 || TEMP_SENSOR_2 != 0 || TEMP_SENSOR_3 != 0 || TEMP_SENSOR_4 != 0 || TEMP_SENSOR_5 != 0 || TEMP_SENSOR_6 != 0 || TEMP_SENSOR_7 != 0 || HAS_HEATED_BED SUBMENU(MSG_PREHEAT_1, menu_preheat_m1); SUBMENU(MSG_PREHEAT_2, menu_preheat_m2); #else diff --git a/Marlin/src/lcd/menu/menu_tmc.cpp b/Marlin/src/lcd/menu/menu_tmc.cpp index 054b4e61f305..ff6a50ccfc5c 100644 --- a/Marlin/src/lcd/menu/menu_tmc.cpp +++ b/Marlin/src/lcd/menu/menu_tmc.cpp @@ -79,6 +79,12 @@ void menu_tmc_current() { #if AXIS_IS_TMC(E5) TMC_EDIT_STORED_I_RMS(E5, LCD_STR_E5); #endif + #if AXIS_IS_TMC(E6) + TMC_EDIT_STORED_I_RMS(E6, LCD_STR_E6); + #endif + #if AXIS_IS_TMC(E7) + TMC_EDIT_STORED_I_RMS(E7, LCD_STR_E7); + #endif END_MENU(); } @@ -131,6 +137,12 @@ void menu_tmc_current() { #if AXIS_HAS_STEALTHCHOP(E5) TMC_EDIT_STORED_HYBRID_THRS(E5, LCD_STR_E5); #endif + #if AXIS_HAS_STEALTHCHOP(E6) + TMC_EDIT_STORED_HYBRID_THRS(E6, LCD_STR_E6); + #endif + #if AXIS_HAS_STEALTHCHOP(E7) + TMC_EDIT_STORED_HYBRID_THRS(E7, LCD_STR_E7); + #endif END_MENU(); } @@ -210,6 +222,12 @@ void menu_tmc_current() { #if AXIS_HAS_STEALTHCHOP(E5) TMC_EDIT_STEP_MODE(E5, LCD_STR_E5); #endif + #if AXIS_HAS_STEALTHCHOP(E6) + TMC_EDIT_STEP_MODE(E6, LCD_STR_E6); + #endif + #if AXIS_HAS_STEALTHCHOP(E7) + TMC_EDIT_STEP_MODE(E7, LCD_STR_E7); + #endif END_MENU(); } diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp index 1ece7f6ce52b..1610c2d5eb2c 100644 --- a/Marlin/src/lcd/menu/menu_tune.cpp +++ b/Marlin/src/lcd/menu/menu_tune.cpp @@ -147,33 +147,72 @@ void menu_tune() { // Fan Speed: // #if FAN_COUNT > 0 + + auto on_fan_update = []{ + thermalManager.set_fan_speed(MenuItemBase::itemIndex, editable.uint8); + }; + + #if HAS_FAN1 || HAS_FAN2 || HAS_FAN3 || HAS_FAN4 || HAS_FAN5 || HAS_FAN6 || HAS_FAN7 + auto fan_edit_items = [&](const uint8_t f) { + editable.uint8 = thermalManager.fan_speed[f]; + EDIT_ITEM_FAST_N(percent, f, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, on_fan_update); + #if ENABLED(EXTRA_FAN_SPEED) + EDIT_ITEM_FAST_N(percent, f, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[f], 3, 255); + #endif + }; + #endif + + #define SNFAN(N) (ENABLED(SINGLENOZZLE) && !HAS_FAN##N && EXTRUDERS > N) + #if SNFAN(1) || SNFAN(2) || SNFAN(3) || SNFAN(4) || SNFAN(5) || SNFAN(6) || SNFAN(7) + auto singlenozzle_item = [&](const uint8_t f) { + editable.uint8 = thermalManager.fan_speed[f]; + EDIT_ITEM_FAST_N(percent, f, MSG_STORED_FAN_N, &editable.uint8, 0, 255, on_fan_update); + }; + #endif + #if HAS_FAN0 editable.uint8 = thermalManager.fan_speed[0]; - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(0, editable.uint8); }); + EDIT_ITEM_FAST_N(percent, 0, MSG_FIRST_FAN_SPEED, &editable.uint8, 0, 255, on_fan_update); #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 1, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); + EDIT_ITEM_FAST_N(percent, 0, MSG_FIRST_EXTRA_FAN_SPEED, &thermalManager.new_fan_speed[0], 3, 255); #endif #endif #if HAS_FAN1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 2, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[1], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 1 - editable.uint8 = thermalManager.fan_speed[1]; - EDIT_ITEM_FAST_N(percent, 2, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(1, editable.uint8); }); + fan_edit_items(1); + #elif SNFAN(1) + singlenozzle_item(1); #endif #if HAS_FAN2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_FAN_SPEED_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); - #if ENABLED(EXTRA_FAN_SPEED) - EDIT_ITEM_FAST_N(percent, 3, MSG_EXTRA_FAN_SPEED_N, &thermalManager.new_fan_speed[2], 3, 255); - #endif - #elif ENABLED(SINGLENOZZLE) && EXTRUDERS > 2 - editable.uint8 = thermalManager.fan_speed[2]; - EDIT_ITEM_FAST_N(percent, 3, MSG_STORED_FAN_N, &editable.uint8, 0, 255, []{ thermalManager.set_fan_speed(2, editable.uint8); }); + fan_edit_items(2); + #elif SNFAN(2) + singlenozzle_item(1); + #endif + #if HAS_FAN3 + fan_edit_items(3); + #elif SNFAN(3) + singlenozzle_item(1); + #endif + #if HAS_FAN4 + fan_edit_items(4); + #elif SNFAN(4) + singlenozzle_item(1); #endif + #if HAS_FAN5 + fan_edit_items(5); + #elif SNFAN(5) + singlenozzle_item(1); + #endif + #if HAS_FAN6 + fan_edit_items(6); + #elif SNFAN(6) + singlenozzle_item(1); + #endif + #if HAS_FAN7 + fan_edit_items(7); + #elif SNFAN(7) + singlenozzle_item(1); + #endif + #endif // FAN_COUNT > 0 // diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index ebd648f2085d..cfa28586b61d 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -39,7 +39,7 @@ L64XX_Marlin L64xxManager; void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); } -char L64XX_Marlin::index_to_axis[MAX_L64XX][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "Z4", "E0", "E1", "E2", "E3", "E4", "E5" }; +char L64XX_Marlin::index_to_axis[MAX_L64XX][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "Z4", "E0", "E1", "E2", "E3", "E4", "E5", "E6", "E7" }; #define DEBUG_OUT ENABLED(L6470_CHITCHAT) #include "../../core/debug_out.h" @@ -69,6 +69,8 @@ uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { (INVERT_X_DIR), (INVERT_E3_DIR), // 11 E3 (INVERT_E4_DIR), // 12 E4 (INVERT_E5_DIR), // 13 E5 + (INVERT_E6_DIR), // 14 E6 + (INVERT_E7_DIR) // 15 E7 }; volatile uint8_t L64XX_Marlin::spi_abort = false; diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h index 325f60d5fa59..9c233fdf0320 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.h +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.h @@ -35,7 +35,7 @@ #define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1 #define HAS_L64XX_EXTRUDER (AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5)) -enum L64XX_axis_t : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, MAX_L64XX }; +enum L64XX_axis_t : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7, MAX_L64XX }; class L64XX_Marlin : public L64XXHelper { public: diff --git a/Marlin/src/libs/softspi.h b/Marlin/src/libs/softspi.h index 39d56b26f78b..5623496d9d53 100644 --- a/Marlin/src/libs/softspi.h +++ b/Marlin/src/libs/softspi.h @@ -66,7 +66,7 @@ * @return value read */ FORCE_INLINE static bool fastDigitalRead(uint8_t pin) { - return g_APinDescription[pin].pPort->PIO_PDSR & g_APinDescription[pin].ulPin; + return digitalRead(pin); } /** @@ -75,10 +75,7 @@ * @param[in] level value to write */ FORCE_INLINE static void fastDigitalWrite(uint8_t pin, bool value) { - if (value) - g_APinDescription[pin].pPort->PIO_SODR = g_APinDescription[pin].ulPin; - else - g_APinDescription[pin].pPort->PIO_CODR = g_APinDescription[pin].ulPin; + digitalWrite(pin, value); } #endif // !CORE_TEENSY diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index f87ff8a5daf3..85b0b850b0f2 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -1008,6 +1008,16 @@ void MarlinSettings::postprocess() { #if AXIS_IS_TMC(E5) tmc_stepper_current.E5 = stepperE5.getMilliamps(); #endif + #if MAX_EXTRUDERS > 6 + #if AXIS_IS_TMC(E6) + tmc_stepper_current.E6 = stepperE6.getMilliamps(); + #endif + #if MAX_EXTRUDERS > 7 + #if AXIS_IS_TMC(E7) + tmc_stepper_current.E7 = stepperE7.getMilliamps(); + #endif + #endif // MAX_EXTRUDERS > 7 + #endif // MAX_EXTRUDERS > 6 #endif // MAX_EXTRUDERS > 5 #endif // MAX_EXTRUDERS > 4 #endif // MAX_EXTRUDERS > 3 @@ -1074,6 +1084,16 @@ void MarlinSettings::postprocess() { #if AXIS_HAS_STEALTHCHOP(E5) tmc_hybrid_threshold.E5 = stepperE5.get_pwm_thrs(); #endif + #if MAX_EXTRUDERS > 6 + #if AXIS_HAS_STEALTHCHOP(E6) + tmc_hybrid_threshold.E6 = stepperE6.get_pwm_thrs(); + #endif + #if MAX_EXTRUDERS > 7 + #if AXIS_HAS_STEALTHCHOP(E7) + tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs(); + #endif + #endif // MAX_EXTRUDERS > 7 + #endif // MAX_EXTRUDERS > 6 #endif // MAX_EXTRUDERS > 5 #endif // MAX_EXTRUDERS > 4 #endif // MAX_EXTRUDERS > 3 @@ -1170,6 +1190,16 @@ void MarlinSettings::postprocess() { #if AXIS_HAS_STEALTHCHOP(E5) tmc_stealth_enabled.E5 = stepperE5.get_stealthChop_status(); #endif + #if MAX_EXTRUDERS > 6 + #if AXIS_HAS_STEALTHCHOP(E6) + tmc_stealth_enabled.E6 = stepperE6.get_stealthChop_status(); + #endif + #if MAX_EXTRUDERS > 7 + #if AXIS_HAS_STEALTHCHOP(E7) + tmc_stealth_enabled.E7 = stepperE7.get_stealthChop_status(); + #endif + #endif // MAX_EXTRUDERS > 7 + #endif // MAX_EXTRUDERS > 6 #endif // MAX_EXTRUDERS > 5 #endif // MAX_EXTRUDERS > 4 #endif // MAX_EXTRUDERS > 3 @@ -2788,6 +2818,14 @@ void MarlinSettings::reset() { #if EXTRUDERS > 5 CONFIG_ECHO_START(); SERIAL_ECHOLNPAIR(" M200 T5 D", LINEAR_UNIT(planner.filament_size[5])); + #if EXTRUDERS > 6 + CONFIG_ECHO_START(); + SERIAL_ECHOLNPAIR(" M200 T6 D", LINEAR_UNIT(planner.filament_size[6])); + #if EXTRUDERS > 7 + CONFIG_ECHO_START(); + SERIAL_ECHOLNPAIR(" M200 T7 D", LINEAR_UNIT(planner.filament_size[7])); + #endif // EXTRUDERS > 7 + #endif // EXTRUDERS > 6 #endif // EXTRUDERS > 5 #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 @@ -3528,6 +3566,12 @@ void MarlinSettings::reset() { _ECHO_603(4); #if EXTRUDERS > 5 _ECHO_603(5); + #if EXTRUDERS > 6 + _ECHO_603(6); + #if EXTRUDERS > 7 + _ECHO_603(7); + #endif // EXTRUDERS > 7 + #endif // EXTRUDERS > 6 #endif // EXTRUDERS > 5 #endif // EXTRUDERS > 4 #endif // EXTRUDERS > 3 diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 27d5fb6fc72d..7d8e270fed0b 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -486,14 +486,20 @@ void _O2 Endstops::report_states() { default: continue; case 1: pin = FIL_RUNOUT_PIN; break; case 2: pin = FIL_RUNOUT2_PIN; break; - #if NUM_RUNOUT_SENSORS > 2 + #if NUM_RUNOUT_SENSORS >= 3 case 3: pin = FIL_RUNOUT3_PIN; break; - #if NUM_RUNOUT_SENSORS > 3 + #if NUM_RUNOUT_SENSORS >= 4 case 4: pin = FIL_RUNOUT4_PIN; break; - #if NUM_RUNOUT_SENSORS > 4 + #if NUM_RUNOUT_SENSORS >= 5 case 5: pin = FIL_RUNOUT5_PIN; break; - #if NUM_RUNOUT_SENSORS > 5 + #if NUM_RUNOUT_SENSORS >= 6 case 6: pin = FIL_RUNOUT6_PIN; break; + #if NUM_RUNOUT_SENSORS >= 7 + case 7: pin = FIL_RUNOUT7_PIN; break; + #if NUM_RUNOUT_SENSORS >= 8 + case 8: pin = FIL_RUNOUT8_PIN; break; + #endif + #endif #endif #endif #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 4c3513c20a81..05522063153c 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1308,7 +1308,21 @@ void Planner::check_axes_activity() { #if HAS_FAN2 FAN_SET(2); #endif - + #if HAS_FAN3 + FAN_SET(3); + #endif + #if HAS_FAN4 + FAN_SET(4); + #endif + #if HAS_FAN5 + FAN_SET(5); + #endif + #if HAS_FAN6 + FAN_SET(6); + #endif + #if HAS_FAN7 + FAN_SET(7); + #endif #endif // FAN_COUNT > 0 #if ENABLED(AUTOTEMP) diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index dec11245f5fd..6e4977984f4c 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -2140,6 +2140,12 @@ void Stepper::init() { #if HAS_E5_DIR E5_DIR_INIT(); #endif + #if HAS_E6_DIR + E6_DIR_INIT(); + #endif + #if HAS_E7_DIR + E7_DIR_INIT(); + #endif // Init Enable Pins - steppers default to disabled. #if HAS_X_ENABLE @@ -2198,6 +2204,14 @@ void Stepper::init() { E5_ENABLE_INIT(); if (!E_ENABLE_ON) E5_ENABLE_WRITE(HIGH); #endif + #if HAS_E6_ENABLE + E6_ENABLE_INIT(); + if (!E_ENABLE_ON) E6_ENABLE_WRITE(HIGH); + #endif + #if HAS_E7_ENABLE + E7_ENABLE_INIT(); + if (!E_ENABLE_ON) E7_ENABLE_WRITE(HIGH); + #endif #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT() #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW) @@ -2261,6 +2275,12 @@ void Stepper::init() { #if E_STEPPERS > 5 && HAS_E5_STEP E_AXIS_INIT(5); #endif + #if E_STEPPERS > 6 && HAS_E6_STEP + E_AXIS_INIT(6); + #endif + #if E_STEPPERS > 7 && HAS_E7_STEP + E_AXIS_INIT(7); + #endif #if DISABLED(I2S_STEPPER_STREAM) HAL_timer_start(STEP_TIMER_NUM, 122); // Init Stepper ISR to 122 Hz for quick starting @@ -2802,6 +2822,20 @@ void Stepper::report_positions() { SET_OUTPUT(E5_MS3_PIN); #endif #endif + #if HAS_E6_MICROSTEPS + SET_OUTPUT(E6_MS1_PIN); + SET_OUTPUT(E6_MS2_PIN); + #if PIN_EXISTS(E6_MS3) + SET_OUTPUT(E6_MS3_PIN); + #endif + #endif + #if HAS_E7_MICROSTEPS + SET_OUTPUT(E7_MS1_PIN); + SET_OUTPUT(E7_MS2_PIN); + #if PIN_EXISTS(E7_MS3) + SET_OUTPUT(E7_MS3_PIN); + #endif + #endif static const uint8_t microstep_modes[] = MICROSTEP_MODES; for (uint16_t i = 0; i < COUNT(microstep_modes); i++) @@ -2847,22 +2881,28 @@ void Stepper::report_positions() { break; #endif #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS1_PIN, ms1); break; + case 3: WRITE(E0_MS1_PIN, ms1); break; #endif #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS1_PIN, ms1); break; + case 4: WRITE(E1_MS1_PIN, ms1); break; #endif #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS1_PIN, ms1); break; + case 5: WRITE(E2_MS1_PIN, ms1); break; #endif #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS1_PIN, ms1); break; + case 6: WRITE(E3_MS1_PIN, ms1); break; #endif #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS1_PIN, ms1); break; + case 7: WRITE(E4_MS1_PIN, ms1); break; #endif #if HAS_E5_MICROSTEPS - case 8: WRITE(E5_MS1_PIN, ms1); break; + case 8: WRITE(E5_MS1_PIN, ms1); break; + #endif + #if HAS_E6_MICROSTEPS + case 9: WRITE(E6_MS1_PIN, ms1); break; + #endif + #if HAS_E7_MICROSTEPS + case 10: WRITE(E7_MS1_PIN, ms1); break; #endif } if (ms2 >= 0) switch (driver) { @@ -2903,22 +2943,28 @@ void Stepper::report_positions() { break; #endif #if HAS_E0_MICROSTEPS - case 3: WRITE(E0_MS2_PIN, ms2); break; + case 3: WRITE(E0_MS2_PIN, ms2); break; #endif #if HAS_E1_MICROSTEPS - case 4: WRITE(E1_MS2_PIN, ms2); break; + case 4: WRITE(E1_MS2_PIN, ms2); break; #endif #if HAS_E2_MICROSTEPS - case 5: WRITE(E2_MS2_PIN, ms2); break; + case 5: WRITE(E2_MS2_PIN, ms2); break; #endif #if HAS_E3_MICROSTEPS - case 6: WRITE(E3_MS2_PIN, ms2); break; + case 6: WRITE(E3_MS2_PIN, ms2); break; #endif #if HAS_E4_MICROSTEPS - case 7: WRITE(E4_MS2_PIN, ms2); break; + case 7: WRITE(E4_MS2_PIN, ms2); break; #endif #if HAS_E5_MICROSTEPS - case 8: WRITE(E5_MS2_PIN, ms2); break; + case 8: WRITE(E5_MS2_PIN, ms2); break; + #endif + #if HAS_E6_MICROSTEPS + case 9: WRITE(E6_MS2_PIN, ms2); break; + #endif + #if HAS_E7_MICROSTEPS + case 10: WRITE(E7_MS2_PIN, ms2); break; #endif } if (ms3 >= 0) switch (driver) { @@ -2959,22 +3005,28 @@ void Stepper::report_positions() { break; #endif #if HAS_E0_MICROSTEPS && PIN_EXISTS(E0_MS3) - case 3: WRITE(E0_MS3_PIN, ms3); break; + case 3: WRITE(E0_MS3_PIN, ms3); break; #endif #if HAS_E1_MICROSTEPS && PIN_EXISTS(E1_MS3) - case 4: WRITE(E1_MS3_PIN, ms3); break; + case 4: WRITE(E1_MS3_PIN, ms3); break; #endif #if HAS_E2_MICROSTEPS && PIN_EXISTS(E2_MS3) - case 5: WRITE(E2_MS3_PIN, ms3); break; + case 5: WRITE(E2_MS3_PIN, ms3); break; #endif #if HAS_E3_MICROSTEPS && PIN_EXISTS(E3_MS3) - case 6: WRITE(E3_MS3_PIN, ms3); break; + case 6: WRITE(E3_MS3_PIN, ms3); break; #endif #if HAS_E4_MICROSTEPS && PIN_EXISTS(E4_MS3) - case 7: WRITE(E4_MS3_PIN, ms3); break; + case 7: WRITE(E4_MS3_PIN, ms3); break; #endif #if HAS_E5_MICROSTEPS && PIN_EXISTS(E5_MS3) - case 8: WRITE(E5_MS3_PIN, ms3); break; + case 8: WRITE(E5_MS3_PIN, ms3); break; + #endif + #if HAS_E6_MICROSTEPS && PIN_EXISTS(E6_MS3) + case 9: WRITE(E6_MS3_PIN, ms3); break; + #endif + #if HAS_E7_MICROSTEPS && PIN_EXISTS(E7_MS3) + case 10: WRITE(E7_MS3_PIN, ms3); break; #endif } } @@ -3084,6 +3136,22 @@ void Stepper::report_positions() { #endif ); #endif + #if HAS_E6_MICROSTEPS + SERIAL_ECHOPGM("E6: "); + SERIAL_CHAR('0' + READ(E6_MS1_PIN), '0' + READ(E6_MS2_PIN) + #if PIN_EXISTS(E6_MS3) + , '0' + READ(E6_MS3_PIN) + #endif + ); + #endif + #if HAS_E7_MICROSTEPS + SERIAL_ECHOPGM("E7: "); + SERIAL_CHAR('0' + READ(E7_MS1_PIN), '0' + READ(E7_MS2_PIN) + #if PIN_EXISTS(E7_MS3) + , '0' + READ(E7_MS3_PIN) + #endif + ); + #endif } #endif // HAS_MICROSTEPS diff --git a/Marlin/src/module/stepper/L64xx.h b/Marlin/src/module/stepper/L64xx.h index c7b2d1e20c82..35b3d723debd 100644 --- a/Marlin/src/module/stepper/L64xx.h +++ b/Marlin/src/module/stepper/L64xx.h @@ -278,3 +278,37 @@ #define E5_DIR_READ() (stepper##E5.getStatus() & STATUS_DIR); #endif #endif + +// E6 Stepper +#if AXIS_IS_L64XX(E6) + extern L64XX_CLASS(E6) stepperE6; + #define E6_ENABLE_INIT() NOOP + #define E6_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE6.free()) + #define E6_ENABLE_READ() (stepperE6.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E6(L6474) + #define E6_DIR_INIT() SET_OUTPUT(E6_DIR_PIN) + #define E6_DIR_WRITE(STATE) L6474_DIR_WRITE(E6, STATE) + #define E6_DIR_READ() READ(E6_DIR_PIN) + #else + #define E6_DIR_INIT() NOOP + #define E6_DIR_WRITE(STATE) L64XX_DIR_WRITE(E6, STATE) + #define E6_DIR_READ() (stepper##E6.getStatus() & STATUS_DIR); + #endif +#endif + +// E7 Stepper +#if AXIS_IS_L64XX(E7) + extern L64XX_CLASS(E7) stepperE7; + #define E7_ENABLE_INIT() NOOP + #define E7_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE7.free()) + #define E7_ENABLE_READ() (stepperE7.getStatus() & STATUS_HIZ) + #if AXIS_DRIVER_TYPE_E7(L6474) + #define E7_DIR_INIT() SET_OUTPUT(E7_DIR_PIN) + #define E7_DIR_WRITE(STATE) L6474_DIR_WRITE(E7, STATE) + #define E7_DIR_READ() READ(E7_DIR_PIN) + #else + #define E7_DIR_INIT() NOOP + #define E7_DIR_WRITE(STATE) L64XX_DIR_WRITE(E7, STATE) + #define E7_DIR_READ() (stepper##E7.getStatus() & STATUS_DIR); + #endif +#endif diff --git a/Marlin/src/module/stepper/TMC26X.h b/Marlin/src/module/stepper/TMC26X.h index f3914332cce5..73cba317064e 100644 --- a/Marlin/src/module/stepper/TMC26X.h +++ b/Marlin/src/module/stepper/TMC26X.h @@ -150,3 +150,19 @@ void tmc26x_init_to_defaults(); #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE) #define E5_ENABLE_READ() stepperE5.isEnabled() #endif + +// E6 Stepper +#if AXIS_DRIVER_TYPE_E6(TMC26X) + extern TMC26XStepper stepperE6; + #define E6_ENABLE_INIT() NOOP + #define E6_ENABLE_WRITE(STATE) stepperE6.setEnabled(STATE) + #define E6_ENABLE_READ() stepperE6.isEnabled() +#endif + +// E7 Stepper +#if AXIS_DRIVER_TYPE_E7(TMC26X) + extern TMC26XStepper stepperE7; + #define E7_ENABLE_INIT() NOOP + #define E7_ENABLE_WRITE(STATE) stepperE7.setEnabled(STATE) + #define E7_ENABLE_READ() stepperE7.isEnabled() +#endif diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index e88c5267449a..d05c7e3db395 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -303,26 +303,115 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif #define E5_STEP_READ() bool(READ(E5_STEP_PIN)) +// E6 Stepper +#ifndef E6_ENABLE_INIT + #define E6_ENABLE_INIT() SET_OUTPUT(E6_ENABLE_PIN) + #define E6_ENABLE_WRITE(STATE) WRITE(E6_ENABLE_PIN,STATE) + #define E6_ENABLE_READ() bool(READ(E6_ENABLE_PIN)) +#endif +#ifndef E6_DIR_INIT + #define E6_DIR_INIT() SET_OUTPUT(E6_DIR_PIN) + #define E6_DIR_WRITE(STATE) WRITE(E6_DIR_PIN,STATE) + #define E6_DIR_READ() bool(READ(E6_DIR_PIN)) +#endif +#define E6_STEP_INIT() SET_OUTPUT(E6_STEP_PIN) +#ifndef E6_STEP_WRITE + #define E6_STEP_WRITE(STATE) WRITE(E6_STEP_PIN,STATE) +#endif +#define E6_STEP_READ() bool(READ(E6_STEP_PIN)) + +// E7 Stepper +#ifndef E7_ENABLE_INIT + #define E7_ENABLE_INIT() SET_OUTPUT(E7_ENABLE_PIN) + #define E7_ENABLE_WRITE(STATE) WRITE(E7_ENABLE_PIN,STATE) + #define E7_ENABLE_READ() bool(READ(E7_ENABLE_PIN)) +#endif +#ifndef E7_DIR_INIT + #define E7_DIR_INIT() SET_OUTPUT(E7_DIR_PIN) + #define E7_DIR_WRITE(STATE) WRITE(E7_DIR_PIN,STATE) + #define E7_DIR_READ() bool(READ(E7_DIR_PIN)) +#endif +#define E7_STEP_INIT() SET_OUTPUT(E7_STEP_PIN) +#ifndef E7_STEP_WRITE + #define E7_STEP_WRITE(STATE) WRITE(E7_STEP_PIN,STATE) +#endif +#define E7_STEP_READ() bool(READ(E7_STEP_PIN)) + /** * Extruder indirection for the single E axis */ #if ENABLED(SWITCHING_EXTRUDER) // One stepper driver per two extruders, reversed on odd index - #if EXTRUDERS > 5 + #if EXTRUDERS > 7 + #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else if (E < 6) { E2_STEP_WRITE(V); } else { E3_STEP_WRITE(V); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \ + case 6: E3_DIR_WRITE( INVERT_E3_DIR); break; case 7: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + } }while(0) + #define REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ + case 6: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 7: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + } }while(0) + #elif EXTRUDERS > 6 + #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else if (E < 6) { E2_STEP_WRITE(V); } else { E3_STEP_WRITE(V); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \ + case 6: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + } }while(0) + #define REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ + case 6: E3_DIR_WRITE(!INVERT_E3_DIR); } }while(0) + #elif EXTRUDERS > 5 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(!INVERT_E2_DIR); case 5: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE( INVERT_E2_DIR); case 5: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 5: E2_DIR_WRITE( INVERT_E2_DIR); break; \ + } }while(0) + #define REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; case 5: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ + } }while(0) #elif EXTRUDERS > 4 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else if (E < 4) { E1_STEP_WRITE(V); } else { E2_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; case 4: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 4: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE(!INVERT_E2_DIR); break; \ + } }while(0) + #define REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 4: E2_DIR_WRITE( INVERT_E2_DIR); break; \ + } }while(0) #elif EXTRUDERS > 3 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 3: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + } }while(0) + #define REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; case 3: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + } }while(0) #elif EXTRUDERS > 2 #define E_STEP_WRITE(E,V) do{ if (E < 2) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) - #define NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; case 2: E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) - #define REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 2: E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) + #define NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E0_DIR_WRITE( INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + } }while(0) + #define REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E0_DIR_WRITE(!INVERT_E0_DIR); break; \ + case 2: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + } }while(0) #else #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0) @@ -340,23 +429,100 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #elif E_STEPPERS > 1 - #if E_STEPPERS > 5 - #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; case 4: E4_STEP_WRITE(V); case 5: E5_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); case 5: E5_DIR_WRITE(!INVERT_E5_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); case 5: E5_DIR_WRITE( INVERT_E5_DIR); } }while(0) + #if E_STEPPERS > 7 + + #define _E_STEP_WRITE(E,V) do{ switch (E) { \ + case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; \ + case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; case 6: E6_STEP_WRITE(V); break; case 7: E7_STEP_WRITE(V); break; \ + } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \ + case 6: E6_DIR_WRITE(!INVERT_E6_DIR); break; case 7: E7_DIR_WRITE(!INVERT_E7_DIR); break; \ + } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \ + case 6: E6_DIR_WRITE( INVERT_E6_DIR); break; case 7: E7_DIR_WRITE( INVERT_E7_DIR); break; \ + } }while(0) + + #elif E_STEPPERS > 6 + + #define _E_STEP_WRITE(E,V) do{ switch (E) { \ + case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; \ + case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; case 6: E6_STEP_WRITE(V); break; \ + } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \ + case 6: E6_DIR_WRITE(!INVERT_E6_DIR); break; \ + } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \ + case 6: E6_DIR_WRITE( INVERT_E6_DIR); break; \ + } }while(0) + + #elif E_STEPPERS > 5 + + #define _E_STEP_WRITE(E,V) do{ switch (E) { \ + case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; \ + case 4: E4_STEP_WRITE(V); break; case 5: E5_STEP_WRITE(V); break; \ + } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; case 5: E5_DIR_WRITE(!INVERT_E5_DIR); break; \ + } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; case 5: E5_DIR_WRITE( INVERT_E5_DIR); break; \ + } }while(0) + #elif E_STEPPERS > 4 - #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; case 4: E4_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; case 4: E4_DIR_WRITE(!INVERT_E4_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; case 4: E4_DIR_WRITE( INVERT_E4_DIR); } }while(0) + + #define _E_STEP_WRITE(E,V) do{ switch (E) { \ + case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; \ + case 4: E4_STEP_WRITE(V); break; \ + } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE(!INVERT_E4_DIR); break; \ + } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + case 4: E4_DIR_WRITE( INVERT_E4_DIR); break; \ + } }while(0) + #elif E_STEPPERS > 3 - #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); } }while(0) - #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); } }while(0) - #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); } }while(0) + + #define _E_STEP_WRITE(E,V) do{ switch (E) { \ + case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); break; case 3: E3_STEP_WRITE(V); break; \ + } }while(0) + #define _NORM_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE(!INVERT_E2_DIR); break; case 3: E3_DIR_WRITE(!INVERT_E3_DIR); break; \ + } }while(0) + #define _REV_E_DIR(E) do{ switch (E) { \ + case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; \ + case 2: E2_DIR_WRITE( INVERT_E2_DIR); break; case 3: E3_DIR_WRITE( INVERT_E3_DIR); break; \ + } }while(0) + #elif E_STEPPERS > 2 + #define _E_STEP_WRITE(E,V) do{ switch (E) { case 0: E0_STEP_WRITE(V); break; case 1: E1_STEP_WRITE(V); break; case 2: E2_STEP_WRITE(V); } }while(0) #define _NORM_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE(!INVERT_E0_DIR); break; case 1: E1_DIR_WRITE(!INVERT_E1_DIR); break; case 2: E2_DIR_WRITE(!INVERT_E2_DIR); } }while(0) #define _REV_E_DIR(E) do{ switch (E) { case 0: E0_DIR_WRITE( INVERT_E0_DIR); break; case 1: E1_DIR_WRITE( INVERT_E1_DIR); break; case 2: E2_DIR_WRITE( INVERT_E2_DIR); } }while(0) + #else + #define _E_STEP_WRITE(E,V) do{ if (E == 0) { E0_STEP_WRITE(V); } else { E1_STEP_WRITE(V); } }while(0) #define _NORM_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }while(0) #define _REV_E_DIR(E) do{ if (E == 0) { E0_DIR_WRITE( INVERT_E0_DIR); } else { E1_DIR_WRITE( INVERT_E1_DIR); } }while(0) @@ -376,7 +542,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E_STEP_WRITE(E,V) do{ if (extruder_duplication_enabled) { DUPE(STEP,V); } else _E_STEP_WRITE(E,V); }while(0) #if E_STEPPERS > 2 - #if E_STEPPERS > 5 + #if E_STEPPERS > 7 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); _DUPE(5,T,V); _DUPE(6,T,V); _DUPE(7,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); NDIR(5); NDIR(6); NDIR(7); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); RDIR(5); RDIR(6); RDIR(7); } else _REV_E_DIR(E); }while(0) + #elif E_STEPPERS > 6 + #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); _DUPE(5,T,V); _DUPE(6,T,V); }while(0) + #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); NDIR(5); NDIR(6); } else _NORM_E_DIR(E); }while(0) + #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); RDIR(5); RDIR(6); } else _REV_E_DIR(E); }while(0) + #elif E_STEPPERS > 5 #define DUPE(T,V) do{ _DUPE(0,T,V); _DUPE(1,T,V); _DUPE(2,T,V); _DUPE(3,T,V); _DUPE(4,T,V); _DUPE(5,T,V); }while(0) #define NORM_E_DIR(E) do{ if (extruder_duplication_enabled) { NDIR(0); NDIR(1); NDIR(2); NDIR(3); NDIR(4); NDIR(5); } else _NORM_E_DIR(E); }while(0) #define REV_E_DIR(E) do{ if (extruder_duplication_enabled) { RDIR(0); RDIR(1); RDIR(2); RDIR(3); RDIR(4); RDIR(5); } else _REV_E_DIR(E); }while(0) @@ -604,12 +778,42 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define E5_disable() NOOP #endif +#if AXIS_DRIVER_TYPE_E6(L6470) + extern L6470 stepperE6; + #define E6_enable() NOOP + #define E6_disable() do{ stepperE6.free(); CBI(axis_known_position, E_AXIS); }while(0) +#elif E_STEPPERS > 6 && HAS_E6_ENABLE + #define E6_enable() E6_ENABLE_WRITE( E_ENABLE_ON) + #define E6_disable() E6_ENABLE_WRITE(!E_ENABLE_ON) +#else + #define E6_enable() NOOP + #define E6_disable() NOOP +#endif + +#if AXIS_DRIVER_TYPE_E7(L6470) + extern L6470 stepperE7; + #define E7_enable() NOOP + #define E7_disable() do{ stepperE7.free(); CBI(axis_known_position, E_AXIS); }while(0) +#elif E_STEPPERS > 7 && HAS_E7_ENABLE + #define E7_enable() E7_ENABLE_WRITE( E_ENABLE_ON) + #define E7_disable() E7_ENABLE_WRITE(!E_ENABLE_ON) +#else + #define E7_enable() NOOP + #define E7_disable() NOOP +#endif + #if ENABLED(MIXING_EXTRUDER) /** * Mixing steppers synchronize their enable (and direction) together */ - #if MIXING_STEPPERS > 5 + #if MIXING_STEPPERS > 7 + #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); E6_enable(); E7_enable(); } + #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); E7_disable(); } + #elif MIXING_STEPPERS > 6 + #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); E6_enable(); } + #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); E6_disable(); } + #elif MIXING_STEPPERS > 5 #define enable_E0() { E0_enable(); E1_enable(); E2_enable(); E3_enable(); E4_enable(); E5_enable(); } #define disable_E0() { E0_disable(); E1_disable(); E2_disable(); E3_disable(); E4_disable(); E5_disable(); } #elif MIXING_STEPPERS > 4 @@ -635,6 +839,10 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define disable_E4() NOOP #define enable_E5() NOOP #define disable_E5() NOOP + #define enable_E6() NOOP + #define disable_E6() NOOP + #define enable_E7() NOOP + #define disable_E7() NOOP #else // !MIXING_EXTRUDER @@ -686,4 +894,20 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define disable_E5() NOOP #endif + #if E_STEPPERS > 6 && HAS_E6_ENABLE + #define enable_E6() E6_enable() + #define disable_E6() E6_disable() + #else + #define enable_E6() NOOP + #define disable_E6() NOOP + #endif + + #if E_STEPPERS > 7 && HAS_E7_ENABLE + #define enable_E7() E7_enable() + #define disable_E7() E7_disable() + #else + #define enable_E7() NOOP + #define disable_E7() NOOP + #endif + #endif // !MIXING_EXTRUDER diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp index bdb6f2037786..ba65c32eb683 100644 --- a/Marlin/src/module/stepper/trinamic.cpp +++ b/Marlin/src/module/stepper/trinamic.cpp @@ -301,6 +301,20 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; TMC_UART_DEFINE_E(SW, 5); #endif #endif + #if AXIS_HAS_UART(E6) + #ifdef E6_HARDWARE_SERIAL + TMC_UART_DEFINE_E(HW, 6); + #else + TMC_UART_DEFINE_E(SW, 6); + #endif + #endif + #if AXIS_HAS_UART(E7) + #ifdef E7_HARDWARE_SERIAL + TMC_UART_DEFINE_E(HW, 7); + #else + TMC_UART_DEFINE_E(SW, 7); + #endif + #endif void tmc_serial_begin() { #if AXIS_HAS_UART(X) @@ -401,6 +415,20 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E }; stepperE5.beginSerial(TMC_BAUD_RATE); #endif #endif + #if AXIS_HAS_UART(E6) + #ifdef E6_HARDWARE_SERIAL + E6_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + #else + stepperE6.beginSerial(TMC_BAUD_RATE); + #endif + #endif + #if AXIS_HAS_UART(E7) + #ifdef E7_HARDWARE_SERIAL + E7_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); + #else + stepperE7.beginSerial(TMC_BAUD_RATE); + #endif + #endif } #endif @@ -654,6 +682,12 @@ void restore_trinamic_drivers() { #if AXIS_IS_TMC(E5) stepperE5.push(); #endif + #if AXIS_IS_TMC(E6) + stepperE6.push(); + #endif + #if AXIS_IS_TMC(E7) + stepperE7.push(); + #endif } void reset_trinamic_drivers() { @@ -719,6 +753,12 @@ void reset_trinamic_drivers() { #if AXIS_IS_TMC(E5) _TMC_INIT(E5, STEALTH_AXIS_E); #endif + #if AXIS_IS_TMC(E6) + _TMC_INIT(E6, STEALTH_AXIS_E); + #endif + #if AXIS_IS_TMC(E7) + _TMC_INIT(E7, STEALTH_AXIS_E); + #endif #if USE_SENSORLESS #if X_SENSORLESS diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index df4675d81767..afa8847108e6 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -58,6 +58,8 @@ #define TMC_E3_LABEL 'E', '3' #define TMC_E4_LABEL 'E', '4' #define TMC_E5_LABEL 'E', '5' +#define TMC_E6_LABEL 'E', '6' +#define TMC_E7_LABEL 'E', '7' #define __TMC_CLASS(TYPE, L, I, A) TMCMarlin #define _TMC_CLASS(TYPE, LandI, A) __TMC_CLASS(TYPE, LandI, A) @@ -266,3 +268,29 @@ void reset_trinamic_drivers(); #define E5_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E5_STEP_PIN); }while(0) #endif #endif + +// E6 Stepper +#if AXIS_IS_TMC(E6) + extern TMC_CLASS_E(6) stepperE6; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6) + #define E6_ENABLE_INIT() NOOP + #define E6_ENABLE_WRITE(STATE) stepperE6.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E6_ENABLE_READ() stepperE6.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E6) + #define E6_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E6_STEP_PIN); }while(0) + #endif +#endif + +// E7 Stepper +#if AXIS_IS_TMC(E7) + extern TMC_CLASS_E(7) stepperE7; + #if ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7) + #define E7_ENABLE_INIT() NOOP + #define E7_ENABLE_WRITE(STATE) stepperE7.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0) + #define E7_ENABLE_READ() stepperE7.isEnabled() + #endif + #if AXIS_HAS_SQUARE_WAVE(E7) + #define E7_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(E7_STEP_PIN); }while(0) + #endif +#endif diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b0b57873ce6e..eba7afd81a94 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -303,9 +303,11 @@ volatile bool Temperature::temp_meas_ready = false; sensor_heater_2 { HEATER_2_RAW_LO_TEMP, HEATER_2_RAW_HI_TEMP, 0, 16383 }, sensor_heater_3 { HEATER_3_RAW_LO_TEMP, HEATER_3_RAW_HI_TEMP, 0, 16383 }, sensor_heater_4 { HEATER_4_RAW_LO_TEMP, HEATER_4_RAW_HI_TEMP, 0, 16383 }, - sensor_heater_5 { HEATER_5_RAW_LO_TEMP, HEATER_5_RAW_HI_TEMP, 0, 16383 }; + sensor_heater_5 { HEATER_5_RAW_LO_TEMP, HEATER_5_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_6 { HEATER_6_RAW_LO_TEMP, HEATER_6_RAW_HI_TEMP, 0, 16383 }, + sensor_heater_7 { HEATER_7_RAW_LO_TEMP, HEATER_7_RAW_HI_TEMP, 0, 16383 }; - temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0, sensor_heater_1, sensor_heater_2, sensor_heater_3, sensor_heater_4, sensor_heater_5); + temp_range_t Temperature::temp_range[HOTENDS] = ARRAY_BY_HOTENDS(sensor_heater_0, sensor_heater_1, sensor_heater_2, sensor_heater_3, sensor_heater_4, sensor_heater_5, sensor_heater_6, sensor_heater_7); #endif #ifdef MAX_CONSECUTIVE_LOW_TEMPERATURE_ERROR_ALLOWED @@ -686,6 +688,12 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { , REPEAT2(4,_EFAN,4) 4 #if HOTENDS > 5 , REPEAT2(5,_EFAN,5) 5 + #if HOTENDS > 6 + , REPEAT2(6,_EFAN,6) 6 + #if HOTENDS > 7 + , REPEAT2(7,_EFAN,7) 7 + #endif + #endif #endif #endif #endif @@ -751,6 +759,12 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) { #if HAS_AUTO_FAN_5 case 5: _UPDATE_AUTO_FAN(E5, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; #endif + #if HAS_AUTO_FAN_6 + case 6: _UPDATE_AUTO_FAN(E6, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; + #endif + #if HAS_AUTO_FAN_7 + case 7: _UPDATE_AUTO_FAN(E7, fan_on, EXTRUDER_AUTO_FAN_SPEED); break; + #endif #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_E case CHAMBER_FAN_INDEX: _UPDATE_AUTO_FAN(CHAMBER, fan_on, CHAMBER_AUTO_FAN_SPEED); break; #endif @@ -893,7 +907,6 @@ void Temperature::min_temp_error(const heater_ind_t heater) { pid_output += work_pid[ee].Kc; } #endif // PID_EXTRUSION_SCALING - #if ENABLED(PID_FAN_SCALING) if (thermalManager.fan_speed[active_extruder] > PID_FAN_SCALING_MIN_SPEED) { work_pid[ee].Kf = PID_PARAM(Kf, ee) + (PID_FAN_SCALING_LIN_FACTOR) * thermalManager.fan_speed[active_extruder]; @@ -902,7 +915,6 @@ void Temperature::min_temp_error(const heater_ind_t heater) { //pid_output -= work_pid[ee].Ki; //pid_output += work_pid[ee].Ki * work_pid[ee].Kf #endif // PID_FAN_SCALING - LIMIT(pid_output, 0, PID_MAX); } temp_dState[ee] = temp_hotend[ee].celsius; @@ -1286,6 +1298,12 @@ void Temperature::manage_heater() { #if ENABLED(HEATER_5_USER_THERMISTOR) { true, 0, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 }, #endif + #if ENABLED(HEATER_6_USER_THERMISTOR) + { true, 0, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 }, + #endif + #if ENABLED(HEATER_7_USER_THERMISTOR) + { true, 0, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 }, + #endif #if ENABLED(HEATER_BED_USER_THERMISTOR) { true, 0, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 }, #endif @@ -1331,6 +1349,12 @@ void Temperature::manage_heater() { #if ENABLED(HEATER_5_USER_THERMISTOR) t_index == CTI_HOTEND_5 ? PSTR("HOTEND 5") : #endif + #if ENABLED(HEATER_6_USER_THERMISTOR) + t_index == CTI_HOTEND_6 ? PSTR("HOTEND 6") : + #endif + #if ENABLED(HEATER_7_USER_THERMISTOR) + t_index == CTI_HOTEND_7 ? PSTR("HOTEND 7") : + #endif #if ENABLED(HEATER_BED_USER_THERMISTOR) t_index == CTI_BED ? PSTR("BED") : #endif @@ -1476,6 +1500,26 @@ void Temperature::manage_heater() { #else break; #endif + case 6: + #if ENABLED(HEATER_6_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_6, raw); + #elif ENABLED(HEATER_6_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_6_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif + case 7: + #if ENABLED(HEATER_7_USER_THERMISTOR) + return user_thermistor_to_deg_c(CTI_HOTEND_7, raw); + #elif ENABLED(HEATER_7_USES_AD595) + return TEMP_AD595(raw); + #elif ENABLED(HEATER_7_USES_AD8495) + return TEMP_AD8495(raw); + #else + break; + #endif default: break; } @@ -1633,8 +1677,9 @@ void Temperature::init() { #endif #if MB(RUMBA) - #define _AD(N) (ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495)) - #if _AD(0) || _AD(1) || _AD(2) || _AD(3) || _AD(4) || _AD(5) || _AD(BED) || _AD(CHAMBER) + #define _AD(N) ANY(HEATER_##N##_USES_AD595, HEATER_##N##_USES_AD8495) + #if _AD(0) || _AD(1) || _AD(2) /* RUMBA has 3 E plugs // || _AD(3) || _AD(4) || _AD(5) || _AD(6) || _AD(7) */ \ + || _AD(BED) || _AD(CHAMBER) // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector MCUCR = _BV(JTD); MCUCR = _BV(JTD); @@ -1668,6 +1713,12 @@ void Temperature::init() { #if HAS_HEATER_5 OUT_WRITE(HEATER_5_PIN, HEATER_5_INVERTING); #endif + #if HAS_HEATER_6 + OUT_WRITE(HEATER_6_PIN, HEATER_6_INVERTING); + #endif + #if HAS_HEATER_7 + OUT_WRITE(HEATER_7_PIN, HEATER_7_INVERTING); + #endif #if HAS_HEATED_BED #ifdef ALFAWISE_UX0 @@ -1690,6 +1741,21 @@ void Temperature::init() { #if HAS_FAN2 INIT_FAN_PIN(FAN2_PIN); #endif + #if HAS_FAN3 + INIT_FAN_PIN(FAN3_PIN); + #endif + #if HAS_FAN4 + INIT_FAN_PIN(FAN4_PIN); + #endif + #if HAS_FAN5 + INIT_FAN_PIN(FAN5_PIN); + #endif + #if HAS_FAN6 + INIT_FAN_PIN(FAN6_PIN); + #endif + #if HAS_FAN7 + INIT_FAN_PIN(FAN7_PIN); + #endif #if ENABLED(USE_CONTROLLER_FAN) INIT_FAN_PIN(CONTROLLER_FAN_PIN); #endif @@ -1731,6 +1797,12 @@ void Temperature::init() { #if HAS_TEMP_ADC_5 HAL_ANALOG_SELECT(TEMP_5_PIN); #endif + #if HAS_TEMP_ADC_6 + HAL_ANALOG_SELECT(TEMP_6_PIN); + #endif + #if HAS_TEMP_ADC_7 + HAL_ANALOG_SELECT(TEMP_7_PIN); + #endif #if HAS_JOY_ADC_X HAL_ANALOG_SELECT(JOY_X_PIN); #endif @@ -1780,6 +1852,12 @@ void Temperature::init() { #if HAS_AUTO_FAN_5 && !(_EFANOVERLAP(5,0) || _EFANOVERLAP(5,1) || _EFANOVERLAP(5,2) || _EFANOVERLAP(5,3) || _EFANOVERLAP(5,4)) INIT_E_AUTO_FAN_PIN(E5_AUTO_FAN_PIN); #endif + #if HAS_AUTO_FAN_6 && !(_EFANOVERLAP(6,0) || _EFANOVERLAP(6,1) || _EFANOVERLAP(6,2) || _EFANOVERLAP(6,3) || _EFANOVERLAP(6,4) || _EFANOVERLAP(6,5)) + INIT_E_AUTO_FAN_PIN(E6_AUTO_FAN_PIN); + #endif + #if HAS_AUTO_FAN_7 && !(_EFANOVERLAP(7,0) || _EFANOVERLAP(7,1) || _EFANOVERLAP(7,2) || _EFANOVERLAP(7,3) || _EFANOVERLAP(7,4) || _EFANOVERLAP(7,5) || _EFANOVERLAP(7,6)) + INIT_E_AUTO_FAN_PIN(E7_AUTO_FAN_PIN); + #endif #if HAS_AUTO_CHAMBER_FAN && !AUTO_CHAMBER_IS_E INIT_CHAMBER_AUTO_FAN_PIN(CHAMBER_AUTO_FAN_PIN); #endif @@ -1841,6 +1919,22 @@ void Temperature::init() { #ifdef HEATER_5_MAXTEMP _TEMP_MAX_E(5); #endif + #if HOTENDS > 6 + #ifdef HEATER_6_MINTEMP + _TEMP_MIN_E(6); + #endif + #ifdef HEATER_6_MAXTEMP + _TEMP_MAX_E(6); + #endif + #if HOTENDS > 7 + #ifdef HEATER_7_MINTEMP + _TEMP_MIN_E(7); + #endif + #ifdef HEATER_7_MAXTEMP + _TEMP_MAX_E(7); + #endif + #endif // HOTENDS > 7 + #endif // HOTENDS > 6 #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 @@ -2232,6 +2326,12 @@ void Temperature::set_current_temp_raw() { temp_hotend[4].update(); #if HAS_TEMP_ADC_5 temp_hotend[5].update(); + #if HAS_TEMP_ADC_6 + temp_hotend[6].update(); + #if HAS_TEMP_ADC_7 + temp_hotend[7].update(); + #endif // HAS_TEMP_ADC_7 + #endif // HAS_TEMP_ADC_6 #endif // HAS_TEMP_ADC_5 #endif // HAS_TEMP_ADC_4 #endif // HAS_TEMP_ADC_3 @@ -2508,6 +2608,21 @@ void Temperature::tick() { #if HAS_FAN2 _FAN_PWM(2); #endif + #if HAS_FAN3 + _FAN_PWM(3); + #endif + #if HAS_FAN4 + _FAN_PWM(4); + #endif + #if HAS_FAN5 + _FAN_PWM(5); + #endif + #if HAS_FAN6 + _FAN_PWM(6); + #endif + #if HAS_FAN7 + _FAN_PWM(7); + #endif #endif } else { @@ -2535,6 +2650,21 @@ void Temperature::tick() { #if HAS_FAN2 if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN(2, LOW); #endif + #if HAS_FAN3 + if (soft_pwm_count_fan[3] <= pwm_count_tmp) WRITE_FAN(3, LOW); + #endif + #if HAS_FAN4 + if (soft_pwm_count_fan[4] <= pwm_count_tmp) WRITE_FAN(4, LOW); + #endif + #if HAS_FAN5 + if (soft_pwm_count_fan[5] <= pwm_count_tmp) WRITE_FAN(5, LOW); + #endif + #if HAS_FAN6 + if (soft_pwm_count_fan[6] <= pwm_count_tmp) WRITE_FAN(6, LOW); + #endif + #if HAS_FAN7 + if (soft_pwm_count_fan[7] <= pwm_count_tmp) WRITE_FAN(7, LOW); + #endif #endif } @@ -2599,6 +2729,21 @@ void Temperature::tick() { #if HAS_FAN2 _PWM_FAN(2); #endif + #if HAS_FAN3 + _FAN_PWM(3); + #endif + #if HAS_FAN4 + _FAN_PWM(4); + #endif + #if HAS_FAN5 + _FAN_PWM(5); + #endif + #if HAS_FAN6 + _FAN_PWM(6); + #endif + #if HAS_FAN7 + _FAN_PWM(7); + #endif } #if HAS_FAN0 if (soft_pwm_count_fan[0] <= pwm_count_tmp) WRITE_FAN(0, LOW); @@ -2609,6 +2754,21 @@ void Temperature::tick() { #if HAS_FAN2 if (soft_pwm_count_fan[2] <= pwm_count_tmp) WRITE_FAN(2, LOW); #endif + #if HAS_FAN3 + if (soft_pwm_count_fan[3] <= pwm_count_tmp) WRITE_FAN(3, LOW); + #endif + #if HAS_FAN4 + if (soft_pwm_count_fan[4] <= pwm_count_tmp) WRITE_FAN(4, LOW); + #endif + #if HAS_FAN5 + if (soft_pwm_count_fan[5] <= pwm_count_tmp) WRITE_FAN(5, LOW); + #endif + #if HAS_FAN6 + if (soft_pwm_count_fan[6] <= pwm_count_tmp) WRITE_FAN(6, LOW); + #endif + #if HAS_FAN7 + if (soft_pwm_count_fan[7] <= pwm_count_tmp) WRITE_FAN(7, LOW); + #endif #endif // FAN_SOFT_PWM // SOFT_PWM_SCALE to frequency: @@ -2730,6 +2890,16 @@ void Temperature::tick() { case MeasureTemp_5: ACCUMULATE_ADC(temp_hotend[5]); break; #endif + #if HAS_TEMP_ADC_6 + case PrepareTemp_6: HAL_START_ADC(TEMP_6_PIN); break; + case MeasureTemp_6: ACCUMULATE_ADC(temp_hotend[6]); break; + #endif + + #if HAS_TEMP_ADC_7 + case PrepareTemp_7: HAL_START_ADC(TEMP_7_PIN); break; + case MeasureTemp_7: ACCUMULATE_ADC(temp_hotend[7]); break; + #endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) case Prepare_FILWIDTH: HAL_START_ADC(FILWIDTH_PIN); break; case Measure_FILWIDTH: diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 9c1860798c53..5273104503ee 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -132,6 +132,12 @@ enum ADCSensorState : char { #if HAS_TEMP_ADC_5 PrepareTemp_5, MeasureTemp_5, #endif + #if HAS_TEMP_ADC_6 + PrepareTemp_6, MeasureTemp_6, + #endif + #if HAS_TEMP_ADC_7 + PrepareTemp_7, MeasureTemp_7, + #endif #if HAS_JOY_ADC_X PrepareJoy_X, MeasureJoy_X, #endif diff --git a/Marlin/src/module/thermistor/thermistors.h b/Marlin/src/module/thermistor/thermistors.h index 1e7b76d15323..875f742ccb28 100644 --- a/Marlin/src/module/thermistor/thermistors.h +++ b/Marlin/src/module/thermistor/thermistors.h @@ -39,7 +39,7 @@ #define OV(N) int16_t((N) * (OVERSAMPLENR) * (THERMISTOR_TABLE_SCALE)) -#define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n) +#define ANY_THERMISTOR_IS(n) (THERMISTOR_HEATER_0 == n || THERMISTOR_HEATER_1 == n || THERMISTOR_HEATER_2 == n || THERMISTOR_HEATER_3 == n || THERMISTOR_HEATER_4 == n || THERMISTOR_HEATER_5 == n || THERMISTOR_HEATER_6 == n || THERMISTOR_HEATER_7 == n || THERMISTORBED == n || THERMISTORCHAMBER == n || THERMISTORPROBE == n) // Pt1000 and Pt100 handling // @@ -235,6 +235,26 @@ #define HEATER_5_TEMPTABLE_LEN 0 #endif +#if THERMISTOR_HEATER_6 + #define HEATER_6_TEMPTABLE TT_NAME(THERMISTOR_HEATER_6) + #define HEATER_6_TEMPTABLE_LEN COUNT(HEATER_6_TEMPTABLE) +#elif defined(HEATER_6_USES_THERMISTOR) + #error "No heater 6 thermistor table specified" +#else + #define HEATER_6_TEMPTABLE nullptr + #define HEATER_6_TEMPTABLE_LEN 0 +#endif + +#if THERMISTOR_HEATER_7 + #define HEATER_7_TEMPTABLE TT_NAME(THERMISTOR_HEATER_7) + #define HEATER_7_TEMPTABLE_LEN COUNT(HEATER_7_TEMPTABLE) +#elif defined(HEATER_7_USES_THERMISTOR) + #error "No heater 7 thermistor table specified" +#else + #define HEATER_7_TEMPTABLE nullptr + #define HEATER_7_TEMPTABLE_LEN 0 +#endif + #ifdef THERMISTORBED #define BED_TEMPTABLE TT_NAME(THERMISTORBED) #define BED_TEMPTABLE_LEN COUNT(BED_TEMPTABLE) @@ -264,6 +284,7 @@ static_assert( HEATER_0_TEMPTABLE_LEN < 256 && HEATER_1_TEMPTABLE_LEN < 256 && HEATER_2_TEMPTABLE_LEN < 256 && HEATER_3_TEMPTABLE_LEN < 256 && HEATER_4_TEMPTABLE_LEN < 256 && HEATER_5_TEMPTABLE_LEN < 256 + && HEATER_6_TEMPTABLE_LEN < 258 && HEATER_7_TEMPTABLE_LEN < 258 && BED_TEMPTABLE_LEN < 256 && CHAMBER_TEMPTABLE_LEN < 256 && PROBE_TEMPTABLE_LEN < 256, "Temperature conversion tables over 255 entries need special consideration." @@ -326,6 +347,24 @@ static_assert( #define HEATER_5_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE #endif #endif +#ifndef HEATER_6_RAW_HI_TEMP + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_6_USES_THERMISTOR) + #define HEATER_6_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE + #define HEATER_6_RAW_LO_TEMP 0 + #else + #define HEATER_6_RAW_HI_TEMP 0 + #define HEATER_6_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE + #endif +#endif +#ifndef HEATER_7_RAW_HI_TEMP + #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_7_USES_THERMISTOR) + #define HEATER_7_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE + #define HEATER_7_RAW_LO_TEMP 0 + #else + #define HEATER_7_RAW_HI_TEMP 0 + #define HEATER_7_RAW_LO_TEMP MAX_RAW_THERMISTOR_VALUE + #endif +#endif #ifndef HEATER_BED_RAW_HI_TEMP #if defined(REVERSE_TEMP_SENSOR_RANGE) || !defined(HEATER_BED_USES_THERMISTOR) #define HEATER_BED_RAW_HI_TEMP MAX_RAW_THERMISTOR_VALUE diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index c29f0c363d69..bd799e5e91f7 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -534,6 +534,8 @@ #include "stm32/pins_STEVAL_3DP001V1.h" // STM32F4 env:STM32F401VE_STEVAL #elif MB(BIGTREE_SKR_PRO_V1_1) #include "stm32/pins_BTT_SKR_PRO_V1_1.h" // STM32F4 env:BIGTREE_SKR_PRO +#elif MB(BIGTREE_GTR_V1_0) + #include "stm32/pins_BTT_GTR_V1_0.h" // STM32F4 env:BIGTREE_GTR #elif MB(BIGTREE_BTT002_V1_0) #include "stm32/pins_BTT_BTT002_V1_0.h" // STM32F4 env:BIGTREE_BTT002 #elif MB(LERDGE_K) @@ -713,6 +715,24 @@ #ifndef E5_MS3_PIN #define E5_MS3_PIN -1 #endif +#ifndef E6_MS1_PIN + #define E6_MS1_PIN -1 +#endif +#ifndef E6_MS2_PIN + #define E6_MS2_PIN -1 +#endif +#ifndef E6_MS3_PIN + #define E6_MS3_PIN -1 +#endif +#ifndef E7_MS1_PIN + #define E7_MS1_PIN -1 +#endif +#ifndef E7_MS2_PIN + #define E7_MS2_PIN -1 +#endif +#ifndef E7_MS3_PIN + #define E7_MS3_PIN -1 +#endif #ifndef E0_STEP_PIN #define E0_STEP_PIN -1 @@ -768,6 +788,24 @@ #ifndef E5_ENABLE_PIN #define E5_ENABLE_PIN -1 #endif +#ifndef E6_STEP_PIN + #define E6_STEP_PIN -1 +#endif +#ifndef E6_DIR_PIN + #define E6_DIR_PIN -1 +#endif +#ifndef E6_ENABLE_PIN + #define E6_ENABLE_PIN -1 +#endif +#ifndef E7_STEP_PIN + #define E7_STEP_PIN -1 +#endif +#ifndef E7_DIR_PIN + #define E7_DIR_PIN -1 +#endif +#ifndef E7_ENABLE_PIN + #define E7_ENABLE_PIN -1 +#endif #ifndef X_CS_PIN #define X_CS_PIN -1 @@ -796,6 +834,12 @@ #ifndef E5_CS_PIN #define E5_CS_PIN -1 #endif +#ifndef E6_CS_PIN + #define E6_CS_PIN -1 +#endif +#ifndef E7_CS_PIN + #define E7_CS_PIN -1 +#endif #ifndef FAN_PIN #define FAN_PIN -1 @@ -839,6 +883,12 @@ #ifndef HEATER_5_PIN #define HEATER_5_PIN -1 #endif +#ifndef HEATER_6_PIN + #define HEATER_6_PIN -1 +#endif +#ifndef HEATER_7_PIN + #define HEATER_7_PIN -1 +#endif #ifndef HEATER_BED_PIN #define HEATER_BED_PIN -1 #endif @@ -861,6 +911,12 @@ #ifndef TEMP_5_PIN #define TEMP_5_PIN -1 #endif +#ifndef TEMP_6_PIN + #define TEMP_6_PIN -1 +#endif +#ifndef TEMP_7_PIN + #define TEMP_7_PIN -1 +#endif #ifndef TEMP_BED_PIN #define TEMP_BED_PIN -1 #endif @@ -940,6 +996,20 @@ #define E5_AUTO_FAN_PIN -1 #endif #endif +#ifndef E6_AUTO_FAN_PIN + #ifdef ORIG_E6_AUTO_FAN_PIN + #define E6_AUTO_FAN_PIN ORIG_E6_AUTO_FAN_PIN + #else + #define E6_AUTO_FAN_PIN -1 + #endif +#endif +#ifndef E7_AUTO_FAN_PIN + #ifdef ORIG_E7_AUTO_FAN_PIN + #define E7_AUTO_FAN_PIN ORIG_E7_AUTO_FAN_PIN + #else + #define E7_AUTO_FAN_PIN -1 + #endif +#endif #ifndef CHAMBER_AUTO_FAN_PIN #ifdef ORIG_CHAMBER_AUTO_FAN_PIN #define CHAMBER_AUTO_FAN_PIN ORIG_CHAMBER_AUTO_FAN_PIN diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 771ca3da0936..ca8c3f9a99f7 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -153,6 +153,24 @@ #if !PIN_EXISTS(E5_MS3) #undef E5_MS3_PIN #endif +#if !PIN_EXISTS(E6_MS1) + #undef E6_MS1_PIN +#endif +#if !PIN_EXISTS(E6_MS2) + #undef E6_MS2_PIN +#endif +#if !PIN_EXISTS(E6_MS3) + #undef E6_MS3_PIN +#endif +#if !PIN_EXISTS(E7_MS1) + #undef E7_MS1_PIN +#endif +#if !PIN_EXISTS(E7_MS2) + #undef E7_MS2_PIN +#endif +#if !PIN_EXISTS(E7_MS3) + #undef E7_MS3_PIN +#endif #if !PIN_EXISTS(E0_STEP) #undef E0_STEP_PIN @@ -208,6 +226,24 @@ #if !PIN_EXISTS(E5_ENABLE) #undef E5_ENABLE_PIN #endif +#if !PIN_EXISTS(E6_STEP) + #undef E6_STEP_PIN +#endif +#if !PIN_EXISTS(E6_DIR) + #undef E6_DIR_PIN +#endif +#if !PIN_EXISTS(E6_ENABLE) + #undef E6_ENABLE_PIN +#endif +#if !PIN_EXISTS(E7_STEP) + #undef E7_STEP_PIN +#endif +#if !PIN_EXISTS(E7_DIR) + #undef E7_DIR_PIN +#endif +#if !PIN_EXISTS(E7_ENABLE) + #undef E7_ENABLE_PIN +#endif #if !PIN_EXISTS(X_CS) #undef X_CS_PIN @@ -236,6 +272,12 @@ #if !PIN_EXISTS(E5_CS) #undef E5_CS_PIN #endif +#if !PIN_EXISTS(E6_CS) + #undef E6_CS_PIN +#endif +#if !PIN_EXISTS(E7_CS) + #undef E7_CS_PIN +#endif #if !PIN_EXISTS(FAN) #undef FAN_PIN @@ -247,6 +289,21 @@ #if !PIN_EXISTS(FAN2) #undef FAN2_PIN #endif +#if !PIN_EXISTS(FAN3) + #undef FAN3_PIN +#endif +#if !PIN_EXISTS(FAN4) + #undef FAN4_PIN +#endif +#if !PIN_EXISTS(FAN5) + #undef FAN5_PIN +#endif +#if !PIN_EXISTS(FAN6) + #undef FAN6_PIN +#endif +#if !PIN_EXISTS(FAN7) + #undef FAN7_PIN +#endif #if !PIN_EXISTS(CONTROLLER_FAN) #undef CONTROLLER_FAN_PIN #endif @@ -279,6 +336,12 @@ #if !PIN_EXISTS(HEATER_5) #undef HEATER_5_PIN #endif +#if !PIN_EXISTS(HEATER_6) + #undef HEATER_6_PIN +#endif +#if !PIN_EXISTS(HEATER_7) + #undef HEATER_7_PIN +#endif #if !PIN_EXISTS(HEATER_BED) #undef HEATER_BED_PIN #endif @@ -301,6 +364,12 @@ #if !PIN_EXISTS(TEMP_5) #undef TEMP_5_PIN #endif +#if !PIN_EXISTS(TEMP_6) + #undef TEMP_6_PIN +#endif +#if !PIN_EXISTS(TEMP_7) + #undef TEMP_7_PIN +#endif #if !PIN_EXISTS(TEMP_BED) #undef TEMP_BED_PIN #endif @@ -363,6 +432,12 @@ #if PIN_EXISTS(TEMP_5) && TEMP_5_PIN < NUM_ANALOG_INPUTS REPORT_NAME_ANALOG(__LINE__, TEMP_5_PIN) #endif +#if PIN_EXISTS(TEMP_6) && TEMP_6_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(__LINE__, TEMP_6_PIN) +#endif +#if PIN_EXISTS(TEMP_7) && TEMP_7_PIN < NUM_ANALOG_INPUTS + REPORT_NAME_ANALOG(__LINE__, TEMP_7_PIN) +#endif #if PIN_EXISTS(TEMP_BED) && TEMP_BED_PIN < NUM_ANALOG_INPUTS REPORT_NAME_ANALOG(__LINE__, TEMP_BED_PIN) #endif @@ -686,6 +761,54 @@ #if PIN_EXISTS(E5_STEP) REPORT_NAME_DIGITAL(__LINE__, E5_STEP_PIN) #endif +#if PIN_EXISTS(E6_AUTO_FAN) + REPORT_NAME_DIGITAL(__LINE__, E6_AUTO_FAN_PIN) +#endif +#if PIN_EXISTS(E6_CS) + REPORT_NAME_DIGITAL(__LINE__, E6_CS_PIN) +#endif +#if PIN_EXISTS(E6_DIR) + REPORT_NAME_DIGITAL(__LINE__, E6_DIR_PIN) +#endif +#if PIN_EXISTS(E6_ENABLE) + REPORT_NAME_DIGITAL(__LINE__, E6_ENABLE_PIN) +#endif +#if PIN_EXISTS(E6_MS1) + REPORT_NAME_DIGITAL(__LINE__, E6_MS1_PIN) +#endif +#if PIN_EXISTS(E6_MS2) + REPORT_NAME_DIGITAL(__LINE__, E6_MS2_PIN) +#endif +#if PIN_EXISTS(E6_MS3) + REPORT_NAME_DIGITAL(__LINE__, E6_MS3_PIN) +#endif +#if PIN_EXISTS(E6_STEP) + REPORT_NAME_DIGITAL(__LINE__, E6_STEP_PIN) +#endif +#if PIN_EXISTS(E7_AUTO_FAN) + REPORT_NAME_DIGITAL(__LINE__, E7_AUTO_FAN_PIN) +#endif +#if PIN_EXISTS(E7_CS) + REPORT_NAME_DIGITAL(__LINE__, E7_CS_PIN) +#endif +#if PIN_EXISTS(E7_DIR) + REPORT_NAME_DIGITAL(__LINE__, E7_DIR_PIN) +#endif +#if PIN_EXISTS(E7_ENABLE) + REPORT_NAME_DIGITAL(__LINE__, E7_ENABLE_PIN) +#endif +#if PIN_EXISTS(E7_MS1) + REPORT_NAME_DIGITAL(__LINE__, E7_MS1_PIN) +#endif +#if PIN_EXISTS(E7_MS2) + REPORT_NAME_DIGITAL(__LINE__, E7_MS2_PIN) +#endif +#if PIN_EXISTS(E7_MS3) + REPORT_NAME_DIGITAL(__LINE__, E7_MS3_PIN) +#endif +#if PIN_EXISTS(E7_STEP) + REPORT_NAME_DIGITAL(__LINE__, E7_STEP_PIN) +#endif #if defined(ENET_CRS) && ENET_CRS >= 0 REPORT_NAME_DIGITAL(__LINE__, ENET_CRS) #endif @@ -765,6 +888,18 @@ #if PIN_EXISTS(FAN3) REPORT_NAME_DIGITAL(__LINE__, FAN3_PIN) #endif +#if PIN_EXISTS(FAN4) + REPORT_NAME_DIGITAL(__LINE__, FAN4_PIN) +#endif +#if PIN_EXISTS(FAN5) + REPORT_NAME_DIGITAL(__LINE__, FAN5_PIN) +#endif +#if PIN_EXISTS(FAN6) + REPORT_NAME_DIGITAL(__LINE__, FAN6_PIN) +#endif +#if PIN_EXISTS(FAN7) + REPORT_NAME_DIGITAL(__LINE__, FAN7_PIN) +#endif #if PIN_EXISTS(FIL_RUNOUT) REPORT_NAME_DIGITAL(__LINE__, FIL_RUNOUT_PIN) #endif @@ -936,6 +1071,12 @@ #if PIN_EXISTS(ORIG_E5_AUTO_FAN) REPORT_NAME_DIGITAL(__LINE__, ORIG_E5_AUTO_FAN_PIN) #endif +#if PIN_EXISTS(ORIG_E6_AUTO_FAN) + REPORT_NAME_DIGITAL(__LINE__, ORIG_E6_AUTO_FAN_PIN) +#endif +#if PIN_EXISTS(ORIG_E7_AUTO_FAN) + REPORT_NAME_DIGITAL(__LINE__, ORIG_E7_AUTO_FAN_PIN) +#endif #if PIN_EXISTS(PHOTOGRAPH) REPORT_NAME_DIGITAL(__LINE__, PHOTOGRAPH_PIN) #endif @@ -1455,6 +1596,18 @@ #if PIN_EXISTS(E5_SERIAL_RX) REPORT_NAME_DIGITAL(__LINE__, E5_SERIAL_RX_PIN) #endif +#if PIN_EXISTS(E6_SERIAL_TX) + REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_TX_PIN) +#endif +#if PIN_EXISTS(E6_SERIAL_RX) + REPORT_NAME_DIGITAL(__LINE__, E6_SERIAL_RX_PIN) +#endif +#if PIN_EXISTS(E7_SERIAL_TX) + REPORT_NAME_DIGITAL(__LINE__, E7_SERIAL_TX_PIN) +#endif +#if PIN_EXISTS(E7_SERIAL_RX) + REPORT_NAME_DIGITAL(__LINE__, E7_SERIAL_RX_PIN) +#endif #if PIN_EXISTS(L6470_CHAIN_SCK) REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_SCK_PIN) #endif diff --git a/Marlin/src/pins/sensitive_pins.h b/Marlin/src/pins/sensitive_pins.h index 24daf354bfbe..2492f318167e 100644 --- a/Marlin/src/pins/sensitive_pins.h +++ b/Marlin/src/pins/sensitive_pins.h @@ -277,6 +277,54 @@ #endif #endif +#define _E6_CS +#define _E6_MS2 +#define _E6_MS3 +#define _E6_MS4 + +#if E_NEEDED(6) + #if PIN_EXISTS(E6_CS) && AXIS_HAS_SPI(E6) + #undef _E6_CS + #define _E6_CS E6_CS_PIN, + #endif + #if PIN_EXISTS(E6_MS2) + #undef _E6_MS2 + #define _E6_MS2 E6_MS2_PIN, + #endif + #if PIN_EXISTS(E6_MS3) + #undef _E6_MS3 + #define _E6_MS3 E6_MS3_PIN, + #endif + #if PIN_EXISTS(E6_MS4) + #undef _E6_MS4 + #define _E6_MS4 E6_MS4_PIN, + #endif +#endif + +#define _E7_CS +#define _E7_MS3 +#define _E7_MS4 +#define _E7_MS5 + +#if E_NEEDED(7) + #if PIN_EXISTS(E7_CS) && AXIS_HAS_SPI(E7) + #undef _E7_CS + #define _E7_CS E7_CS_PIN, + #endif + #if PIN_EXISTS(E7_MS3) + #undef _E7_MS3 + #define _E7_MS3 E7_MS3_PIN, + #endif + #if PIN_EXISTS(E7_MS4) + #undef _E7_MS4 + #define _E7_MS4 E7_MS4_PIN, + #endif + #if PIN_EXISTS(E7_MS5) + #undef _E7_MS5 + #define _E7_MS5 E7_MS5_PIN, + #endif +#endif + // // E Steppers // @@ -287,6 +335,8 @@ #define _E3_PINS #define _E4_PINS #define _E5_PINS +#define _E6_PINS +#define _E7_PINS #if EXTRUDERS #undef _E0_PINS @@ -303,7 +353,9 @@ #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, _E2_CS _E2_MS1 _E2_MS2 _E2_MS3 #endif #endif + #elif EXTRUDERS > 1 || ENABLED(MIXING_EXTRUDER) + #undef _E1_PINS #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, _E1_CS _E1_MS1 _E1_MS2 _E1_MS3 #if EXTRUDERS > 2 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 2) @@ -318,10 +370,19 @@ #if EXTRUDERS > 5 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 5) #undef _E5_PINS #define _E5_PINS E5_STEP_PIN, E5_DIR_PIN, E5_ENABLE_PIN, _E5_CS _E5_MS1 _E5_MS2 _E5_MS3 + #if EXTRUDERS > 6 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 6) + #undef _E6_PINS + #define _E6_PINS E6_STEP_PIN, E6_DIR_PIN, E6_ENABLE_PIN, _E6_CS _E6_MS1 _E6_MS2 _E6_MS3 + #if EXTRUDERS > 7 || (ENABLED(MIXING_EXTRUDER) && MIXING_STEPPERS > 7) + #undef _E7_PINS + #define _E7_PINS E7_STEP_PIN, E7_DIR_PIN, E7_ENABLE_PIN, _E7_CS _E7_MS1 _E7_MS2 _E7_MS3 + #endif // EXTRUDERS > 7 || MIXING_EXTRUDER > 7 + #endif // EXTRUDERS > 6 || MIXING_EXTRUDER > 6 #endif // EXTRUDERS > 5 || MIXING_EXTRUDER > 5 #endif // EXTRUDERS > 4 || MIXING_EXTRUDER > 4 #endif // EXTRUDERS > 3 || MIXING_EXTRUDER > 3 #endif // EXTRUDERS > 2 || MIXING_EXTRUDER > 2 + #endif // EXTRUDERS > 1 || MIXING_EXTRUDER // @@ -334,6 +395,8 @@ #define _H3_PINS #define _H4_PINS #define _H5_PINS +#define _H6_PINS +#define _H7_PINS #if HOTENDS #undef _H0_PINS @@ -353,6 +416,14 @@ #if HOTENDS > 5 #undef _H5_PINS #define _H5_PINS HEATER_5_PIN, E5_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_5_PIN), + #if HOTENDS > 6 + #undef _H6_PINS + #define _H6_PINS HEATER_6_PIN, E6_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_6_PIN), + #if HOTENDS > 7 + #undef _H7_PINS + #define _H7_PINS HEATER_7_PIN, E7_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_7_PIN), + #endif // HOTENDS > 7 + #endif // HOTENDS > 6 #endif // HOTENDS > 5 #endif // HOTENDS > 4 #endif // HOTENDS > 3 @@ -539,6 +610,31 @@ #else #define _FAN2 #endif +#if PIN_EXISTS(FAN3) + #define _FAN3 FAN3_PIN, +#else + #define _FAN3 +#endif +#if PIN_EXISTS(FAN4) + #define _FAN4 FAN4_PIN, +#else + #define _FAN4 +#endif +#if PIN_EXISTS(FAN5) + #define _FAN5 FAN5_PIN, +#else + #define _FAN5 +#endif +#if PIN_EXISTS(FAN6) + #define _FAN6 FAN6_PIN, +#else + #define _FAN6 +#endif +#if PIN_EXISTS(FAN7) + #define _FAN7 FAN7_PIN, +#else + #define _FAN7 +#endif #if PIN_EXISTS(CONTROLLER_FAN) #define _FANC CONTROLLER_FAN_PIN, #else @@ -550,9 +646,9 @@ #endif #define SENSITIVE_PINS { \ - _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z4_PINS \ - _Z_PROBE _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS \ - _BED_PINS _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS \ - _PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FANC \ + _X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z4_PINS _Z_PROBE \ + _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _E6_PINS _E7_PINS _BED_PINS \ + _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS _H6_PINS _H7_PINS \ + _PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FAN3 _FAN4 _FAN5 _FAN6 _FAN7 _FANC \ HAL_SENSITIVE_PINS \ } diff --git a/Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h new file mode 100644 index 000000000000..8ed2e50d253e --- /dev/null +++ b/Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h @@ -0,0 +1,391 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 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 + +#ifndef TARGET_STM32F4 + #error "Oops! Select an STM32F4 board in 'Tools > Board.'" +#elif HOTENDS > 8 || E_STEPPERS > 8 + #error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers." +#elif HOTENDS > MAX_EXTRUDERS || E_STEPPERS > MAX_EXTRUDERS + #error "Marlin extruder/hotends limit! Increase MAX_EXTRUDERS to continue." +#endif + +#define BOARD_INFO_NAME "BIGTREE GTR 1.0" + +// Use one of these or SDCard-based Emulation will be used +//#define I2C_EEPROM +//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation +//#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation + +#define TP // Enable to define servo and probe pins + +// +// Servos +// +#if ENABLED(TP) + #define SERVO0_PIN PB11 +#endif + +#define PS_ON_PIN PH6 + +// +// Limit Switches +// +#define X_MIN_PIN PF2 +#define X_MAX_PIN PG14 +#define Y_MIN_PIN PC13 +#define Y_MAX_PIN PG9 +#define Z_MIN_PIN PE0 +#define Z_MAX_PIN PD3 + +// +// Pins on the extender +// +//#define X_MIN_PIN PI4 +//#define X2_MIN_PIN PF12 +//#define Y_MIN_PIN PF4 +//#define Y2_MIN_PIN PI7 +//#define Z_MIN_PIN PF6 + +#if ENABLED(TP) && !defined(Z_MIN_PROBE_PIN) + #define Z_MIN_PROBE_PIN PH11 // Z Probe must be PH11 +#endif + +// +// Steppers +// +#define X_STEP_PIN PC15 +#define X_DIR_PIN PF0 +#define X_ENABLE_PIN PF1 +#ifndef X_CS_PIN + #define X_CS_PIN PC14 +#endif + +#define Y_STEP_PIN PE3 +#define Y_DIR_PIN PE2 +#define Y_ENABLE_PIN PE4 +#ifndef Y_CS_PIN + #define Y_CS_PIN PE1 +#endif + +#define Z_STEP_PIN PB8 +#define Z_DIR_PIN PB7 // PB7 +#define Z_ENABLE_PIN PB9 +#ifndef Z_CS_PIN + #define Z_CS_PIN PB5 +#endif + +#define E0_STEP_PIN PG12 +#define E0_DIR_PIN PG11 +#define E0_ENABLE_PIN PG13 +#ifndef E0_CS_PIN + #define E0_CS_PIN PG10 +#endif + +#define E1_STEP_PIN PD6 +#define E1_DIR_PIN PD5 +#define E1_ENABLE_PIN PD7 +#ifndef E1_CS_PIN + #define E1_CS_PIN PD4 +#endif + +#define E2_STEP_PIN PD1 +#define E2_DIR_PIN PD0 +#define E2_ENABLE_PIN PD2 +#ifndef E2_CS_PIN + #define E2_CS_PIN PC12 +#endif + +#define E3_STEP_PIN PF3 +#define E3_DIR_PIN PG3 +#define E3_ENABLE_PIN PF8 +#ifndef E3_CS_PIN + #define E3_CS_PIN PG4 +#endif + +#define E4_STEP_PIN PD14 +#define E4_DIR_PIN PD11 +#define E4_ENABLE_PIN PG2 +#ifndef E4_CS_PIN + #define E4_CS_PIN PE15 +#endif + +#define E5_STEP_PIN PE12 +#define E5_DIR_PIN PE10 +#define E5_ENABLE_PIN PF14 +#ifndef E5_CS_PIN + #define E5_CS_PIN PE7 +#endif + +#define E6_STEP_PIN PG0 +#define E6_DIR_PIN PG1 +#define E6_ENABLE_PIN PE8 +#ifndef E6_CS_PIN + #define E6_CS_PIN PF15 +#endif + +#define E7_STEP_PIN PH12 +#define E7_DIR_PIN PH15 +#define E7_ENABLE_PIN PI0 +#ifndef E7_CS_PIN + #define E7_CS_PIN PH14 +#endif + +// +// Software SPI pins for TMC2130 stepper drivers +// +#if ENABLED(TMC_USE_SW_SPI) + #ifndef TMC_SW_MOSI + #define TMC_SW_MOSI PG15 + #endif + #ifndef TMC_SW_MISO + #define TMC_SW_MISO PB6 + #endif + #ifndef TMC_SW_SCK + #define TMC_SW_SCK PB3 + #endif +#endif + +#if HAS_TMC220x + /** + * TMC2208/TMC2209 stepper drivers + * + * Hardware serial communication ports. + * If undefined software serial is used according to the pins below + */ + //#define X_HARDWARE_SERIAL Serial + //#define X2_HARDWARE_SERIAL Serial1 + //#define Y_HARDWARE_SERIAL Serial1 + //#define Y2_HARDWARE_SERIAL Serial1 + //#define Z_HARDWARE_SERIAL Serial1 + //#define Z2_HARDWARE_SERIAL Serial1 + //#define E0_HARDWARE_SERIAL Serial1 + //#define E1_HARDWARE_SERIAL Serial1 + //#define E2_HARDWARE_SERIAL Serial1 + //#define E3_HARDWARE_SERIAL Serial1 + //#define E4_HARDWARE_SERIAL Serial1 + //#define E5_HARDWARE_SERIAL Serial1 + //#define E6_HARDWARE_SERIAL Serial1 + //#define E7_HARDWARE_SERIAL Serial1 + + // + // Software serial + // + #define X_SERIAL_TX_PIN PC14 + #define X_SERIAL_RX_PIN PC14 + + #define Y_SERIAL_TX_PIN PE1 + #define Y_SERIAL_RX_PIN PE1 + + #define Z_SERIAL_TX_PIN PB5 + #define Z_SERIAL_RX_PIN PB5 + + #define E0_SERIAL_TX_PIN PG10 + #define E0_SERIAL_RX_PIN PG10 + + #define E1_SERIAL_TX_PIN PD4 + #define E1_SERIAL_RX_PIN PD4 + + #define E2_SERIAL_TX_PIN PC12 + #define E2_SERIAL_RX_PIN PC12 + + #define E3_SERIAL_TX_PIN PG4 + #define E3_SERIAL_RX_PIN PG4 + + #define E4_SERIAL_TX_PIN PE15 + #define E4_SERIAL_RX_PIN PE15 + + #define E5_SERIAL_TX_PIN PE7 + #define E5_SERIAL_RX_PIN PE7 + + #define E6_SERIAL_TX_PIN PF15 + #define E6_SERIAL_RX_PIN PF15 + + #define E7_SERIAL_TX_PIN PH14 + #define E7_SERIAL_RX_PIN PH14 + + // Reduce baud rate to improve software serial reliability + #define TMC_BAUD_RATE 19200 +#endif + +// +// Temperature Sensors +// +#define TEMP_0_PIN PC1 // T1 <-> E0 +#define TEMP_1_PIN PC2 // T2 <-> E1 +#define TEMP_2_PIN PC3 // T3 <-> E2 + +#define TEMP_3_PIN PA3 // T4 <-> E3 +#define TEMP_4_PIN PF9 // T5 <-> E4 +#define TEMP_5_PIN PF10 // T6 <-> E5 +//#define TEMP_6_PIN PF7 // T7 <-> E6 +//#define TEMP_7_PIN PF5 // T8 <-> E7 + +#define TEMP_BED_PIN PC0 // T0 <-> Bed + +// SPI for Max6675 or Max31855 Thermocouple +// Uses a separate SPI bus +// If you have a two-way thermocouple, you can customize two THERMO_CSx_PIN pins (x:1~2) + +#define THERMO_SCK_PIN PI1 // SCK +#define THERMO_DO_PIN PI2 // MISO +#define THERMO_CS1_PIN PH9 // CS1 +#define THERMO_CS2_PIN PH2 // CS2 + +#define MAX6675_SS_PIN THERMO_CS1_PIN +#define MAX6675_SS2_PIN THERMO_CS2_PIN +#define MAX6675_SCK_PIN THERMO_SCK_PIN +#define MAX6675_DO_PIN THERMO_DO_PIN + +// +// Heaters / Fans +// +#define HEATER_0_PIN PB1 // Heater0 +#define HEATER_1_PIN PA1 // Heater1 +#define HEATER_2_PIN PB0 // Heater2 + +#define HEATER_3_PIN PD15 // Heater3 +#define HEATER_4_PIN PD13 // Heater4 +#define HEATER_5_PIN PD12 // Heater5 +//#define HEATER_6_PIN PE13 // Heater6 +//#define HEATER_7_PIN PI6 // Heater7 + +#define HEATER_BED_PIN PA2 // Hotbed + +#define FAN_PIN PE5 // Fan0 +#define FAN1_PIN PE6 // Fan1 +#define FAN2_PIN PC8 // Fan2 + +#define FAN3_PIN PI5 // Fan3 +#define FAN4_PIN PE9 // Fan4 +#define FAN5_PIN PE11 // Fan5 +//#define FAN6_PIN PC9 // Fan6 +//#define FAN7_PIN PE14 // Fan7 + +// +// By default the onboard SD (SPI1) is enabled +// +#define CUSTOM_SPI_PINS +#if DISABLED(CUSTOM_SPI_PINS) + #define SDSS PB12 +#endif + +// HAL SPI1 pins group +#if ENABLED(CUSTOM_SPI_PINS) + #define SDSS PA4 + #define SD_DETECT_PIN PC4 + #define LCD_SDSS PA4 + + #define SCK_PIN PA5 + #define MISO_PIN PA6 + #define MOSI_PIN PA7 + #define SS_PIN PA4 // Chip select for SD card used by Marlin +#endif + +/** + * _____ _____ + * NC | · · | GND 5V | · · | GND + * RESET | · · | PB10(SD_DETECT) (LCD_D7) PG5 | · · | PG6 (LCD_D6) + * (MOSI)PB15 | · · | PH10(BTN_EN2) (LCD_D5) PG7 | · · | PG8 (LCD_D4) + * (SD_SS)PB12 | · · | PD10(BTN_EN1) (LCD_RS) PA8 | · · | PC10 (LCD_EN) + * (SCK)PB13 | · · | PB14(MISO) (BTN_ENC) PA15 | · · | PC11 (BEEPER) + *  ̄ ̄  ̄ ̄ + * EXP2 EXP1 + */ + +// +// LCDs and Controllers +// +#if HAS_SPI_LCD + #define BEEPER_PIN PC11 + #define BTN_ENC PA15 + + #if ENABLED(CR10_STOCKDISPLAY) + + #define LCD_PINS_RS PA8 + + #define BTN_EN1 PD10 + #define BTN_EN2 PH10 + + #define LCD_PINS_ENABLE PG7 + #define LCD_PINS_D4 PG8 + + //#undef ST7920_DELAY_1 + //#undef ST7920_DELAY_2 + //#undef ST7920_DELAY_3 + + #else + + #define LCD_PINS_RS PA8 + + #define BTN_EN1 PD10 + #define BTN_EN2 PH10 + + #if DISABLED(CUSTOM_SPI_PINS) + #define SD_DETECT_PIN PB10 + #define LCD_SDSS PB12 + #endif + + #define LCD_PINS_ENABLE PC10 + #define LCD_PINS_D4 PG8 + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS PC10 + #define DOGLCD_A0 PA8 + //#define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PG8 // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PG7 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PG6 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PG5 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PF13 + #endif + #endif // !FYSETC_MINI_12864 + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PG7 + #define LCD_PINS_D6 PG6 + #define LCD_PINS_D7 PG5 + #endif + + #endif + + // Alter timing for graphical display + #if HAS_GRAPHICAL_LCD + #define BOARD_ST7920_DELAY_1 DELAY_NS(96) + #define BOARD_ST7920_DELAY_2 DELAY_NS(48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) + #endif + + //#define DOGLCD_CS PB12 + //#define DOGLCD_A0 PA8 + //#define LCD_PINS_DC PB14 + //#define DOGLCD_MOSI PB15 + +#endif // HAS_SPI_LCD diff --git a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c index cb2d99578525..fd1f29645957 100644 --- a/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c +++ b/buildroot/share/PlatformIO/variants/BIGTREE_SKR_PRO_1v1/PeripheralPins.c @@ -90,8 +90,13 @@ const PinMap PinMap_I2C_SDA[] = { {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, - #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio - {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #if STM32F4X_PIN_NUM >= 144 // 144 pins mcu, 114 gpio + #if STM32F4X_PIN_NUM >= 176 + {PH_5, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PH_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + #else + {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #endif #endif {NC, NP, 0} }; @@ -103,8 +108,14 @@ const PinMap PinMap_I2C_SCL[] = { {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, - #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio - {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #if STM32F4X_PIN_NUM >= 144 // 144 pins mcu, 114 gpio + #if STM32F4X_PIN_NUM >= 176 + //{PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PH_4, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + {PH_7, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, + #else + {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, + #endif #endif {NC, NP, 0} }; @@ -141,8 +152,10 @@ const PinMap PinMap_PWM[] = { */ //{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 //{PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 - //{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 is bltouch analog? + {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 is bltouch analog? + //{PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + //{PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 //{PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 //{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 //{PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 @@ -173,7 +186,7 @@ const PinMap PinMap_PWM[] = { //{PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 //{PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 //{PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - //{PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 + {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 //{PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N //{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N //{PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N @@ -186,21 +199,28 @@ const PinMap PinMap_PWM[] = { //{PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 //{PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 //{PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - //{PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - //{PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 + {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 //{PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N - //{PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 + {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 //{PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N - //{PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 + {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 //{PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N - //{PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 - //{PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 + {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 + {PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 #if STM32F4X_PIN_NUM >= 144 //144 pins mcu, 114 gpio //{PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 //{PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 //{PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1 //{PF_9, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 #endif + #if STM32F4X_PIN_NUM >= 176 //176 pins mcu, 140 gpio + {PH_10, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 + {PH_6, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1 + //{PH_11, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 + {PI_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1 + {PI_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2 + #endif {NC, NP, 0} }; #endif @@ -275,7 +295,8 @@ const PinMap PinMap_UART_CTS[] = { #ifdef HAL_SPI_MODULE_ENABLED const PinMap PinMap_SPI_MOSI[] = { - {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + //{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, {NC, NP, 0} diff --git a/platformio.ini b/platformio.ini index 9cf2c918ed71..df3dcb0f667b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -586,7 +586,7 @@ lib_ignore = Adafruit NeoPixel # # STM32F401VE -# 'STEVAL-3DP001)' STM32F401VE board - https://www.st.com/en/evaluation-tools/steval-3dp001v1.html +# 'STEVAL-3DP001V1' STM32F401VE board - https://www.st.com/en/evaluation-tools/steval-3dp001v1.html # [env:STM32F401VE_STEVAL] platform = ststm32 @@ -677,6 +677,37 @@ src_filter = ${common.default_src_filter} + debug_tool = stlink debug_init_break = +# +# Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) +# +[env:BIGTREE_GTR_V1_0] +platform = ststm32@>=5.7.0 +framework = arduino +platform_packages = framework-arduinoststm32@>=3.10700.191028 +board = BigTree_SKR_Pro +extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py +build_flags = ${common.build_flags} + -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407IG\" + -DTARGET_STM32F4 -DSTM32F407IX -DVECT_TAB_OFFSET=0x8000 + -DHAVE_HWSERIAL3 + -DHAVE_HWSERIAL6 + -DPIN_SERIAL3_RX=PD_9 + -DPIN_SERIAL3_TX=PD_8 + -DPIN_SERIAL6_RX=PC_7 + -DPIN_SERIAL6_TX=PC_6 + + -IMarlin/src/HAL/HAL_STM32 +lib_deps = + U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip + LiquidCrystal + TMCStepper@>=0.5.2,<1.0.0 + Adafruit NeoPixel + LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip + Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip +lib_ignore = SoftwareSerial, SoftwareSerialM +src_filter = ${common.default_src_filter} + +monitor_speed = 250000 + # # BigTreeTech BTT002 (STM32F407VET6 ARM Cortex-M4) # From 838a420e27cc740e0891f1a165b66b212ff59dac Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 26 Jan 2020 00:06:19 +0000 Subject: [PATCH 12/30] [cron] Bump distribution date (2020-01-26) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 278fa14de135..8d4b2fdc3892 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 "2020-01-24" + #define STRING_DISTRIBUTION_DATE "2020-01-26" #endif /** From 95d5a0c480d655bf96a6989ad3df0f240ae343b2 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sat, 25 Jan 2020 22:02:06 -0800 Subject: [PATCH 13/30] Fix DELTA_CALIBRATION_MENU recursive call (#16656) --- Marlin/src/feature/bedlevel/bedlevel.cpp | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 4 ++-- Marlin/src/gcode/bedlevel/mbl/G29.cpp | 4 ++-- Marlin/src/lcd/menu/menu_bed_leveling.cpp | 10 ++++------ Marlin/src/lcd/menu/menu_delta_calibrate.cpp | 12 ++++++++---- Marlin/src/lcd/ultralcd.cpp | 4 ++++ Marlin/src/lcd/ultralcd.h | 8 +++++--- 7 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index 547c6af0b32f..9aa3ae0a57c0 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -247,7 +247,7 @@ void reset_bed_level() { current_position = pos; #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; + ui.wait_for_move = false; #endif } diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index 53c48a62b6e4..7cbaefbf23e9 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -508,7 +508,7 @@ G29_TYPE GcodeSuite::G29() { set_bed_leveling_enabled(abl_should_enable); g29_in_progress = false; #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; + ui.wait_for_move = false; #endif } @@ -810,7 +810,7 @@ G29_TYPE GcodeSuite::G29() { #if ENABLED(PROBE_MANUALLY) g29_in_progress = false; #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; + ui.wait_for_move = false; #endif #endif diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp index 944e8d3a69bf..92d95f169b6f 100644 --- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp @@ -88,7 +88,7 @@ void GcodeSuite::G29() { case MeshStart: mbl.reset(); mbl_probe_index = 0; - if (!ui.wait_for_bl_move) { + if (!ui.wait_for_move) { queue.inject_P(PSTR("G28\nG29 S2")); return; } @@ -148,7 +148,7 @@ void GcodeSuite::G29() { #endif #if ENABLED(LCD_BED_LEVELING) - ui.wait_for_bl_move = false; + ui.wait_for_move = false; #endif } break; diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp index 753aa3d5e18b..6cc40cab6ca4 100644 --- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp +++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp @@ -56,8 +56,6 @@ #endif ); - bool MarlinUI::wait_for_bl_move; // = false - // // Bed leveling is done. Wait for G29 to complete. // A flag is used so that this can release control @@ -70,7 +68,7 @@ // ** This blocks the command queue! ** // void _lcd_level_bed_done() { - if (!ui.wait_for_bl_move) { + if (!ui.wait_for_move) { #if MANUAL_PROBE_HEIGHT > 0 && DISABLED(MESH_BED_LEVELING) // Display "Done" screen and wait for moves to complete line_to_z(MANUAL_PROBE_HEIGHT); @@ -103,7 +101,7 @@ // // The last G29 records the point and enables bed leveling // - ui.wait_for_bl_move = true; + ui.wait_for_move = true; ui.goto_screen(_lcd_level_bed_done); #if ENABLED(MESH_BED_LEVELING) queue.inject_P(PSTR("G29 S2")); @@ -146,7 +144,7 @@ MenuEditItemBase::draw_edit_screen(GET_TEXT(MSG_LEVEL_BED_NEXT_POINT), msg); } ui.refresh(LCDVIEW_CALL_NO_REDRAW); - if (!ui.wait_for_bl_move) ui.goto_screen(_lcd_level_bed_get_z); + if (!ui.wait_for_move) ui.goto_screen(_lcd_level_bed_get_z); } // @@ -156,7 +154,7 @@ ui.goto_screen(_lcd_level_bed_moving); // G29 Records Z, moves, and signals when it pauses - ui.wait_for_bl_move = true; + ui.wait_for_move = true; #if ENABLED(MESH_BED_LEVELING) queue.inject_P(manual_probe_index ? PSTR("G29 S2") : PSTR("G29 S1")); #elif ENABLED(PROBE_MANUALLY) diff --git a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp index 75c427bafaac..e26a0966c2cb 100644 --- a/Marlin/src/lcd/menu/menu_delta_calibrate.cpp +++ b/Marlin/src/lcd/menu/menu_delta_calibrate.cpp @@ -41,10 +41,14 @@ #endif void _man_probe_pt(const xy_pos_t &xy) { - do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES); - ui.synchronize(); - move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); - ui.goto_screen(lcd_move_z); + if (!ui.wait_for_move) { + ui.wait_for_move = true; + do_blocking_move_to_xy_z(xy, Z_CLEARANCE_BETWEEN_PROBES); + ui.wait_for_move = false; + ui.synchronize(); + move_menu_scale = _MAX(PROBE_MANUALLY_STEP, MIN_STEPS_PER_SEGMENT / float(DEFAULT_XYZ_STEPS_PER_UNIT)); + ui.goto_screen(lcd_move_z); + } } #if ENABLED(DELTA_AUTO_CALIBRATION) diff --git a/Marlin/src/lcd/ultralcd.cpp b/Marlin/src/lcd/ultralcd.cpp index 380b18a07cf3..04ebd5079f6d 100644 --- a/Marlin/src/lcd/ultralcd.cpp +++ b/Marlin/src/lcd/ultralcd.cpp @@ -45,6 +45,10 @@ MarlinUI ui; #endif #endif +#if LCD_HAS_WAIT_FOR_MOVE + bool MarlinUI::wait_for_move; // = false +#endif + #if HAS_SPI_LCD #if ENABLED(STATUS_MESSAGE_SCROLLING) uint8_t MarlinUI::status_scroll_offset; // = 0 diff --git a/Marlin/src/lcd/ultralcd.h b/Marlin/src/lcd/ultralcd.h index c56f0b8350bc..c98d3d562788 100644 --- a/Marlin/src/lcd/ultralcd.h +++ b/Marlin/src/lcd/ultralcd.h @@ -532,10 +532,12 @@ class MarlinUI { #endif - #if ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING) - static bool wait_for_bl_move; + #define LCD_HAS_WAIT_FOR_MOVE EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION) || (ENABLED(LCD_BED_LEVELING) && EITHER(PROBE_MANUALLY, MESH_BED_LEVELING)) + + #if LCD_HAS_WAIT_FOR_MOVE + static bool wait_for_move; #else - static constexpr bool wait_for_bl_move = false; + static constexpr bool wait_for_move = false; #endif #if HAS_LCD_MENU && EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) From e3611ad209582a222562ec88332c8ad9f85e2937 Mon Sep 17 00:00:00 2001 From: 0r31 <37673727+0r31@users.noreply.github.com> Date: Sun, 26 Jan 2020 08:08:40 +0100 Subject: [PATCH 14/30] Fix MKS Base + Digipot compile error (#16636) --- .../HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c | 1 - .../HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h | 1 + Marlin/src/HAL/HAL_LPC1768/include/i2c_util.h | 8 ++++++++ Marlin/src/feature/digipot/digipot_mcp4451.cpp | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c index 8dc8c61b453d..dd83c7a97193 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c +++ b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.c @@ -36,7 +36,6 @@ #endif #include "digipot_mcp4451_I2C_routines.h" -#include "i2c_util.h" // These two routines are exact copies of the lpc17xx_i2c.c routines. Couldn't link to // to the lpc17xx_i2c.c routines so had to copy them into this file & rename them. diff --git a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h index 6d6fafa8bb78..db6715e2b67e 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/digipot_mcp4451_I2C_routines.h @@ -33,6 +33,7 @@ #include #include #include +#include "i2c_util.h" uint8_t digipot_mcp4451_start(uint8_t sla); uint8_t digipot_mcp4451_send_byte(uint8_t data); diff --git a/Marlin/src/HAL/HAL_LPC1768/include/i2c_util.h b/Marlin/src/HAL/HAL_LPC1768/include/i2c_util.h index 671a1e3746f3..1ca3fc184452 100644 --- a/Marlin/src/HAL/HAL_LPC1768/include/i2c_util.h +++ b/Marlin/src/HAL/HAL_LPC1768/include/i2c_util.h @@ -45,4 +45,12 @@ #include #include +#ifdef __cplusplus + extern "C" { +#endif + void configure_i2c(const uint8_t clock_option); + +#ifdef __cplusplus + } +#endif diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 13022abad1d0..48b4d154be2a 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -77,7 +77,7 @@ void digipot_i2c_set_current(const uint8_t channel, const float current) { void digipot_i2c_init() { #if MB(MKS_SBASE) - configure_i2c(); + configure_i2c(16); // Setting clock_option to 16 ensure the I2C bus is initialized at 400kHz #else Wire.begin(); #endif From 6357619ab29d2e03db883a1ebe8ee16b2714c55c Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Sun, 26 Jan 2020 15:11:30 +0800 Subject: [PATCH 15/30] Add ESP3DLib idletask entry point (#16658) --- Marlin/src/HAL/HAL_ESP32/HAL.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/src/HAL/HAL_ESP32/HAL.cpp b/Marlin/src/HAL/HAL_ESP32/HAL.cpp index 73e60c17800e..7bc007f3c4c1 100644 --- a/Marlin/src/HAL/HAL_ESP32/HAL.cpp +++ b/Marlin/src/HAL/HAL_ESP32/HAL.cpp @@ -111,6 +111,9 @@ void HAL_idletask() { #if BOTH(WIFISUPPORT, OTASUPPORT) OTA_handle(); #endif + #if ENABLED(ESP3D_WIFISUPPORT) + esp3dlib.idletask(); + #endif } void HAL_clear_reset_source() { } From 4a71285c34e161b9f38079e40d8bac2861f8ff78 Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 26 Jan 2020 22:05:34 +1300 Subject: [PATCH 16/30] Fix Serial defines for M43 on AVR (#16649) --- Marlin/src/pins/pinsDebug.h | 52 +++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index d53b65583796..1972c3ba94f4 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -137,31 +137,33 @@ const PinInfo pin_array[] PROGMEM = { #endif #endif - #if SERIAL_PORT_2 == 0 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_0, 0, true }, - { TXD_NAME_0, 1, true }, - #elif AVR_ATmega1284_FAMILY - { RXD_NAME_0, 8, true }, - { TXD_NAME_0, 9, true }, - #endif - #elif SERIAL_PORT_2 == 1 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_1, 19, true }, - { TXD_NAME_1, 18, true }, - #elif AVR_ATmega1284_FAMILY - { RXD_NAME_1, 10, true }, - { TXD_NAME_1, 11, true }, - #endif - #elif SERIAL_PORT_2 == 2 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_2, 17, true }, - { TXD_NAME_2, 16, true }, - #endif - #elif SERIAL_PORT_2 == 3 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_3, 15, true }, - { TXD_NAME_3, 14, true }, + #ifdef SERIAL_PORT_2 + #if SERIAL_PORT_2 == 0 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_0, 0, true }, + { TXD_NAME_0, 1, true }, + #elif AVR_ATmega1284_FAMILY + { RXD_NAME_0, 8, true }, + { TXD_NAME_0, 9, true }, + #endif + #elif SERIAL_PORT_2 == 1 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_1, 19, true }, + { TXD_NAME_1, 18, true }, + #elif AVR_ATmega1284_FAMILY + { RXD_NAME_1, 10, true }, + { TXD_NAME_1, 11, true }, + #endif + #elif SERIAL_PORT_2 == 2 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_2, 17, true }, + { TXD_NAME_2, 16, true }, + #endif + #elif SERIAL_PORT_2 == 3 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_3, 15, true }, + { TXD_NAME_3, 14, true }, + #endif #endif #endif From 44d400db83e2efe9d4544aa49f4ab8f0042ba00c Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 26 Jan 2020 01:16:03 -0800 Subject: [PATCH 17/30] Fix HOMING_BACKOFF_MM for DELTA (#16657) --- Marlin/src/module/delta.cpp | 10 +++++++++- Marlin/src/module/motion.cpp | 10 ++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/src/module/delta.cpp b/Marlin/src/module/delta.cpp index bc547f615927..bed5cd24cf48 100644 --- a/Marlin/src/module/delta.cpp +++ b/Marlin/src/module/delta.cpp @@ -254,7 +254,7 @@ void home_delta() { - probe_offset.z #endif ); - line_to_current_position(homing_feedrate(X_AXIS)); + line_to_current_position(homing_feedrate(Z_AXIS)); planner.synchronize(); // Re-enable stealthChop if used. Disable diag1 pin on driver. @@ -280,6 +280,14 @@ void home_delta() { sync_plan_position(); + #if DISABLED(DELTA_HOME_TO_SAFE_ZONE) && defined(HOMING_BACKOFF_MM) + constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM; + if (endstop_backoff.z) { + current_position.z -= ABS(endstop_backoff.z) * Z_HOME_DIR; + line_to_current_position(homing_feedrate(Z_AXIS)); + } + #endif + if (DEBUGGING(LEVELING)) DEBUG_POS("<<< home_delta", current_position); } diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 4c1b5340df09..9d0422c4a62b 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -1748,15 +1748,9 @@ void homeaxis(const AxisEnum axis) { if (axis == Z_AXIS && STOW_PROBE()) return; #endif - #ifdef HOMING_BACKOFF_MM + #if DISABLED(DELTA) && defined(HOMING_BACKOFF_MM) constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM; - const float backoff_mm = endstop_backoff[ - #if ENABLED(DELTA) - Z_AXIS - #else - axis - #endif - ]; + const float backoff_mm = endstop_backoff[axis]; if (backoff_mm) { current_position[axis] -= ABS(backoff_mm) * axis_home_dir; line_to_current_position( From bbfbcb8a5d938df2f2da0baca128046a0eb4792d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jan 2020 03:20:02 -0600 Subject: [PATCH 18/30] Clean up PID language defines --- Marlin/src/lcd/language/language_cz.h | 8 -------- Marlin/src/lcd/language/language_de.h | 8 -------- Marlin/src/lcd/language/language_el_gr.h | 8 -------- Marlin/src/lcd/language/language_en.h | 2 ++ Marlin/src/lcd/language/language_it.h | 8 -------- Marlin/src/lcd/language/language_jp_kana.h | 8 -------- Marlin/src/lcd/language/language_pl.h | 8 -------- Marlin/src/lcd/language/language_ru.h | 8 -------- Marlin/src/lcd/language/language_sk.h | 8 -------- Marlin/src/lcd/language/language_uk.h | 8 -------- Marlin/src/lcd/language/language_vi.h | 8 -------- Marlin/src/lcd/language/language_zh_CN.h | 8 -------- Marlin/src/lcd/language/language_zh_TW.h | 8 -------- 13 files changed, 2 insertions(+), 96 deletions(-) diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 6703d300dee9..6a65f094078c 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -266,14 +266,6 @@ namespace Language_cz { PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Vyp"); PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID automatika"); PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID automatika *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Vybrat"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vybrat *"); PROGMEM Language_Str MSG_ACC = _UxGT("Zrychl"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 008cb6f924ad..6d5b665dbf3b 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -245,14 +245,6 @@ namespace Language_de { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Auto Temperatur"); PROGMEM Language_Str MSG_LCD_ON = _UxGT("an"); PROGMEM Language_Str MSG_LCD_OFF = _UxGT("aus"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Auswählen"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Auswählen *"); PROGMEM Language_Str MSG_ACC = _UxGT("Beschleunigung"); diff --git a/Marlin/src/lcd/language/language_el_gr.h b/Marlin/src/lcd/language/language_el_gr.h index 3e6e07f0bbbf..c2acbf400a68 100644 --- a/Marlin/src/lcd/language/language_el_gr.h +++ b/Marlin/src/lcd/language/language_el_gr.h @@ -102,14 +102,6 @@ namespace Language_el_gr { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Αυτομ. ρύθμιση θερμοκρασίας"); PROGMEM Language_Str MSG_LCD_ON = _UxGT("Ενεργοποιημένο"); PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Απενεργοποιημένο"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_ACC = _UxGT("Επιτάχυνση"); PROGMEM Language_Str MSG_JERK = _UxGT("Vαντίδραση"); PROGMEM Language_Str MSG_VA_JERK = _UxGT("Vαντίδραση ") LCD_STR_A; diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 363aff4820da..a0e54b5b31e3 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -265,6 +265,8 @@ namespace Language_en { PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); + PROGMEM Language_Str MSG_PID_F = _UxGT("PID-F"); + PROGMEM Language_Str MSG_PID_F_E = _UxGT("PID-F *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Select"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Select *"); PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index ea17a076b6a9..66b45f298700 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -255,14 +255,6 @@ namespace Language_it { PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Off"); PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Seleziona"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Seleziona *"); PROGMEM Language_Str MSG_ACC = _UxGT("Accel"); diff --git a/Marlin/src/lcd/language/language_jp_kana.h b/Marlin/src/lcd/language/language_jp_kana.h index adb39dfe4094..81580b71ed39 100644 --- a/Marlin/src/lcd/language/language_jp_kana.h +++ b/Marlin/src/lcd/language/language_jp_kana.h @@ -110,14 +110,6 @@ namespace Language_jp_kana { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("ジドウオンドセイギョ"); // "Autotemp" PROGMEM Language_Str MSG_LCD_ON = _UxGT("オン"); // "On" PROGMEM Language_Str MSG_LCD_OFF = _UxGT("オフ"); // "Off" - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("センタク"); // "Select" PROGMEM Language_Str MSG_SELECT_E = _UxGT("センタク *"); PROGMEM Language_Str MSG_ACC = _UxGT("カソクド mm/s²"); // "Accel" diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index b9bb9541e788..972f5044b1bb 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -254,14 +254,6 @@ namespace Language_pl { PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Wył."); PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID Autostrojenie"); PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID Autostrojenie *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Wybierz"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Wybierz *"); PROGMEM Language_Str MSG_ACC = _UxGT("Przyspieszenie"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 00b351b0307b..d7e4de5dd203 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -222,14 +222,6 @@ namespace Language_ru { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Автотемпература"); PROGMEM Language_Str MSG_LCD_ON = _UxGT("Вкл."); PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Выкл."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Выбор"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Выбор *"); PROGMEM Language_Str MSG_ACC = _UxGT("Ускорение"); diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 348751949835..acb829870204 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -257,14 +257,6 @@ namespace Language_sk { PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Vyp"); PROGMEM Language_Str MSG_PID_AUTOTUNE = _UxGT("PID kalibrácia"); PROGMEM Language_Str MSG_PID_AUTOTUNE_E = _UxGT("PID kalibrácia *"); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Vybrať"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Vybrať *"); PROGMEM Language_Str MSG_ACC = _UxGT("Zrýchlenie"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 78e0cf7cfb21..f7234fb83f2d 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -102,14 +102,6 @@ namespace Language_uk { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Автотемпер."); PROGMEM Language_Str MSG_LCD_ON = _UxGT("Увімк."); PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Вимк."); - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Вибрати"); PROGMEM Language_Str MSG_SELECT_E = _UxGT("Вибрати *"); PROGMEM Language_Str MSG_ACC = _UxGT("Приск."); diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index 6a42933c1931..b5ecd019acf2 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -222,14 +222,6 @@ namespace Language_vi { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("Nhiệt độ tự động"); // Autotemp PROGMEM Language_Str MSG_LCD_ON = _UxGT("Bật"); // on PROGMEM Language_Str MSG_LCD_OFF = _UxGT("Tắt"); // off - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("Lựa"); // Select PROGMEM Language_Str MSG_SELECT_E = _UxGT("Lựa *"); PROGMEM Language_Str MSG_ACC = _UxGT("Tăng Tốc"); diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index 9a52ac2f8299..4e730924e2c6 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -199,14 +199,6 @@ namespace Language_zh_CN { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("自动控温"); //"Autotemp" PROGMEM Language_Str MSG_LCD_ON = _UxGT("开"); //"On" PROGMEM Language_Str MSG_LCD_OFF = _UxGT("关"); //"Off" - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); //"PID-P" - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); //"PID-I" - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); //"PID-D" - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); //"PID-C" - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("选择"); //"Select" PROGMEM Language_Str MSG_SELECT_E = _UxGT("选择 *"); PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 92343b3efaf8..f260836916f8 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -199,14 +199,6 @@ namespace Language_zh_TW { PROGMEM Language_Str MSG_AUTOTEMP = _UxGT("自動控溫"); //"Autotemp" PROGMEM Language_Str MSG_LCD_ON = _UxGT("開"); //"On" PROGMEM Language_Str MSG_LCD_OFF = _UxGT("關"); //"Off" - PROGMEM Language_Str MSG_PID_P = _UxGT("PID-P"); //"PID-P" - PROGMEM Language_Str MSG_PID_P_E = _UxGT("PID-P *"); - PROGMEM Language_Str MSG_PID_I = _UxGT("PID-I"); //"PID-I" - PROGMEM Language_Str MSG_PID_I_E = _UxGT("PID-I *"); - PROGMEM Language_Str MSG_PID_D = _UxGT("PID-D"); //"PID-D" - PROGMEM Language_Str MSG_PID_D_E = _UxGT("PID-D *"); - PROGMEM Language_Str MSG_PID_C = _UxGT("PID-C"); //"PID-C" - PROGMEM Language_Str MSG_PID_C_E = _UxGT("PID-C *"); PROGMEM Language_Str MSG_SELECT = _UxGT("選擇"); //"Select" PROGMEM Language_Str MSG_SELECT_E = _UxGT("選擇 *"); PROGMEM Language_Str MSG_ACC = _UxGT("加速度"); //"Accel" acceleration From 1d1dc8e33934c0f837d0c590e8fe8d2a61a1c64b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jan 2020 03:20:11 -0600 Subject: [PATCH 19/30] More 8 extruder defines --- Marlin/Configuration_adv.h | 12 ++++++++++++ Marlin/src/inc/SanityCheck.h | 4 ++++ Marlin/src/module/stepper/TMC26X.cpp | 12 ++++++++++++ Marlin/src/module/temperature.h | 2 +- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 7d453e1dae02..51fcd1f4b64c 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1957,6 +1957,18 @@ #define E5_MICROSTEPS 16 #endif + #if AXIS_DRIVER_TYPE_E6(TMC26X) + #define E6_MAX_CURRENT 1000 + #define E6_SENSE_RESISTOR 91 + #define E6_MICROSTEPS 16 + #endif + + #if AXIS_DRIVER_TYPE_E7(TMC26X) + #define E7_MAX_CURRENT 1000 + #define E7_SENSE_RESISTOR 91 + #define E7_MICROSTEPS 16 + #endif + #endif // TMC26X // @section tmc_smart diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 58c284746baf..a91131e083f9 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2140,6 +2140,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS INVALID_TMC_ADDRESS(E4); #elif AXIS_DRIVER_TYPE_E5(TMC2209) INVALID_TMC_ADDRESS(E5); +#elif AXIS_DRIVER_TYPE_E6(TMC2209) + INVALID_TMC_ADDRESS(E6); +#elif AXIS_DRIVER_TYPE_E7(TMC2209) + INVALID_TMC_ADDRESS(E7); #endif #undef INVALID_TMC_ADDRESS diff --git a/Marlin/src/module/stepper/TMC26X.cpp b/Marlin/src/module/stepper/TMC26X.cpp index b8aeb9cb5646..58d9463a2d13 100644 --- a/Marlin/src/module/stepper/TMC26X.cpp +++ b/Marlin/src/module/stepper/TMC26X.cpp @@ -78,6 +78,12 @@ #if AXIS_DRIVER_TYPE_E5(TMC26X) _TMC26X_DEFINE(E5); #endif +#if AXIS_DRIVER_TYPE_E6(TMC26X) + _TMC26X_DEFINE(E6); +#endif +#if AXIS_DRIVER_TYPE_E7(TMC26X) + _TMC26X_DEFINE(E7); +#endif #define _TMC26X_INIT(A) do{ \ stepper##A.setMicrosteps(A##_MICROSTEPS); \ @@ -127,6 +133,12 @@ void tmc26x_init_to_defaults() { #if AXIS_DRIVER_TYPE_E5(TMC26X) _TMC26X_INIT(E5); #endif + #if AXIS_DRIVER_TYPE_E6(TMC26X) + _TMC26X_INIT(E6); + #endif + #if AXIS_DRIVER_TYPE_E7(TMC26X) + _TMC26X_INIT(E7); + #endif } #endif // TMC26X diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 5273104503ee..0bf67ed41b82 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -49,7 +49,7 @@ typedef enum : int8_t { INDEX_NONE = -5, H_PROBE, H_REDUNDANT, H_CHAMBER, H_BED, - H_E0, H_E1, H_E2, H_E3, H_E4, H_E5 + H_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7 } heater_ind_t; // PID storage From 3572fa22a03aee050ec301e9acb41b16e83b8ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Morav=C4=8D=C3=ADk?= Date: Sun, 26 Jan 2020 10:27:08 +0100 Subject: [PATCH 20/30] Update Slovak language (#16646) --- Marlin/src/lcd/language/language_sk.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index acb829870204..b21e8d05bc0c 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -244,6 +244,7 @@ namespace Language_sk { PROGMEM Language_Str MSG_CHAMBER = _UxGT("Komora"); PROGMEM Language_Str MSG_FAN_SPEED = _UxGT("Rýchlosť vent."); PROGMEM Language_Str MSG_FAN_SPEED_N = _UxGT("Rýchlosť vent. ~"); + PROGMEM Language_Str MSG_STORED_FAN_N = _UxGT("Ulož. vent. ~"); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED = _UxGT("Rýchlosť ex. vent."); PROGMEM Language_Str MSG_EXTRA_FAN_SPEED_N = _UxGT("Rýchlosť ex. vent. ~"); PROGMEM Language_Str MSG_FLOW = _UxGT("Prietok"); @@ -379,13 +380,16 @@ namespace Language_sk { PROGMEM Language_Str MSG_BLTOUCH_MODE_CHANGE = _UxGT("POZOR: Zlé nastav. môže spôsobiť poškoden. Pokračovať?"); PROGMEM Language_Str MSG_TOUCHMI_PROBE = _UxGT("TouchMI"); PROGMEM Language_Str MSG_TOUCHMI_INIT = _UxGT("Inicializ. TouchMI"); - PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test ofsetu Z"); + PROGMEM Language_Str MSG_TOUCHMI_ZTEST = _UxGT("Test Z ofsetu"); PROGMEM Language_Str MSG_TOUCHMI_SAVE = _UxGT("Uložiť"); PROGMEM Language_Str MSG_MANUAL_DEPLOY_TOUCHMI = _UxGT("Zasunúť TouchMI"); PROGMEM Language_Str MSG_MANUAL_DEPLOY = _UxGT("Zasunúť sondu Z"); PROGMEM Language_Str MSG_MANUAL_STOW = _UxGT("Vysunúť sondu Z"); PROGMEM Language_Str MSG_HOME_FIRST = _UxGT("Najskôr os %s%s%s domov"); - PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Ofset sondy Z"); + PROGMEM Language_Str MSG_ZPROBE_OFFSETS = _UxGT("Ofsety sondy Z"); + PROGMEM Language_Str MSG_ZPROBE_XOFFSET = _UxGT("X ofset"); + PROGMEM Language_Str MSG_ZPROBE_YOFFSET = _UxGT("Y ofset"); + PROGMEM Language_Str MSG_ZPROBE_ZOFFSET = _UxGT("Z ofset"); PROGMEM Language_Str MSG_BABYSTEP_X = _UxGT("Babystep X"); PROGMEM Language_Str MSG_BABYSTEP_Y = _UxGT("Babystep Y"); PROGMEM Language_Str MSG_BABYSTEP_Z = _UxGT("Babystep Z"); From c49e987b1e9eb2f38eb80e1c405676032a053008 Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 26 Jan 2020 22:33:35 +1300 Subject: [PATCH 21/30] Fix M43 timer report on AVR (#16645) --- Marlin/src/HAL/HAL_AVR/pinsDebug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/HAL_AVR/pinsDebug.h b/Marlin/src/HAL/HAL_AVR/pinsDebug.h index 13c8a42b07de..0787076fb7e8 100644 --- a/Marlin/src/HAL/HAL_AVR/pinsDebug.h +++ b/Marlin/src/HAL/HAL_AVR/pinsDebug.h @@ -231,10 +231,10 @@ static void err_is_interrupt() { SERIAL_ECHOPGM(" compare interrupt enabled" static void err_prob_interrupt() { SERIAL_ECHOPGM(" overflow interrupt enabled"); } static void print_is_also_tied() { SERIAL_ECHOPGM(" is also tied to this pin"); SERIAL_ECHO_SP(14); } -void com_print(uint8_t N, uint8_t Z) { +inline void com_print(const uint8_t N, const uint8_t Z) { const uint8_t *TCCRA = (uint8_t*)TCCR_A(N); SERIAL_ECHOPGM(" COM"); - SERIAL_CHAR('0' + N, 'A' + Z); + SERIAL_CHAR('0' + N, Z); SERIAL_ECHOPAIR(": ", int((*TCCRA >> (6 - Z * 2)) & 0x03)); } From 81f31efaee0120a297d3b35fe1a13dca5cf321f2 Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Sun, 26 Jan 2020 10:34:58 +0100 Subject: [PATCH 22/30] Fix Spanish (swapped BLTouch strings) (#16637) --- Marlin/src/lcd/language/language_es.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 83ec5e43315e..1a54244c1696 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -345,8 +345,8 @@ namespace Language_es { PROGMEM Language_Str MSG_BLTOUCH = _UxGT("BLTouch"); PROGMEM Language_Str MSG_BLTOUCH_SELFTEST = _UxGT("Cmd: Auto-Prueba"); PROGMEM Language_Str MSG_BLTOUCH_RESET = _UxGT("Cmd: Reiniciar"); - PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Bajar pistón"); - PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Subir pistón"); + PROGMEM Language_Str MSG_BLTOUCH_STOW = _UxGT("Cmd: Subir pistón"); + PROGMEM Language_Str MSG_BLTOUCH_DEPLOY = _UxGT("Cmd: Bajar pistón"); PROGMEM Language_Str MSG_BLTOUCH_SW_MODE = _UxGT("Cmd: Modo Software"); PROGMEM Language_Str MSG_BLTOUCH_5V_MODE = _UxGT("Cmd: Modo 5V"); PROGMEM Language_Str MSG_BLTOUCH_OD_MODE = _UxGT("Cmd: Modo OD"); From 0949c0f326a8baf0af5a23c1545fa34f418295ce Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 26 Jan 2020 22:49:11 +1300 Subject: [PATCH 23/30] SKR 1.3 sensorless endstops hack (#16659) --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 29 ++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 9b0ff5293af3..7f74456a486c 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -25,32 +25,31 @@ /** * Limit Switches - * - * For Stallguard homing to max swap the min / max pins so - * the MAX physical connectors can be used for other things. */ -#if X_HOME_DIR == -1 || !X_STALL_SENSITIVITY +#if X_HOME_DIR > 0 && X_STALL_SENSITIVITY && !defined(USE_XMAX_PLUG) + // For StallGuard homing to MAX swap the MIN / MAX pins + // so the MAX physical connectors may be used for other things. + #define X_MIN_PIN P1_28 // X_MAX (free) + #define X_MAX_PIN P1_29 // X_MIN +#else // else, non-endstop is free and appears in M43 output #define X_MIN_PIN P1_29 // X_MIN #define X_MAX_PIN P1_28 // X_MAX -#else - #define X_MIN_PIN P1_28 // X_MAX - #define X_MAX_PIN P1_29 // X_MIN #endif -#if Y_HOME_DIR == -1 || !Y_STALL_SENSITIVITY +#if Y_HOME_DIR > 0 && Y_STALL_SENSITIVITY && !defined(USE_YMAX_PLUG) + #define Y_MIN_PIN P1_26 // Y_MAX (free) + #define Y_MAX_PIN P1_27 // Y_MIN +#else #define Y_MIN_PIN P1_27 // Y_MIN #define Y_MAX_PIN P1_26 // Y_MAX -#else - #define Y_MIN_PIN P1_26 // Y_MAX - #define Y_MAX_PIN P1_27 // Y_MIN #endif -#if Z_HOME_DIR == -1 || !Z_STALL_SENSITIVITY +#if Z_HOME_DIR > 0 && Z_STALL_SENSITIVITY && !defined(USE_ZMAX_PLUG) + #define Z_MIN_PIN P1_24 // Z_MAX (free) + #define Z_MAX_PIN P1_25 // Z_MIN +#else #define Z_MIN_PIN P1_25 // Z_MIN #define Z_MAX_PIN P1_24 // Z_MAX -#else - #define Z_MIN_PIN P1_24 // Z_MAX - #define Z_MAX_PIN P1_25 // Z_MIN #endif #define ONBOARD_ENDSTOPPULLUPS // Board has built-in pullups From 5e3e8fcdb9b2ee634489519c4ea81242acf68c2e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jan 2020 17:07:13 -0600 Subject: [PATCH 24/30] Fix PID F menu label --- Marlin/src/lcd/menu/menu_advanced.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index e24b415155a2..ec03a0066cbf 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -306,7 +306,7 @@ void menu_cancelobject(); #if ENABLED(PID_FAN_SCALING) #define _PID_EDIT_MENU_ITEMS(N) \ _PID_BASE_MENU_ITEMS(N); \ - EDIT_ITEM(float3, PID_LABEL(MSG_PID_F,N), &PID_PARAM(Kf, N), 1, 9990) + EDIT_ITEM_N(float3, N, MSG_PID_F_E, &PID_PARAM(Kf, N), 1, 9990) #else #define _PID_EDIT_MENU_ITEMS(N) _PID_BASE_MENU_ITEMS(N) #endif From f6a6704b66db7a0d9164e8136fd08d7e05814e2b Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Mon, 27 Jan 2020 00:06:35 +0000 Subject: [PATCH 25/30] [cron] Bump distribution date (2020-01-27) --- Marlin/src/inc/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 8d4b2fdc3892..f120d87571f8 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 "2020-01-26" + #define STRING_DISTRIBUTION_DATE "2020-01-27" #endif /** From 48098b1675a7e2ac0412b66328e3ad6a6eaeb9c8 Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Mon, 27 Jan 2020 07:34:17 +0700 Subject: [PATCH 26/30] Preserve CWD for write/remove file (#16667) --- Marlin/src/sd/cardreader.cpp | 33 +++++++++++++++++++-------------- Marlin/src/sd/cardreader.h | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Marlin/src/sd/cardreader.cpp b/Marlin/src/sd/cardreader.cpp index cb8310f17932..538a744e46fb 100644 --- a/Marlin/src/sd/cardreader.cpp +++ b/Marlin/src/sd/cardreader.cpp @@ -504,7 +504,7 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0* stopSDPrint(); SdFile *curDir; - const char * const fname = diveToFile(curDir, path); + const char * const fname = diveToFile(true, curDir, path); if (!fname) return; if (file.open(curDir, fname, O_READ)) { @@ -532,7 +532,7 @@ void CardReader::openFileWrite(char * const path) { stopSDPrint(); SdFile *curDir; - const char * const fname = diveToFile(curDir, path); + const char * const fname = diveToFile(false, curDir, path); if (!fname) return; if (file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) { @@ -557,7 +557,7 @@ void CardReader::removeFile(const char * const name) { //stopSDPrint(); SdFile *curDir; - const char * const fname = diveToFile(curDir, name); + const char * const fname = diveToFile(false, curDir, name); if (!fname) return; if (file.remove(curDir, fname)) { @@ -704,26 +704,28 @@ uint16_t CardReader::countFilesInWorkDir() { * * A nullptr result indicates an unrecoverable error. */ -const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, const bool echo/*=false*/) { +const char* CardReader::diveToFile(const bool update_cwd, SdFile*& curDir, const char * const path, const bool echo/*=false*/) { // Track both parent and subfolder static SdFile newDir1, newDir2; SdFile *sub = &newDir1, *startDir; + // Parsing the path string const char *item_name_adr = path; - if (path[0] == '/') { + + if (path[0] == '/') { // Starting at the root directory? curDir = &root; - workDirDepth = 0; + if (update_cwd) workDirDepth = 0; // The cwd can be updated for the benefit of sub-programs item_name_adr++; } else - curDir = &workDir; + curDir = &workDir; // Dive from workDir (as set by the UI) startDir = curDir; - - // Start dive while (item_name_adr) { - // Find next sub + // Find next subdirectory delimiter char * const name_end = strchr(item_name_adr, '/'); + + // Last atom in the path? Item found. if (name_end <= item_name_adr) break; // Set subDirName @@ -746,13 +748,16 @@ const char* CardReader::diveToFile(SdFile*& curDir, const char * const path, con // curDir now subDir curDir = sub; - // Update workDirParents and workDirDepth - if (workDirDepth < MAX_DIR_DEPTH) workDirParents[workDirDepth++] = *curDir; + // Update workDirParents, workDirDepth, and workDir + if (update_cwd) { + if (workDirDepth < MAX_DIR_DEPTH) workDirParents[workDirDepth++] = *curDir; + workDir = *curDir; + } - // Point sub pointer to unused newDir + // Point sub at the other scratch object sub = (curDir != &newDir1) ? &newDir1 : &newDir2; - // item_name_adr point to next sub + // Next path atom address item_name_adr = name_end + 1; } return item_name_adr; diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index f7081b95b3da..5d3a2e71b376 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -125,7 +125,7 @@ class CardReader { static inline uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } // Helper for open and remove - static const char* diveToFile(SdFile*& curDir, const char * const path, const bool echo=false); + static const char* diveToFile(const bool update_cwd, SdFile*& curDir, const char * const path, const bool echo=false); #if ENABLED(SDCARD_SORT_ALPHA) static void presort(); From 56cd747c8be868b21619001aeebbecd3827a7e93 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jan 2020 17:39:45 -0600 Subject: [PATCH 27/30] Rename some temperature members --- Marlin/src/module/temperature.cpp | 22 +++++++++++----------- Marlin/src/module/temperature.h | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index eba7afd81a94..559b3d5a1ee7 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -287,7 +287,7 @@ Temperature thermalManager; float Temperature::redundant_temperature = 0.0; #endif -volatile bool Temperature::temp_meas_ready = false; +volatile bool Temperature::raw_temps_ready = false; #if ENABLED(PID_EXTRUSION_SCALING) int32_t Temperature::last_e_position, Temperature::lpq[LPQ_MAX_LEN]; @@ -435,7 +435,7 @@ volatile bool Temperature::temp_meas_ready = false; const millis_t ms = millis(); - if (temp_meas_ready) { // temp sample ready + if (raw_temps_ready) { // temp sample ready updateTemperaturesFromRawValues(); // Get the current temperature and constrain it @@ -1053,7 +1053,7 @@ void Temperature::manage_heater() { if (emergency_parser.killed_by_M112) kill(); #endif - if (!temp_meas_ready) return; + if (!raw_temps_ready) return; updateTemperaturesFromRawValues(); // also resets the watchdog @@ -1090,10 +1090,10 @@ void Temperature::manage_heater() { #if WATCH_HOTENDS // Make sure temperature is increasing - if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? - if (degHotend(e) < watch_hotend[e].target) // Failed to increase enough? + if (watch_hotend[e].next_ms && ELAPSED(ms, watch_hotend[e].next_ms)) { // Time to check this extruder? + if (degHotend(e) < watch_hotend[e].target) // Failed to increase enough? _temp_error((heater_ind_t)e, PSTR(MSG_T_HEATING_FAILED), GET_TEXT(MSG_HEATING_FAILED_LCD)); - else // Start again if the target is still far off + else // Start again if the target is still far off start_watching_hotend(e); } #endif @@ -1625,7 +1625,7 @@ void Temperature::updateTemperaturesFromRawValues() { // Reset the watchdog on good temperature measurement watchdog_refresh(); - temp_meas_ready = false; + raw_temps_ready = false; } #if MAX6675_SEPARATE_SPI @@ -2304,9 +2304,9 @@ void Temperature::disable_all_heaters() { #endif // HAS_MAX6675 /** - * Get raw temperatures + * Update raw temperatures */ -void Temperature::set_current_temp_raw() { +void Temperature::update_raw_temperatures() { #if HAS_TEMP_ADC_0 && DISABLED(HEATER_0_USES_MAX6675) temp_hotend[0].update(); @@ -2360,13 +2360,13 @@ void Temperature::set_current_temp_raw() { joystick.z.update(); #endif - temp_meas_ready = true; + raw_temps_ready = true; } void Temperature::readings_ready() { // Update the raw values if they've been read. Else we could be updating them during reading. - if (!temp_meas_ready) set_current_temp_raw(); + if (!raw_temps_ready) update_raw_temperatures(); // Filament Sensor - can be read any time since IIR filtering is used #if ENABLED(FILAMENT_WIDTH_SENSOR) diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 0bf67ed41b82..da73ed37a4b9 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -360,7 +360,7 @@ class Temperature { static bool inited; // If temperature controller is running #endif - static volatile bool temp_meas_ready; + static volatile bool raw_temps_ready; #if WATCH_HOTENDS static heater_watch_t watch_hotend[HOTENDS]; @@ -805,7 +805,7 @@ class Temperature { #endif private: - static void set_current_temp_raw(); + static void update_raw_temperatures(); static void updateTemperaturesFromRawValues(); #define HAS_MAX6675 EITHER(HEATER_0_USES_MAX6675, HEATER_1_USES_MAX6675) From 2325bede8a079845dd19ce8020350c1d8f8a18f1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 26 Jan 2020 21:08:44 -0600 Subject: [PATCH 28/30] Fix Trigorilla 1.4 limit switches See #16612 --- Marlin/src/pins/ramps/pins_TRIGORILLA_14.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h index 031ab8e16bcb..987d2a07561c 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h @@ -37,6 +37,12 @@ #define SERVO3_PIN 6 #endif +// +// Limit Switches +// +#define X_MAX_PIN 43 +#define Y_MIN_PIN 19 + // Labeled pins #define TRIGORILLA_HEATER_BED_PIN 8 #define TRIGORILLA_HEATER_0_PIN 10 From a0a93e35ae4275c1f99d776b5cc32d91ee7160d2 Mon Sep 17 00:00:00 2001 From: Robby Candra Date: Mon, 27 Jan 2020 11:46:26 +0700 Subject: [PATCH 29/30] =?UTF-8?q?Fix=20serial=20port=20redirection=20(inde?= =?UTF-8?q?x=20=E2=89=A0=20port=20num)=20(#16687)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/serial.cpp | 2 +- Marlin/src/gcode/queue.cpp | 17 ++++++++--------- Marlin/src/gcode/queue.h | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 534d94f00ae0..2c37d681eeda 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -29,7 +29,7 @@ static const char errormagic[] PROGMEM = "Error:"; static const char echomagic[] PROGMEM = "echo:"; #if NUM_SERIAL > 1 - int8_t serial_port_index = SERIAL_PORT; + int8_t serial_port_index = 0; #endif void serialprintPGM(PGM_P str) { diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index ff35b553a853..b1673f57f3a9 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -191,7 +191,6 @@ bool GCodeQueue::process_injected_command() { // Execute command if non-blank if (i) { parser.parse(cmd); - PORT_REDIRECT(SERIAL_PORT); gcode.process_parsed_command(); } return true; @@ -243,7 +242,7 @@ void GCodeQueue::ok_to_send() { #if NUM_SERIAL > 1 const int16_t pn = port[index_r]; if (pn < 0) return; - PORT_REDIRECT(pn); + PORT_REDIRECT(pn); // Reply to the serial port that sent the command #endif if (!send_ok[index_r]) return; SERIAL_ECHOPGM(MSG_OK); @@ -267,9 +266,9 @@ void GCodeQueue::ok_to_send() { */ void GCodeQueue::flush_and_request_resend() { #if NUM_SERIAL > 1 - const int16_t p = port[index_r]; - if (p < 0) return; - PORT_REDIRECT(p); + const int16_t pn = port[index_r]; + if (pn < 0) return; + PORT_REDIRECT(pn); // Reply to the serial port that sent the command #endif SERIAL_FLUSH(); SERIAL_ECHOPGM(MSG_RESEND); @@ -296,14 +295,14 @@ inline int read_serial(const uint8_t index) { } } -void GCodeQueue::gcode_line_error(PGM_P const err, const int8_t port) { - PORT_REDIRECT(port); +void GCodeQueue::gcode_line_error(PGM_P const err, const int8_t pn) { + PORT_REDIRECT(pn); // Reply to the serial port that sent the command SERIAL_ERROR_START(); serialprintPGM(err); SERIAL_ECHOLN(last_N); - while (read_serial(port) != -1); // clear out the RX buffer + while (read_serial(pn) != -1); // Clear out the RX buffer flush_and_request_resend(); - serial_count[port] = 0; + serial_count[pn] = 0; } FORCE_INLINE bool is_M29(const char * const cmd) { // matches "M29" & "M29 ", but not "M290", etc diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 173cadc68ebc..d7f30d1bac93 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -150,7 +150,7 @@ class GCodeQueue { */ static bool enqueue_one(const char* cmd); - static void gcode_line_error(PGM_P const err, const int8_t port); + static void gcode_line_error(PGM_P const err, const int8_t pn); }; From e2eef1256a6feaceb8f4c7f02188e8d6d6d43519 Mon Sep 17 00:00:00 2001 From: Hans007a <32525735+Hans007a@users.noreply.github.com> Date: Tue, 7 Jan 2020 20:52:19 +0100 Subject: [PATCH 30/30] G60/G61 Position Save/Restore (#16557) --- Marlin/Configuration_adv.h | 5 ++ Marlin/src/HAL/HAL_STM32/timers.h | 10 ++-- Marlin/src/core/language.h | 4 ++ Marlin/src/gcode/feature/pause/G60.cpp | 59 +++++++++++++++++++++ Marlin/src/gcode/feature/pause/G61.cpp | 71 ++++++++++++++++++++++++++ Marlin/src/gcode/gcode.cpp | 22 +++++--- Marlin/src/gcode/gcode.h | 7 +++ Marlin/src/inc/Conditionals_adv.h | 5 ++ Marlin/src/module/motion.cpp | 8 ++- Marlin/src/module/motion.h | 6 +++ 10 files changed, 183 insertions(+), 14 deletions(-) create mode 100644 Marlin/src/gcode/feature/pause/G60.cpp create mode 100644 Marlin/src/gcode/feature/pause/G61.cpp diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 51fcd1f4b64c..db5ad52abfcf 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1576,6 +1576,11 @@ // @section extras +// +// G60/G61 Position Save and Return +// +//#define SAVED_POSITIONS 1 // Each saved position slot costs 12 bytes + // // G2/G3 Arc Support // diff --git a/Marlin/src/HAL/HAL_STM32/timers.h b/Marlin/src/HAL/HAL_STM32/timers.h index aa85836bd543..f1dce173e48b 100644 --- a/Marlin/src/HAL/HAL_STM32/timers.h +++ b/Marlin/src/HAL/HAL_STM32/timers.h @@ -61,8 +61,6 @@ #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals - // STM32F401 only has timers 1-5 & 9-11 with timers 4 & 5 usually assigned to TIMER_SERVO and TIMER_TONE - #ifndef STEP_TIMER #define STEP_TIMER 9 #endif @@ -76,19 +74,19 @@ #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals #ifndef STEP_TIMER - #define STEP_TIMER 6 + #define STEP_TIMER 6 // STM32F401 has no TIM6, TIM7, or TIM8 #endif #ifndef TEMP_TIMER - #define TEMP_TIMER 14 + #define TEMP_TIMER 14 // TIM7 is consumed by Software Serial if used. #endif #elif defined(STM32F7xx) - #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals + #define HAL_TIMER_RATE (F_CPU / 2) // frequency of timer peripherals #ifndef STEP_TIMER - #define STEP_TIMER 6 + #define STEP_TIMER 6 // the RIGHT timer! #endif #ifndef TEMP_TIMER diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index fe279bae8947..ecafd49a8298 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -222,6 +222,10 @@ #define MSG_SOFT_MIN " Min: " #define MSG_SOFT_MAX " Max: " +#define MSG_SAVED_POS "Position saved" +#define MSG_RESTORING_POS "Restoring position" +#define MSG_INVALID_POS_SLOT "Invalid slot. Total: " + #define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir " #define MSG_SD_INIT_FAIL "SD init fail" #define MSG_SD_VOL_INIT_FAIL "volume.init failed" diff --git a/Marlin/src/gcode/feature/pause/G60.cpp b/Marlin/src/gcode/feature/pause/G60.cpp new file mode 100644 index 000000000000..94b73cd7d92b --- /dev/null +++ b/Marlin/src/gcode/feature/pause/G60.cpp @@ -0,0 +1,59 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if SAVED_POSITIONS + +#include "../../../core/language.h" +#include "../../gcode.h" +#include "../../../module/motion.h" + +#define DEBUG_OUT ENABLED(SAVED_POSITIONS_DEBUG) +#include "../../../core/debug_out.h" + +/** + * G60: Save current position + * + * S - Memory slot # (0-based) to save into (default 0) + */ +void GcodeSuite::G60() { + const uint8_t slot = parser.byteval('S'); + + if (slot >= SAVED_POSITIONS) { + SERIAL_ERROR_MSG(MSG_INVALID_POS_SLOT STRINGIFY(SAVED_POSITIONS)); + return; + } + + stored_position[slot] = current_position; + SBI(saved_slots, slot); + + #if ENABLED(SAVED_POSITIONS_DEBUG) + const xyze_pos_t &pos = stored_position[slot]; + DEBUG_ECHOPAIR_F(MSG_SAVED_POS " S", slot); + DEBUG_ECHOPAIR_F(" : X", pos.x); + DEBUG_ECHOPAIR_F_P(SP_Y_STR, pos.y); + DEBUG_ECHOLNPAIR_F_P(SP_Z_STR, pos.z); + #endif +} + +#endif // SAVED_POSITIONS diff --git a/Marlin/src/gcode/feature/pause/G61.cpp b/Marlin/src/gcode/feature/pause/G61.cpp new file mode 100644 index 000000000000..5d854dfab482 --- /dev/null +++ b/Marlin/src/gcode/feature/pause/G61.cpp @@ -0,0 +1,71 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if SAVED_POSITIONS + +#include "../../../core/language.h" +#include "../../module/planner.h" +#include "../../gcode.h" +#include "../../../module/motion.h" + +/** + * G61: Return to saved position + * + * F - Feedrate (optional) for the move back. + * S - Slot # (0-based) to restore from (default 0). + * X Y Z - Axes to restore. At least one is required. + */ +void GcodeSuite::G61(void) { + + const uint8_t slot = parser.byteval('S'); + + #if SAVED_POSITIONS < 256 + if (slot >= SAVED_POSITIONS) { + SERIAL_ERROR_MSG(MSG_INVALID_POS_SLOT STRINGIFY(SAVED_POSITIONS)); + return; + } + #endif + + // No saved position? No axes being restored? + if (!TEST(saved_slots, slot) || !parser.seen("XYZ")) return; + + // Apply any given feedrate over 0.0 + const float fr = parser.linearval('F'); + if (fr > 0.0) feedrate_mm_s = MMM_TO_MMS(fr); + + SERIAL_ECHOPAIR(MSG_RESTORING_POS " S", int(slot)); + LOOP_XYZ(i) { + destination[i] = parser.seen(axis_codes[i]) + ? stored_position[slot][i] + parser.value_axis_units((AxisEnum)i) + : current_position[i]; + SERIAL_CHAR(' ', axis_codes[i]); + SERIAL_ECHO_F(destination[i]); + } + SERIAL_EOL(); + + // Move to the saved position + prepare_move_to_destination(); +} + +#endif // SAVED_POSITIONS diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 7ff86f3149b1..955e62e80e11 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -314,19 +314,27 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #if ENABLED(CNC_COORDINATE_SYSTEMS) - case 53: G53(); break; - case 54: G54(); break; - case 55: G55(); break; - case 56: G56(); break; - case 57: G57(); break; - case 58: G58(); break; - case 59: G59(); break; + case 53: G53(); break; // G53: (prefix) Apply native workspace + case 54: G54(); break; // G54: Switch to Workspace 1 + case 55: G55(); break; // G55: Switch to Workspace 2 + case 56: G56(); break; // G56: Switch to Workspace 3 + case 57: G57(); break; // G57: Switch to Workspace 4 + case 58: G58(); break; // G58: Switch to Workspace 5 + case 59: G59(); break; // G59.0 - G59.3: Switch to Workspace 6-9 + #endif + + #if SAVED_POSITIONS + case 60: G60(); break; // G60: save current position + case 61: G61(); break; // G61: Apply/restore saved coordinates. #endif #if ENABLED(PROBE_TEMP_COMPENSATION) case 76: G76(); break; // G76: Calibrate first layer compensation values #endif + case 60: G60(); break; // G60: save current position + case 61: G61(); break; // G61: Apply/restore saved coordinates. + #if ENABLED(GCODE_MOTION_MODES) case 80: G80(); break; // G80: Reset the current motion mode #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index f7111c6eeca9..5bbc5e862cff 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -67,6 +67,8 @@ * G34 - Z Stepper automatic alignment using probe: I T A (Requires Z_STEPPER_AUTO_ALIGN) * G38 - Probe in any direction using the Z_MIN_PROBE (Requires G38_PROBE_TARGET) * G42 - Coordinated move to a mesh point (Requires MESH_BED_LEVELING, AUTO_BED_LEVELING_BLINEAR, or AUTO_BED_LEVELING_UBL) + * G60 - Save current position. (Requires SAVED_POSITIONS) + * G61 - Apply/restore saved coordinates. (Requires SAVED_POSITIONS) * G76 - Calibrate first layer temperature offsets. (Requires PROBE_TEMP_COMPENSATION) * G80 - Cancel current motion mode (Requires GCODE_MOTION_MODES) * G90 - Use Absolute Coordinates @@ -471,6 +473,11 @@ class GcodeSuite { static void G76(); #endif + #if SAVED_POSITIONS + static void G60(); + static void G61(); + #endif + #if ENABLED(GCODE_MOTION_MODES) static void G80(); #endif diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 00be08433d08..7ac2d167ada8 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -142,3 +142,8 @@ #if ENABLED(JOYSTICK) #define POLL_JOG #endif + +// G60/G61 Position Save +#if SAVED_POSITIONS > 256 + #error "SAVED_POSITIONS must be an integer from 0 to 256." +#endif diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 9d0422c4a62b..6dbf940addca 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -109,9 +109,15 @@ xyze_pos_t current_position = { X_HOME_POS, Y_HOME_POS, Z_HOME_POS }; */ xyze_pos_t destination; // {0} +// G60/G61 Position Save and Return +#if SAVED_POSITIONS + uint8_t saved_slots; + xyz_pos_t stored_position[SAVED_POSITIONS]; +#endif + // The active extruder (tool). Set with T command. #if EXTRUDERS > 1 - uint8_t active_extruder; // = 0 + uint8_t active_extruder = 0; // = 0 #endif #if ENABLED(LCD_SHOW_E_TOTAL) diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 43ae2b23035d..a30573e7973f 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -65,6 +65,12 @@ extern bool relative_mode; extern xyze_pos_t current_position, // High-level current tool position destination; // Destination for a move +// G60/G61 Position Save and Return +#if SAVED_POSITIONS + extern uint8_t saved_slots; + extern xyz_pos_t stored_position[SAVED_POSITIONS]; +#endif + // Scratch space for a cartesian result extern xyz_pos_t cartes;