From 068624a726213dc91f485db4d4eda1d89f656025 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2022 13:02:54 -0500 Subject: [PATCH 01/31] =?UTF-8?q?=F0=9F=93=8C=20Ask=20for=20PlatformIO=206?= =?UTF-8?q?.1.1=20or=20newer=20(#24435)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/pioutil.py | 9 +++++++-- .../share/PlatformIO/scripts/preflight-checks.py | 5 +++++ ini/esp32.ini | 13 +++++++------ platformio.ini | 13 +++---------- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/pioutil.py b/buildroot/share/PlatformIO/scripts/pioutil.py index b8c1e9cfca..32096dab3f 100644 --- a/buildroot/share/PlatformIO/scripts/pioutil.py +++ b/buildroot/share/PlatformIO/scripts/pioutil.py @@ -4,5 +4,10 @@ # Make sure 'vscode init' is not the current command def is_pio_build(): - from SCons.Script import COMMAND_LINE_TARGETS - return "idedata" not in COMMAND_LINE_TARGETS and "_idedata" not in COMMAND_LINE_TARGETS + from SCons.Script import DefaultEnvironment + env = DefaultEnvironment() + return not env.IsIntegrationDump() + +def get_pio_version(): + from platformio import util + return util.pioversion_to_intstr() diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index dbd0510b5d..e4bcc83cb3 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -52,6 +52,11 @@ if pioutil.is_pio_build(): if 'PIOENV' not in env: raise SystemExit("Error: PIOENV is not defined. This script is intended to be used with PlatformIO") + # Require PlatformIO 6.1.1 or later + vers = pioutil.get_pio_version() + if vers < [6, 1, 1]: + raise SystemExit("Error: Marlin requires PlatformIO >= 6.1.1. Use 'pio upgrade' to get a newer version.") + if 'MARLIN_FEATURES' not in env: raise SystemExit("Error: this script should be used after common Marlin scripts") diff --git a/ini/esp32.ini b/ini/esp32.ini index 05b045f16e..f12ef99759 100644 --- a/ini/esp32.ini +++ b/ini/esp32.ini @@ -20,6 +20,7 @@ build_src_filter = ${common.default_src_filter} + lib_ignore = NativeEthernet upload_speed = 500000 monitor_speed = 250000 +monitor_filters = colorize, time, send_on_enter, log2file, esp32_exception_decoder #upload_port = marlinesp.local #board_build.flash_mode = qio @@ -28,13 +29,13 @@ extends = env:esp32 board_build.partitions = default_16MB.csv [env:PANDA] -extends = env:esp32 -build_flags = ${env:esp32.build_flags} -DUSE_ESP32_EXIO -DUSE_ESP32_TASK_WDT -lib_deps = ${common.lib_deps} - SoftwareSerialEsp32 +extends = env:esp32 +build_flags = ${env:esp32.build_flags} -DUSE_ESP32_EXIO -DUSE_ESP32_TASK_WDT +lib_deps = ${common.lib_deps} + SoftwareSerialEsp32 board_build.partitions = Marlin/src/HAL/ESP32/esp32.csv -upload_speed = 115200 -monitor_speed = 115200 +upload_speed = 115200 +monitor_speed = 115200 [env:mks_tinybee] extends = env:esp32 diff --git a/platformio.ini b/platformio.ini index 3820e70193..06ab120966 100644 --- a/platformio.ini +++ b/platformio.ini @@ -267,17 +267,10 @@ framework = arduino extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} lib_deps = ${common.lib_deps} -platform_packages = platformio/tool-dfuutil@^1.11.0 monitor_speed = 250000 -monitor_flags = - --quiet - --echo - --eol - LF - --filter - colorize - --filter - time +monitor_eol = LF +monitor_echo = yes +monitor_filters = colorize, time, send_on_enter, log2file # # Just print the dependency tree From 3c3c9f1a8eb8a690494161e3831448ca3c848205 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 12 Jul 2022 13:25:36 -0500 Subject: [PATCH 02/31] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Updat?= =?UTF-8?q?e=20Mac=20Sim=20directions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/PlatformIO/debugging/launch.json | 12 +++---- ini/native.ini | 34 ++++++++++++++----- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/buildroot/share/PlatformIO/debugging/launch.json b/buildroot/share/PlatformIO/debugging/launch.json index f2219a44b8..f9936ebced 100644 --- a/buildroot/share/PlatformIO/debugging/launch.json +++ b/buildroot/share/PlatformIO/debugging/launch.json @@ -29,9 +29,9 @@ "request": "launch", "type": "cppdbg", "cwd": "${workspaceRoot}", - "program": ".pio/build/simulator_macos_debug/debug/MarlinSimulator", - //"program": ".pio/build/simulator_linux_debug/MarlinSimulator", - //"program": ".pio/build/simulator_windows/MarlinSimulator", + "program": "${workspaceRoot}/.pio/build/simulator_macos_debug/debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_linux_debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_windows/MarlinSimulator", "miDebuggerPath": "/opt/local/bin/ggdb", "MIMode": "gdb" }, @@ -40,9 +40,9 @@ "request": "launch", "type": "cppdbg", "cwd": "${workspaceRoot}", - "program": ".pio/build/simulator_macos_debug/debug/MarlinSimulator", - //"program": ".pio/build/simulator_linux_debug/MarlinSimulator", - //"program": ".pio/build/simulator_windows/MarlinSimulator", + "program": "${workspaceRoot}/.pio/build/simulator_macos_debug/debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_linux_debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_windows/MarlinSimulator", //"targetArchitecture": "arm64", "MIMode": "lldb" } diff --git a/ini/native.ini b/ini/native.ini index 693a985d4e..1905559fd0 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -63,20 +63,36 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags} # # Simulator for macOS (MacPorts) # -# sudo port install gcc11 gdb glm libsdl2 libsdl2_net freetype -# sudo port install ld64 @3_3 +ld64_xcode + +# +# MacPorts: +# sudo port install gcc11 glm libsdl2 libsdl2_net # # cd /opt/local/bin # sudo rm -f gcc g++ cc # sudo ln -s gcc-mp-11 gcc ; sudo ln -s g++-mp-11 g++ ; sudo ln -s g++ cc -# This step may be obsolete: -# sudo port uninstall ld64 ld64-latest -# -# cd - +# cd - +# rehash # # Use 'sudo port install mesa' to get a if no Xcode is installed. # If Xcode is installed be sure to run `xcode-select --install` first. # +#================================================================================== +# +# Homebrew: +# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +# +# brew install gcc@12 glm sdl2 sdl2_net +# +# cd /opt/homebrew/bin +# sudo rm -f gcc g++ cc +# sudo ln -s gcc-12 gcc ; sudo ln -s g++-12 g++ ; sudo ln -s g++ cc +# cd - +# +# Use 'brew install mesa' to get a if no Xcode is installed. +# If Xcode is installed be sure to run `xcode-select --install` first. +# + [simulator_macos] build_unflags = -lGL -fstack-protector-strong build_flags = @@ -110,7 +126,7 @@ custom_gcc = g++ # pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-glm mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-dlfcn # [env:simulator_windows] -extends = simulator_common +extends = simulator_common build_src_flags = ${simulator_common.build_src_flags} -fpermissive -build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp -build_type = debug +build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp +build_type = debug From cee517bc2488d63d9f668f9759918ae5784e8fb3 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Wed, 13 Jul 2022 00:25:33 +0000 Subject: [PATCH 03/31] [cron] Bump distribution date (2022-07-13) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 6c33d08adf..d53dffc2e1 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2022-07-12" +//#define STRING_DISTRIBUTION_DATE "2022-07-13" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index e61be2f0bc..8e22a5b5a3 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 "2022-07-12" + #define STRING_DISTRIBUTION_DATE "2022-07-13" #endif /** From 1d31b6215a4af5d768c0066f632e5c56326f218a Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Thu, 14 Jul 2022 03:25:35 +0200 Subject: [PATCH 04/31] =?UTF-8?q?=F0=9F=94=A8=20Abort=20firmware=20update?= =?UTF-8?q?=20on=20transfer=20error=20(#24472)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/scripts/MarlinBinaryProtocol.py | 21 ++- buildroot/share/scripts/upload.py | 132 +++++++++++++----- 2 files changed, 111 insertions(+), 42 deletions(-) diff --git a/buildroot/share/scripts/MarlinBinaryProtocol.py b/buildroot/share/scripts/MarlinBinaryProtocol.py index 4887ad9919..ecf9df35e2 100644 --- a/buildroot/share/scripts/MarlinBinaryProtocol.py +++ b/buildroot/share/scripts/MarlinBinaryProtocol.py @@ -376,11 +376,13 @@ class FileTransferProtocol(object): token, data = self.await_response(1000) if token == 'PFT:success': print("File closed") - return + return True elif token == 'PFT:ioerror': print("Client storage device IO error") + return False elif token == 'PFT:invalid': print("No open file") + return False def abort(self): self.protocol.send(FileTransferProtocol.protocol_id, FileTransferProtocol.Packet.ABORT); @@ -417,12 +419,23 @@ class FileTransferProtocol(object): self.write(data[start:end]) kibs = (( (i+1) * block_size) / 1024) / (millis() + 1 - start_time) * 1000 if (i / blocks) >= dump_pctg: - print("\r{0:2.2f}% {1:4.2f}KiB/s {2} Errors: {3}".format((i / blocks) * 100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression_support else "", self.protocol.errors), end='') + print("\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3}".format((i / blocks) * 100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression_support else "", self.protocol.errors), end='') dump_pctg += 0.1 - print("\r{0:2.2f}% {1:4.2f}KiB/s {2} Errors: {3}".format(100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression_support else "", self.protocol.errors)) # no one likes transfers finishing at 99.8% + if self.protocol.errors > 0: + # Dump last status (errors may not be visible) + print("\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3} - Aborting...".format((i / blocks) * 100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression_support else "", self.protocol.errors), end='') + print("") # New line to break the transfer speed line + self.close() + print("Transfer aborted due to protocol errors") + #raise Exception("Transfer aborted due to protocol errors") + return False; + print("\r{0:2.0f}% {1:4.2f}KiB/s {2} Errors: {3}".format(100, kibs, "[{0:4.2f}KiB/s]".format(kibs * cratio) if compression_support else "", self.protocol.errors)) # no one likes transfers finishing at 99.8% - self.close() + if not self.close(): + print("Transfer failed") + return False print("Transfer complete") + return True class EchoProtocol(object): diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index c7730d8f29..31d5620f4e 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -20,14 +20,18 @@ Import("env") import MarlinBinaryProtocol -# Internal debug flag -Debug = False - #-----------------# # Upload Callback # #-----------------# def Upload(source, target, env): + #-------# + # Debug # + #-------# + Debug = False # Set to True to enable script debug + def debugPrint(data): + if Debug: print(f"[Debug]: {data}") + #------------------# # Marlin functions # #------------------# @@ -39,19 +43,35 @@ def Upload(source, target, env): # Port functions # #----------------# def _GetUploadPort(env): - if Debug: print('Autodetecting upload port...') + debugPrint('Autodetecting upload port...') env.AutodetectUploadPort(env) - port = env.subst('$UPLOAD_PORT') - if not port: + portName = env.subst('$UPLOAD_PORT') + if not portName: raise Exception('Error detecting the upload port.') - if Debug: print('OK') - return port + debugPrint('OK') + return portName #-------------------------# # Simple serial functions # #-------------------------# + def _OpenPort(): + # Open serial port + if port.is_open: return + debugPrint('Opening upload port...') + port.open() + port.reset_input_buffer() + debugPrint('OK') + + def _ClosePort(): + # Open serial port + if port is None: return + if not port.is_open: return + debugPrint('Closing upload port...') + port.close() + debugPrint('OK') + def _Send(data): - if Debug: print(f'>> {data}') + debugPrint(f'>> {data}') strdata = bytearray(data, 'utf8') + b'\n' port.write(strdata) time.sleep(0.010) @@ -60,37 +80,37 @@ def Upload(source, target, env): clean_responses = [] responses = port.readlines() for Resp in responses: - # Test: suppress invaid chars (coming from debug info) + # Suppress invalid chars (coming from debug info) try: clean_response = Resp.decode('utf8').rstrip().lstrip() clean_responses.append(clean_response) except: pass - if Debug: print(f'<< {clean_response}') + debugPrint(f'<< {clean_response}') return clean_responses #------------------# # SDCard functions # #------------------# def _CheckSDCard(): - if Debug: print('Checking SD card...') + debugPrint('Checking SD card...') _Send('M21') Responses = _Recv() if len(Responses) < 1 or not any('SD card ok' in r for r in Responses): raise Exception('Error accessing SD card') - if Debug: print('SD Card OK') + debugPrint('SD Card OK') return True #----------------# # File functions # #----------------# def _GetFirmwareFiles(UseLongFilenames): - if Debug: print('Get firmware files...') + debugPrint('Get firmware files...') _Send(f"M20 F{'L' if UseLongFilenames else ''}") Responses = _Recv() if len(Responses) < 3 or not any('file list' in r for r in Responses): raise Exception('Error getting firmware files') - if Debug: print('OK') + debugPrint('OK') return Responses def _FilterFirmwareFiles(FirmwareList, UseLongFilenames): @@ -114,6 +134,17 @@ def Upload(source, target, env): raise Exception(f"Firmware file '{FirmwareFile}' not removed") return Removed + def _RollbackUpload(FirmwareFile): + if not rollback: return + print(f"Rollback: trying to delete firmware '{FirmwareFile}'...") + _OpenPort() + # Wait for SD card release + time.sleep(1) + # Remount SD card + _CheckSDCard() + print(' OK' if _RemoveFirmwareFile(FirmwareFile) else ' Error!') + _ClosePort() + #---------------------# # Callback Entrypoint # @@ -121,6 +152,7 @@ def Upload(source, target, env): port = None protocol = None filetransfer = None + rollback = False # Get Marlin evironment vars MarlinEnv = env['MARLIN_FEATURES'] @@ -204,9 +236,9 @@ def Upload(source, target, env): if not marlin_custom_firmware_upload: raise Exception(f"CUSTOM_FIRMWARE_UPLOAD must be enabled in 'Configuration_adv.h' for '{marlin_motherboard}'") - # Init serial port + # Init & Open serial port port = serial.Serial(upload_port, baudrate = upload_speed, write_timeout = 0, timeout = 0.1) - port.reset_input_buffer() + _OpenPort() # Check SD card status _CheckSDCard() @@ -228,24 +260,26 @@ def Upload(source, target, env): print(' OK' if _RemoveFirmwareFile(OldFirmwareFile) else ' Error!') # Close serial - port.close() + _ClosePort() # Cleanup completed - if Debug: print('Cleanup completed') + debugPrint('Cleanup completed') # WARNING! The serial port must be closed here because the serial transfer that follow needs it! # Upload firmware file - if Debug: print(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'") + debugPrint(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'") protocol = MarlinBinaryProtocol.Protocol(upload_port, upload_speed, upload_blocksize, float(upload_error_ratio), int(upload_timeout)) #echologger = MarlinBinaryProtocol.EchoProtocol(protocol) protocol.connect() + # Mark the rollback (delete broken transfer) from this point on + rollback = True filetransfer = MarlinBinaryProtocol.FileTransferProtocol(protocol) - filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test) + transferOK = filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test) protocol.disconnect() # Notify upload completed - protocol.send_ascii('M117 Firmware uploaded') + protocol.send_ascii('M117 Firmware uploaded' if transferOK else 'M117 Firmware upload failed') # Remount SD card print('Wait for SD card release...') @@ -253,34 +287,56 @@ def Upload(source, target, env): print('Remount SD card') protocol.send_ascii('M21') - # Trigger firmware update - if upload_reset: - print('Trigger firmware update...') - protocol.send_ascii('M997', True) + # Transfer failed? + if not transferOK: + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + else: + # Trigger firmware update + if upload_reset: + print('Trigger firmware update...') + protocol.send_ascii('M997', True) + protocol.shutdown() - protocol.shutdown() - print('Firmware update completed') + print('Firmware update completed' if transferOK else 'Firmware update failed') + return 0 if transferOK else -1 except KeyboardInterrupt: - if port: port.close() + print('Aborted by user') if filetransfer: filetransfer.abort() - if protocol: protocol.shutdown() + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() raise except serial.SerialException as se: - if port: port.close() - print(f'Serial excepion: {se}') + # This exception is raised only for send_ascii data (not for binary transfer) + print(f'Serial excepion: {se}, transfer aborted') + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() raise Exception(se) except MarlinBinaryProtocol.FatalError: - if port: port.close() - if protocol: protocol.shutdown() - print('Too many retries, Abort') + print('Too many retries, transfer aborted') + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() raise - except: - if port: port.close() - if protocol: protocol.shutdown() + except Exception as ex: + print(f"\nException: {ex}, transfer aborted") + if protocol: + protocol.disconnect() + protocol.shutdown() + _RollbackUpload(upload_firmware_target_name) + _ClosePort() print('Firmware not updated') raise From 2dc543c4f58c39e6cdf7a4a001c15100268cdf46 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 13 Jul 2022 21:22:53 -0500 Subject: [PATCH 05/31] =?UTF-8?q?=F0=9F=8E=A8=20ANY=20=3D>=20EITHER?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 4 ++-- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 2 +- .../ftdi_eve_lib/basic/commands.cpp | 2 +- .../lcd/extui/ftdi_eve_touch_ui/theme/colors.h | 16 ++++++++-------- Marlin/src/libs/nozzle.cpp | 2 +- Marlin/src/module/probe.cpp | 2 +- Marlin/src/module/temperature.cpp | 10 +++++----- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 2 +- Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 2 +- Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 2 +- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h | 2 +- Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 2 +- Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 2 +- Marlin/src/pins/rambo/pins_RAMBO.h | 2 +- Marlin/src/pins/rambo/pins_SCOOVO_X9H.h | 2 +- Marlin/src/pins/ramps/pins_AZTEEG_X3.h | 2 +- Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h | 4 ++-- Marlin/src/pins/ramps/pins_MKS_GEN_13.h | 2 +- Marlin/src/pins/ramps/pins_RAMPS.h | 2 +- Marlin/src/pins/ramps/pins_TRIGORILLA_14.h | 2 +- Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h | 2 +- Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h | 2 +- Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h | 2 +- Marlin/src/pins/samd/pins_RAMPS_144.h | 2 +- Marlin/src/pins/stm32f1/pins_BEAST.h | 2 +- Marlin/src/pins/stm32f1/pins_CHITU3D.h | 2 +- Marlin/src/pins/stm32f1/pins_STM32F1R.h | 2 +- Marlin/src/pins/stm32f1/pins_STM3R_MINI.h | 2 +- .../src/pins/stm32f4/pins_MKS_MONSTER8_common.h | 2 +- Marlin/src/pins/teensy2/pins_PRINTRBOARD.h | 2 +- Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h | 2 +- 33 files changed, 46 insertions(+), 46 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 12314e6492..1d3ad1c2d5 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -464,7 +464,7 @@ #define HAS_DGUS_LCD_CLASSIC 1 #endif -#if ANY(HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_RELOADED) +#if EITHER(HAS_DGUS_LCD_CLASSIC, DGUS_LCD_UI_RELOADED) #define HAS_DGUS_LCD 1 #endif @@ -1431,7 +1431,7 @@ #define TFT_DEFAULT_ORIENTATION 0 #define TFT_RES_480x272 #define TFT_INTERFACE_FSMC -#elif ANY(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28) // ILI9328 or R61505 +#elif EITHER(MKS_ROBIN_TFT_V1_1R, LONGER_LK_TFT28) // ILI9328 or R61505 #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) #define TFT_RES_320x240 #define TFT_INTERFACE_FSMC diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index dfccd9b8f5..3a5470b03e 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -48,7 +48,7 @@ // Set additional flags to let HALs choose in their Conditionals_post.h #if ANY(FLASH_EEPROM_EMULATION, SRAM_EEPROM_EMULATION, SDCARD_EEPROM_EMULATION, QSPI_EEPROM) #define USE_EMULATED_EEPROM 1 - #elif ANY(I2C_EEPROM, SPI_EEPROM) + #elif EITHER(I2C_EEPROM, SPI_EEPROM) #define USE_WIRED_EEPROM 1 #elif ENABLED(IIC_BL24CXX_EEPROM) // nothing diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index 455fce272a..ab21c7be4a 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -565,7 +565,7 @@ void MarlinUI::draw_status_message(const bool blink) { #endif // AUTO_BED_LEVELING_UBL - #if ANY(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) + #if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY) void MarlinUI::zoffset_overlay(const int8_t dir) { const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW), diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp index a796c8edcf..662753a154 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp @@ -1208,7 +1208,7 @@ void CLCD::default_display_orientation() { + ENABLED(TOUCH_UI_INVERTED) * 1 ); cmd.execute(); - #elif ANY(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED) + #elif EITHER(TOUCH_UI_PORTRAIT, TOUCH_UI_MIRRORED) #error "PORTRAIT or MIRRORED orientation not supported on the FT800." #elif ENABLED(TOUCH_UI_INVERTED) mem_write_32(REG::ROTATE, 1); diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h index 995379fcda..70c2be4ec2 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/colors.h @@ -37,14 +37,14 @@ namespace Theme { #else // Use linear accent colors - #if ANY(TOUCH_UI_ROYAL_THEME, TOUCH_UI_FROZEN_THEME) - // Dark blue accent colors - constexpr int accent_hue = 216; - constexpr float accent_sat = 0.7; + #if EITHER(TOUCH_UI_ROYAL_THEME, TOUCH_UI_FROZEN_THEME) + // Dark blue accent colors + constexpr int accent_hue = 216; + constexpr float accent_sat = 0.7; #else - // Green accent colors - constexpr int accent_hue = 68; - constexpr float accent_sat = 0.68; + // Green accent colors + constexpr int accent_hue = 68; + constexpr float accent_sat = 0.68; #endif // Shades of accent color @@ -88,7 +88,7 @@ namespace Theme { constexpr uint32_t bed_mesh_lines_rgb = 0xFFFFFF; constexpr uint32_t bed_mesh_shadow_rgb = 0x444444; - #elif ANY(TOUCH_UI_COCOA_THEME, TOUCH_UI_FROZEN_THEME) + #elif EITHER(TOUCH_UI_COCOA_THEME, TOUCH_UI_FROZEN_THEME) constexpr uint32_t theme_darkest = accent_color_1; constexpr uint32_t theme_dark = accent_color_4; diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp index 4ca8fa2cae..575e74a814 100644 --- a/Marlin/src/libs/nozzle.cpp +++ b/Marlin/src/libs/nozzle.cpp @@ -161,7 +161,7 @@ Nozzle nozzle; void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) { xyz_pos_t start[HOTENDS] = NOZZLE_CLEAN_START_POINT, end[HOTENDS] = NOZZLE_CLEAN_END_POINT, middle[HOTENDS] = NOZZLE_CLEAN_CIRCLE_MIDDLE; - const uint8_t arrPos = ANY(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder; + const uint8_t arrPos = EITHER(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder; #if NOZZLE_CLEAN_MIN_TEMP > 20 if (thermalManager.degTargetHotend(arrPos) < NOZZLE_CLEAN_MIN_TEMP) { diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp index afe5ba7a74..cc6b521fe1 100644 --- a/Marlin/src/module/probe.cpp +++ b/Marlin/src/module/probe.cpp @@ -53,7 +53,7 @@ float largest_sensorless_adj = 0; #endif -#if ANY(HAS_QUIET_PROBING, USE_SENSORLESS) +#if EITHER(HAS_QUIET_PROBING, USE_SENSORLESS) #include "stepper/indirection.h" #if BOTH(HAS_QUIET_PROBING, PROBING_ESTEPPERS_OFF) #include "stepper.h" diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 65b79d8bc4..97d248864e 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -904,7 +904,7 @@ volatile bool Temperature::raw_temps_ready = false; temp_hotend[active_extruder].target = 0.0f; temp_hotend[active_extruder].soft_pwm_amount = 0; #if HAS_FAN - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); planner.sync_fan_speeds(fan_speed); #endif @@ -922,7 +922,7 @@ volatile bool Temperature::raw_temps_ready = false; disable_all_heaters(); #if HAS_FAN zero_fan_speeds(); - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); #endif const xyz_pos_t tuningpos = MPC_TUNING_POS; @@ -949,7 +949,7 @@ volatile bool Temperature::raw_temps_ready = false; } #if HAS_FAN - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0); planner.sync_fan_speeds(fan_speed); #endif @@ -1031,7 +1031,7 @@ volatile bool Temperature::raw_temps_ready = false; total_energy_fan0 += constants.heater_power * hotend.soft_pwm_amount / 127 * MPC_dT + (last_temp - current_temp) * constants.block_heat_capacity; #if HAS_FAN else if (ELAPSED(ms, test_end_ms) && !fan0_done) { - set_fan_speed(ANY(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); + set_fan_speed(EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 255); planner.sync_fan_speeds(fan_speed); settle_end_ms = ms + settle_time; test_end_ms = settle_end_ms + test_duration; @@ -1430,7 +1430,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) { float ambient_xfer_coeff = constants.ambient_xfer_coeff_fan0; #if ENABLED(MPC_INCLUDE_FAN) - const uint8_t fan_index = ANY(MPC_FAN_0_ACTIVE_HOTEND, MPC_FAN_0_ALL_HOTENDS) ? 0 : ee; + const uint8_t fan_index = EITHER(MPC_FAN_0_ACTIVE_HOTEND, MPC_FAN_0_ALL_HOTENDS) ? 0 : ee; const float fan_fraction = TERN_(MPC_FAN_0_ACTIVE_HOTEND, !this_hotend ? 0.0f : ) fan_speed[fan_index] * RECIPROCAL(255); ambient_xfer_coeff += fan_fraction * constants.fan255_adjustment; #endif diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 7953f678fa..9e2eedd68e 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -582,7 +582,7 @@ #define LCD_SDSS SDSS #define SD_DETECT_PIN 49 - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #define DOGLCD_CS 45 #define DOGLCD_A0 44 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h index 7f9e530f3c..cf12a98aef 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h @@ -238,7 +238,7 @@ #define LCD_SDSS P0_28 // EXP2.4 #define LCD_PINS_ENABLE P0_18 // EXP1.3 #define LCD_PINS_D4 P0_15 // EXP1.5 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define DOGLCD_SCK SD_SCK_PIN #define DOGLCD_MOSI SD_MOSI_PIN #endif diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 56d75a748c..fe424c800a 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -351,7 +351,7 @@ //#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4 #endif - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define DOGLCD_CS P0_16 // (16) #define DOGLCD_A0 P2_06 // (59) J3-8 & AUX-2 #define DOGLCD_SCK SD_SCK_PIN diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h index 7ce78ad283..bc7cada8da 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h @@ -107,7 +107,7 @@ // Display // -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN P1_31 #define DOGLCD_A0 P2_06 #define DOGLCD_CS P0_16 diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h index 4fbc19eed8..c33fe6e28f 100644 --- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h +++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h @@ -154,7 +154,7 @@ //#define SHIFT_EN_PIN P1_22 // (41) J5-4 & AUX-4 #endif - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN P1_30 // (37) may change if cable changes #define DOGLCD_CS P0_26 // (63) J5-3 & AUX-2 #define DOGLCD_SCK SD_SCK_PIN diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h index e80116efd0..cfaca164f8 100644 --- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h @@ -91,7 +91,7 @@ // // LCD / Controller // -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN P1_31 #define DOGLCD_A0 P2_11 diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 5484b193b9..cb7a059134 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -208,7 +208,7 @@ #define LCD_PINS_D6 74 #define LCD_PINS_D7 75 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 44 // NB: Panucatt's Viki 2.0 wiring diagram (v1.2) indicates that the // beeper/buzzer is connected to pin 33; however, the pin used in the diff --git a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h index 4c2645e64b..533284a4bf 100644 --- a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h +++ b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h @@ -143,7 +143,7 @@ #define HOME_PIN BTN_HOME -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 44 // Pins for DOGM SPI LCD Support #define DOGLCD_A0 70 diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h index 44d8341c11..31adea4270 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h @@ -51,7 +51,7 @@ #undef STAT_LED_RED_PIN #undef STAT_LED_BLUE_PIN -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #undef DOGLCD_A0 #undef DOGLCD_CS diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h index 5dc191cd20..24266bb9d2 100644 --- a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h @@ -142,7 +142,7 @@ #undef BEEPER_PIN #define BEEPER_PIN 33 -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) #undef SD_DETECT_PIN #define SD_DETECT_PIN 49 // For easy adapter board #undef BEEPER_PIN @@ -169,7 +169,7 @@ #undef SPINDLE_DIR_PIN #if HAS_CUTTER // EXP2 header - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BTN_EN2 31 // Pin 7 needed for Spindle PWM #endif #define SPINDLE_LASER_PWM_PIN 7 // Hardware PWM diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index bb7b55893e..1ba58629c1 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -60,7 +60,7 @@ // // LCD / Controller // -#if ANY(VIKI2, miniVIKI) +#if EITHER(VIKI2, miniVIKI) /** * VIKI2 Has two groups of wires with... * diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index d779372b1b..5672915b7c 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -728,7 +728,7 @@ #define LCD_SDSS SDSS #define SD_DETECT_PIN EXP2_04_PIN - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #define DOGLCD_CS AUX4_05_PIN #define DOGLCD_A0 AUX2_07_PIN diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h index 994a54297f..b685ff0094 100644 --- a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h +++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h @@ -128,7 +128,7 @@ // LCD Display input pins #if IS_NEWPANEL - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #undef DOGLCD_A0 #define DOGLCD_A0 23 #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h index 37060ab945..146c519ff9 100644 --- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h +++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h @@ -163,7 +163,7 @@ // // LCD / Controller // -#if ANY(BOARD_REV_1_0, BOARD_REV_1_1_TO_1_3) +#if EITHER(BOARD_REV_1_0, BOARD_REV_1_1_TO_1_3) #define LCD_PINS_RS 24 #define LCD_PINS_ENABLE 22 diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index 980a957a50..4cb0f60328 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -217,7 +217,7 @@ #endif - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define DOGLCD_A0 EXP1_04_PIN #define KILL_PIN 51 #define STAT_LED_BLUE_PIN EXP1_08_PIN diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h index 382c607d23..264b2e80c6 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -373,7 +373,7 @@ //#define LCD_SDSS SDSS //#define SD_DETECT_PIN EXP2_01_PIN - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index 0f4bb1d0b5..e90be4eda1 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -424,7 +424,7 @@ //#define LCD_SDSS SDSS //#define SD_DETECT_PIN EXP2_01_PIN - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 406162c089..2c42506a5f 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -408,7 +408,7 @@ //#define LCD_SDSS SDSS //#define SD_DETECT_PIN 49 - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 diff --git a/Marlin/src/pins/stm32f1/pins_BEAST.h b/Marlin/src/pins/stm32f1/pins_BEAST.h index d494b29c14..4dafe2f273 100644 --- a/Marlin/src/pins/stm32f1/pins_BEAST.h +++ b/Marlin/src/pins/stm32f1/pins_BEAST.h @@ -131,7 +131,7 @@ #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) #error "LCD_I2C_VIKI is not supported." - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 1f56e59a23..3b66096a27 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -171,7 +171,7 @@ #define LCD_SDSS PD5 // 53 #define SD_DETECT_PIN PD1 // 49 - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #define BEEPER_PIN PC1 // 33 diff --git a/Marlin/src/pins/stm32f1/pins_STM32F1R.h b/Marlin/src/pins/stm32f1/pins_STM32F1R.h index c08b707d7e..634cadc1aa 100644 --- a/Marlin/src/pins/stm32f1/pins_STM32F1R.h +++ b/Marlin/src/pins/stm32f1/pins_STM32F1R.h @@ -120,7 +120,7 @@ #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) #error "LCD_I2C_VIKI is not supported." - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index e189fc3f97..eee7dbf316 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -144,7 +144,7 @@ #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI) #error "LCD_I2C_VIKI is not supported." - #elif ANY(VIKI2, miniVIKI) + #elif EITHER(VIKI2, miniVIKI) #error "VIKI2 / miniVIKI is not supported." #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #error "ELB_FULL_GRAPHIC_CONTROLLER is not supported." diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h index 2af6a872db..cc02ac3097 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h @@ -261,7 +261,7 @@ #endif #endif -#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI) +#if EITHER(TFT_COLOR_UI, TFT_CLASSIC_UI) #define TFT_CS_PIN EXP1_04_PIN #define TFT_SCK_PIN EXP2_09_PIN #define TFT_MISO_PIN EXP2_10_PIN diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h index 82d9cec894..ddf0d53ea6 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h @@ -130,7 +130,7 @@ #define LCD_PINS_D6 5 // D5 JP11-6 #define LCD_PINS_D7 4 // D4 JP11-5 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 8 // E0 JP11-10 #define DOGLCD_A0 40 // F2 JP2-2 diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h index 1ac953c89f..1867398087 100644 --- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h +++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h @@ -207,7 +207,7 @@ #define LCD_PINS_D6 5 // D5 JP11-6 #define LCD_PINS_D7 4 // D4 JP11-5 - #if ANY(VIKI2, miniVIKI) + #if EITHER(VIKI2, miniVIKI) #define BEEPER_PIN 8 // E0 JP11-10 #define DOGLCD_A0 40 // F2 JP2-2 From 3f4e4a4d891e3c4b73ab80aedec46e69c1b59f0d Mon Sep 17 00:00:00 2001 From: Bob Kuhn Date: Wed, 13 Jul 2022 22:16:22 -0500 Subject: [PATCH 06/31] =?UTF-8?q?=F0=9F=94=A5=20Drop=20STM=20L64**=20drive?= =?UTF-8?q?rs,=20STEVAL=5F3DP001V1=20(#24427)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test-builds.yml | 1 - Marlin/Configuration.h | 5 +- Marlin/Configuration_adv.h | 247 ----- Marlin/src/HAL/shared/HAL_spi_L6470.cpp | 139 --- Marlin/src/MarlinCore.cpp | 13 +- Marlin/src/core/boards.h | 1 - Marlin/src/core/drivers.h | 17 - Marlin/src/gcode/calibrate/G28.cpp | 20 - Marlin/src/gcode/feature/L6470/M122.cpp | 151 --- Marlin/src/gcode/feature/L6470/M906.cpp | 417 -------- Marlin/src/gcode/feature/L6470/M916-M918.cpp | 650 ------------ Marlin/src/gcode/gcode.cpp | 8 - Marlin/src/gcode/gcode.h | 15 +- Marlin/src/gcode/host/M114.cpp | 89 -- Marlin/src/inc/Conditionals_post.h | 42 +- Marlin/src/inc/SanityCheck.h | 34 +- Marlin/src/libs/L64XX/L64XX_Marlin.cpp | 998 ------------------ Marlin/src/libs/L64XX/L64XX_Marlin.h | 141 --- Marlin/src/libs/L64XX/README.md | 98 -- Marlin/src/module/stepper.cpp | 31 +- Marlin/src/module/stepper/L64xx.cpp | 264 ----- Marlin/src/module/stepper/L64xx.h | 490 --------- Marlin/src/module/stepper/indirection.cpp | 1 - Marlin/src/module/stepper/indirection.h | 4 - Marlin/src/pins/pins.h | 8 +- Marlin/src/pins/pinsDebug_list.h | 15 - .../src/pins/stm32f4/pins_STEVAL_3DP001V1.h | 325 ------ .../boards/marlin_STEVAL_STM32F401VE.json | 64 -- .../MARLIN_STEVAL_F401VE/PeripheralPins.c | 260 ----- .../MARLIN_STEVAL_F401VE/PinNamesVar.h | 33 - .../MARLIN_STEVAL_F401VE/hal_conf_custom.h | 495 --------- .../variants/MARLIN_STEVAL_F401VE/ldscript.ld | 187 ---- .../variants/MARLIN_STEVAL_F401VE/variant.cpp | 310 ------ .../variants/MARLIN_STEVAL_F401VE/variant.h | 327 ------ buildroot/tests/FYSETC_F6 | 8 +- buildroot/tests/STM32F401VE_STEVAL | 15 - ini/features.ini | 2 - ini/stm32f4.ini | 11 - 38 files changed, 55 insertions(+), 5881 deletions(-) delete mode 100644 Marlin/src/HAL/shared/HAL_spi_L6470.cpp delete mode 100644 Marlin/src/gcode/feature/L6470/M122.cpp delete mode 100644 Marlin/src/gcode/feature/L6470/M906.cpp delete mode 100644 Marlin/src/gcode/feature/L6470/M916-M918.cpp delete mode 100644 Marlin/src/libs/L64XX/L64XX_Marlin.cpp delete mode 100644 Marlin/src/libs/L64XX/L64XX_Marlin.h delete mode 100644 Marlin/src/libs/L64XX/README.md delete mode 100644 Marlin/src/module/stepper/L64xx.cpp delete mode 100644 Marlin/src/module/stepper/L64xx.h delete mode 100644 Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h delete mode 100644 buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json delete mode 100644 buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PeripheralPins.c delete mode 100644 buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PinNamesVar.h delete mode 100644 buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h delete mode 100644 buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/ldscript.ld delete mode 100644 buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.cpp delete mode 100644 buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.h delete mode 100755 buildroot/tests/STM32F401VE_STEVAL diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index e2418f38a6..90a960430b 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -81,7 +81,6 @@ jobs: - STM32F401RC_creality - STM32F103VE_longer - STM32F407VE_black - - STM32F401VE_STEVAL - BIGTREE_BTT002 - BIGTREE_SKR_PRO - BIGTREE_GTR_V1_0 diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index e05428ad08..4d9bf8871f 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -148,13 +148,12 @@ * * Use TMC2208/TMC2208_STANDALONE for TMC2225 drivers and TMC2209/TMC2209_STANDALONE for TMC2226 drivers. * - * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01, - * TB6560, TB6600, TMC2100, + * Options: A4988, A5984, DRV8825, LV8729, TB6560, TB6600, TMC2100, * TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE, * TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE, * TMC26X, TMC26X_STANDALONE, TMC2660, TMC2660_STANDALONE, * TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE - * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] + * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE'] */ #define X_DRIVER_TYPE A4988 #define Y_DRIVER_TYPE A4988 diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 7f85b241a2..bf305741dd 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -3239,253 +3239,6 @@ #endif // HAS_TRINAMIC_CONFIG -// @section L64XX - -/** - * L64XX Stepper Driver options - * - * Arduino-L6470 library (0.8.0 or higher) is required. - * https://github.com/ameyer/Arduino-L6470 - * - * Requires the following to be defined in your pins_YOUR_BOARD file - * L6470_CHAIN_SCK_PIN - * L6470_CHAIN_MISO_PIN - * L6470_CHAIN_MOSI_PIN - * L6470_CHAIN_SS_PIN - * ENABLE_RESET_L64XX_CHIPS(Q) where Q is 1 to enable and 0 to reset - */ - -#if HAS_L64XX - - //#define L6470_CHITCHAT // Display additional status info - - #if AXIS_IS_L64XX(X) - #define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16 - #define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current - // L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down - // POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down - #define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down) - // L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down - // POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down - // L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current - #define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474 - #define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI - #define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest - #endif - - #if AXIS_IS_L64XX(X2) - #define X2_MICROSTEPS X_MICROSTEPS - #define X2_OVERCURRENT 2000 - #define X2_STALLCURRENT 1500 - #define X2_MAX_VOLTAGE 127 - #define X2_CHAIN_POS -1 - #define X2_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(Y) - #define Y_MICROSTEPS 128 - #define Y_OVERCURRENT 2000 - #define Y_STALLCURRENT 1500 - #define Y_MAX_VOLTAGE 127 - #define Y_CHAIN_POS -1 - #define Y_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(Y2) - #define Y2_MICROSTEPS Y_MICROSTEPS - #define Y2_OVERCURRENT 2000 - #define Y2_STALLCURRENT 1500 - #define Y2_MAX_VOLTAGE 127 - #define Y2_CHAIN_POS -1 - #define Y2_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(Z) - #define Z_MICROSTEPS 128 - #define Z_OVERCURRENT 2000 - #define Z_STALLCURRENT 1500 - #define Z_MAX_VOLTAGE 127 - #define Z_CHAIN_POS -1 - #define Z_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(Z2) - #define Z2_MICROSTEPS Z_MICROSTEPS - #define Z2_OVERCURRENT 2000 - #define Z2_STALLCURRENT 1500 - #define Z2_MAX_VOLTAGE 127 - #define Z2_CHAIN_POS -1 - #define Z2_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(Z3) - #define Z3_MICROSTEPS Z_MICROSTEPS - #define Z3_OVERCURRENT 2000 - #define Z3_STALLCURRENT 1500 - #define Z3_MAX_VOLTAGE 127 - #define Z3_CHAIN_POS -1 - #define Z3_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(Z4) - #define Z4_MICROSTEPS Z_MICROSTEPS - #define Z4_OVERCURRENT 2000 - #define Z4_STALLCURRENT 1500 - #define Z4_MAX_VOLTAGE 127 - #define Z4_CHAIN_POS -1 - #define Z4_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(I) - #define I_MICROSTEPS 128 - #define I_OVERCURRENT 2000 - #define I_STALLCURRENT 1500 - #define I_MAX_VOLTAGE 127 - #define I_CHAIN_POS -1 - #define I_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(J) - #define J_MICROSTEPS 128 - #define J_OVERCURRENT 2000 - #define J_STALLCURRENT 1500 - #define J_MAX_VOLTAGE 127 - #define J_CHAIN_POS -1 - #define J_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(K) - #define K_MICROSTEPS 128 - #define K_OVERCURRENT 2000 - #define K_STALLCURRENT 1500 - #define K_MAX_VOLTAGE 127 - #define K_CHAIN_POS -1 - #define K_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(U) - #define U_MICROSTEPS 128 - #define U_OVERCURRENT 2000 - #define U_STALLCURRENT 1500 - #define U_MAX_VOLTAGE 127 - #define U_CHAIN_POS -1 - #define U_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(V) - #define V_MICROSTEPS 128 - #define V_OVERCURRENT 2000 - #define V_STALLCURRENT 1500 - #define V_MAX_VOLTAGE 127 - #define V_CHAIN_POS -1 - #define V_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(W) - #define W_MICROSTEPS 128 - #define W_OVERCURRENT 2000 - #define W_STALLCURRENT 1500 - #define W_MAX_VOLTAGE 127 - #define W_CHAIN_POS -1 - #define W_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(E0) - #define E0_MICROSTEPS 128 - #define E0_OVERCURRENT 2000 - #define E0_STALLCURRENT 1500 - #define E0_MAX_VOLTAGE 127 - #define E0_CHAIN_POS -1 - #define E0_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(E1) - #define E1_MICROSTEPS E0_MICROSTEPS - #define E1_OVERCURRENT 2000 - #define E1_STALLCURRENT 1500 - #define E1_MAX_VOLTAGE 127 - #define E1_CHAIN_POS -1 - #define E1_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(E2) - #define E2_MICROSTEPS E0_MICROSTEPS - #define E2_OVERCURRENT 2000 - #define E2_STALLCURRENT 1500 - #define E2_MAX_VOLTAGE 127 - #define E2_CHAIN_POS -1 - #define E2_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(E3) - #define E3_MICROSTEPS E0_MICROSTEPS - #define E3_OVERCURRENT 2000 - #define E3_STALLCURRENT 1500 - #define E3_MAX_VOLTAGE 127 - #define E3_CHAIN_POS -1 - #define E3_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(E4) - #define E4_MICROSTEPS E0_MICROSTEPS - #define E4_OVERCURRENT 2000 - #define E4_STALLCURRENT 1500 - #define E4_MAX_VOLTAGE 127 - #define E4_CHAIN_POS -1 - #define E4_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(E5) - #define E5_MICROSTEPS E0_MICROSTEPS - #define E5_OVERCURRENT 2000 - #define E5_STALLCURRENT 1500 - #define E5_MAX_VOLTAGE 127 - #define E5_CHAIN_POS -1 - #define E5_SLEW_RATE 1 - #endif - - #if AXIS_IS_L64XX(E6) - #define E6_MICROSTEPS E0_MICROSTEPS - #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 E0_MICROSTEPS - #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. - * Other detected conditions can be used to stop the current print. - * Relevant G-codes: - * M906 - I1/2/3/4/5 Set or get motor drive level using axis codes X, Y, Z, E. Report values if no axis codes given. - * I not present or I0 or I1 - X, Y, Z or E0 - * I2 - X2, Y2, Z2 or E1 - * I3 - Z3 or E3 - * I4 - Z4 or E4 - * I5 - E5 - * M916 - Increase drive level until get thermal warning - * M917 - Find minimum current thresholds - * M918 - Increase speed until max or error - * M122 S0/1 - Report driver parameters - */ - //#define MONITOR_L6470_DRIVER_STATUS - - #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - #define KVAL_HOLD_STEP_DOWN 1 - //#define L6470_STOP_ON_ERROR - #endif - -#endif // HAS_L64XX // @section i2cbus diff --git a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp b/Marlin/src/HAL/shared/HAL_spi_L6470.cpp deleted file mode 100644 index 5d4ce89b27..0000000000 --- a/Marlin/src/HAL/shared/HAL_spi_L6470.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/** - * 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 . - * - */ - -/** - * Software L6470 SPI functions originally from Arduino Sd2Card Library - * Copyright (c) 2009 by William Greiman - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_L64XX - -#include "Delay.h" - -#include "../../core/serial.h" -#include "../../libs/L64XX/L64XX_Marlin.h" - -// Make sure GCC optimizes this file. -// Note that this line triggers a bug in GCC which is fixed by casting. -// See the note below. -#pragma GCC optimize (3) - -// run at ~4Mhz -inline uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0 - for (uint8_t bits = 8; bits--;) { - WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80); - b <<= 1; // little setup time - - WRITE(L6470_CHAIN_SCK_PIN, HIGH); - DELAY_NS(125); // 10 cycles @ 84mhz - - b |= (READ(L6470_CHAIN_MISO_PIN) != 0); - - WRITE(L6470_CHAIN_SCK_PIN, LOW); - DELAY_NS(125); // 10 cycles @ 84mhz - } - return b; -} - -inline uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3 - for (uint8_t bits = 8; bits--;) { - WRITE(L6470_CHAIN_SCK_PIN, LOW); - WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80); - - DELAY_NS(125); // 10 cycles @ 84mhz - WRITE(L6470_CHAIN_SCK_PIN, HIGH); - DELAY_NS(125); // Need more delay for fast CPUs - - b <<= 1; // little setup time - b |= (READ(L6470_CHAIN_MISO_PIN) != 0); - } - DELAY_NS(125); // 10 cycles @ 84mhz - return b; -} - -/** - * L64XX methods for SPI init and transfer - */ -void L64XX_Marlin::spi_init() { - OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH); - OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH); - OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); - SET_INPUT(L6470_CHAIN_MISO_PIN); - - #if PIN_EXISTS(L6470_BUSY) - SET_INPUT(L6470_BUSY_PIN); - #endif - - OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH); -} - -uint8_t L64XX_Marlin::transfer_single(uint8_t data, int16_t ss_pin) { - // First device in chain has data sent last - extDigitalWrite(ss_pin, LOW); - - hal.isr_off(); // Disable interrupts during SPI transfer (can't allow partial command to chips) - const uint8_t data_out = L6470_SpiTransfer_Mode_3(data); - hal.isr_on(); // Enable interrupts - - extDigitalWrite(ss_pin, HIGH); - return data_out; -} - -uint8_t L64XX_Marlin::transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position) { - uint8_t data_out = 0; - - // first device in chain has data sent last - extDigitalWrite(ss_pin, LOW); - - for (uint8_t i = L64XX::chain[0]; !L64xxManager.spi_abort && i >= 1; i--) { // Send data unless aborted - hal.isr_off(); // Disable interrupts during SPI transfer (can't allow partial command to chips) - const uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP)); - hal.isr_on(); // Enable interrupts - if (i == chain_position) data_out = temp; - } - - extDigitalWrite(ss_pin, HIGH); - return data_out; -} - -/** - * Platform-supplied L6470 buffer transfer method - */ -void L64XX_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) { - // First device in chain has its data sent last - - if (spi_active) { // Interrupted SPI transfer so need to - WRITE(L6470_CHAIN_SS_PIN, HIGH); // guarantee min high of 650ns - DELAY_US(1); - } - - WRITE(L6470_CHAIN_SS_PIN, LOW); - for (uint8_t i = length; i >= 1; i--) - L6470_SpiTransfer_Mode_3(uint8_t(L6470_buf[i])); - WRITE(L6470_CHAIN_SS_PIN, HIGH); -} - -#pragma GCC reset_options - -#endif // HAS_L64XX diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 7a835da497..099289f35b 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -226,10 +226,6 @@ #include "feature/mmu/mmu2.h" #endif -#if HAS_L64XX - #include "libs/L64XX/L64XX_Marlin.h" -#endif - #if ENABLED(PASSWORD_FEATURE) #include "feature/password/password.h" #endif @@ -432,7 +428,7 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { if (!has_blocks && !do_reset_timeout && gcode.stepper_inactive_timeout()) { if (!already_shutdown_steppers) { - already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this + already_shutdown_steppers = true; // Individual axes will be disabled if configured TERN_(DISABLE_INACTIVE_X, stepper.disable_axis(X_AXIS)); @@ -731,8 +727,6 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) { TERN_(MONITOR_DRIVER_STATUS, monitor_tmc_drivers()); - TERN_(MONITOR_L6470_DRIVER_STATUS, L64xxManager.monitor_driver()); - // Limit check_axes_activity frequency to 10Hz static millis_t next_check_axes_ms = 0; if (ELAPSED(ms, next_check_axes_ms)) { @@ -1062,7 +1056,6 @@ inline void tmc_standby_setup() { * • TMC220x Stepper Drivers (Serial) * • PSU control * • Power-loss Recovery - * • L64XX Stepper Drivers (SPI) * • Stepper Driver Reset: DISABLE * • TMC Stepper Drivers (SPI) * • Run hal.init_board() for additional pins setup @@ -1251,10 +1244,6 @@ void setup() { SETUP_RUN(tmc_init_cs_pins()); #endif - #if HAS_L64XX - SETUP_RUN(L64xxManager.init()); // Set up SPI, init drivers - #endif - #if ENABLED(PSU_CONTROL) SETUP_LOG("PSU_CONTROL"); powerManager.init(); diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 2882f5a1ee..2e71c632de 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -385,7 +385,6 @@ #define BOARD_RUMBA32_BTT 4204 // RUMBA32 STM32F446VE based controller from BIGTREETECH #define BOARD_BLACK_STM32F407VE 4205 // BLACK_STM32F407VE #define BOARD_BLACK_STM32F407ZE 4206 // BLACK_STM32F407ZE -#define BOARD_STEVAL_3DP001V1 4207 // STEVAL-3DP001V1 3D PRINTER BOARD #define BOARD_BTT_SKR_PRO_V1_1 4208 // BigTreeTech SKR Pro v1.1 (STM32F407ZG) #define BOARD_BTT_SKR_PRO_V1_2 4209 // BigTreeTech SKR Pro v1.2 (STM32F407ZG) #define BOARD_BTT_BTT002_V1_0 4210 // BigTreeTech BTT002 v1.0 (STM32F407VG) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 7f9da909b2..8cf03d342a 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -30,10 +30,6 @@ #define _A5984 0x5984 #define _DRV8825 0x8825 #define _LV8729 0x8729 -#define _L6470 0x6470 -#define _L6474 0x6474 -#define _L6480 0x6480 -#define _POWERSTEP01 0xF00D #define _TB6560 0x6560 #define _TB6600 0x6600 #define _TMC2100 0x2100 @@ -193,16 +189,3 @@ #if HAS_DRIVER(TMC26X) #define HAS_TMC26X 1 #endif - -// -// L64XX Stepper Drivers -// - -#if HAS_DRIVER(L6470) || HAS_DRIVER(L6474) || HAS_DRIVER(L6480) || HAS_DRIVER(POWERSTEP01) - #define HAS_L64XX 1 -#endif -#if HAS_L64XX && !HAS_DRIVER(L6474) - #define HAS_L64XX_NOT_L6474 1 -#endif - -#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6474) || AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(POWERSTEP01)) diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 384fc7210c..e312bf07b5 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -55,10 +55,6 @@ #include "../../lcd/e3v2/proui/dwin.h" #endif -#if HAS_L64XX // set L6470 absolute position registers to counts - #include "../../libs/L64XX/L64XX_Marlin.h" -#endif - #if ENABLED(LASER_FEATURE) #include "../../feature/spindle_laser.h" #endif @@ -601,20 +597,4 @@ void GcodeSuite::G28() { TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(old_grblstate)); - #if HAS_L64XX - // Set L6470 absolute position registers to counts - // constexpr *might* move this to PROGMEM. - // If not, this will need a PROGMEM directive and an accessor. - #define _EN_ITEM(N) , E_AXIS - static constexpr AxisEnum L64XX_axis_xref[MAX_L64XX] = { - NUM_AXIS_LIST(X_AXIS, Y_AXIS, Z_AXIS, I_AXIS, J_AXIS, K_AXIS, U_AXIS, V_AXIS, W_AXIS), - X_AXIS, Y_AXIS, Z_AXIS, Z_AXIS, Z_AXIS - REPEAT(E_STEPPERS, _EN_ITEM) - }; - #undef _EN_ITEM - for (uint8_t j = 1; j <= L64XX::chain[0]; j++) { - const uint8_t cv = L64XX::chain[j]; - L64xxManager.set_param((L64XX_axis_t)cv, L6470_ABS_POS, stepper.position(L64XX_axis_xref[cv])); - } - #endif } diff --git a/Marlin/src/gcode/feature/L6470/M122.cpp b/Marlin/src/gcode/feature/L6470/M122.cpp deleted file mode 100644 index 4a5629b049..0000000000 --- a/Marlin/src/gcode/feature/L6470/M122.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/** - * 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 HAS_L64XX - -#include "../../gcode.h" -#include "../../../libs/L64XX/L64XX_Marlin.h" -#include "../../../module/stepper/indirection.h" - -void echo_yes_no(const bool yes); - -inline void L6470_say_status(const L64XX_axis_t axis) { - if (L64xxManager.spi_abort) return; - const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; - L64xxManager.get_status(axis); - L64xxManager.say_axis(axis); - #if ENABLED(L6470_CHITCHAT) - char temp_buf[20]; - sprintf_P(temp_buf, PSTR(" status: %4x "), sh.STATUS_AXIS_RAW); - SERIAL_ECHO(temp_buf); - print_bin(sh.STATUS_AXIS_RAW); - switch (sh.STATUS_AXIS_LAYOUT) { - case L6470_STATUS_LAYOUT: SERIAL_ECHOPGM(" L6470"); break; - case L6474_STATUS_LAYOUT: SERIAL_ECHOPGM(" L6474"); break; - case L6480_STATUS_LAYOUT: SERIAL_ECHOPGM(" L6480/powerSTEP01"); break; - } - #endif - SERIAL_ECHOPGM("\n...OUTPUT: "); - SERIAL_ECHOF(sh.STATUS_AXIS & STATUS_HIZ ? F("OFF") : F("ON ")); - SERIAL_ECHOPGM(" BUSY: "); echo_yes_no((sh.STATUS_AXIS & STATUS_BUSY) == 0); - SERIAL_ECHOPGM(" DIR: "); - SERIAL_ECHOF((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64xxManager.index_to_dir[axis]) ? F("FORWARD") : F("REVERSE")); - if (sh.STATUS_AXIS_LAYOUT == L6480_STATUS_LAYOUT) { - SERIAL_ECHOPGM(" Last Command: "); - if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("VALID"); - else SERIAL_ECHOPGM("ERROR"); - SERIAL_ECHOPGM("\n...THERMAL: "); - switch ((sh.STATUS_AXIS & (sh.STATUS_AXIS_TH_SD | sh.STATUS_AXIS_TH_WRN)) >> 11) { - case 0: SERIAL_ECHOPGM("DEVICE SHUTDOWN"); break; - case 1: SERIAL_ECHOPGM("BRIDGE SHUTDOWN"); break; - case 2: SERIAL_ECHOPGM("WARNING "); break; - case 3: SERIAL_ECHOPGM("OK "); break; - } - } - else { - SERIAL_ECHOPGM(" Last Command: "); - if (!(sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD)) SERIAL_ECHOPGM("IN"); - SERIAL_ECHOPGM("VALID "); - SERIAL_ECHOF(sh.STATUS_AXIS & sh.STATUS_AXIS_NOTPERF_CMD ? F("COMPLETED ") : F("Not PERFORMED")); - SERIAL_ECHOPGM("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING " : "OK "); - } - SERIAL_ECHOPGM(" OVERCURRENT:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_OCD) == 0); - if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) { - SERIAL_ECHOPGM(" STALL:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_A) == 0 || (sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_B) == 0); - SERIAL_ECHOPGM(" STEP-CLOCK MODE:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD) != 0); - } - else { - SERIAL_ECHOPGM(" STALL: NA " - " STEP-CLOCK MODE: NA" - " UNDER VOLTAGE LOCKOUT: "); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_UVLO) == 0); - } - SERIAL_EOL(); -} - -/** - * M122: Debug L6470 drivers - */ -void GcodeSuite::M122() { - L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status - L64xxManager.spi_active = true; // Tell set_directions() a series of SPI transfers is underway - - //if (parser.seen('S')) - // tmc_set_report_interval(parser.value_bool()); - //else - - #if AXIS_IS_L64XX(X) - L6470_say_status(X); - #endif - #if AXIS_IS_L64XX(X2) - L6470_say_status(X2); - #endif - #if AXIS_IS_L64XX(Y) - L6470_say_status(Y); - #endif - #if AXIS_IS_L64XX(Y2) - L6470_say_status(Y2); - #endif - #if AXIS_IS_L64XX(Z) - L6470_say_status(Z); - #endif - #if AXIS_IS_L64XX(Z2) - L6470_say_status(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - L6470_say_status(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - L6470_say_status(Z4); - #endif - #if AXIS_IS_L64XX(E0) - L6470_say_status(E0); - #endif - #if AXIS_IS_L64XX(E1) - L6470_say_status(E1); - #endif - #if AXIS_IS_L64XX(E2) - L6470_say_status(E2); - #endif - #if AXIS_IS_L64XX(E3) - L6470_say_status(E3); - #endif - #if AXIS_IS_L64XX(E4) - L6470_say_status(E4); - #endif - #if AXIS_IS_L64XX(E5) - L6470_say_status(E5); - #endif - #if AXIS_IS_L64XX(E6) - L6470_say_status(E6); - #endif - #if AXIS_IS_L64XX(E7) - L6470_say_status(E7); - #endif - - L64xxManager.spi_active = false; // done with all SPI transfers - clear handshake flags - L64xxManager.spi_abort = false; - L64xxManager.pause_monitor(false); -} - -#endif // HAS_L64XX diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp deleted file mode 100644 index 26c637df27..0000000000 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/** - * 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 HAS_L64XX - -#if AXIS_COLLISION('I') - #error "M906 parameter 'I' collision with axis name." -#endif - -#include "../../gcode.h" -#include "../../../libs/L64XX/L64XX_Marlin.h" -#include "../../../module/stepper/indirection.h" -#include "../../../module/planner.h" - -#define DEBUG_OUT ENABLED(L6470_CHITCHAT) -#include "../../../core/debug_out.h" - -/** - * MACRO to fetch information on the items associated with current limiting - * and maximum voltage output. - * - * L6470 can be setup to shutdown if either current threshold is exceeded. - * - * L6470 output current can not be set directly. It is set indirectly by - * setting the maximum effective output voltage. - * - * Effective output voltage is set by PWM duty cycle. - * - * Maximum effective output voltage is affected by MANY variables. The main ones are: - * KVAL_HOLD - * KVAL_RUN - * KVAL_ACC - * KVAL_DEC - * Vs compensation (if enabled) - */ -void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) { - - if (L64xxManager.spi_abort) return; // don't do anything if set_directions() has occurred - - const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; - const uint16_t status = L64xxManager.get_status(axis); //also populates shadow structure - const uint8_t OverCurrent_Threshold = uint8_t(motor.GetParam(L6470_OCD_TH)); - - auto say_axis_status = [](const L64XX_axis_t axis, const uint16_t status) { - L64xxManager.say_axis(axis); - #if ENABLED(L6470_CHITCHAT) - char tmp[10]; - sprintf_P(tmp, PSTR("%4x "), status); - DEBUG_ECHOPGM(" status: ", tmp); - print_bin(status); - #else - UNUSED(status); - #endif - SERIAL_EOL(); - }; - - char temp_buf[10]; - - switch (sh.STATUS_AXIS_LAYOUT) { - case L6470_STATUS_LAYOUT: // L6470 - case L6480_STATUS_LAYOUT: { // L6480 & powerstep01 - const uint16_t Stall_Threshold = (uint8_t)motor.GetParam(L6470_STALL_TH), - motor_status = (status & (STATUS_MOT_STATUS)) >> 5, - L6470_ADC_out = motor.GetParam(L6470_ADC_OUT), - L6470_ADC_out_limited = constrain(L6470_ADC_out, 8, 24); - const float comp_coef = 1600.0f / L6470_ADC_out_limited; - const uint16_t MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); - - say_axis_status(axis, sh.STATUS_AXIS_RAW); - - SERIAL_ECHOPGM("...OverCurrent Threshold: "); - sprintf_P(temp_buf, PSTR("%2d ("), OverCurrent_Threshold); - SERIAL_ECHO(temp_buf); - SERIAL_ECHO((OverCurrent_Threshold + 1) * motor.OCD_CURRENT_CONSTANT_INV); - SERIAL_ECHOPGM(" mA)"); - SERIAL_ECHOPGM(" Stall Threshold: "); - sprintf_P(temp_buf, PSTR("%2d ("), Stall_Threshold); - SERIAL_ECHO(temp_buf); - SERIAL_ECHO((Stall_Threshold + 1) * motor.STALL_CURRENT_CONSTANT_INV); - SERIAL_ECHOPGM(" mA)"); - SERIAL_ECHOPGM(" Motor Status: "); - switch (motor_status) { - case 0: SERIAL_ECHOPGM("stopped"); break; - case 1: SERIAL_ECHOPGM("accelerating"); break; - case 2: SERIAL_ECHOPGM("decelerating"); break; - case 3: SERIAL_ECHOPGM("at constant speed"); break; - } - SERIAL_EOL(); - - SERIAL_ECHOPGM("...MicroSteps: ", MicroSteps, - " ADC_OUT: ", L6470_ADC_out); - SERIAL_ECHOPGM(" Vs_compensation: "); - SERIAL_ECHOF((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_EN_VSCOMP) ? F("ENABLED ") : F("DISABLED")); - SERIAL_ECHOLNPGM(" Compensation coefficient: ~", comp_coef * 0.01f); - - SERIAL_ECHOPGM("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD), - " KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN), - " KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC), - " KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC), - " V motor max = "); - switch (motor_status) { - case 0: SERIAL_ECHO(motor.GetParam(L6470_KVAL_HOLD) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_HOLD)"); break; - case 1: SERIAL_ECHO(motor.GetParam(L6470_KVAL_RUN) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_RUN)"); break; - case 2: SERIAL_ECHO(motor.GetParam(L6470_KVAL_ACC) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_ACC)"); break; - case 3: SERIAL_ECHO(motor.GetParam(L6470_KVAL_DEC) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_HOLD)"); break; - } - SERIAL_EOL(); - - #if ENABLED(L6470_CHITCHAT) - DEBUG_ECHOPGM("...SLEW RATE: "); - switch (sh.STATUS_AXIS_LAYOUT) { - case L6470_STATUS_LAYOUT: { - switch ((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT) { - case 0: { DEBUG_ECHOLNPGM("320V/uS") ; break; } - case 1: { DEBUG_ECHOLNPGM("75V/uS") ; break; } - case 2: { DEBUG_ECHOLNPGM("110V/uS") ; break; } - case 3: { DEBUG_ECHOLNPGM("260V/uS") ; break; } - } - break; - } - case L6480_STATUS_LAYOUT: { - switch (motor.GetParam(L6470_GATECFG1) & CONFIG1_SR ) { - case CONFIG1_SR_220V_us: { DEBUG_ECHOLNPGM("220V/uS") ; break; } - case CONFIG1_SR_400V_us: { DEBUG_ECHOLNPGM("400V/uS") ; break; } - case CONFIG1_SR_520V_us: { DEBUG_ECHOLNPGM("520V/uS") ; break; } - case CONFIG1_SR_980V_us: { DEBUG_ECHOLNPGM("980V/uS") ; break; } - default: { DEBUG_ECHOLNPGM("unknown") ; break; } - } - } - } - #endif - SERIAL_EOL(); - break; - } - - case L6474_STATUS_LAYOUT: { // L6474 - const uint16_t L6470_ADC_out = motor.GetParam(L6470_ADC_OUT) & 0x1F, - L6474_TVAL_val = motor.GetParam(L6474_TVAL) & 0x7F; - - say_axis_status(axis, sh.STATUS_AXIS_RAW); - - SERIAL_ECHOPGM("...OverCurrent Threshold: "); - sprintf_P(temp_buf, PSTR("%2d ("), OverCurrent_Threshold); - SERIAL_ECHO(temp_buf); - SERIAL_ECHO((OverCurrent_Threshold + 1) * motor.OCD_CURRENT_CONSTANT_INV); - SERIAL_ECHOPGM(" mA)"); - SERIAL_ECHOPGM(" TVAL: "); - sprintf_P(temp_buf, PSTR("%2d ("), L6474_TVAL_val); - SERIAL_ECHO(temp_buf); - SERIAL_ECHO((L6474_TVAL_val + 1) * motor.STALL_CURRENT_CONSTANT_INV); - SERIAL_ECHOLNPGM(" mA) Motor Status: NA"); - - const uint16_t MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); //NOMORE(MicroSteps, 16); - SERIAL_ECHOPGM("...MicroSteps: ", MicroSteps, - " ADC_OUT: ", L6470_ADC_out); - - SERIAL_ECHOLNPGM(" Vs_compensation: NA\n"); - SERIAL_ECHOLNPGM("...KVAL_HOLD: NA" - " KVAL_RUN : NA" - " KVAL_ACC: NA" - " KVAL_DEC: NA" - " V motor max = NA"); - - #if ENABLED(L6470_CHITCHAT) - DEBUG_ECHOPGM("...SLEW RATE: "); - switch ((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT) { - case 0: DEBUG_ECHOLNPGM("320V/uS") ; break; - case 1: DEBUG_ECHOLNPGM("75V/uS") ; break; - case 2: DEBUG_ECHOLNPGM("110V/uS") ; break; - case 3: DEBUG_ECHOLNPGM("260V/uS") ; break; - default: DEBUG_ECHOLNPGM("slew rate: ", (motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT); break; - } - #endif - SERIAL_EOL(); - SERIAL_EOL(); - break; - } - } -} - -/** - * M906: report or set KVAL_HOLD which sets the maximum effective voltage provided by the - * PWMs to the steppers - * - * On L6474 this sets the TVAL register (same address). - * - * I - select which driver(s) to change on multi-driver axis - * (default) all drivers on the axis - * 0 - monitor only the first XYZ... driver - * 1 - monitor only X2, Y2, Z2 - * 2 - monitor only Z3 - * 3 - monitor only Z4 - * Xxxx, Yxxx, Zxxx, Axxx, Bxxx, Cxxx, Uxxx, Vxxx, Wxxx, Exxx - axis to change (optional) - * L6474 - current in mA (4A max) - * All others - 0-255 - * - * Sets KVAL_HOLD which affects the current being driven through the stepper. - * - * L6470 is used in the STEP-CLOCK mode. KVAL_HOLD is the only KVAL_xxx - * that affects the effective voltage seen by the stepper. - */ -void GcodeSuite::M906() { - - L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status - - #define L6470_SET_KVAL_HOLD(Q) (AXIS_IS_L64XX(Q) ? stepper##Q.setTVALCurrent(value) : stepper##Q.SetParam(L6470_KVAL_HOLD, uint8_t(value))) - - DEBUG_ECHOLNPGM("M906"); - - uint8_t report_current = true; - - #if AXIS_IS_L64XX(X2) || AXIS_IS_L64XX(Y2) || AXIS_IS_L64XX(Z2) || AXIS_IS_L64XX(Z3) || AXIS_IS_L64XX(Z4) - const int8_t index = parser.byteval('I', -1); - #else - constexpr int8_t index = -1; - #endif - - LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(AXIS_CHAR(i))) { - - report_current = false; - - if (planner.has_blocks_queued() || planner.cleaning_buffer_counter) { - SERIAL_ECHOLNPGM("Test aborted. Can't set KVAL_HOLD while steppers are moving."); - return; - } - - switch (i) { - #if AXIS_IS_L64XX(X) || AXIS_IS_L64XX(X2) - case X_AXIS: - #if AXIS_IS_L64XX(X) - if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(X); - #endif - #if AXIS_IS_L64XX(X2) - if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(X2); - #endif - break; - #endif - - #if AXIS_IS_L64XX(Y) || AXIS_IS_L64XX(Y2) - case Y_AXIS: - #if AXIS_IS_L64XX(Y) - if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(Y); - #endif - #if AXIS_IS_L64XX(Y2) - if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(Y2); - #endif - break; - #endif - - #if AXIS_IS_L64XX(Z) || AXIS_IS_L64XX(Z2) || AXIS_IS_L64XX(Z3) || AXIS_IS_L64XX(Z4) - case Z_AXIS: - #if AXIS_IS_L64XX(Z) - if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(Z); - #endif - #if AXIS_IS_L64XX(Z2) - if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - if (index < 0 || index == 2) L6470_SET_KVAL_HOLD(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - if (index < 0 || index == 3) L6470_SET_KVAL_HOLD(Z4); - #endif - break; - #endif - - #if AXIS_IS_L64XX(I) - case I_AXIS: L6470_SET_KVAL_HOLD(I); break; - #endif - #if AXIS_IS_L64XX(J) - case J_AXIS: L6470_SET_KVAL_HOLD(J); break; - #endif - #if AXIS_IS_L64XX(K) - case K_AXIS: L6470_SET_KVAL_HOLD(K); break; - #endif - #if AXIS_IS_L64XX(U) - case U_AXIS: L6470_SET_KVAL_HOLD(U); break; - #endif - #if AXIS_IS_L64XX(V) - case V_AXIS: L6470_SET_KVAL_HOLD(V); break; - #endif - #if AXIS_IS_L64XX(W) - case W_AXIS: L6470_SET_KVAL_HOLD(W); break; - #endif - - #if AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7) - case E_AXIS: { - const int8_t eindex = get_target_e_stepper_from_command(-2); - #if AXIS_IS_L64XX(E0) - if (eindex < 0 || eindex == 0) L6470_SET_KVAL_HOLD(E0); - #endif - #if AXIS_IS_L64XX(E1) - if (eindex < 0 || eindex == 1) L6470_SET_KVAL_HOLD(E1); - #endif - #if AXIS_IS_L64XX(E2) - if (eindex < 0 || eindex == 2) L6470_SET_KVAL_HOLD(E2); - #endif - #if AXIS_IS_L64XX(E3) - if (eindex < 0 || eindex == 3) L6470_SET_KVAL_HOLD(E3); - #endif - #if AXIS_IS_L64XX(E4) - if (eindex < 0 || eindex == 4) L6470_SET_KVAL_HOLD(E4); - #endif - #if AXIS_IS_L64XX(E5) - if (eindex < 0 || eindex == 5) L6470_SET_KVAL_HOLD(E5); - #endif - #if AXIS_IS_L64XX(E6) - if (eindex < 0 || eindex == 6) L6470_SET_KVAL_HOLD(E6); - #endif - #if AXIS_IS_L64XX(E7) - if (eindex < 0 || eindex == 7) L6470_SET_KVAL_HOLD(E7); - #endif - } break; - #endif - } - } - - if (report_current) { - #define L64XX_REPORT_CURRENT(Q) L64XX_report_current(stepper##Q, Q) - - L64xxManager.spi_active = true; // Tell set_directions() a series of SPI transfers is underway - - #if AXIS_IS_L64XX(X) - L64XX_REPORT_CURRENT(X); - #endif - #if AXIS_IS_L64XX(X2) - L64XX_REPORT_CURRENT(X2); - #endif - #if AXIS_IS_L64XX(Y) - L64XX_REPORT_CURRENT(Y); - #endif - #if AXIS_IS_L64XX(Y2) - L64XX_REPORT_CURRENT(Y2); - #endif - #if AXIS_IS_L64XX(Z) - L64XX_REPORT_CURRENT(Z); - #endif - #if AXIS_IS_L64XX(Z2) - L64XX_REPORT_CURRENT(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - L64XX_REPORT_CURRENT(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - L64XX_REPORT_CURRENT(Z4); - #endif - #if AXIS_IS_L64XX(I) - L64XX_REPORT_CURRENT(I); - #endif - #if AXIS_IS_L64XX(J) - L64XX_REPORT_CURRENT(J); - #endif - #if AXIS_IS_L64XX(K) - L64XX_REPORT_CURRENT(K); - #endif - #if AXIS_IS_L64XX(U) - L64XX_REPORT_CURRENT(U); - #endif - #if AXIS_IS_L64XX(V) - L64XX_REPORT_CURRENT(V); - #endif - #if AXIS_IS_L64XX(W) - L64XX_REPORT_CURRENT(W); - #endif - #if AXIS_IS_L64XX(E0) - L64XX_REPORT_CURRENT(E0); - #endif - #if AXIS_IS_L64XX(E1) - L64XX_REPORT_CURRENT(E1); - #endif - #if AXIS_IS_L64XX(E2) - L64XX_REPORT_CURRENT(E2); - #endif - #if AXIS_IS_L64XX(E3) - L64XX_REPORT_CURRENT(E3); - #endif - #if AXIS_IS_L64XX(E4) - L64XX_REPORT_CURRENT(E4); - #endif - #if AXIS_IS_L64XX(E5) - L64XX_REPORT_CURRENT(E5); - #endif - #if AXIS_IS_L64XX(E6) - L64XX_REPORT_CURRENT(E6); - #endif - #if AXIS_IS_L64XX(E7) - L64XX_REPORT_CURRENT(E7); - #endif - - L64xxManager.spi_active = false; // done with all SPI transfers - clear handshake flags - L64xxManager.spi_abort = false; - L64xxManager.pause_monitor(false); - } -} - -#endif // HAS_L64XX diff --git a/Marlin/src/gcode/feature/L6470/M916-M918.cpp b/Marlin/src/gcode/feature/L6470/M916-M918.cpp deleted file mode 100644 index 9e1f1b98da..0000000000 --- a/Marlin/src/gcode/feature/L6470/M916-M918.cpp +++ /dev/null @@ -1,650 +0,0 @@ -/** - * 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 . - * - */ - -// -// NOTE: All tests assume each axis uses matching driver chips. -// - -#include "../../../inc/MarlinConfig.h" - -#if HAS_L64XX - -#include "../../gcode.h" -#include "../../../module/stepper/indirection.h" -#include "../../../module/planner.h" -#include "../../../libs/L64XX/L64XX_Marlin.h" - -#define DEBUG_OUT ENABLED(L6470_CHITCHAT) -#include "../../../core/debug_out.h" - -/** - * M916: increase KVAL_HOLD until get thermal warning - * NOTE - on L6474 it is TVAL that is used - * - * J - select which driver(s) to monitor on multi-driver axis - * 0 - (default) monitor all drivers on the axis or E0 - * 1 - monitor only X, Y, Z, E1 - * 2 - monitor only X2, Y2, Z2, E2 - * 3 - monitor only Z3, E3 - * 4 - monitor only Z4, E4 - * - * Xxxx, Yxxx, Zxxx, Exxx - axis to be monitored with displacement - * xxx (1-255) is distance moved on either side of current position - * - * F - feedrate - * optional - will use default max feedrate from configuration.h if not specified - * - * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only - * optional - will report current value from driver if not specified - * - * K - value for KVAL_HOLD (0 - 255) (ignored for L6474) - * optional - will report current value from driver if not specified - * - * D - time (in seconds) to run each setting of KVAL_HOLD/TVAL - * optional - defaults to zero (runs each setting once) - */ - -/** - * This routine is also useful for determining the approximate KVAL_HOLD - * where the stepper stops losing steps. The sound will get noticeably quieter - * as it stops losing steps. - */ - -void GcodeSuite::M916() { - - DEBUG_ECHOLNPGM("M916"); - - L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status - - // Variables used by L64xxManager.get_user_input function - some may not be used - char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored - L64XX_axis_t axis_index[3]; - uint16_t axis_status[3]; - uint8_t driver_count = 1; - float position_max; - float position_min; - float final_feedrate; - uint8_t kval_hold; - uint8_t OCD_TH_val = 0; - uint8_t STALL_TH_val = 0; - uint16_t over_current_threshold; - constexpr uint8_t over_current_flag = false; // M916 doesn't play with the overcurrent thresholds - - #define DRIVER_TYPE_L6474(Q) AXIS_DRIVER_TYPE_##Q(L6474) - - uint8_t j; // general purpose counter - - if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) - return; // quit if invalid user input - - DEBUG_ECHOLNPGM("feedrate = ", final_feedrate); - - planner.synchronize(); // wait for all current movement commands to complete - - const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; - for (j = 0; j < driver_count; j++) - L64xxManager.get_status(axis_index[j]); // clear out any pre-existing error flags - - char temp_axis_string[] = " "; - temp_axis_string[0] = axis_mon[0][0]; // need to have a string for use within sprintf format section - char gcode_string[80]; - uint16_t status_composite = 0; - - uint16_t M91x_counter = kval_hold; - uint16_t M91x_counter_max; - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { - M91x_counter_max = 128; // TVAL is 7 bits - LIMIT(M91x_counter, 0U, 127U); - } - else - M91x_counter_max = 256; // KVAL_HOLD is 8 bits - - uint8_t M91x_delay_s = parser.byteval('D'); // get delay in seconds - millis_t M91x_delay_ms = SEC_TO_MS(M91x_delay_s * 60); - millis_t M91x_delay_end; - - DEBUG_ECHOLNPGM(".\n."); - - do { - - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) - DEBUG_ECHOLNPGM("TVAL current (mA) = ", (M91x_counter + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV); // report TVAL current for this run - else - DEBUG_ECHOLNPGM("kval_hold = ", M91x_counter); // report KVAL_HOLD for this run - - for (j = 0; j < driver_count; j++) - L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, M91x_counter); //set KVAL_HOLD or TVAL (same register address) - - M91x_delay_end = millis() + M91x_delay_ms; - do { - // turn the motor(s) both directions - sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(final_feedrate)); - process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(final_feedrate)); - process_subcommands_now(gcode_string); - - // get the status after the motors have stopped - planner.synchronize(); - - status_composite = 0; // clear out the old bits - - for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low - status_composite |= axis_status[j] ; - } - - if (status_composite) break; - } while (millis() < M91x_delay_end); - - if (status_composite) break; - - M91x_counter++; - - } while (!(status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) && (M91x_counter < M91x_counter_max)); - - DEBUG_ECHOLNPGM("."); - - #if ENABLED(L6470_CHITCHAT) - if (status_composite) { - L64xxManager.error_status_decode(status_composite, axis_index[0], - sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, - sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, - sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT); - DEBUG_ECHOLNPGM("."); - } - #endif - - if ((status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD))) - DEBUG_ECHOLNPGM(".\n.\nTest completed normally - Thermal warning/shutdown has occurred"); - else if (status_composite) - DEBUG_ECHOLNPGM(".\n.\nTest completed abnormally - non-thermal error has occurred"); - else - DEBUG_ECHOLNPGM(".\n.\nTest completed normally - Unable to get to thermal warning/shutdown"); - - L64xxManager.pause_monitor(false); -} - -/** - * M917: Find minimum current thresholds - * - * Decrease OCD current until overcurrent error - * Increase OCD until overcurrent error goes away - * Decrease stall threshold until stall (not done on L6474) - * Increase stall until stall error goes away (not done on L6474) - * - * J - select which driver(s) to monitor on multi-driver axis - * 0 - (default) monitor all drivers on the axis or E0 - * 1 - monitor only X, Y, Z, E1 - * 2 - monitor only X2, Y2, Z2, E2 - * Xxxx, Yxxx, Zxxx, Exxx - axis to be monitored with displacement - * xxx (1-255) is distance moved on either side of current position - * - * F - feedrate - * optional - will use default max feedrate from Configuration.h if not specified - * - * I - starting over-current threshold - * optional - will report current value from driver if not specified - * if there are multiple drivers on the axis then all will be set the same - * - * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only - * optional - will report current value from driver if not specified - * - * K - value for KVAL_HOLD (0 - 255) (ignored for L6474) - * optional - will report current value from driver if not specified - */ -void GcodeSuite::M917() { - - DEBUG_ECHOLNPGM("M917"); - - L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status - - char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored - L64XX_axis_t axis_index[3]; - uint16_t axis_status[3]; - uint8_t driver_count = 1; - float position_max; - float position_min; - float final_feedrate; - uint8_t kval_hold; - uint8_t OCD_TH_val = 0; - uint8_t STALL_TH_val = 0; - uint16_t over_current_threshold; - constexpr uint8_t over_current_flag = true; - - uint8_t j; // general purpose counter - - if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) - return; // quit if invalid user input - - DEBUG_ECHOLNPGM("feedrate = ", final_feedrate); - - planner.synchronize(); // wait for all current movement commands to complete - - const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; - for (j = 0; j < driver_count; j++) - L64xxManager.get_status(axis_index[j]); // clear error flags - char temp_axis_string[] = " "; - temp_axis_string[0] = axis_mon[0][0]; // need a sprintf format string - char gcode_string[80]; - uint16_t status_composite = 0; - uint8_t test_phase = 0; // 0 - decreasing OCD - exit when OCD warning occurs (ignore STALL) - // 1 - increasing OCD - exit when OCD warning stops (ignore STALL) - // 2 - OCD finalized - decreasing STALL - exit when STALL warning happens - // 3 - OCD finalized - increasing STALL - exit when STALL warning stop - // 4 - all testing completed - DEBUG_ECHOPGM(".\n.\n.\nover_current threshold : ", (OCD_TH_val + 1) * 375); // first status display - DEBUG_ECHOPGM(" (OCD_TH: : ", OCD_TH_val); - if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) { - DEBUG_ECHOPGM(") Stall threshold: ", (STALL_TH_val + 1) * 31.25); - DEBUG_ECHOPGM(" (STALL_TH: ", STALL_TH_val); - } - DEBUG_ECHOLNPGM(")"); - - do { - - if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) DEBUG_ECHOPGM("STALL threshold : ", (STALL_TH_val + 1) * 31.25); - DEBUG_ECHOLNPGM(" OCD threshold : ", (OCD_TH_val + 1) * 375); - - sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(final_feedrate)); - process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(final_feedrate)); - process_subcommands_now(gcode_string); - - planner.synchronize(); - - status_composite = 0; // clear out the old bits - - for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low - status_composite |= axis_status[j]; - } - - if (status_composite && (status_composite & sh.STATUS_AXIS_UVLO)) { - DEBUG_ECHOLNPGM("Test aborted (Undervoltage lockout active)"); - #if ENABLED(L6470_CHITCHAT) - for (j = 0; j < driver_count; j++) { - if (j) DEBUG_ECHOPGM("..."); - L64xxManager.error_status_decode(axis_status[j], axis_index[j], - sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, - sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, - sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT); - } - #endif - return; - } - - if (status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) { - DEBUG_ECHOLNPGM("thermal problem - waiting for chip(s) to cool down "); - uint16_t status_composite_temp = 0; - uint8_t k = 0; - do { - k++; - if (!(k % 4)) { - kval_hold *= 0.95; - DEBUG_EOL(); - DEBUG_ECHOLNPGM("Lowering KVAL_HOLD by about 5% to ", kval_hold); - for (j = 0; j < driver_count; j++) - L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); - } - DEBUG_ECHOLNPGM("."); - reset_stepper_timeout(); // keep steppers powered - safe_delay(5000); - status_composite_temp = 0; - for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK; // bits of interest are all active low - status_composite_temp |= axis_status[j]; - } - } - while (status_composite_temp & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)); - DEBUG_EOL(); - } - if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B | sh.STATUS_AXIS_OCD)) { - switch (test_phase) { - - case 0: { - if (status_composite & sh.STATUS_AXIS_OCD) { - // phase 0 with OCD warning - time to go to next phase - if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) { - OCD_TH_val = sh.AXIS_OCD_TH_MAX; // limit to max - test_phase = 2; // at highest value so skip phase 1 - //DEBUG_ECHOLNPGM("LOGIC E0A OCD at highest - skip to 2"); - DEBUG_ECHOLNPGM("OCD at highest - OCD finalized"); - } - else { - OCD_TH_val++; // normal exit to next phase - test_phase = 1; // setup for first pass of phase 1 - //DEBUG_ECHOLNPGM("LOGIC E0B - inc OCD & go to 1"); - DEBUG_ECHOLNPGM("inc OCD"); - } - } - else { // phase 0 without OCD warning - keep on decrementing if can - if (OCD_TH_val) { - OCD_TH_val--; // try lower value - //DEBUG_ECHOLNPGM("LOGIC E0C - dec OCD"); - DEBUG_ECHOLNPGM("dec OCD"); - } - else { - test_phase = 2; // at lowest value without warning so skip phase 1 - //DEBUG_ECHOLNPGM("LOGIC E0D - OCD at latest - go to 2"); - DEBUG_ECHOLNPGM("OCD finalized"); - } - } - } break; - - case 1: { - if (status_composite & sh.STATUS_AXIS_OCD) { - // phase 1 with OCD warning - increment if can - if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) { - OCD_TH_val = sh.AXIS_OCD_TH_MAX; // limit to max - test_phase = 2; // at highest value so go to next phase - //DEBUG_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2"); - DEBUG_ECHOLNPGM("OCD finalized"); - } - else { - OCD_TH_val++; // try a higher value - //DEBUG_ECHOLNPGM("LOGIC E1B - inc OCD"); - DEBUG_ECHOLNPGM("inc OCD"); - } - } - else { // phase 1 without OCD warning - normal exit to phase 2 - test_phase = 2; - //DEBUG_ECHOLNPGM("LOGIC E1C - no OCD warning - go to 1"); - DEBUG_ECHOLNPGM("OCD finalized"); - } - } break; - - case 2: { - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 - test_phase = 4; - break; - } - if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) { - // phase 2 with stall warning - time to go to next phase - if (STALL_TH_val >= 127) { - STALL_TH_val = 127; // limit to max - //DEBUG_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit"); - DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); - test_phase = 4; - } - else { - test_phase = 3; // normal exit to next phase (found failing value of STALL) - STALL_TH_val++; // setup for first pass of phase 3 - //DEBUG_ECHOLNPGM("LOGIC E2B - INC - STALL warning, inc Stall, go to 3"); - DEBUG_ECHOLNPGM("inc Stall"); - } - } - else { // phase 2 without stall warning - decrement if can - if (STALL_TH_val) { - STALL_TH_val--; // try a lower value - //DEBUG_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL"); - DEBUG_ECHOLNPGM("dec STALL"); - } - else { - DEBUG_ECHOLNPGM("finished - STALL at lowest value but still do NOT have stall warning"); - test_phase = 4; - //DEBUG_ECHOLNPGM("LOGIC E2D - no STALL, at lowest so quit"); - } - } - } break; - - case 3: { - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 - test_phase = 4; - break; - } - if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) { - // phase 3 with stall warning - increment if can - if (STALL_TH_val >= 127) { - STALL_TH_val = 127; // limit to max - DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning"); - test_phase = 4; - //DEBUG_ECHOLNPGM("LOGIC E3A - STALL, at max so quit"); - } - else { - STALL_TH_val++; // still looking for passing value - //DEBUG_ECHOLNPGM("LOGIC E3B - STALL, inc stall"); - DEBUG_ECHOLNPGM("inc stall"); - } - } - else { //phase 3 without stall warning but have OCD warning - DEBUG_ECHOLNPGM("Hardware problem - OCD warning without STALL warning"); - test_phase = 4; - //DEBUG_ECHOLNPGM("LOGIC E3C - not STALLED, hardware problem (quit)"); - } - } break; - - } - - } - else { - switch (test_phase) { - case 0: { // phase 0 without OCD warning - keep on decrementing if can - if (OCD_TH_val) { - OCD_TH_val--; // try lower value - //DEBUG_ECHOLNPGM("LOGIC N0A - DEC OCD"); - DEBUG_ECHOLNPGM("DEC OCD"); - } - else { - test_phase = 2; // at lowest value without warning so skip phase 1 - //DEBUG_ECHOLNPGM("LOGIC N0B - OCD at lowest (go to phase 2)"); - DEBUG_ECHOLNPGM("OCD finalized"); - } - } break; - - case 1: //DEBUG_ECHOLNPGM("LOGIC N1 (go directly to 2)"); // phase 1 without OCD warning - drop directly to phase 2 - DEBUG_ECHOLNPGM("OCD finalized"); - - case 2: { // phase 2 without stall warning - keep on decrementing if can - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 - test_phase = 4; - break; - } - if (STALL_TH_val) { - STALL_TH_val--; // try a lower value (stay in phase 2) - //DEBUG_ECHOLNPGM("LOGIC N2B - dec STALL"); - DEBUG_ECHOLNPGM("dec STALL"); - } - else { - DEBUG_ECHOLNPGM("finished - STALL at lowest value but still no stall warning"); - test_phase = 4; - //DEBUG_ECHOLNPGM("LOGIC N2C - STALL at lowest (quit)"); - } - } break; - - case 3: { - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // skip all STALL_TH steps if L6474 - test_phase = 4; - break; - } - test_phase = 4; - //DEBUG_ECHOLNPGM("LOGIC N3 - finished!"); - DEBUG_ECHOLNPGM("finished!"); - } break; // phase 3 without any warnings - desired exit - } // - } // end of status checks - - if (test_phase != 4) { - for (j = 0; j < driver_count; j++) { // update threshold(s) - L64xxManager.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val); - if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) L64xxManager.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val); - if (L64xxManager.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) DEBUG_ECHOLNPGM("OCD mismatch"); - if ((L64xxManager.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) && (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT)) DEBUG_ECHOLNPGM("STALL mismatch"); - } - } - - } while (test_phase != 4); - - DEBUG_ECHOLNPGM("."); - if (status_composite) { - #if ENABLED(L6470_CHITCHAT) - for (j = 0; j < driver_count; j++) { - if (j) DEBUG_ECHOPGM("..."); - L64xxManager.error_status_decode(axis_status[j], axis_index[j], - sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, - sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, - sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT); - } - DEBUG_ECHOLNPGM("."); - #endif - DEBUG_ECHOLNPGM("Completed with errors"); - } - else - DEBUG_ECHOLNPGM("Completed with no errors"); - DEBUG_ECHOLNPGM("."); - - L64xxManager.pause_monitor(false); -} - -/** - * M918: increase speed until error or max feedrate achieved (as shown in configuration.h)) - * - * J - select which driver(s) to monitor on multi-driver axis - * 0 - (default) monitor all drivers on the axis or E0 - * 1 - monitor only X, Y, Z, E1 - * 2 - monitor only X2, Y2, Z2, E2 - * Xxxx, Yxxx, Zxxx, Exxx - axis to be monitored with displacement - * xxx (1-255) is distance moved on either side of current position - * - * I - over current threshold - * optional - will report current value from driver if not specified - * - * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only - * optional - will report current value from driver if not specified - * - * K - value for KVAL_HOLD (0 - 255) (ignored for L6474) - * optional - will report current value from driver if not specified - * - * M - value for microsteps (1 - 128) (optional) - * optional - will report current value from driver if not specified - */ -void GcodeSuite::M918() { - - DEBUG_ECHOLNPGM("M918"); - - L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status - - char axis_mon[3][3] = { {" "}, {" "}, {" "} }; // list of Axes to be monitored - L64XX_axis_t axis_index[3]; - uint16_t axis_status[3]; - uint8_t driver_count = 1; - float position_max, position_min; - float final_feedrate; - uint8_t kval_hold; - uint8_t OCD_TH_val = 0; - uint8_t STALL_TH_val = 0; - uint16_t over_current_threshold; - constexpr uint8_t over_current_flag = true; - - const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow; - - uint8_t j; // general purpose counter - - if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold)) - return; // quit if invalid user input - - L64xxManager.get_status(axis_index[0]); // populate shadow array - - uint8_t m_steps = parser.byteval('M'); - - if (m_steps != 0) { - LIMIT(m_steps, 1, sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT ? 16 : 128); // L6474 - - uint8_t stepVal; - for (stepVal = 0; stepVal < 8; stepVal++) { // convert to L64xx register value - if (m_steps == 1) break; - m_steps >>= 1; - } - - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) - stepVal |= 0x98; // NO SYNC - else - stepVal |= (!SYNC_EN) | SYNC_SEL_1 | stepVal; - - for (j = 0; j < driver_count; j++) { - L64xxManager.set_param(axis_index[j], dSPIN_HARD_HIZ, 0); // can't write STEP register if stepper being powered - // results in an extra NOOP being sent (data 00) - L64xxManager.set_param(axis_index[j], L6470_STEP_MODE, stepVal); // set microsteps - } - } - m_steps = L64xxManager.get_param(axis_index[0], L6470_STEP_MODE) & 0x07; // get microsteps - - DEBUG_ECHOLNPGM("Microsteps = ", _BV(m_steps)); - DEBUG_ECHOLNPGM("target (maximum) feedrate = ", final_feedrate); - - const float feedrate_inc = final_feedrate / 10, // Start at 1/10 of max & go up by 1/10 per step - fr_limit = final_feedrate * 0.99f; // Rounding-safe comparison value - float current_feedrate = 0; - - planner.synchronize(); // Wait for moves to complete - - for (j = 0; j < driver_count; j++) - L64xxManager.get_status(axis_index[j]); // Clear error flags - - char temp_axis_string[2] = " "; - temp_axis_string[0] = axis_mon[0][0]; // Need a sprintf format string - //temp_axis_string[1] = '\n'; - - char gcode_string[80]; - uint16_t status_composite = 0; - DEBUG_ECHOLNPGM(".\n.\n."); // Make feedrate outputs easier to read - - do { - current_feedrate += feedrate_inc; - DEBUG_ECHOLNPGM("...feedrate = ", current_feedrate); - - sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(current_feedrate)); - process_subcommands_now(gcode_string); - - sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(current_feedrate)); - process_subcommands_now(gcode_string); - - planner.synchronize(); - - for (j = 0; j < driver_count; j++) { - axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & 0x0800; // Bits of interest are all active LOW - status_composite |= axis_status[j]; - } - if (status_composite) break; // Break on any error - } while (current_feedrate < fr_limit); - - DEBUG_ECHOPGM("Completed with "); - if (status_composite) { - DEBUG_ECHOLNPGM("errors"); - #if ENABLED(L6470_CHITCHAT) - for (j = 0; j < driver_count; j++) { - if (j) DEBUG_ECHOPGM("..."); - L64xxManager.error_status_decode(axis_status[j], axis_index[j], - sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN, - sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B, - sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT); - } - #endif - } - else - DEBUG_ECHOLNPGM("no errors"); - - L64xxManager.pause_monitor(false); -} - -#endif // HAS_L64XX diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index a13940afc3..d0242570eb 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -1005,14 +1005,6 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { case 919: M919(); break; // M919: Set stepper Chopper Times #endif - #if HAS_L64XX - case 122: M122(); break; // M122: Report status - case 906: M906(); break; // M906: Set or get motor drive level - case 916: M916(); break; // M916: L6470 tuning: Increase drive level until thermal warning - case 917: M917(); break; // M917: L6470 tuning: Find minimum current thresholds - case 918: M918(); break; // M918: L6470 tuning: Increase speed until max or error - #endif - #if HAS_MICROSTEPS case 350: M350(); break; // M350: Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers. case 351: M351(); break; // M351: Toggle MS1 MS2 pins directly, S# determines MS1 or MS2, X# sets the pin high/low. diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index a6b530a268..e754b6dc3d 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -155,7 +155,7 @@ * M120 - Enable endstops detection. * M121 - Disable endstops detection. * - * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) + * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) * M123 - Report fan tachometers. (Requires En_FAN_TACHO_PIN) Optionally set auto-report interval. (Requires AUTO_REPORT_FANS) * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE) * @@ -286,7 +286,7 @@ * M871 - Print/reset/clear first layer temperature offset values. (Requires PTC_PROBE, PTC_BED, or PTC_HOTEND) * M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER) * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes XYZE, etc. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) + * M906 - Set or get motor current in milliamps using axis codes XYZE, etc. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) * M908 - Control digital trimpot directly. (Requires HAS_MOTOR_CURRENT_DAC or DIGIPOTSS_PIN) * M909 - Print digipot/DAC current value. (Requires HAS_MOTOR_CURRENT_DAC) @@ -295,9 +295,6 @@ * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD) * M914 - Set StallGuard sensitivity. (Requires SENSORLESS_HOMING or SENSORLESS_PROBING) - * M916 - L6470 tuning: Increase KVAL_HOLD until thermal warning. (Requires at least one _DRIVER_TYPE L6470) - * M917 - L6470 tuning: Find minimum current thresholds. (Requires at least one _DRIVER_TYPE L6470) - * M918 - L6470 tuning: Increase speed until max or error. (Requires at least one _DRIVER_TYPE L6470) * M919 - Get or Set motor Chopper Times (time_off, hysteresis_end, hysteresis_start) using axis codes XYZE, etc. If no parameters are given, report. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) * M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER) * M3426 - Read MCP3426 ADC over I2C. (Requires HAS_MCP3426_ADC) @@ -1163,14 +1160,6 @@ private: static void M919(); #endif - #if HAS_L64XX - static void M122(); - static void M906(); - static void M916(); - static void M917(); - static void M918(); - #endif - #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM || HAS_MOTOR_CURRENT_I2C || HAS_MOTOR_CURRENT_DAC static void M907(); #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index 8ea300b5e0..60359eeecf 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -28,12 +28,6 @@ #if ENABLED(M114_DETAIL) - #if HAS_L64XX - #include "../../libs/L64XX/L64XX_Marlin.h" - #define DEBUG_OUT ENABLED(L6470_CHITCHAT) - #include "../../core/debug_out.h" - #endif - void report_all_axis_pos(const xyze_pos_t &pos, const uint8_t n=LOGICAL_AXES, const uint8_t precision=3) { char str[12]; LOOP_L_N(a, n) { @@ -84,89 +78,6 @@ planner.synchronize(); - #if HAS_L64XX - char temp_buf[80]; - int32_t temp; - //#define ABS_POS_SIGN_MASK 0b1111 1111 1110 0000 0000 0000 0000 0000 - #define ABS_POS_SIGN_MASK 0b11111111111000000000000000000000 - #define REPORT_ABSOLUTE_POS(Q) do{ \ - L64xxManager.say_axis(Q, false); \ - temp = L6470_GETPARAM(L6470_ABS_POS,Q); \ - if (temp & ABS_POS_SIGN_MASK) temp |= ABS_POS_SIGN_MASK; \ - sprintf_P(temp_buf, PSTR(":%8ld "), temp); \ - DEBUG_ECHO(temp_buf); \ - }while(0) - - DEBUG_ECHOPGM("\nL6470:"); - #if AXIS_IS_L64XX(X) - REPORT_ABSOLUTE_POS(X); - #endif - #if AXIS_IS_L64XX(X2) - REPORT_ABSOLUTE_POS(X2); - #endif - #if AXIS_IS_L64XX(Y) - REPORT_ABSOLUTE_POS(Y); - #endif - #if AXIS_IS_L64XX(Y2) - REPORT_ABSOLUTE_POS(Y2); - #endif - #if AXIS_IS_L64XX(Z) - REPORT_ABSOLUTE_POS(Z); - #endif - #if AXIS_IS_L64XX(Z2) - REPORT_ABSOLUTE_POS(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - REPORT_ABSOLUTE_POS(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - REPORT_ABSOLUTE_POS(Z4); - #endif - #if AXIS_IS_L64XX(I) - REPORT_ABSOLUTE_POS(I); - #endif - #if AXIS_IS_L64XX(J) - REPORT_ABSOLUTE_POS(J); - #endif - #if AXIS_IS_L64XX(K) - REPORT_ABSOLUTE_POS(K); - #endif - #if AXIS_IS_L64XX(U) - REPORT_ABSOLUTE_POS(U); - #endif - #if AXIS_IS_L64XX(V) - REPORT_ABSOLUTE_POS(V); - #endif - #if AXIS_IS_L64XX(W) - REPORT_ABSOLUTE_POS(W); - #endif - #if AXIS_IS_L64XX(E0) - REPORT_ABSOLUTE_POS(E0); - #endif - #if AXIS_IS_L64XX(E1) - REPORT_ABSOLUTE_POS(E1); - #endif - #if AXIS_IS_L64XX(E2) - REPORT_ABSOLUTE_POS(E2); - #endif - #if AXIS_IS_L64XX(E3) - REPORT_ABSOLUTE_POS(E3); - #endif - #if AXIS_IS_L64XX(E4) - REPORT_ABSOLUTE_POS(E4); - #endif - #if AXIS_IS_L64XX(E5) - REPORT_ABSOLUTE_POS(E5); - #endif - #if AXIS_IS_L64XX(E6) - REPORT_ABSOLUTE_POS(E6); - #endif - #if AXIS_IS_L64XX(E7) - REPORT_ABSOLUTE_POS(E7); - #endif - SERIAL_EOL(); - #endif // HAS_L64XX - SERIAL_ECHOPGM("Stepper:"); LOOP_LOGICAL_AXES(i) { SERIAL_ECHOPGM_P((PGM_P)pgm_read_ptr(&SP_AXIS_LBL[i]), stepper.position((AxisEnum)i)); diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 3a5470b03e..5f9ab3dc7d 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -1610,7 +1610,7 @@ #define HAS_X_MS_PINS 1 #endif -#if PIN_EXISTS(X2_ENABLE) || AXIS_IS_L64XX(X2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)) +#if PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)) #define HAS_X2_ENABLE 1 #endif #if PIN_EXISTS(X2_DIR) @@ -1631,7 +1631,7 @@ #endif #if HAS_Y_AXIS - #if PIN_EXISTS(Y_ENABLE) || AXIS_IS_L64XX(Y) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)) + #if PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)) #define HAS_Y_ENABLE 1 #endif #if PIN_EXISTS(Y_DIR) @@ -1644,7 +1644,7 @@ #define HAS_Y_MS_PINS 1 #endif - #if PIN_EXISTS(Y2_ENABLE) || AXIS_IS_L64XX(Y2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)) + #if PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)) #define HAS_Y2_ENABLE 1 #endif #if PIN_EXISTS(Y2_DIR) @@ -1664,7 +1664,7 @@ #endif #if HAS_Z_AXIS - #if PIN_EXISTS(Z_ENABLE) || AXIS_IS_L64XX(Z) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)) + #if PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)) #define HAS_Z_ENABLE 1 #endif #if PIN_EXISTS(Z_DIR) @@ -1684,7 +1684,7 @@ #endif #if NUM_Z_STEPPERS >= 2 - #if PIN_EXISTS(Z2_ENABLE) || AXIS_IS_L64XX(Z2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)) + #if PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)) #define HAS_Z2_ENABLE 1 #endif #if PIN_EXISTS(Z2_DIR) @@ -1699,7 +1699,7 @@ #endif #if NUM_Z_STEPPERS >= 3 - #if PIN_EXISTS(Z3_ENABLE) || AXIS_IS_L64XX(Z3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)) + #if PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)) #define HAS_Z3_ENABLE 1 #endif #if PIN_EXISTS(Z3_DIR) @@ -1714,7 +1714,7 @@ #endif #if NUM_Z_STEPPERS >= 4 - #if PIN_EXISTS(Z4_ENABLE) || AXIS_IS_L64XX(Z4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4)) + #if PIN_EXISTS(Z4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z4)) #define HAS_Z4_ENABLE 1 #endif #if PIN_EXISTS(Z4_DIR) @@ -1729,7 +1729,7 @@ #endif #if HAS_I_AXIS - #if PIN_EXISTS(I_ENABLE) || AXIS_IS_L64XX(I) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I)) + #if PIN_EXISTS(I_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I)) #define HAS_I_ENABLE 1 #endif #if PIN_EXISTS(I_DIR) @@ -1749,7 +1749,7 @@ #endif #if HAS_J_AXIS - #if PIN_EXISTS(J_ENABLE) || AXIS_IS_L64XX(J) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J)) + #if PIN_EXISTS(J_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J)) #define HAS_J_ENABLE 1 #endif #if PIN_EXISTS(J_DIR) @@ -1769,7 +1769,7 @@ #endif #if HAS_K_AXIS - #if PIN_EXISTS(K_ENABLE) || AXIS_IS_L64XX(K) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K)) + #if PIN_EXISTS(K_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K)) #define HAS_K_ENABLE 1 #endif #if PIN_EXISTS(K_DIR) @@ -1789,7 +1789,7 @@ #endif #if HAS_U_AXIS - #if PIN_EXISTS(U_ENABLE) || AXIS_IS_L64XX(U) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(U)) + #if PIN_EXISTS(U_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(U)) #define HAS_U_ENABLE 1 #endif #if PIN_EXISTS(U_DIR) @@ -1809,7 +1809,7 @@ #endif #if HAS_V_AXIS - #if PIN_EXISTS(V_ENABLE) || AXIS_IS_L64XX(V) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(V)) + #if PIN_EXISTS(V_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(V)) #define HAS_V_ENABLE 1 #endif #if PIN_EXISTS(V_DIR) @@ -1829,7 +1829,7 @@ #endif #if HAS_W_AXIS - #if PIN_EXISTS(W_ENABLE) || AXIS_IS_L64XX(W) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(W)) + #if PIN_EXISTS(W_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(W)) #define HAS_W_ENABLE 1 #endif #if PIN_EXISTS(W_DIR) @@ -1851,7 +1851,7 @@ // Extruder steppers and solenoids #if HAS_EXTRUDERS - #if PIN_EXISTS(E0_ENABLE) || AXIS_IS_L64XX(E0) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)) + #if PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)) #define HAS_E0_ENABLE 1 #endif #if PIN_EXISTS(E0_DIR) @@ -1865,7 +1865,7 @@ #endif #if E_STEPPERS > 1 || ENABLED(E_DUAL_STEPPER_DRIVERS) - #if PIN_EXISTS(E1_ENABLE) || AXIS_IS_L64XX(E1) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)) + #if PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)) #define HAS_E1_ENABLE 1 #endif #if PIN_EXISTS(E1_DIR) @@ -1880,7 +1880,7 @@ #endif #if E_STEPPERS > 2 - #if PIN_EXISTS(E2_ENABLE) || AXIS_IS_L64XX(E2) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)) + #if PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)) #define HAS_E2_ENABLE 1 #endif #if PIN_EXISTS(E2_DIR) @@ -1895,7 +1895,7 @@ #endif #if E_STEPPERS > 3 - #if PIN_EXISTS(E3_ENABLE) || AXIS_IS_L64XX(E3) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)) + #if PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)) #define HAS_E3_ENABLE 1 #endif #if PIN_EXISTS(E3_DIR) @@ -1910,7 +1910,7 @@ #endif #if E_STEPPERS > 4 - #if PIN_EXISTS(E4_ENABLE) || AXIS_IS_L64XX(E4) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)) + #if PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)) #define HAS_E4_ENABLE 1 #endif #if PIN_EXISTS(E4_DIR) @@ -1925,7 +1925,7 @@ #endif #if E_STEPPERS > 5 - #if PIN_EXISTS(E5_ENABLE) || AXIS_IS_L64XX(E5) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)) + #if PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)) #define HAS_E5_ENABLE 1 #endif #if PIN_EXISTS(E5_DIR) @@ -1940,7 +1940,7 @@ #endif #if E_STEPPERS > 6 - #if PIN_EXISTS(E6_ENABLE) || AXIS_IS_L64XX(E6) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)) + #if PIN_EXISTS(E6_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E6)) #define HAS_E6_ENABLE 1 #endif #if PIN_EXISTS(E6_DIR) @@ -1955,7 +1955,7 @@ #endif #if E_STEPPERS > 7 - #if PIN_EXISTS(E7_ENABLE) || AXIS_IS_L64XX(E7) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)) + #if PIN_EXISTS(E7_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E7)) #define HAS_E7_ENABLE 1 #endif #if PIN_EXISTS(E7_DIR) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 3df020e3f0..dff7fb88a8 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -350,7 +350,7 @@ #elif defined(HAVE_TMC2208) #error "HAVE_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208." #elif defined(HAVE_L6470DRIVER) - #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470." + #error "HAVE_L6470DRIVER is obsolete. L64xx stepper drivers are no longer supported in Marlin." #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(E6_IS_TMC) || defined(E7_IS_TMC) #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X." @@ -363,9 +363,6 @@ #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(E6_IS_TMC2208) || defined(E7_IS_TMC2208) #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208." -#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(E6_IS_L6470) || defined(E7_IS_L6470) - #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470." #elif defined(AUTOMATIC_CURRENT_CONTROL) #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS." #elif defined(FILAMENT_CHANGE_LOAD_LENGTH) @@ -647,6 +644,26 @@ #error "LEVEL_CENTER_TOO is now BED_TRAMMING_INCLUDE_CENTER." #endif +// L64xx stepper drivers have been removed +#define _L6470 0x6470 +#define _L6474 0x6474 +#define _L6480 0x6480 +#define _POWERSTEP01 0xF00D +#if HAS_DRIVER(L6470) + #error "L6470 stepper drivers are no longer supported in Marlin." +#elif HAS_DRIVER(L6474) + #error "L6474 stepper drivers are no longer supported in Marlin." +#elif HAS_DRIVER(L6480) + #error "L6480 stepper drivers are no longer supported in Marlin." +#elif HAS_DRIVER(POWERSTEP01) + #error "POWERSTEP01 stepper drivers are no longer supported in Marlin." +#endif +#undef _L6470 +#undef _L6474 +#undef _L6480 +#undef _POWERSTEP01 + +// Check AXIS_RELATIVE_MODES constexpr float arm[] = AXIS_RELATIVE_MODES; static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements."); @@ -3533,7 +3550,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * TMC SPI Chaining */ -#define IN_CHAIN(A) ((A##_CHAIN_POS > 0) && !HAS_L64XX) +#define IN_CHAIN(A) A##_CHAIN_POS > 0 #if IN_CHAIN(X ) || IN_CHAIN(Y ) || IN_CHAIN(Z ) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(Z4) \ || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5) || IN_CHAIN(E6) || IN_CHAIN(E7) #define BAD_CHAIN(A) (IN_CHAIN(A) && !PIN_EXISTS(A##_CS)) @@ -3598,13 +3615,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #undef IN_CHAIN -/** - * L64XX requirement - */ -#if HAS_L64XX && NUM_AXES > 3 - #error "L64XX requires NUM_AXES <= 3. Homing with L64XX is not yet implemented for NUM_AXES > 3." -#endif - /** * Digipot requirement */ diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp deleted file mode 100644 index 1d69434067..0000000000 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ /dev/null @@ -1,998 +0,0 @@ -/** - * 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 . - * - */ - -/** - * The monitor_driver routines are a close copy of the TMC code - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_L64XX - -#include "L64XX_Marlin.h" - -L64XX_Marlin L64xxManager; - -#include "../../module/stepper/indirection.h" -#include "../../gcode/gcode.h" -#include "../../module/planner.h" -#include "../../HAL/shared/Delay.h" - -static const char NUM_AXIS_LIST( - str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ", - str_I[] PROGMEM = STR_I " ", str_J[] PROGMEM = STR_J " ", str_K[] PROGMEM = STR_K " " - ), - str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2", - str_Z2[] PROGMEM = "Z2", str_Z3[] PROGMEM = "Z3", str_Z4[] PROGMEM = "Z4", - LIST_N(EXTRUDERS, - str_E0[] PROGMEM = "E0", str_E1[] PROGMEM = "E1", - str_E2[] PROGMEM = "E2", str_E3[] PROGMEM = "E3", - str_E4[] PROGMEM = "E4", str_E5[] PROGMEM = "E5", - str_E6[] PROGMEM = "E6", str_E7[] PROGMEM = "E7" - ) - ; - -#define _EN_ITEM(N) , str_E##N -PGM_P const L64XX_Marlin::index_to_axis[] PROGMEM = { - NUM_AXIS_LIST(str_X, str_Y, str_Z, str_I, str_J, str_K), - str_X2, str_Y2, str_Z2, str_Z3, str_Z4 - REPEAT(E_STEPPERS, _EN_ITEM) -}; -#undef _EN_ITEM - -#define DEBUG_OUT ENABLED(L6470_CHITCHAT) -#include "../../core/debug_out.h" - -void echo_yes_no(const bool yes) { DEBUG_ECHOPGM_P(yes ? PSTR(" YES") : PSTR(" NO ")); UNUSED(yes); } - -uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction command for each driver - -#define _EN_ITEM(N) , ENABLED(INVERT_E##N##_DIR) -const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = { - NUM_AXIS_LIST(ENABLED(INVERT_X_DIR), ENABLED(INVERT_Y_DIR), ENABLED(INVERT_Z_DIR), ENABLED(INVERT_I_DIR), ENABLED(INVERT_J_DIR), ENABLED(INVERT_K_DIR), ENABLED(INVERT_U_DIR), ENABLED(INVERT_V_DIR), ENABLED(INVERT_W_DIR)) - , ENABLED(INVERT_X_DIR) ^ BOTH(HAS_DUAL_X_STEPPERS, INVERT_X2_VS_X_DIR) // X2 - , ENABLED(INVERT_Y_DIR) ^ BOTH(HAS_DUAL_Y_STEPPERS, INVERT_Y2_VS_Y_DIR) // Y2 - , ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z2_VS_Z_DIR) // Z2 - , ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z3_VS_Z_DIR) // Z3 - , ENABLED(INVERT_Z_DIR) ^ ENABLED(INVERT_Z4_VS_Z_DIR) // Z4 - REPEAT(E_STEPPERS, _EN_ITEM) -}; -#undef _EN_ITEM - -volatile uint8_t L64XX_Marlin::spi_abort = false; -uint8_t L64XX_Marlin::spi_active = false; - -L64XX_Marlin::L64XX_shadow_t L64XX_Marlin::shadow; - -//uint32_t UVLO_ADC = 0x0400; // ADC undervoltage event - -void L6470_populate_chain_array() { - - #define _L6470_INIT_SPI(Q) do{ stepper##Q.set_chain_info(Q, Q##_CHAIN_POS); }while(0) - - #if AXIS_IS_L64XX(X) - _L6470_INIT_SPI(X); - #endif - #if AXIS_IS_L64XX(X2) - _L6470_INIT_SPI(X2); - #endif - #if AXIS_IS_L64XX(Y) - _L6470_INIT_SPI(Y); - #endif - #if AXIS_IS_L64XX(Y2) - _L6470_INIT_SPI(Y2); - #endif - #if AXIS_IS_L64XX(Z) - _L6470_INIT_SPI(Z); - #endif - #if AXIS_IS_L64XX(Z2) - _L6470_INIT_SPI(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - _L6470_INIT_SPI(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - _L6470_INIT_SPI(Z4); - #endif - #if AXIS_IS_L64XX(E0) - _L6470_INIT_SPI(E0); - #endif - #if AXIS_IS_L64XX(E1) - _L6470_INIT_SPI(E1); - #endif - #if AXIS_IS_L64XX(E2) - _L6470_INIT_SPI(E2); - #endif - #if AXIS_IS_L64XX(E3) - _L6470_INIT_SPI(E3); - #endif - #if AXIS_IS_L64XX(E4) - _L6470_INIT_SPI(E4); - #endif - #if AXIS_IS_L64XX(E5) - _L6470_INIT_SPI(E5); - #endif - #if AXIS_IS_L64XX(E6) - _L6470_INIT_SPI(E6); - #endif - #if AXIS_IS_L64XX(E7) - _L6470_INIT_SPI(E7); - #endif -} - - -/** - * Some status bit positions & definitions differ per driver. - * Copy info to known locations to simplfy check/display logic. - * 1. Copy stepper status - * 2. Copy status bit definitions - * 3. Copy status layout - * 4. Make all error bits active low (as needed) - */ -uint16_t L64XX_Marlin::get_stepper_status(L64XX &st) { - shadow.STATUS_AXIS_RAW = st.getStatus(); - shadow.STATUS_AXIS = shadow.STATUS_AXIS_RAW; - shadow.STATUS_AXIS_LAYOUT = st.L6470_status_layout; - shadow.AXIS_OCD_TH_MAX = st.OCD_TH_MAX; - shadow.AXIS_STALL_TH_MAX = st.STALL_TH_MAX; - shadow.AXIS_OCD_CURRENT_CONSTANT_INV = st.OCD_CURRENT_CONSTANT_INV; - shadow.AXIS_STALL_CURRENT_CONSTANT_INV = st.STALL_CURRENT_CONSTANT_INV; - shadow.L6470_AXIS_CONFIG = st.L64XX_CONFIG; - shadow.L6470_AXIS_STATUS = st.L64XX_STATUS; - shadow.STATUS_AXIS_OCD = st.STATUS_OCD; - shadow.STATUS_AXIS_SCK_MOD = st.STATUS_SCK_MOD; - shadow.STATUS_AXIS_STEP_LOSS_A = st.STATUS_STEP_LOSS_A; - shadow.STATUS_AXIS_STEP_LOSS_B = st.STATUS_STEP_LOSS_B; - shadow.STATUS_AXIS_TH_SD = st.STATUS_TH_SD; - shadow.STATUS_AXIS_TH_WRN = st.STATUS_TH_WRN; - shadow.STATUS_AXIS_UVLO = st.STATUS_UVLO; - shadow.STATUS_AXIS_WRONG_CMD = st.STATUS_WRONG_CMD; - shadow.STATUS_AXIS_CMD_ERR = st.STATUS_CMD_ERR; - shadow.STATUS_AXIS_NOTPERF_CMD = st.STATUS_NOTPERF_CMD; - - switch (shadow.STATUS_AXIS_LAYOUT) { - case L6470_STATUS_LAYOUT: { // L6470 - shadow.L6470_ERROR_MASK = shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_OCD | shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B; - shadow.STATUS_AXIS ^= (shadow.STATUS_AXIS_WRONG_CMD | shadow.STATUS_AXIS_NOTPERF_CMD); // invert just error bits that are active high - break; - } - case L6474_STATUS_LAYOUT: { // L6474 - shadow.L6470_ERROR_MASK = shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_OCD ; - shadow.STATUS_AXIS ^= (shadow.STATUS_AXIS_WRONG_CMD | shadow.STATUS_AXIS_NOTPERF_CMD); // invert just error bits that are active high - break; - } - case L6480_STATUS_LAYOUT: { // L6480 & powerSTEP01 - shadow.L6470_ERROR_MASK = shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_OCD | shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B; - shadow.STATUS_AXIS ^= (shadow.STATUS_AXIS_CMD_ERR | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD); // invert just error bits that are active high - break; - } - } - return shadow.STATUS_AXIS; -} - - -void L64XX_Marlin::init() { // Set up SPI and then init chips - ENABLE_RESET_L64XX_CHIPS(LOW); // hardware reset of drivers - DELAY_US(100); - ENABLE_RESET_L64XX_CHIPS(HIGH); - DELAY_US(1000); // need about 650µs for the chip(s) to fully start up - L6470_populate_chain_array(); // Set up array to control where in the SPI transfer sequence a particular stepper's data goes - - spi_init(); // Since L64XX SPI pins are unset we must init SPI here - - init_to_defaults(); // init the chips -} - -uint16_t L64XX_Marlin::get_status(const L64XX_axis_t axis) { - - #define STATUS_L6470(Q) get_stepper_status(stepper##Q) - - switch (axis) { - default: break; - #if AXIS_IS_L64XX(X) - case X : return STATUS_L6470(X); - #endif - #if AXIS_IS_L64XX(Y) - case Y : return STATUS_L6470(Y); - #endif - #if AXIS_IS_L64XX(Z) - case Z : return STATUS_L6470(Z); - #endif - #if AXIS_IS_L64XX(X2) - case X2: return STATUS_L6470(X2); - #endif - #if AXIS_IS_L64XX(Y2) - case Y2: return STATUS_L6470(Y2); - #endif - #if AXIS_IS_L64XX(Z2) - case Z2: return STATUS_L6470(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - case Z3: return STATUS_L6470(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - case Z4: return STATUS_L6470(Z4); - #endif - #if AXIS_IS_L64XX(E0) - case E0: return STATUS_L6470(E0); - #endif - #if AXIS_IS_L64XX(E1) - case E1: return STATUS_L6470(E1); - #endif - #if AXIS_IS_L64XX(E2) - case E2: return STATUS_L6470(E2); - #endif - #if AXIS_IS_L64XX(E3) - case E3: return STATUS_L6470(E3); - #endif - #if AXIS_IS_L64XX(E4) - case E4: return STATUS_L6470(E4); - #endif - #if AXIS_IS_L64XX(E5) - case E5: return STATUS_L6470(E5); - #endif - #if AXIS_IS_L64XX(E6) - case E6: return STATUS_L6470(E6); - #endif - #if AXIS_IS_L64XX(E7) - case E7: return STATUS_L6470(E7); - #endif - } - - return 0; // Not needed but kills a compiler warning -} - -uint32_t L64XX_Marlin::get_param(const L64XX_axis_t axis, const uint8_t param) { - - #define GET_L6470_PARAM(Q) L6470_GETPARAM(param, Q) - - switch (axis) { - default: break; - #if AXIS_IS_L64XX(X) - case X : return GET_L6470_PARAM(X); - #endif - #if AXIS_IS_L64XX(Y) - case Y : return GET_L6470_PARAM(Y); - #endif - #if AXIS_IS_L64XX(Z) - case Z : return GET_L6470_PARAM(Z); - #endif - #if AXIS_IS_L64XX(X2) - case X2: return GET_L6470_PARAM(X2); - #endif - #if AXIS_IS_L64XX(Y2) - case Y2: return GET_L6470_PARAM(Y2); - #endif - #if AXIS_IS_L64XX(Z2) - case Z2: return GET_L6470_PARAM(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - case Z3: return GET_L6470_PARAM(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - case Z4: return GET_L6470_PARAM(Z4); - #endif - #if AXIS_IS_L64XX(E0) - case E0: return GET_L6470_PARAM(E0); - #endif - #if AXIS_IS_L64XX(E1) - case E1: return GET_L6470_PARAM(E1); - #endif - #if AXIS_IS_L64XX(E2) - case E2: return GET_L6470_PARAM(E2); - #endif - #if AXIS_IS_L64XX(E3) - case E3: return GET_L6470_PARAM(E3); - #endif - #if AXIS_IS_L64XX(E4) - case E4: return GET_L6470_PARAM(E4); - #endif - #if AXIS_IS_L64XX(E5) - case E5: return GET_L6470_PARAM(E5); - #endif - #if AXIS_IS_L64XX(E6) - case E6: return GET_L6470_PARAM(E6); - #endif - #if AXIS_IS_L64XX(E7) - case E7: return GET_L6470_PARAM(E7); - #endif - } - - return 0; // not needed but kills a compiler warning -} - -void L64XX_Marlin::set_param(const L64XX_axis_t axis, const uint8_t param, const uint32_t value) { - - #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value) - - switch (axis) { - default: break; - #if AXIS_IS_L64XX(X) - case X : SET_L6470_PARAM(X); break; - #endif - #if AXIS_IS_L64XX(Y) - case Y : SET_L6470_PARAM(Y); break; - #endif - #if AXIS_IS_L64XX(Z) - case Z : SET_L6470_PARAM(Z); break; - #endif - #if AXIS_IS_L64XX(I) - case I : SET_L6470_PARAM(I); break; - #endif - #if AXIS_IS_L64XX(J) - case J : SET_L6470_PARAM(J); break; - #endif - #if AXIS_IS_L64XX(K) - case K : SET_L6470_PARAM(K); break; - #endif - #if AXIS_IS_L64XX(X2) - case X2: SET_L6470_PARAM(X2); break; - #endif - #if AXIS_IS_L64XX(Y2) - case Y2: SET_L6470_PARAM(Y2); break; - #endif - #if AXIS_IS_L64XX(Z2) - case Z2: SET_L6470_PARAM(Z2); break; - #endif - #if AXIS_IS_L64XX(Z3) - case Z3: SET_L6470_PARAM(Z3); break; - #endif - #if AXIS_IS_L64XX(Z4) - case Z4: SET_L6470_PARAM(Z4); break; - #endif - #if AXIS_IS_L64XX(E0) - case E0: SET_L6470_PARAM(E0); break; - #endif - #if AXIS_IS_L64XX(E1) - case E1: SET_L6470_PARAM(E1); break; - #endif - #if AXIS_IS_L64XX(E2) - case E2: SET_L6470_PARAM(E2); break; - #endif - #if AXIS_IS_L64XX(E3) - case E3: SET_L6470_PARAM(E3); break; - #endif - #if AXIS_IS_L64XX(E4) - case E4: SET_L6470_PARAM(E4); break; - #endif - #if AXIS_IS_L64XX(E5) - case E5: SET_L6470_PARAM(E5); break; - #endif - #if AXIS_IS_L64XX(E6) - case E6: SET_L6470_PARAM(E6); break; - #endif - #if AXIS_IS_L64XX(E7) - case E7: SET_L6470_PARAM(E7); break; - #endif - } -} - -inline void echo_min_max(const char a, const_float_t min, const_float_t max) { - DEBUG_CHAR(' '); DEBUG_CHAR(a); - DEBUG_ECHOLNPGM(" min = ", min, " max = ", max); -} -inline void echo_oct_used(const_float_t oct, const uint8_t stall) { - DEBUG_ECHOPGM("over_current_threshold used : ", oct); - DEBUG_ECHOPGM_P(stall ? PSTR(" (Stall") : PSTR(" (OCD")); - DEBUG_ECHOLNPGM(" threshold)"); -} -inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("Test aborted - motion out of bounds"); } - -uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_index[3], char axis_mon[3][3], - float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, - uint8_t over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold -) { - // Return TRUE if the calling routine needs to abort/kill - - uint16_t displacement = 0; // " = 0" to eliminate compiler warning - uint8_t j; // general purpose counter - - if (!all_axes_homed()) { - DEBUG_ECHOLNPGM("Test aborted - home all before running this command"); - return true; - } - - uint8_t found_displacement = false; - LOOP_LOGICAL_AXES(i) if (uint16_t _displacement = parser.intval(AXIS_CHAR(i))) { - found_displacement = true; - displacement = _displacement; - const uint8_t axis_offset = parser.byteval('J'); - axis_mon[0][0] = AXIS_CHAR(i); // Axis first character, one of XYZ...E - const bool single_or_e = axis_offset >= 2 || axis_mon[0][0] == 'E', - one_or_more = !single_or_e && axis_offset == 0; - uint8_t driver_count_local = 0; // Can't use "driver_count" directly as a subscript because it's passed by reference - if (single_or_e) // Single axis, E0, or E1 - axis_mon[0][1] = axis_offset + '0'; // Index given by 'J' parameter - - if (single_or_e || one_or_more) { - for (j = 0; j < MAX_L64XX; j++) { // Count up the drivers on this axis - PGM_P str = (PGM_P)pgm_read_ptr(&index_to_axis[j]); // Get a PGM_P from progmem - const char c = pgm_read_byte(str); // Get a char from progmem - if (axis_mon[0][0] == c) { // For each stepper on this axis... - char *mon = axis_mon[driver_count_local]; - *mon++ = c; // Copy the 3 letter axis name - *mon++ = pgm_read_byte(&str[1]); // to the axis_mon array - *mon = pgm_read_byte(&str[2]); - axis_index[driver_count_local] = (L64XX_axis_t)j; // And store the L64XX axis index - driver_count_local++; - } - } - if (one_or_more) driver_count = driver_count_local; - } - break; // only take first axis found - } - - if (!found_displacement) { - DEBUG_ECHOLNPGM("Test aborted - AXIS with displacement is required"); - return true; - } - - // - // Position calcs & checks - // - - const float LOGICAL_AXIS_LIST( - E_center = current_position.e, - X_center = LOGICAL_X_POSITION(current_position.x), - Y_center = LOGICAL_Y_POSITION(current_position.y), - Z_center = LOGICAL_Z_POSITION(current_position.z), - I_center = LOGICAL_I_POSITION(current_position.i), - J_center = LOGICAL_J_POSITION(current_position.j), - K_center = LOGICAL_K_POSITION(current_position.k) - ); - - switch (axis_mon[0][0]) { - default: position_max = position_min = 0; break; - - case 'X': { - position_min = X_center - displacement; - position_max = X_center + displacement; - echo_min_max('X', position_min, position_max); - if (TERN0(HAS_ENDSTOPS, position_min < (X_MIN_POS) || position_max > (X_MAX_POS))) { - err_out_of_bounds(); - return true; - } - } break; - - #if HAS_Y_AXIS - case 'Y': { - position_min = Y_center - displacement; - position_max = Y_center + displacement; - echo_min_max('Y', position_min, position_max); - if (TERN0(HAS_ENDSTOPS, position_min < (Y_MIN_POS) || position_max > (Y_MAX_POS))) { - err_out_of_bounds(); - return true; - } - } break; - #endif - - #if HAS_Z_AXIS - case 'Z': { - position_min = Z_center - displacement; - position_max = Z_center + displacement; - echo_min_max('Z', position_min, position_max); - if (TERN0(HAS_ENDSTOPS, position_min < (Z_MIN_POS) || position_max > (Z_MAX_POS))) { - err_out_of_bounds(); - return true; - } - } break; - #endif - - #if HAS_I_AXIS - case AXIS4_NAME: { - position_min = I_center - displacement; - position_max = I_center + displacement; - echo_min_max(AXIS4_NAME, position_min, position_max); - if (TERN0(HAS_ENDSTOPS, position_min < (I_MIN_POS) || position_max > (I_MAX_POS))) { - err_out_of_bounds(); - return true; - } - } break; - #endif - - #if HAS_J_AXIS - case AXIS5_NAME: { - position_min = J_center - displacement; - position_max = J_center + displacement; - echo_min_max(AXIS5_NAME, position_min, position_max); - if (TERN1(HAS_ENDSTOPS, position_min < (J_MIN_POS) || position_max > (J_MAX_POS))) { - err_out_of_bounds(); - return true; - } - } break; - #endif - - #if HAS_K_AXIS - case AXIS6_NAME: { - position_min = K_center - displacement; - position_max = K_center + displacement; - echo_min_max(AXIS6_NAME, position_min, position_max); - if (TERN2(HAS_ENDSTOPS, position_min < (K_MIN_POS) || position_max > (K_MAX_POS))) { - err_out_of_bounds(); - return true; - } - } break; - #endif - - #if HAS_EXTRUDERS - case 'E': { - position_min = E_center - displacement; - position_max = E_center + displacement; - echo_min_max('E', position_min, position_max); - } break; - #endif - } - - // - // Work on the drivers - // - - LOOP_L_N(k, driver_count) { - uint8_t not_found = true; - for (j = 1; j <= L64XX::chain[0]; j++) { - PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[L64XX::chain[j]]); - if (pgm_read_byte(&str[0]) == axis_mon[k][0] && pgm_read_byte(&str[1]) == axis_mon[k][1]) { // See if a L6470 driver - not_found = false; - break; - } - } - if (not_found) { - driver_count = k; - axis_mon[k][0] = ' '; // mark this entry invalid - break; - } - } - - if (driver_count == 0) { - DEBUG_ECHOLNPGM("Test aborted - not a L6470 axis"); - return true; - } - - DEBUG_ECHOPGM("Monitoring:"); - for (j = 0; j < driver_count; j++) DEBUG_ECHOPGM(" ", axis_mon[j]); - DEBUG_EOL(); - - // now have a list of driver(s) to monitor - - // - // TVAL & kVAL_HOLD checks & settings - // - const L64XX_shadow_t &sh = shadow; - get_status(axis_index[0]); // populate shadow array - - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // L6474 - use TVAL - uint16_t TVAL_current = parser.ushortval('T'); - if (TVAL_current) { - uint8_t TVAL_count = (TVAL_current / sh.AXIS_STALL_CURRENT_CONSTANT_INV) - 1; - LIMIT(TVAL_count, 0, sh.AXIS_STALL_TH_MAX); - for (j = 0; j < driver_count; j++) - set_param(axis_index[j], L6474_TVAL, TVAL_count); - } - // only print the tval from one of the drivers - kval_hold = get_param(axis_index[0], L6474_TVAL); - DEBUG_ECHOLNPGM("TVAL current (mA) = ", (kval_hold + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV); - } - else { - kval_hold = parser.byteval('K'); - if (kval_hold) { - DEBUG_ECHOLNPGM("kval_hold = ", kval_hold); - for (j = 0; j < driver_count; j++) - set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold); - } - else { - // only print the KVAL_HOLD from one of the drivers - kval_hold = get_param(axis_index[0], L6470_KVAL_HOLD); - DEBUG_ECHOLNPGM("KVAL_HOLD = ", kval_hold); - } - } - - // - // Overcurrent checks & settings - // - - if (over_current_flag) { - - uint8_t OCD_TH_val_local = 0, // compiler thinks OCD_TH_val is unused if use it directly - STALL_TH_val_local = 0; // just in case ... - - over_current_threshold = parser.intval('I'); - - if (over_current_threshold) { - - OCD_TH_val_local = over_current_threshold/375; - LIMIT(OCD_TH_val_local, 0, 15); - STALL_TH_val_local = over_current_threshold/31.25; - LIMIT(STALL_TH_val_local, 0, 127); - uint16_t OCD_TH_actual = (OCD_TH_val_local + 1) * 375, - STALL_TH_actual = (STALL_TH_val_local + 1) * 31.25; - if (OCD_TH_actual < STALL_TH_actual) { - OCD_TH_val_local++; - OCD_TH_actual = (OCD_TH_val_local + 1) * 375; - } - - DEBUG_ECHOLNPGM("over_current_threshold specified: ", over_current_threshold); - if (!(sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)) echo_oct_used((STALL_TH_val_local + 1) * 31.25, true); - echo_oct_used((OCD_TH_val_local + 1) * 375, false); - - #define SET_OVER_CURRENT(Q) do { stepper##Q.SetParam(L6470_STALL_TH, STALL_TH_val_local); stepper##Q.SetParam(L6470_OCD_TH, OCD_TH_val_local);} while (0) - - for (j = 0; j < driver_count; j++) { - set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); - set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); - } - } - else { - // only get & print the OVER_CURRENT values from one of the drivers - STALL_TH_val_local = get_param(axis_index[0], L6470_STALL_TH); - OCD_TH_val_local = get_param(axis_index[0], L6470_OCD_TH); - - if (!(sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)) echo_oct_used((STALL_TH_val_local + 1) * 31.25, true); - echo_oct_used((OCD_TH_val_local + 1) * 375, false); - } // over_current_threshold - - for (j = 0; j < driver_count; j++) { // set all drivers on axis the same - set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local); - set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local); - } - - OCD_TH_val = OCD_TH_val_local; // force compiler to update the main routine's copy - STALL_TH_val = STALL_TH_val_local; // force compiler to update the main routine's copy - } // end of overcurrent - - // - // Feedrate - // - - final_feedrate = parser.floatval('F'); - if (final_feedrate == 0) { - static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE; - const uint8_t num_feedrates = COUNT(default_max_feedrate); - for (j = 0; j < num_feedrates; j++) { - if (AXIS_CHAR(j) == axis_mon[0][0]) { - final_feedrate = default_max_feedrate[j]; - break; - } - } - if (j == 3 && num_feedrates > 4) { // have more than one extruder feedrate - uint8_t extruder_num = axis_mon[0][1] - '0'; - if (j <= num_feedrates - extruder_num) // have a feedrate specifically for this extruder - final_feedrate = default_max_feedrate[j + extruder_num]; - else - final_feedrate = default_max_feedrate[3]; // use E0 feedrate for this extruder - } - final_feedrate *= 60; // convert to mm/minute - } // end of feedrate - - return false; // FALSE indicates no user input problems -} - -void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*/) { - if (label) SERIAL_ECHOPGM("AXIS:"); - const char * const str = L64xxManager.index_to_axis[axis]; - SERIAL_CHAR(' ', str[0], str[1], ' '); -} - -#if ENABLED(L6470_CHITCHAT) - - // Assumes status bits have been inverted - void L64XX_Marlin::error_status_decode(const uint16_t status, const L64XX_axis_t axis, - const uint16_t _status_axis_th_sd, const uint16_t _status_axis_th_wrn, - const uint16_t _status_axis_step_loss_a, const uint16_t _status_axis_step_loss_b, - const uint16_t _status_axis_ocd, const uint8_t _status_axis_layout - ) { - say_axis(axis); - DEBUG_ECHOPGM(" THERMAL: "); - DEBUG_ECHOPGM_P((status & _status_axis_th_sd) ? PSTR("SHUTDOWN") : (status & _status_axis_th_wrn) ? PSTR("WARNING ") : PSTR("OK ")); - DEBUG_ECHOPGM(" OVERCURRENT: "); - echo_yes_no((status & _status_axis_ocd) != 0); - if (!(_status_axis_layout == L6474_STATUS_LAYOUT)) { // L6474 doesn't have these bits - DEBUG_ECHOPGM(" STALL: "); - echo_yes_no((status & (_status_axis_step_loss_a | _status_axis_step_loss_b)) != 0); - } - DEBUG_EOL(); - } - -#endif - -////////////////////////////////////////////////////////////////////////////////////////////////// -//// -//// MONITOR_L6470_DRIVER_STATUS routines -//// -////////////////////////////////////////////////////////////////////////////////////////////////// - -#if ENABLED(MONITOR_L6470_DRIVER_STATUS) - - bool L64XX_Marlin::monitor_paused = false; // Flag to skip monitor during M122, M906, M916, M917, M918, etc. - - struct L6470_driver_data { - L64XX_axis_t driver_index; - uint32_t driver_status; - uint8_t is_otw; - uint8_t otw_counter; - uint8_t is_ot; - uint8_t is_hi_Z; - uint8_t com_counter; - }; - - L6470_driver_data driver_L6470_data[] = { - #if AXIS_IS_L64XX(X) - { X, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(Y) - { Y, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(Z) - { Z, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(I) - { I, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(J) - { J, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(K) - { K, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(X2) - { X2, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(Y2) - { Y2, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(Z2) - { Z2, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(Z3) - { Z3, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(Z4) - { Z4, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(E0) - { E0, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(E1) - { E1, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(E2) - { E2, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(E3) - { E3, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(E4) - { E4, 0, 0, 0, 0, 0, 0 }, - #endif - #if AXIS_IS_L64XX(E5) - { E5, 0, 0, 0, 0, 0, 0 } - #endif - #if AXIS_IS_L64XX(E6) - { E6, 0, 0, 0, 0, 0, 0 } - #endif - #if AXIS_IS_L64XX(E7) - { E7, 0, 0, 0, 0, 0, 0 } - #endif - }; - - void L64XX_Marlin::append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err/*=nullptr*/) { - PGM_P const str = (PGM_P)pgm_read_ptr(&index_to_axis[stepper_index]); - p += sprintf_P(p, PSTR("Stepper %c%c "), pgm_read_byte(&str[0]), pgm_read_byte(&str[1])); - if (err) p += sprintf_P(p, err); - } - - void L64XX_Marlin::monitor_update(L64XX_axis_t stepper_index) { - if (spi_abort) return; // don't do anything if set_directions() has occurred - const L64XX_shadow_t &sh = shadow; - get_status(stepper_index); // get stepper status and details - uint16_t status = sh.STATUS_AXIS; - uint8_t kval_hold, tval; - char temp_buf[120], *p = temp_buf; - uint8_t j; - for (j = 0; j < L64XX::chain[0]; j++) // find the table for this stepper - if (driver_L6470_data[j].driver_index == stepper_index) break; - - driver_L6470_data[j].driver_status = status; - uint16_t _status = ~status; // all error bits are active low - - if (status == 0 || status == 0xFFFF) { // com problem - if (driver_L6470_data[j].com_counter == 0) { // warn user when it first happens - driver_L6470_data[j].com_counter++; - append_stepper_err(p, stepper_index, PSTR(" - communications lost\n")); - DEBUG_ECHO(temp_buf); - } - else { - driver_L6470_data[j].com_counter++; - if (driver_L6470_data[j].com_counter > 240) { // remind of com problem about every 2 minutes - driver_L6470_data[j].com_counter = 1; - append_stepper_err(p, stepper_index, PSTR(" - still no communications\n")); - DEBUG_ECHO(temp_buf); - } - } - } - else { - if (driver_L6470_data[j].com_counter) { // comms re-established - driver_L6470_data[j].com_counter = 0; - append_stepper_err(p, stepper_index, PSTR(" - communications re-established\n.. setting all drivers to default values\n")); - DEBUG_ECHO(temp_buf); - init_to_defaults(); - } - else { - // no com problems - do the usual checks - if (_status & sh.L6470_ERROR_MASK) { - append_stepper_err(p, stepper_index); - - if (status & STATUS_HIZ) { // The driver has shut down. HiZ is active high - driver_L6470_data[j].is_hi_Z = true; - p += sprintf_P(p, PSTR("%cIS SHUT DOWN"), ' '); - //if (_status & sh.STATUS_AXIS_TH_SD) { // strange - TH_SD never seems to go active, must be implied by the HiZ and TH_WRN - if (_status & sh.STATUS_AXIS_TH_WRN) { // over current shutdown - p += sprintf_P(p, PSTR("%cdue to over temperature"), ' '); - driver_L6470_data[j].is_ot = true; - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // L6474 - tval = get_param(stepper_index, L6474_TVAL) - 2 * KVAL_HOLD_STEP_DOWN; - set_param(stepper_index, L6474_TVAL, tval); // reduce TVAL - p += sprintf_P(p, PSTR(" - TVAL reduced by %d to %d mA"), uint16_t (2 * KVAL_HOLD_STEP_DOWN * sh.AXIS_STALL_CURRENT_CONSTANT_INV), uint16_t ((tval + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV)); // let user know - } - else { - kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - 2 * KVAL_HOLD_STEP_DOWN; - set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD - p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), 2 * KVAL_HOLD_STEP_DOWN, kval_hold); // let user know - } - } - else - driver_L6470_data[j].is_ot = false; - } - else { - driver_L6470_data[j].is_hi_Z = false; - - if (_status & sh.STATUS_AXIS_TH_WRN) { // have an over temperature warning - driver_L6470_data[j].is_otw = true; - driver_L6470_data[j].otw_counter++; - kval_hold = get_param(stepper_index, L6470_KVAL_HOLD); - if (driver_L6470_data[j].otw_counter > 4) { // otw present for 2 - 2.5 seconds, reduce KVAL_HOLD - driver_L6470_data[j].otw_counter = 0; - driver_L6470_data[j].is_otw = true; - if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) { // L6474 - tval = get_param(stepper_index, L6474_TVAL) - KVAL_HOLD_STEP_DOWN; - set_param(stepper_index, L6474_TVAL, tval); // reduce TVAL - p += sprintf_P(p, PSTR(" - TVAL reduced by %d to %d mA"), uint16_t (KVAL_HOLD_STEP_DOWN * sh.AXIS_STALL_CURRENT_CONSTANT_INV), uint16_t ((tval + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV)); // let user know - } - else { - kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - KVAL_HOLD_STEP_DOWN; - set_param(stepper_index, L6470_KVAL_HOLD, kval_hold); // reduce KVAL_HOLD - p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), KVAL_HOLD_STEP_DOWN, kval_hold); // let user know - } - } - else if (driver_L6470_data[j].otw_counter) - p += sprintf_P(p, PSTR("%c- thermal warning"), ' '); // warn user - } - } - - #if ENABLED(L6470_STOP_ON_ERROR) - if (_status & (sh.STATUS_AXIS_UVLO | sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) - kill(temp_buf); - #endif - - #if ENABLED(L6470_CHITCHAT) - if (_status & sh.STATUS_AXIS_OCD) - p += sprintf_P(p, PSTR("%c over current"), ' '); - - if (_status & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) - p += sprintf_P(p, PSTR("%c stall"), ' '); - - if (_status & sh.STATUS_AXIS_UVLO) - p += sprintf_P(p, PSTR("%c under voltage lock out"), ' '); - - p += sprintf_P(p, PSTR("%c\n"), ' '); - #endif - - DEBUG_ECHOLN(temp_buf); // print the error message - } - else { - driver_L6470_data[j].is_ot = false; - driver_L6470_data[j].otw_counter = 0; //clear out warning indicators - driver_L6470_data[j].is_otw = false; - } // end usual checks - - } // comms established but have errors - } // comms re-established - } // end monitor_update() - - - void L64XX_Marlin::monitor_driver() { - static millis_t next_cOT = 0; - if (ELAPSED(millis(), next_cOT)) { - next_cOT = millis() + 500; - - if (!monitor_paused) { // Skip during M122, M906, M916, M917 or M918 (could steal status result from test) - - spi_active = true; // Tell set_directions() a series of SPI transfers is underway - - #if AXIS_IS_L64XX(X) - monitor_update(X); - #endif - #if AXIS_IS_L64XX(Y) - monitor_update(Y); - #endif - #if AXIS_IS_L64XX(Z) - monitor_update(Z); - #endif - #if AXIS_IS_L64XX(I) - monitor_update(I); - #endif - #if AXIS_IS_L64XX(J) - monitor_update(J); - #endif - #if AXIS_IS_L64XX(K) - monitor_update(K); - #endif - #if AXIS_IS_L64XX(X2) - monitor_update(X2); - #endif - #if AXIS_IS_L64XX(Y2) - monitor_update(Y2); - #endif - #if AXIS_IS_L64XX(Z2) - monitor_update(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - monitor_update(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - monitor_update(Z4); - #endif - #if AXIS_IS_L64XX(E0) - monitor_update(E0); - #endif - #if AXIS_IS_L64XX(E1) - monitor_update(E1); - #endif - #if AXIS_IS_L64XX(E2) - monitor_update(E2); - #endif - #if AXIS_IS_L64XX(E3) - monitor_update(E3); - #endif - #if AXIS_IS_L64XX(E4) - monitor_update(E4); - #endif - #if AXIS_IS_L64XX(E5) - monitor_update(E5); - #endif - #if AXIS_IS_L64XX(E6) - monitor_update(E6); - #endif - #if AXIS_IS_L64XX(E7) - monitor_update(E7); - #endif - - if (TERN0(L6470_DEBUG, report_L6470_status)) DEBUG_EOL(); - - spi_active = false; // done with all SPI transfers - clear handshake flags - spi_abort = false; - } - } - } - -#endif // MONITOR_L6470_DRIVER_STATUS - -#endif // HAS_L64XX diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h deleted file mode 100644 index e8d8498ac7..0000000000 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * 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 . - * - */ -#pragma once - -#include "../../inc/MarlinConfig.h" - -#include -#if !(L6470_LIBRARY_VERSION >= 0x000800) - #error 'L6470_LIBRARY_VERSION 0x000800 or later required' -#endif - -#define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P) - -#define dSPIN_STEP_CLOCK 0x58 -#define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK -#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) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7)) - -#define _EN_ITEM(N) , E##N -enum L64XX_axis_t : uint8_t { MAIN_AXIS_NAMES, X2, Y2, Z2, Z3, Z4 REPEAT(E_STEPPERS, _EN_ITEM), MAX_L64XX }; -#undef _EN_ITEM - -class L64XX_Marlin : public L64XXHelper { -public: - static PGM_P const index_to_axis[MAX_L64XX]; - - static const uint8_t index_to_dir[MAX_L64XX]; - - static uint8_t dir_commands[MAX_L64XX]; - - // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer - static volatile uint8_t spi_abort; - static uint8_t spi_active; - - L64XX_Marlin() {} - - static void init(); - static void init_to_defaults(); - - static uint16_t get_stepper_status(L64XX &st); - - static uint16_t get_status(const L64XX_axis_t axis); - - static uint32_t get_param(const L64XX_axis_t axis, const uint8_t param); - - static void set_param(const L64XX_axis_t axis, const uint8_t param, const uint32_t value); - - //static void send_command(const L64XX_axis_t axis, uint8_t command); - - static uint8_t get_user_input(uint8_t &driver_count, L64XX_axis_t axis_index[3], char axis_mon[3][3], - float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold, - uint8_t over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold); - - static void transfer(uint8_t L6470_buf[], const uint8_t length); - - static void say_axis(const L64XX_axis_t axis, const uint8_t label=true); - #if ENABLED(L6470_CHITCHAT) - static void error_status_decode( - const uint16_t status, const L64XX_axis_t axis, - const uint16_t _status_axis_th_sd, const uint16_t _status_axis_th_wrn, - const uint16_t _status_axis_step_loss_a, const uint16_t _status_axis_step_loss_b, - const uint16_t _status_axis_ocd, const uint8_t _status_axis_layout - ); - #else - FORCE_INLINE static void error_status_decode( - const uint16_t, const L64XX_axis_t, - const uint16_t, const uint16_t, - const uint16_t, const uint16_t, - const uint16_t, const uint8_t - ){} - #endif - - // ~40 bytes SRAM to simplify status decode routines - typedef struct { - uint8_t STATUS_AXIS_LAYOUT; // Copy of L6470_status_layout - uint8_t AXIS_OCD_TH_MAX; // Size of OCD_TH field - uint8_t AXIS_STALL_TH_MAX; // Size of STALL_TH field - float AXIS_OCD_CURRENT_CONSTANT_INV; // mA per count - float AXIS_STALL_CURRENT_CONSTANT_INV; // mA per count - uint8_t L6470_AXIS_CONFIG, // Address of the CONFIG register - L6470_AXIS_STATUS; // Address of the STATUS register - uint16_t L6470_ERROR_MASK, // STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B - L6474_ERROR_MASK, // STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD | STATUS_OCD - STATUS_AXIS_RAW, // Copy of status register contents - STATUS_AXIS, // Copy of status register contents but with all error bits active low - STATUS_AXIS_OCD, // Overcurrent detected bit position - STATUS_AXIS_SCK_MOD, // Step clock mode is active bit position - STATUS_AXIS_STEP_LOSS_A, // Stall detected on A bridge bit position - STATUS_AXIS_STEP_LOSS_B, // Stall detected on B bridge bit position - STATUS_AXIS_TH_SD, // Thermal shutdown bit position - STATUS_AXIS_TH_WRN, // Thermal warning bit position - STATUS_AXIS_UVLO, // Undervoltage lockout is active bit position - STATUS_AXIS_WRONG_CMD, // Last command not valid bit position - STATUS_AXIS_CMD_ERR, // Command error bit position - STATUS_AXIS_NOTPERF_CMD; // Last command not performed bit position - } L64XX_shadow_t; - - static L64XX_shadow_t shadow; - - #if ENABLED(MONITOR_L6470_DRIVER_STATUS) - static bool monitor_paused; - static void pause_monitor(const bool p) { monitor_paused = p; } - static void monitor_update(L64XX_axis_t stepper_index); - static void monitor_driver(); - #else - static void pause_monitor(const bool) {} - #endif - -//protected: - // L64XXHelper methods - static void spi_init(); - static uint8_t transfer_single(uint8_t data, int16_t ss_pin); - static uint8_t transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position); - -private: - static void append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err=nullptr); - -}; - -void echo_yes_no(const bool yes); - -extern L64XX_Marlin L64xxManager; diff --git a/Marlin/src/libs/L64XX/README.md b/Marlin/src/libs/L64XX/README.md deleted file mode 100644 index d28bec5e67..0000000000 --- a/Marlin/src/libs/L64XX/README.md +++ /dev/null @@ -1,98 +0,0 @@ -### L64XX Stepper Driver - -*Arduino-L6470* library revision 0.8.0 or above is required. - -This software can be used with the L6470, L6474, L6480 and the powerSTEP01 (collectively referred to as "L64xx" from now on). Different drivers can be mixed within a system. - -These devices use voltage PWMs to drive the stepper phases. On the L6474 the phase current is controlled by the `TVAL` register. On all the other drivers the phase current is indirectly controlled via the `KVAL_HOLD` register which scales the PWM duty cycle. - -This software assumes that all drivers are in one SPI daisy chain. - -### Hardware Setup - -- MOSI from controller tied to SDI on the first device - -- SDO of the first device is tied to SDI of the next device - -- SDO of the last device is tied to MISO of the controller - -- All devices share the same `SCK_PIN` and `SS_PIN` pins. The user must supply a macro to control the `RESET_PIN`(s). - -- Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay). - -- Each L6470 acts on the **last** SPI data it saw when the `SS_PIN` **goes high**. - -The L6474 uses the standard STEP DIR interface. Phase currents are changed in response to step pulses. The direction is set by the DIR pin. Instead of an ENA pin, stepper power is controlled with SPI commands. - -The other drivers operate in `STEP_CLOCK` mode. In this mode the Direction / Enable functions are done with SPI commands and the phase currents are changed in response to STEP pulses. - -### Hardware / Software Interaction - -Except for the L6474, powering up a stepper and setting the direction are done by the same command. You can't do one without the other. - -**All** directions are set **every time** a new block is popped off the queue by the stepper ISR. - -When setting direction, SPI transfers are minimized by using arrays and a specialized SPI method. *Arduino-L6470* library calls are not used. For N L64xx drivers, this results in N bytes transferred. If library calls were used then N2 bytes would be sent. - -### Power-up (Reset) Sequence - -- Stepper objects are instantiated before the `setup()` entry point is reached. - -- In `setup()` (before stepper drivers are initialized) the `L6470_init()` method is called to do the following: - - - If present, pulse the hardware reset pin. - - - Populate the `L6470_chain` array, which maps positions in the SPI stream to commands/data for L64XX stepper drivers. - - - Initialize the L64XX Software SPI pin states. - - - Initialize L64XX drivers. They may be reset later by a call to `L6470_init_to_defaults()`. - -The steppers are **NOT** powered up (enabled) during this sequence. - -### `L6470_chain` array - -This array is used by all routines that transmit SPI data. For a chain with N devices, the array contains: - -Index|Value ------|----- -0|Number of drivers in chain -1|Axis index of the first device in the chain (closest to MOSI) -...| -N|Axis index of the last device chain (closest to MISO) - -### Set Direction and Enable - -The `DIR_WRITE` macros for the L64xx drivers are written so that the standard X, Y, Z and extruder logic used by the `set_directions()` routine is not altered. These macros write the correct forward/reverse command to the corresponding location in the array `L6470_dir_commands`. On the L6474 the array the command used just enables the stepper because direction is set by the DIR pin. - -At the end of the `set_directions()` routine, the array `L6470_chain` is used to grab the corresponding direction/enable commands out of the array `L6470_dir_commands` and put them in the correct sequence in the array `L6470_buf`. Array `L6470_buf` is then passed to the **`void`** `L6470_Transfer` function which actually sends the data to the devices. - -### Utilities, etc. - -The **absolute position** registers should accurately reflect Marlin’s stepper position counts. They are set to zero during initialization. `G28` sets them to the Marlin counts for the corresponding axis after homing. NOTE: These registers are often the negative of the Marlin counts. This is because the Marlin counts reflect the logical direction while the registers reflect the stepper direction. The register contents are displayed via the `M114 D` command. - -The `L6470_monitor` feature reads the status of each device every half second. It will report if there are any error conditions present or if communications has been lost/restored. The `KVAL_HOLD` value is reduced every 2 – 2.5 seconds if the thermal warning or thermal shutdown conditions are present. - -**M122** displays the settings of most of the bits in the status register plus a couple of other items. - -**M906** can be used to set the `KVAL_HOLD` register (`TVAL` on L6474) one driver at a time. If a setting is not included with the command then the contents of the registers that affect the phase current/voltage are displayed. - -**M916, M917 & M918** - -These utilities are used to tune the system. They can get you in the ballpark for acceptable jerk, acceleration, top speed and `KVAL_HOLD` settings (`TVAL` on L6474). In general they seem to provide an overly optimistic `KVAL_HOLD` (`TVAL`) setting because of the lag between setting `KVAL_HOLD` (`TVAL`) and the driver reaching final temperature. Enabling the `L6470_monitor` feature during prints will provide the **final useful setting**. - -The amount of power needed to move the stepper without skipping steps increases as jerk, acceleration, top speed, and micro-steps increase. The power dissipated by the driver increases as the power to the stepper increases. The net result is a balancing act between jerk, acceleration, top speed, micro-steps, and power dissipated by the driver. - -**M916** - Increases `KVAL_HOLD` (`TVAL`) while moving one axis until a thermal warning is generated. This routine is also useful for determining the approximate `KVAL_HOLD` (`TVAL`) where the stepper stops losing steps. The sound will get noticeably quieter as it stops losing steps. - -**M917** - Find minimum current thresholds. This is accomplished by doing the following steps while moving an axis: - -1. Decrease OCD current until overcurrent error. - -2. Increase OCD until overcurrent error goes away. - -3. Decrease stall threshold until stall error (not available on the L6474). - -4. Increase stall until stall error goes away (not available on the L6474). - -**M918** - Increase speed until error or max feedrate achieved. diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index 2bacc55606..593c8f7c6f 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -117,12 +117,6 @@ Stepper stepper; // Singleton #include "../feature/runout.h" #endif -#if HAS_L64XX - #include "../libs/L64XX/L64XX_Marlin.h" - uint8_t L6470_buf[MAX_L64XX + 1]; // chip command sequence - element 0 not used - bool L64XX_OK_to_power_up = false; // flag to keep L64xx steppers powered down after a reset or power up -#endif - #if ENABLED(AUTO_POWER_CONTROL) #include "../feature/power.h" #endif @@ -618,27 +612,6 @@ void Stepper::set_directions() { #endif #endif // !LIN_ADVANCE - #if HAS_L64XX - if (L64XX_OK_to_power_up) { // OK to send the direction commands (which powers up the L64XX steppers) - if (L64xxManager.spi_active) { - L64xxManager.spi_abort = true; // Interrupted SPI transfer needs to shut down gracefully - for (uint8_t j = 1; j <= L64XX::chain[0]; j++) - L6470_buf[j] = dSPIN_NOP; // Fill buffer with NOOPs - L64xxManager.transfer(L6470_buf, L64XX::chain[0]); // Send enough NOOPs to complete any command - L64xxManager.transfer(L6470_buf, L64XX::chain[0]); - L64xxManager.transfer(L6470_buf, L64XX::chain[0]); - } - - // L64xxManager.dir_commands[] is an array that holds direction command for each stepper - - // Scan command array, copy matches into L64xxManager.transfer - for (uint8_t j = 1; j <= L64XX::chain[0]; j++) - L6470_buf[j] = L64xxManager.dir_commands[L64XX::chain[j]]; - - L64xxManager.transfer(L6470_buf, L64XX::chain[0]); // send the command stream to the drivers - } - #endif - DIR_WAIT_AFTER(); } @@ -2351,13 +2324,11 @@ uint32_t Stepper::block_phase_isr() { else LA_isr_rate = LA_ADV_NEVER; #endif - if ( ENABLED(HAS_L64XX) // Always set direction for L64xx (Also enables the chips) - || ENABLED(DUAL_X_CARRIAGE) // TODO: Find out why this fixes "jittery" small circles + if ( ENABLED(DUAL_X_CARRIAGE) // TODO: Find out why this fixes "jittery" small circles || current_block->direction_bits != last_direction_bits || TERN(MIXING_EXTRUDER, false, stepper_extruder != last_moved_extruder) ) { E_TERN_(last_moved_extruder = stepper_extruder); - TERN_(HAS_L64XX, L64XX_OK_to_power_up = true); set_directions(current_block->direction_bits); } diff --git a/Marlin/src/module/stepper/L64xx.cpp b/Marlin/src/module/stepper/L64xx.cpp deleted file mode 100644 index 5b60746396..0000000000 --- a/Marlin/src/module/stepper/L64xx.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/** - * 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 . - * - */ - -/** - * stepper/L64xx.cpp - * Stepper driver indirection for L64XX drivers - */ - -#include "../../inc/MarlinConfig.h" - -#if HAS_L64XX - -#include "L64xx.h" - -#if AXIS_IS_L64XX(X) - L64XX_CLASS(X) stepperX(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(X2) - L64XX_CLASS(X2) stepperX2(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(Y) - L64XX_CLASS(Y) stepperY(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(Y2) - L64XX_CLASS(Y2) stepperY2(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(Z) - L64XX_CLASS(Z) stepperZ(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(Z2) - L64XX_CLASS(Z2) stepperZ2(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(Z3) - L64XX_CLASS(Z3) stepperZ3(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(Z4) - L64XX_CLASS(Z4) stepperZ4(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(I) - L64XX_CLASS(I) stepperI(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(J) - L64XX_CLASS(J) stepperJ(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(K) - L64XX_CLASS(K) stepperK(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(U) - L64XX_CLASS(u) stepperU(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(V) - L64XX_CLASS(v) stepperV(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(W) - L64XX_CLASS(w) stepperW(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E0) - L64XX_CLASS(E0) stepperE0(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E1) - L64XX_CLASS(E1) stepperE1(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E2) - L64XX_CLASS(E2) stepperE2(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E3) - L64XX_CLASS(E3) stepperE3(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E4) - L64XX_CLASS(E4) stepperE4(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E5) - L64XX_CLASS(E5) stepperE5(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E6) - L64XX_CLASS(E6) stepperE6(L6470_CHAIN_SS_PIN); -#endif -#if AXIS_IS_L64XX(E7) - L64XX_CLASS(E7) stepperE7(L6470_CHAIN_SS_PIN); -#endif - -// Not using L64XX class init method because it -// briefly sends power to the steppers - -inline void L6470_init_chip(L64XX &st, const int ms, const int oc, const int sc, const int mv, const int slew_rate) { - st.set_handlers(L64xxManager.spi_init, L64xxManager.transfer_single, L64xxManager.transfer_chain); // specify which external SPI routines to use - switch (st.L6470_status_layout) { - case L6470_STATUS_LAYOUT: { - st.resetDev(); - st.softFree(); - st.SetParam(st.L64XX_CONFIG, CONFIG_PWM_DIV_1 | CONFIG_PWM_MUL_2 | CONFIG_OC_SD_DISABLE | CONFIG_VS_COMP_DISABLE | CONFIG_SW_HARD_STOP | CONFIG_INT_16MHZ); - st.SetParam(L6470_KVAL_RUN, 0xFF); - st.SetParam(L6470_KVAL_ACC, 0xFF); - st.SetParam(L6470_KVAL_DEC, 0xFF); - st.setMicroSteps(ms); - st.setOverCurrent(oc); - st.setStallCurrent(sc); - st.SetParam(L6470_KVAL_HOLD, mv); - st.SetParam(L6470_ABS_POS, 0); - uint32_t config_temp = st.GetParam(st.L64XX_CONFIG); - config_temp &= ~CONFIG_POW_SR; - switch (slew_rate) { - case 0: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_75V_us); break; - default: - case 1: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_110V_us); break; - case 3: - case 2: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_260V_us); break; - } - st.getStatus(); - st.getStatus(); - break; - } - - case L6474_STATUS_LAYOUT: { - st.free(); - //st.SetParam(st.L64XX_CONFIG, CONFIG_PWM_DIV_1 | CONFIG_PWM_MUL_2 | CONFIG_OC_SD_DISABLE | CONFIG_VS_COMP_DISABLE | CONFIG_SW_HARD_STOP | CONFIG_INT_16MHZ); - //st.SetParam(L6474_TVAL, 0xFF); - st.setMicroSteps(ms); - st.setOverCurrent(oc); - st.setTVALCurrent(sc); - st.SetParam(L6470_ABS_POS, 0); - uint32_t config_temp = st.GetParam(st.L64XX_CONFIG); - config_temp &= ~CONFIG_POW_SR & ~CONFIG_EN_TQREG; // clear out slew rate and set current to be controlled by TVAL register - switch (slew_rate) { - case 0: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_75V_us); break; - default: - case 1: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_110V_us); break; - case 3: - case 2: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_260V_us); break; - //case 0: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_75V_us); break; - //default: - //case 1: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_110V_us); break; - //case 3: - //case 2: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_260V_us); break; - - //case 0: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break; - //default: - //case 1: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break; - //case 3: - //case 2: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break; - } - st.getStatus(); - st.getStatus(); - break; - } - - case L6480_STATUS_LAYOUT: { - st.resetDev(); - st.softFree(); - st.SetParam(st.L64XX_CONFIG, CONFIG_PWM_DIV_1 | CONFIG_PWM_MUL_2 | CONFIG_OC_SD_DISABLE | CONFIG_VS_COMP_DISABLE | CONFIG_SW_HARD_STOP | CONFIG_INT_16MHZ); - st.SetParam(L6470_KVAL_RUN, 0xFF); - st.SetParam(L6470_KVAL_ACC, 0xFF); - st.SetParam(L6470_KVAL_DEC, 0xFF); - st.setMicroSteps(ms); - st.setOverCurrent(oc); - st.setStallCurrent(sc); - st.SetParam(+-L6470_KVAL_HOLD, mv); - st.SetParam(L6470_ABS_POS, 0); - st.SetParam(st.L64XX_CONFIG,(st.GetParam(st.L64XX_CONFIG) | PWR_VCC_7_5V)); - st.getStatus(); // must clear out status bits before can set slew rate - st.getStatus(); - switch (slew_rate) { - case 0: st.SetParam(L6470_GATECFG1, CONFIG1_SR_220V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_220V_us); break; - default: - case 1: st.SetParam(L6470_GATECFG1, CONFIG1_SR_400V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_400V_us); break; - case 2: st.SetParam(L6470_GATECFG1, CONFIG1_SR_520V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_520V_us); break; - case 3: st.SetParam(L6470_GATECFG1, CONFIG1_SR_980V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_980V_us); break; - } - break; - } - } -} - -#define L6470_INIT_CHIP(Q) L6470_init_chip(stepper##Q, Q##_MICROSTEPS, Q##_OVERCURRENT, Q##_STALLCURRENT, Q##_MAX_VOLTAGE, Q##_SLEW_RATE) - -void L64XX_Marlin::init_to_defaults() { - #if AXIS_IS_L64XX(X) - L6470_INIT_CHIP(X); - #endif - #if AXIS_IS_L64XX(X2) - L6470_INIT_CHIP(X2); - #endif - #if AXIS_IS_L64XX(Y) - L6470_INIT_CHIP(Y); - #endif - #if AXIS_IS_L64XX(Y2) - L6470_INIT_CHIP(Y2); - #endif - #if AXIS_IS_L64XX(Z) - L6470_INIT_CHIP(Z); - #endif - #if AXIS_IS_L64XX(Z2) - L6470_INIT_CHIP(Z2); - #endif - #if AXIS_IS_L64XX(Z3) - L6470_INIT_CHIP(Z3); - #endif - #if AXIS_IS_L64XX(Z4) - L6470_INIT_CHIP(Z4); - #endif - #if AXIS_IS_L64XX(I) - L6470_INIT_CHIP(I); - #endif - #if AXIS_IS_L64XX(J) - L6470_INIT_CHIP(J); - #endif - #if AXIS_IS_L64XX(K) - L6470_INIT_CHIP(K); - #endif - #if AXIS_IS_L64XX(U) - L6470_INIT_CHIP(U); - #endif - #if AXIS_IS_L64XX(V) - L6470_INIT_CHIP(V); - #endif - #if AXIS_IS_L64XX(W) - L6470_INIT_CHIP(W); - #endif - #if AXIS_IS_L64XX(E0) - L6470_INIT_CHIP(E0); - #endif - #if AXIS_IS_L64XX(E1) - L6470_INIT_CHIP(E1); - #endif - #if AXIS_IS_L64XX(E2) - L6470_INIT_CHIP(E2); - #endif - #if AXIS_IS_L64XX(E3) - L6470_INIT_CHIP(E3); - #endif - #if AXIS_IS_L64XX(E4) - L6470_INIT_CHIP(E4); - #endif - #if AXIS_IS_L64XX(E5) - L6470_INIT_CHIP(E5); - #endif - #if AXIS_IS_L64XX(E6) - L6470_INIT_CHIP(E6); - #endif - #if AXIS_IS_L64XX(E7) - L6470_INIT_CHIP(E7); - #endif -} - -#endif // HAS_L64XX diff --git a/Marlin/src/module/stepper/L64xx.h b/Marlin/src/module/stepper/L64xx.h deleted file mode 100644 index 870b0414f8..0000000000 --- a/Marlin/src/module/stepper/L64xx.h +++ /dev/null @@ -1,490 +0,0 @@ -/** - * 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 . - * - */ -#pragma once - -/** - * stepper/L64xx.h - * Stepper driver indirection for L64XX drivers - */ - -#include "../../inc/MarlinConfig.h" -#include "../../libs/L64XX/L64XX_Marlin.h" - -// Convert option names to L64XX classes -#define CLASS_L6470 L6470 -#define CLASS_L6474 L6474 -#define CLASS_POWERSTEP01 powerSTEP01 - -#define __L64XX_CLASS(TYPE) CLASS_##TYPE -#define _L64XX_CLASS(TYPE) __L64XX_CLASS(TYPE) -#define L64XX_CLASS(ST) _L64XX_CLASS(ST##_DRIVER_TYPE) - -#define L6474_DIR_WRITE(A,STATE) do{ L64xxManager.dir_commands[A] = dSPIN_L6474_ENABLE; WRITE(A##_DIR_PIN, STATE); }while(0) -#define L64XX_DIR_WRITE(A,STATE) do{ L64xxManager.dir_commands[A] = (STATE) ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD; }while(0) - -// X Stepper -#if AXIS_IS_L64XX(X) - extern L64XX_CLASS(X) stepperX; - #define X_ENABLE_INIT() NOOP - #define X_ENABLE_WRITE(STATE) (STATE ? stepperX.hardStop() : stepperX.free()) - #define X_ENABLE_READ() (stepperX.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_X(L6474) - #define X_DIR_INIT() SET_OUTPUT(X_DIR_PIN) - #define X_DIR_WRITE(STATE) L6474_DIR_WRITE(X, STATE) - #define X_DIR_READ() READ(X_DIR_PIN) - #else - #define X_DIR_INIT() NOOP - #define X_DIR_WRITE(STATE) L64XX_DIR_WRITE(X, STATE) - #define X_DIR_READ() (stepper##X.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_X(L6470) - #define DISABLE_STEPPER_X() stepperX.free() - #endif - #endif -#endif - -// Y Stepper -#if AXIS_IS_L64XX(Y) - extern L64XX_CLASS(Y) stepperY; - #define Y_ENABLE_INIT() NOOP - #define Y_ENABLE_WRITE(STATE) (STATE ? stepperY.hardStop() : stepperY.free()) - #define Y_ENABLE_READ() (stepperY.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_Y(L6474) - #define Y_DIR_INIT() SET_OUTPUT(Y_DIR_PIN) - #define Y_DIR_WRITE(STATE) L6474_DIR_WRITE(Y, STATE) - #define Y_DIR_READ() READ(Y_DIR_PIN) - #else - #define Y_DIR_INIT() NOOP - #define Y_DIR_WRITE(STATE) L64XX_DIR_WRITE(Y, STATE) - #define Y_DIR_READ() (stepper##Y.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_Y(L6470) - #define DISABLE_STEPPER_Y() stepperY.free() - #endif - #endif -#endif - -// Z Stepper -#if AXIS_IS_L64XX(Z) - extern L64XX_CLASS(Z) stepperZ; - #define Z_ENABLE_INIT() NOOP - #define Z_ENABLE_WRITE(STATE) (STATE ? stepperZ.hardStop() : stepperZ.free()) - #define Z_ENABLE_READ() (stepperZ.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_Z(L6474) - #define Z_DIR_INIT() SET_OUTPUT(Z_DIR_PIN) - #define Z_DIR_WRITE(STATE) L6474_DIR_WRITE(Z, STATE) - #define Z_DIR_READ() READ(Z_DIR_PIN) - #else - #define Z_DIR_INIT() NOOP - #define Z_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z, STATE) - #define Z_DIR_READ() (stepper##Z.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_Z(L6470) - #define DISABLE_STEPPER_Z() stepperZ.free() - #endif - #endif -#endif - -// X2 Stepper -#if HAS_X2_ENABLE && AXIS_IS_L64XX(X2) - extern L64XX_CLASS(X2) stepperX2; - #define X2_ENABLE_INIT() NOOP - #define X2_ENABLE_WRITE(STATE) (STATE ? stepperX2.hardStop() : stepperX2.free()) - #define X2_ENABLE_READ() (stepperX2.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_X2(L6474) - #define X2_DIR_INIT() SET_OUTPUT(X2_DIR_PIN) - #define X2_DIR_WRITE(STATE) L6474_DIR_WRITE(X2, STATE) - #define X2_DIR_READ() READ(X2_DIR_PIN) - #else - #define X2_DIR_INIT() NOOP - #define X2_DIR_WRITE(STATE) L64XX_DIR_WRITE(X2, STATE) - #define X2_DIR_READ() (stepper##X2.getStatus() & STATUS_DIR); - #endif -#endif - -#if AXIS_DRIVER_TYPE_X2(L6470) - #define DISABLE_STEPPER_X2() stepperX2.free() -#endif - -// Y2 Stepper -#if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2) - extern L64XX_CLASS(Y2) stepperY2; - #define Y2_ENABLE_INIT() NOOP - #define Y2_ENABLE_WRITE(STATE) (STATE ? stepperY2.hardStop() : stepperY2.free()) - #define Y2_ENABLE_READ() (stepperY2.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_Y2(L6474) - #define Y2_DIR_INIT() SET_OUTPUT(Y2_DIR_PIN) - #define Y2_DIR_WRITE(STATE) L6474_DIR_WRITE(Y2, STATE) - #define Y2_DIR_READ() READ(Y2_DIR_PIN) - #else - #define Y2_DIR_INIT() NOOP - #define Y2_DIR_WRITE(STATE) L64XX_DIR_WRITE(Y2, STATE) - #define Y2_DIR_READ() (stepper##Y2.getStatus() & STATUS_DIR); - #endif -#endif - -#if AXIS_DRIVER_TYPE_Y2(L6470) - #define DISABLE_STEPPER_Y2() stepperY2.free() -#endif - -// Z2 Stepper -#if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2) - extern L64XX_CLASS(Z2) stepperZ2; - #define Z2_ENABLE_INIT() NOOP - #define Z2_ENABLE_WRITE(STATE) (STATE ? stepperZ2.hardStop() : stepperZ2.free()) - #define Z2_ENABLE_READ() (stepperZ2.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_Z2(L6474) - #define Z2_DIR_INIT() SET_OUTPUT(Z2_DIR_PIN) - #define Z2_DIR_WRITE(STATE) L6474_DIR_WRITE(Z2, STATE) - #define Z2_DIR_READ() READ(Z2_DIR_PIN) - #else - #define Z2_DIR_INIT() NOOP - #define Z2_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z2, STATE) - #define Z2_DIR_READ() (stepper##Z2.getStatus() & STATUS_DIR); - #endif -#endif - -#if AXIS_DRIVER_TYPE_Z2(L6470) - #define DISABLE_STEPPER_Z2() stepperZ2.free() -#endif - -// Z3 Stepper -#if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3) - extern L64XX_CLASS(Z3) stepperZ3; - #define Z3_ENABLE_INIT() NOOP - #define Z3_ENABLE_WRITE(STATE) (STATE ? stepperZ3.hardStop() : stepperZ3.free()) - #define Z3_ENABLE_READ() (stepperZ3.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_Z3(L6474) - #define Z3_DIR_INIT() SET_OUTPUT(Z3_DIR_PIN) - #define Z3_DIR_WRITE(STATE) L6474_DIR_WRITE(Z3, STATE) - #define Z3_DIR_READ() READ(Z3_DIR_PIN) - #else - #define Z3_DIR_INIT() NOOP - #define Z3_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z3, STATE) - #define Z3_DIR_READ() (stepper##Z3.getStatus() & STATUS_DIR); - #endif -#endif - -#if AXIS_DRIVER_TYPE_Z3(L6470) - #define DISABLE_STEPPER_Z3() stepperZ3.free() -#endif - -// Z4 Stepper -#if HAS_Z4_ENABLE && AXIS_IS_L64XX(Z4) - extern L64XX_CLASS(Z4) stepperZ4; - #define Z4_ENABLE_INIT() NOOP - #define Z4_ENABLE_WRITE(STATE) (STATE ? stepperZ4.hardStop() : stepperZ4.free()) - #define Z4_ENABLE_READ() (stepperZ4.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_Z4(L6474) - #define Z4_DIR_INIT() SET_OUTPUT(Z4_DIR_PIN) - #define Z4_DIR_WRITE(STATE) L6474_DIR_WRITE(Z4, STATE) - #define Z4_DIR_READ() READ(Z4_DIR_PIN) - #else - #define Z4_DIR_INIT() NOOP - #define Z4_DIR_WRITE(STATE) L64XX_DIR_WRITE(Z4, STATE) - #define Z4_DIR_READ() (stepper##Z4.getStatus() & STATUS_DIR); - #endif -#endif - -#if AXIS_DRIVER_TYPE_Z4(L6470) - #define DISABLE_STEPPER_Z4() stepperZ4.free() -#endif - -// I Stepper -#if AXIS_IS_L64XX(I) - extern L64XX_CLASS(I) stepperI; - #define I_ENABLE_INIT() NOOP - #define I_ENABLE_WRITE(STATE) (STATE ? stepperI.hardStop() : stepperI.free()) - #define I_ENABLE_READ() (stepperI.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_I(L6474) - #define I_DIR_INIT() SET_OUTPUT(I_DIR_PIN) - #define I_DIR_WRITE(STATE) L6474_DIR_WRITE(I, STATE) - #define I_DIR_READ() READ(I_DIR_PIN) - #else - #define I_DIR_INIT() NOOP - #define I_DIR_WRITE(STATE) L64XX_DIR_WRITE(I, STATE) - #define I_DIR_READ() (stepper##I.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_I(L6470) - #define DISABLE_STEPPER_I() stepperI.free() - #endif - #endif -#endif - -// J Stepper -#if AXIS_IS_L64XX(J) - extern L64XX_CLASS(J) stepperJ; - #define J_ENABLE_INIT() NOOP - #define J_ENABLE_WRITE(STATE) (STATE ? stepperJ.hardStop() : stepperJ.free()) - #define J_ENABLE_READ() (stepperJ.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_J(L6474) - #define J_DIR_INIT() SET_OUTPUT(J_DIR_PIN) - #define J_DIR_WRITE(STATE) L6474_DIR_WRITE(J, STATE) - #define J_DIR_READ() READ(J_DIR_PIN) - #else - #define J_DIR_INIT() NOOP - #define J_DIR_WRITE(STATE) L64XX_DIR_WRITE(J, STATE) - #define J_DIR_READ() (stepper##J.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_J(L6470) - #define DISABLE_STEPPER_J() stepperJ.free() - #endif - #endif -#endif - -// K Stepper -#if AXIS_IS_L64XX(K) - extern L64XX_CLASS(K) stepperK; - #define K_ENABLE_INIT() NOOP - #define K_ENABLE_WRITE(STATE) (STATE ? stepperK.hardStop() : stepperK.free()) - #define K_ENABLE_READ() (stepperK.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_K(L6474) - #define K_DIR_INIT() SET_OUTPUT(K_DIR_PIN) - #define K_DIR_WRITE(STATE) L6474_DIR_WRITE(K, STATE) - #define K_DIR_READ() READ(K_DIR_PIN) - #else - #define K_DIR_INIT() NOOP - #define K_DIR_WRITE(STATE) L64XX_DIR_WRITE(K, STATE) - #define K_DIR_READ() (stepper##K.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_K(L6470) - #define DISABLE_STEPPER_K() stepperK.free() - #endif - #endif -#endif - -// U Stepper -#if HAS_U_AXIS - #if AXIS_IS_L64XX(U) - extern L64XX_CLASS(U) stepperU; - #define U_ENABLE_INIT() NOOP - #define U_ENABLE_WRITE(STATE) (STATE ? stepperU.hardStop() : stepperU.free()) - #define U_ENABLE_READ() (stepperU.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_U(L6474) - #define U_DIR_INIT() SET_OUTPUT(U_DIR_PIN) - #define U_DIR_WRITE(STATE) L6474_DIR_WRITE(U, STATE) - #define U_DIR_READ() READ(U_DIR_PIN) - #else - #define U_DIR_INIT() NOOP - #define U_DIR_WRITE(STATE) L64XX_DIR_WRITE(U, STATE) - #define U_DIR_READ() (stepper##U.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_U(L6470) - #define DISABLE_STEPPER_U() stepperU.free() - #endif - #endif - #endif -#endif - -// V Stepper -#if HAS_V_AXIS - #if AXIS_IS_L64XX(V) - extern L64XX_CLASS(V) stepperV; - #define V_ENABLE_INIT() NOOP - #define V_ENABLE_WRITE(STATE) (STATE ? stepperV.hardStop() : stepperV.free()) - #define V_ENABLE_READ() (stepperV.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_V(L6474) - #define V_DIR_INIT() SET_OUTPUT(V_DIR_PIN) - #define V_DIR_WRITE(STATE) L6474_DIR_WRITE(V, STATE) - #define V_DIR_READ() READ(V_DIR_PIN) - #else - #define V_DIR_INIT() NOOP - #define V_DIR_WRITE(STATE) L64XX_DIR_WRITE(V, STATE) - #define V_DIR_READ() (stepper##V.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_V(L6470) - #define DISABLE_STEPPER_V() stepperV.free() - #endif - #endif - #endif -#endif - -// W Stepper -#if HAS_W_AXIS - #if AXIS_IS_L64XX(W) - extern L64XX_CLASS(w) stepperW; - #define W_ENABLE_INIT() NOOP - #define W_ENABLE_WRITE(STATE) (STATE ? stepperW.hardStop() : stepperW.free()) - #define W_ENABLE_READ() (stepperW.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_W(L6474) - #define W_DIR_INIT() SET_OUTPUT(W_DIR_PIN) - #define W_DIR_WRITE(STATE) L6474_DIR_WRITE(W, STATE) - #define W_DIR_READ() READ(W_DIR_PIN) - #else - #define W_DIR_INIT() NOOP - #define W_DIR_WRITE(STATE) L64XX_DIR_WRITE(W, STATE) - #define W_DIR_READ() (stepper##W.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_W(L6470) - #define DISABLE_STEPPER_W() stepperW.free() - #endif - #endif - #endif -#endif - -// E0 Stepper -#if AXIS_IS_L64XX(E0) - extern L64XX_CLASS(E0) stepperE0; - #define E0_ENABLE_INIT() NOOP - #define E0_ENABLE_WRITE(STATE) (STATE ? stepperE0.hardStop() : stepperE0.free()) - #define E0_ENABLE_READ() (stepperE0.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_E0(L6474) - #define E0_DIR_INIT() SET_OUTPUT(E0_DIR_PIN) - #define E0_DIR_WRITE(STATE) L6474_DIR_WRITE(E0, STATE) - #define E0_DIR_READ() READ(E0_DIR_PIN) - #else - #define E0_DIR_INIT() NOOP - #define E0_DIR_WRITE(STATE) L64XX_DIR_WRITE(E0, STATE) - #define E0_DIR_READ() (stepper##E0.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_E0(L6470) - #define DISABLE_STEPPER_E0() do{ stepperE0.free(); }while(0) - #endif - #endif -#endif - -// E1 Stepper -#if AXIS_IS_L64XX(E1) - extern L64XX_CLASS(E1) stepperE1; - #define E1_ENABLE_INIT() NOOP - #define E1_ENABLE_WRITE(STATE) (STATE ? stepperE1.hardStop() : stepperE1.free()) - #define E1_ENABLE_READ() (stepperE1.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_E1(L6474) - #define E1_DIR_INIT() SET_OUTPUT(E1_DIR_PIN) - #define E1_DIR_WRITE(STATE) L6474_DIR_WRITE(E1, STATE) - #define E1_DIR_READ() READ(E1_DIR_PIN) - #else - #define E1_DIR_INIT() NOOP - #define E1_DIR_WRITE(STATE) L64XX_DIR_WRITE(E1, STATE) - #define E1_DIR_READ() (stepper##E1.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_E1(L6470) - #define DISABLE_STEPPER_E1() do{ stepperE1.free(); }while(0) - #endif - #endif -#endif - -// E2 Stepper -#if AXIS_IS_L64XX(E2) - extern L64XX_CLASS(E2) stepperE2; - #define E2_ENABLE_INIT() NOOP - #define E2_ENABLE_WRITE(STATE) (STATE ? stepperE2.hardStop() : stepperE2.free()) - #define E2_ENABLE_READ() (stepperE2.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_E2(L6474) - #define E2_DIR_INIT() SET_OUTPUT(E2_DIR_PIN) - #define E2_DIR_WRITE(STATE) L6474_DIR_WRITE(E2, STATE) - #define E2_DIR_READ() READ(E2_DIR_PIN) - #else - #define E2_DIR_INIT() NOOP - #define E2_DIR_WRITE(STATE) L64XX_DIR_WRITE(E2, STATE) - #define E2_DIR_READ() (stepper##E2.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_E2(L6470) - #define DISABLE_STEPPER_E2() do{ stepperE2.free(); }while(0) - #endif - #endif -#endif - -// E3 Stepper -#if AXIS_IS_L64XX(E3) - extern L64XX_CLASS(E3) stepperE3; - #define E3_ENABLE_INIT() NOOP - #define E3_ENABLE_WRITE(STATE) (STATE ? stepperE3.hardStop() : stepperE3.free()) - #define E3_ENABLE_READ() (stepperE3.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_E3(L6474) - #define E3_DIR_INIT() SET_OUTPUT(E3_DIR_PIN) - #define E3_DIR_WRITE(STATE) L6474_DIR_WRITE(E3, STATE) - #define E3_DIR_READ() READ(E3_DIR_PIN) - #else - #define E3_DIR_INIT() NOOP - #define E3_DIR_WRITE(STATE) L64XX_DIR_WRITE(E3, STATE) - #define E3_DIR_READ() (stepper##E3.getStatus() & STATUS_DIR); - #endif -#endif - -// E4 Stepper -#if AXIS_IS_L64XX(E4) - extern L64XX_CLASS(E4) stepperE4; - #define E4_ENABLE_INIT() NOOP - #define E4_ENABLE_WRITE(STATE) (STATE ? stepperE4.hardStop() : stepperE4.free()) - #define E4_ENABLE_READ() (stepperE4.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_E4(L6474) - #define E4_DIR_INIT() SET_OUTPUT(E4_DIR_PIN) - #define E4_DIR_WRITE(STATE) L6474_DIR_WRITE(E4, STATE) - #define E4_DIR_READ() READ(E4_DIR_PIN) - #else - #define E4_DIR_INIT() NOOP - #define E4_DIR_WRITE(STATE) L64XX_DIR_WRITE(E4, STATE) - #define E4_DIR_READ() (stepper##E4.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_E4(L6470) - #define DISABLE_STEPPER_E4() do{ stepperE4.free(); }while(0) - #endif - #endif -#endif - -// E5 Stepper -#if AXIS_IS_L64XX(E5) - extern L64XX_CLASS(E5) stepperE5; - #define E5_ENABLE_INIT() NOOP - #define E5_ENABLE_WRITE(STATE) (STATE ? stepperE5.hardStop() : stepperE5.free()) - #define E5_ENABLE_READ() (stepperE5.getStatus() & STATUS_HIZ) - #if AXIS_DRIVER_TYPE_E5(L6474) - #define E5_DIR_INIT() SET_OUTPUT(E5_DIR_PIN) - #define E5_DIR_WRITE(STATE) L6474_DIR_WRITE(E5, STATE) - #define E5_DIR_READ() READ(E5_DIR_PIN) - #else - #define E5_DIR_INIT() NOOP - #define E5_DIR_WRITE(STATE) L64XX_DIR_WRITE(E5, STATE) - #define E5_DIR_READ() (stepper##E5.getStatus() & STATUS_DIR); - #if AXIS_DRIVER_TYPE_E5(L6470) - #define DISABLE_STEPPER_E5() do{ stepperE5.free(); }while(0) - #endif - #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 ? stepperE6.hardStop() : 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); - #if AXIS_DRIVER_TYPE_E6(L6470) - #define DISABLE_STEPPER_E6() do{ stepperE6.free(); }while(0) - #endif - #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 ? stepperE7.hardStop() : 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); - #if AXIS_DRIVER_TYPE_E7(L6470) - #define DISABLE_STEPPER_E7() do{ stepperE7.free(); }while(0) - #endif - #endif -#endif diff --git a/Marlin/src/module/stepper/indirection.cpp b/Marlin/src/module/stepper/indirection.cpp index e44496d022..427fd71cbe 100644 --- a/Marlin/src/module/stepper/indirection.cpp +++ b/Marlin/src/module/stepper/indirection.cpp @@ -38,7 +38,6 @@ void restore_stepper_drivers() { void reset_stepper_drivers() { TERN_(HAS_TMC26X, tmc26x_init_to_defaults()); - TERN_(HAS_L64XX, L64xxManager.init_to_defaults()); TERN_(HAS_TRINAMIC_CONFIG, reset_trinamic_drivers()); } diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index 687a0f2896..3f21530af7 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -32,10 +32,6 @@ #include "../../inc/MarlinConfig.h" -#if HAS_L64XX - #include "L64xx.h" -#endif - #if HAS_TMC26X #include "TMC26X.h" #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index ee4f43ccef..8457cdc4ff 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -629,8 +629,6 @@ #include "stm32f4/pins_RUMBA32_BTT.h" // STM32F4 env:rumba32 #elif MB(BLACK_STM32F407VE) #include "stm32f4/pins_BLACK_STM32F407VE.h" // STM32F4 env:STM32F407VE_black -#elif MB(STEVAL_3DP001V1) - #include "stm32f4/pins_STEVAL_3DP001V1.h" // STM32F4 env:STM32F401VE_STEVAL #elif MB(BTT_SKR_PRO_V1_1) #include "stm32f4/pins_BTT_SKR_PRO_V1_1.h" // STM32F4 env:BIGTREE_SKR_PRO env:BIGTREE_SKR_PRO_usb_flash_drive #elif MB(BTT_SKR_PRO_V1_2) @@ -786,6 +784,7 @@ #define BOARD_STM32F103R 99906 #define BOARD_ESP32 99907 #define BOARD_STEVAL 99908 + #define BOARD_STEVAL_3DP001V1 99908 #define BOARD_BIGTREE_SKR_V1_1 99909 #define BOARD_BIGTREE_SKR_V1_3 99910 #define BOARD_BIGTREE_SKR_V1_4 99911 @@ -841,7 +840,7 @@ #elif MOTHERBOARD == BOARD_ESP32 #error "BOARD_ESP32 has been renamed BOARD_ESPRESSIF_ESP32. Please update your configuration." #elif MB(STEVAL) - #error "BOARD_STEVAL has been renamed BOARD_STEVAL_3DP001V1. Please update your configuration." + #error "BOARD_STEVAL_3DP001V1 (BOARD_STEVAL) is no longer supported in Marlin." #elif MB(RUMBA32) #error "BOARD_RUMBA32 is now BOARD_RUMBA32_MKS or BOARD_RUMBA32_V1_0. Please update your configuration." #elif MB(RUMBA32_AUS3D) @@ -873,7 +872,7 @@ #undef BOARD_STM32F103R #undef BOARD_ESP32 #undef BOARD_STEVAL - #undef BOARD_BIGTREE_SKR_MINI_E3 + #undef BOARD_STEVAL_3DP001V1 #undef BOARD_BIGTREE_SKR_V1_1 #undef BOARD_BIGTREE_SKR_V1_3 #undef BOARD_BIGTREE_SKR_V1_4 @@ -881,6 +880,7 @@ #undef BOARD_BIGTREE_BTT002_V1_0 #undef BOARD_BIGTREE_SKR_PRO_V1_1 #undef BOARD_BIGTREE_SKR_MINI_V1_1 + #undef BOARD_BIGTREE_SKR_MINI_E3 #undef BOARD_BIGTREE_SKR_E3_DIP #undef BOARD_RUMBA32 #undef BOARD_RUMBA32_AUS3D diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h index 8969997e9a..034e4adf1b 100644 --- a/Marlin/src/pins/pinsDebug_list.h +++ b/Marlin/src/pins/pinsDebug_list.h @@ -1826,21 +1826,6 @@ #if PIN_EXISTS(K_SERIAL_RX) REPORT_NAME_DIGITAL(__LINE__, K_SERIAL_RX_PIN) #endif -#if PIN_EXISTS(L6470_CHAIN_SCK) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_SCK_PIN) -#endif -#if PIN_EXISTS(L6470_CHAIN_MISO) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_MISO_PIN) -#endif -#if PIN_EXISTS(L6470_CHAIN_MOSI) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_MOSI_PIN) -#endif -#if PIN_EXISTS(L6470_CHAIN_SS) - REPORT_NAME_DIGITAL(__LINE__, L6470_CHAIN_SS_PIN) -#endif -#if PIN_EXISTS(L6470_RESET_CHAIN) - REPORT_NAME_DIGITAL(__LINE__, L6470_RESET_CHAIN_PIN) -#endif #if PIN_EXISTS(FET_SAFETY) REPORT_NAME_DIGITAL(__LINE__, FET_SAFETY_PIN) #endif diff --git a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h deleted file mode 100644 index 0b527a6fdb..0000000000 --- a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h +++ /dev/null @@ -1,325 +0,0 @@ -/** - * 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 . - * - */ -#pragma once - -// Source: https://github.com/stm32duino/Arduino_Core_STM32/blob/master/variants/ST3DP001_EVAL/variant.cpp - -/** - * HOW TO COMPILE - * - * PlatformIO - Use the STM32F401VE_STEVAL environment (or the "Auto Build Marlin" extension). - * - * Arduino - Tested with 1.8.10 - * Install library per https://github.com/stm32duino/Arduino_Core_STM32 - * Make the following selections under the TOOL menu in the Arduino IDE - * Board: "3D printer boards" - * Board part number: "STEVAL-3DP001V1" - * U(S)ART support: "Enabled (generic "Serial")" - * USB support (if available): "CDC (no generic "Serial")" - * Optimize: "Smallest (-Os default)" - * C Runtime Library: "newlib Nano (default)" - */ - -#include "env_validate.h" - -#ifndef MACHINE_NAME - #define MACHINE_NAME "STEVAL-3DP001V1" -#endif - -// -// Limit Switches -// -#define X_MIN_PIN PD8 // X_STOP -#define Y_MIN_PIN PD9 // Y_STOP -#define Z_MIN_PIN PD10 // Z_STOP - -#define X_MAX_PIN PD0 // W_STOP -#define Y_MAX_PIN PA8 // V_STOP -#define Z_MAX_PIN PD11 // U_STOP - -// -// Z Probe (when not Z_MIN_PIN) -// -//#ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN PA4 // SPI1_CS -//#endif - -// -// Filament runout -// -//#define FIL_RUNOUT_PIN PA3 // BED_THERMISTOR_3 - -// -// Steppers -// - -#define X_STEP_PIN PE14 // X_PWM -#define X_DIR_PIN PE15 // X_DIR -#define X_ENABLE_PIN PE13 // X_RESET -#define X_CS_PIN PA4 // SPI1_CS - -#define Y_STEP_PIN PB10 // Y_PWM -#define Y_DIR_PIN PE9 // Y_DIR -#define Y_ENABLE_PIN PE10 // Y_RESET -#define Y_CS_PIN PA4 // SPI1_CS - -#define Z_STEP_PIN PC6 // Z_PWM -#define Z_DIR_PIN PC0 // Z_DIR -#define Z_ENABLE_PIN PC15 // Z_RESET -#define Z_CS_PIN PA4 // SPI1_CS - -#define E0_STEP_PIN PD12 // E1_PW -#define E0_DIR_PIN PC13 // E1_DIR -#define E0_ENABLE_PIN PC14 // E1_RESET -#define E0_CS_PIN PA4 // SPI1_CS - -#define E1_STEP_PIN PE5 // E2_PWM -#define E1_DIR_PIN PE6 // E2_DIR -#define E1_ENABLE_PIN PE4 // E2_RESET -#define E1_CS_PIN PA4 // SPI1_CS - -#define E2_STEP_PIN PB8 // E3_PWM -#define E2_DIR_PIN PE2 // E3_DIR -#define E2_ENABLE_PIN PE3 // E3_RESET -#define E2_CS_PIN PA4 // SPI1_CS - -// needed to pass a sanity check -#define X2_CS_PIN PA4 // SPI1_CS -#define Y2_CS_PIN PA4 // SPI1_CS -#define Z2_CS_PIN PA4 // SPI1_CS -#define Z3_CS_PIN PA4 // SPI1_CS -#define E3_CS_PIN PA4 // SPI1_CS -#define E4_CS_PIN PA4 // SPI1_CS -#define E5_CS_PIN PA4 // SPI1_CS - -#if HAS_L64XX - #define L6470_CHAIN_SCK_PIN PA5 // SPI1_SCK - #define L6470_CHAIN_MISO_PIN PA6 // SPI1_MISO - #define L6470_CHAIN_MOSI_PIN PA7 // SPI1_MOSI - #define L6470_CHAIN_SS_PIN PA4 // SPI1_CS - - //#define SD_SCK_PIN L6470_CHAIN_SCK_PIN - //#define SD_MISO_PIN L6470_CHAIN_MISO_PIN - //#define SD_MOSI_PIN L6470_CHAIN_MOSI_PIN -#else - //#define SD_SCK_PIN PB13 // SPI2_SCK - //#define SD_MISO_PIN PB14 // SPI2_MISO - //#define SD_MOSI_PIN PB15 // SPI2_MOSI -#endif - -/** - * Macro to reset/enable L6474 stepper drivers - * - * IMPORTANT - To disable (bypass) L6474s, install the corresponding - * resistors (R11 - R17) and change the "V" to "0" for the - * corresponding pins here: - */ -#define ENABLE_RESET_L64XX_CHIPS(V) do{ OUT_WRITE(X_ENABLE_PIN, V); \ - OUT_WRITE(Y_ENABLE_PIN, V); \ - OUT_WRITE(Z_ENABLE_PIN, V); \ - OUT_WRITE(E0_ENABLE_PIN,V); \ - OUT_WRITE(E1_ENABLE_PIN,V); \ - OUT_WRITE(E2_ENABLE_PIN,V); \ - }while(0) - -// -// Temperature Sensors -// -#define TEMP_0_PIN PA0 // Analog Input 3 -#define TEMP_1_PIN PA1 // Analog Input 4 -#define TEMP_2_PIN PA2 // Analog Input 5 -#define TEMP_BED_PIN PC2 // Analog Input 0 -#define TEMP_BED_1_PIN PC3 // Analog Input 1 -#define TEMP_BED_2_PIN PA3 // Analog Input 2 - -// -// Heaters / Fans -// -#define HEATER_0_PIN PC7 // E1_HEAT_PWM -#define HEATER_1_PIN PB0 // E2_HEAT_PWM -#define HEATER_2_PIN PB1 // E3_HEAT_PWM -#define HEATER_BED_PIN PD14 // BED_HEAT_1 FET -#define HEATER_BED_1_PIN PD13 // BED_HEAT_2 FET -#define HEATER_BED_2_PIN PD15 // BED_HEAT_3 FET - -#define FAN_PIN PC4 // E1_FAN PWM pin, Part cooling fan FET -#define FAN1_PIN PC5 // E2_FAN PWM pin, Extruder fan FET -#define FAN2_PIN PE8 // E3_FAN PWM pin, Controller fan FET - -#ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN PC5 // FAN1_PIN -#endif - -// -// Misc functions -// -#define LED_PIN -1 // PE1 Green LED Heartbeat -#define PS_ON_PIN -1 -#define KILL_PIN -1 -#define POWER_LOSS_PIN -1 // PWR_LOSS / nAC_FAULT - -// -// LCD / Controller -// -//#define SD_DETECT_PIN PA15 // SD_CARD_DETECT -//#define BEEPER_PIN PC9 // SDIO_D1 -//#define LCD_PINS_RS PE9 // Y_DIR -//#define LCD_PINS_ENABLE PE8 // E3_FAN -//#define LCD_PINS_D4 PB12 // SPI2_CS -//#define LCD_PINS_D5 PB13 // SPI2_SCK -//#define LCD_PINS_D6 PB14 // SPI2_MISO -//#define LCD_PINS_D7 PB15 // SPI2_MOSI -//#define BTN_EN1 PC4 // E1_FAN -//#define BTN_EN2 PC5 // E2_FAN -//#define BTN_ENC PC3 // BED_THERMISTOR_2 - -// -// Extension pins -// -//#define EXT0_PIN PB0 // E2_HEAT -//#define EXT1_PIN PB1 // E3_HEAT -//#define EXT2_PIN PB2 // not used (tied to ground) -//#define EXT3_PIN PD8 // X_STOP -//#define EXT4_PIN PD9 // Y_STOP -//#define EXT5_PIN PD10 // Z_STOP -//#define EXT6_PIN PD11 // U_STOP -//#define EXT7_PIN PD12 // E1_PWM -//#define EXT8_PIN PB10 // Y_PWM - -// WIFI -// PD3 CTS -// PD4 RTS -// PD5 TX -// PD6 RX -// PB5 WIFI_WAKEUP -// PE11 WIFI_RESET -// PE12 WIFI_BOOT - -// I2C USER -// PB7 SDA -// PB6 SCL - -// JTAG -// PA13 JTAG_TMS/SWDIO -// PA14 JTAG_TCK/SWCLK -// PB3 JTAG_TDO/SWO - -// -// Onboard SD support -// -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#if SD_CONNECTION_IS(ONBOARD) - - #define SDIO_SUPPORT // Use SDIO for onboard SD - #if DISABLED(SDIO_SUPPORT) - #define SOFTWARE_SPI // Use soft SPI for onboard SD - #define SDSS PC11 - #define SD_SCK_PIN PC12 - #define SD_MISO_PIN PC8 - #define SD_MOSI_PIN PD2 - #endif - - //#define SD_DETECT_PIN PA15 - -#endif - -#ifndef SDSS - #define SDSS PA4 // SPI1_CS -#endif - -// OTG -// PA11 OTG_DM -// PA12 OTG_DP - -// USER_PINS -// PD7 USER3 -// PB9 USER1 -// PE0 USER2 -// PB4 USER4 - -// USERKET -// PE7 USER_BUTTON - -// PA9 TX -// PA10 RX - -// IR/PROBE -// PD1 IR_OUT -// PC1 IR_ON - -/** - * Logical pin vs. port/pin cross reference - * - * PA0 E1_THERMISTOR PD0 W_STOP - * PA1 E2_THERMISTOR PD1 IR_OUT - * PA2 E3_THERMISTOR PD2 SDIO_CMD - * PA3 BED_THERMISTOR_3 PD3 CTS - * PA4 SPI1_CS PD4 RTS - * PA5 SPI1_SCK PD5 TX - * PA6 SPI1_MISO PD6 RX - * PA7 SPI1_MOSI PD7 USER3 - * PA8 V_STOP PD8 X_STOP - * PA9 TX PD9 Y_STOP - * PA10 RX PD10 Z_STOP - * PA11 OTG_DM PD11 U_STOP - * PA12 OTG_DP PD12 E1_PWM - * PA13 JTAG_TMS/SWDIO PD13 BED_HEAT_2 - * PA14 JTAG_TCK/SWCLK PD14 BED_HEAT_1 - * PA15 SD_CARD_DETECT PD15 BED_HEAT_3 - * - * PB0 E2_HEAT_PWM PE0 USER2 - * PB1 E3_HEAT_PWM PE1 STATUS_LED - * PB2 --- PE2 E3_DIR - * PB3 JTAG_TDO/SWO PE3 E3_RESET - * PB4 USER4 PE4 E2_RESET - * PB5 WIFI_WAKEUP PE5 E2_PWM - * PB6 SCL PE6 E2_DIR - * PB7 SDA PE7 USER_BUTTON - * PB8 E3_PWM PE8 E3_FAN - * PB9 USER1 PE9 Y_DIR - * PB10 Y_PWM PE10 Y_RESET - * PB11 --- PE11 WIFI_RESET - * PB12 SPI2_CS PE12 WIFI_BOOT - * PB13 SPI2_SCK PE13 X_RESET - * PB14 SPI2_MISO PE14 X_PWM - * PB15 SPI2_MOSI PE15 X_DIR - * - * PC0 Z_DIR - * PC1 IR_ON - * PC2 BED_THERMISTOR_1 - * PC3 BED_THERMISTOR_2 - * PC4 E1_FAN - * PC5 E2_FAN - * PC6 Z_PWM - * PC7 E1_HEAT_PWM - * PC8 SDIO_D0 - * PC9 SDIO_D1 - * PC10 SDIO_D2 - * PC11 SDIO_D3 - * PC12 SDIO_CK - * PC13 E1_DIR - * PC14 E1_RESET - * PC15 Z_RESET - */ diff --git a/buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json b/buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json deleted file mode 100644 index e260950f25..0000000000 --- a/buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "build": { - "core": "stm32", - "cpu": "cortex-m4", - "extra_flags": "-DSTM32F401xx -DARDUINO_STEVAL", - "f_cpu": "84000000L", - "hwids": [ - [ - "0x1EAF", - "0x0003" - ], - [ - "0x0483", - "0x3748" - ] - ], - "mcu": "stm32f401vet6", - "variant": "MARLIN_STEVAL_F401VE" - }, - "debug": { - "jlink_device": "STM32F401VE", - "openocd_target": "stm32f4x", - "svd_path": "STM32F40x.svd", - "tools": { - "stlink": { - "server": { - "arguments": [ - "-f", - "scripts/interface/stlink.cfg", - "-c", - "transport select hla_swd", - "-f", - "scripts/target/stm32f4x.cfg", - "-c", - "reset_config none" - ], - "executable": "bin/openocd", - "package": "tool-openocd" - } - } - } - }, - "frameworks": [ - "arduino", - "stm32cube" - ], - "name": "STM32F401VE (96k RAM. 512k Flash)", - "upload": { - "disable_flushing": false, - "maximum_ram_size": 98304, - "maximum_size": 514288, - "protocol": "stlink", - "protocols": [ - "stlink", - "dfu", - "jlink" - ], - "require_upload_port": true, - "use_1200bps_touch": false, - "wait_for_upload_port": false - }, - "url": "https://www.st.com/en/evaluation-tools/steval-3dp001v1.html", - "vendor": "Generic" -} diff --git a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PeripheralPins.c deleted file mode 100644 index d3d754b689..0000000000 --- a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PeripheralPins.c +++ /dev/null @@ -1,260 +0,0 @@ - -/* - ******************************************************************************* - * Copyright (c) 2019, STMicroelectronics - * All rights reserved. - * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ******************************************************************************* - * Automatically generated from STM32F401V(D-E)Tx.xml - */ -#include "Arduino.h" -#include "PeripheralPins.h" - -/* ===== - * Note: Commented lines are alternative possibilities which are not used per default. - * If you change them, you will have to know what you do - * ===== - */ - -//*** ADC *** - -#ifdef HAL_ADC_MODULE_ENABLED -WEAK const PinMap PinMap_ADC[] = { - {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 - {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 - {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 - {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 - //{PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 - //{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 - //{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 - //{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 - //{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 - //{PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 - //{PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 - //{PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 - {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 - {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 - //{PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 - //{PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 - {NC, NP, 0} -}; -#endif - -//*** No DAC *** - -//*** I2C *** - -#ifdef HAL_I2C_MODULE_ENABLED -WEAK const PinMap PinMap_I2C_SDA[] = { - //{PB_3, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C2)}, - //{PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C3)}, - {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - //{PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - //{PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, - {NC, NP, 0} -}; - -WEAK const PinMap PinMap_I2C_SCL[] = { - //{PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, - {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)}, - {NC, NP, 0} -}; -#endif - -//*** PWM *** - -#ifdef HAL_TIM_MODULE_ENABLED -WEAK 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_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 - //{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - //{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 - //{PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - //{PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - //{PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - //{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N - //{PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - //{PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 - //{PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 - //{PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 - //{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 - //{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - //{PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N - {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - //{PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N - {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - //{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - //{PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - //{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - //{PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 - //{PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - //{PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - //{PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - //{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_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_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N - {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_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_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 - {PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - {PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 - {PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - //{PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - //{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_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_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 - {NC, NP, 0} -}; -#endif - -//*** SERIAL *** - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_TX[] = { - //{PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - //{PA_11, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, - //{PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - //{PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, - {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {NC, NP, 0} -}; - -WEAK const PinMap PinMap_UART_RX[] = { - //{PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - //{PA_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, - //{PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - //{PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)}, - {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {NC, NP, 0} -}; - -WEAK const PinMap PinMap_UART_RTS[] = { - //{PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - //{PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {NC, NP, 0} -}; - -WEAK const PinMap PinMap_UART_CTS[] = { - //{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - //{PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {NC, NP, 0} -}; -#endif - -//*** SPI *** - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_MOSI[] = { - {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - //{PC_3, 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)}, - //{PD_6, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PE_6, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - //{PE_14, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - {NC, NP, 0} -}; - -WEAK const PinMap PinMap_SPI_MISO[] = { - {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - //{PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - //{PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - //{PE_5, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - //{PE_13, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - {NC, NP, 0} -}; - -WEAK const PinMap PinMap_SPI_SCLK[] = { - {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - //{PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - //{PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - //{PD_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - //{PE_2, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - //{PE_12, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - {NC, NP, 0} -}; - -WEAK const PinMap PinMap_SPI_SSEL[] = { - {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - //{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - //{PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - //{PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - //{PE_4, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - //{PE_11, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, - {NC, NP, 0} -}; -#endif - -//*** No CAN *** - -//*** No ETHERNET *** - -//*** No QUADSPI *** - -//*** USB *** - -#ifdef HAL_PCD_MODULE_ENABLED -WEAK const PinMap PinMap_USB_OTG_FS[] = { - //{PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF - //{PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS - //{PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID - {PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM - {PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP - {NC, NP, 0} -}; -#endif - -//*** No USB_OTG_HS *** -//*** SD *** - -#ifdef HAL_SD_MODULE_ENABLED -WEAK const PinMap PinMap_SD[] = { - //{PB_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D4 - //{PB_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D5 - //{PC_6, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D6 - //{PC_7, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D7 - {PC_8, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D0 - {PC_9, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D1 - {PC_10, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D2 - {PC_11, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDIO)}, // SDIO_D3 - {PC_12, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CK - {PD_2, SDIO, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDIO)}, // SDIO_CMD - {NC, NP, 0} -}; -#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PinNamesVar.h deleted file mode 100644 index 6a1eb9b887..0000000000 --- a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/PinNamesVar.h +++ /dev/null @@ -1,33 +0,0 @@ -/* SYS_WKUP */ -#ifdef PWR_WAKEUP_PIN1 - SYS_WKUP1 = PA_0, -#endif -#ifdef PWR_WAKEUP_PIN2 - SYS_WKUP2 = NC, -#endif -#ifdef PWR_WAKEUP_PIN3 - SYS_WKUP3 = NC, -#endif -#ifdef PWR_WAKEUP_PIN4 - SYS_WKUP4 = NC, -#endif -#ifdef PWR_WAKEUP_PIN5 - SYS_WKUP5 = NC, -#endif -#ifdef PWR_WAKEUP_PIN6 - SYS_WKUP6 = NC, -#endif -#ifdef PWR_WAKEUP_PIN7 - SYS_WKUP7 = NC, -#endif -#ifdef PWR_WAKEUP_PIN8 - SYS_WKUP8 = NC, -#endif -/* USB */ -#ifdef USBCON - USB_OTG_FS_SOF = PA_8, - USB_OTG_FS_VBUS = PA_9, - USB_OTG_FS_ID = PA_10, - USB_OTG_FS_DM = PA_11, - USB_OTG_FS_DP = PA_12, -#endif diff --git a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h deleted file mode 100644 index 7d013d2b27..0000000000 --- a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/hal_conf_custom.h +++ /dev/null @@ -1,495 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf.h - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_CUSTOM -#define __STM32F4xx_HAL_CONF_CUSTOM - -#ifdef __cplusplus -extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ - /** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -#define HAL_ADC_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_IWDG_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -#define HAL_SD_MODULE_ENABLED -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -//#define HAL_PCD_MODULE_ENABLED // Automatically added if any type of USB is enabled, as in Arduino IDE. (STM32 v3.10700.191028) - -//#define HAL_CAN_MODULE_ENABLED -//#define HAL_CAN_LEGACY_MODULE_ENABLED -//#define HAL_CEC_MODULE_ENABLED -//#define HAL_CRYP_MODULE_ENABLED -//#define HAL_DAC_MODULE_ENABLED -//#define HAL_DCMI_MODULE_ENABLED -//#define HAL_DMA2D_MODULE_ENABLED -//#define HAL_ETH_MODULE_ENABLED -//#define HAL_NAND_MODULE_ENABLED -//#define HAL_NOR_MODULE_ENABLED -//#define HAL_PCCARD_MODULE_ENABLED -//#define HAL_SRAM_MODULE_ENABLED -//#define HAL_SDRAM_MODULE_ENABLED -//#define HAL_HASH_MODULE_ENABLED -//#define HAL_SMBUS_MODULE_ENABLED -//#define HAL_I2S_MODULE_ENABLED -//#define HAL_LTDC_MODULE_ENABLED -//#define HAL_DSI_MODULE_ENABLED -//#define HAL_QSPI_MODULE_ENABLED -//#define HAL_RNG_MODULE_ENABLED -//#define HAL_SAI_MODULE_ENABLED -//#define HAL_UART_MODULE_ENABLED // by default -//#define HAL_USART_MODULE_ENABLED -//#define HAL_IRDA_MODULE_ENABLED -//#define HAL_SMARTCARD_MODULE_ENABLED -//#define HAL_WWDG_MODULE_ENABLED -//#define HAL_HCD_MODULE_ENABLED -//#define HAL_FMPI2C_MODULE_ENABLED -//#define HAL_SPDIFRX_MODULE_ENABLED -//#define HAL_DFSDM_MODULE_ENABLED -//#define HAL_LPTIM_MODULE_ENABLED -//#define HAL_MMC_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#ifndef HSE_VALUE -#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#ifndef HSE_STARTUP_TIMEOUT -#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#ifndef HSI_VALUE -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#ifndef LSI_VALUE -#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz -The real value may vary depending on the variations -in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#ifndef LSE_VALUE -#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#ifndef LSE_STARTUP_TIMEOUT -#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#ifndef EXTERNAL_CLOCK_VALUE -#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#if !defined (VDD_VALUE) -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#endif -#if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ -#endif -#if !defined (USE_RTOS) -#define USE_RTOS 0U -#endif -#if !defined (PREFETCH_ENABLE) -#define PREFETCH_ENABLE 1U -#endif -#if !defined (INSTRUCTION_CACHE_ENABLE) -#define INSTRUCTION_CACHE_ENABLE 1U -#endif -#if !defined (DATA_CACHE_ENABLE) -#define DATA_CACHE_ENABLE 1U -#endif - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY 0x000000FFU -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY 0x00000FFFU - -#define PHY_READ_TO 0x0000FFFFU -#define PHY_WRITE_TO 0x0000FFFFU - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ -#ifndef USE_SPI_CRC -#define USE_SPI_CRC 0U -#endif - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED -#include "stm32f4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED -#include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED -#include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED -#include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED -#include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED -#include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED -#include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED -#include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED -#include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED -#include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED -#include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED -#include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED -#include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ -void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_CUSTOM_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/ldscript.ld deleted file mode 100644 index c5788dbebe..0000000000 --- a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/ldscript.ld +++ /dev/null @@ -1,187 +0,0 @@ -/* -***************************************************************************** -** -** File : ldscript.ld -** -** Abstract : Linker script for STM32F401RETx Device with -** 512KByte FLASH, 96KByte RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2014 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20018000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(4); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(4); - } >RAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.cpp b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.cpp deleted file mode 100644 index 4ecbff0ecc..0000000000 --- a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2017, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - */ - -#include "pins_arduino.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef ARDUINO_STEVAL -// Pin number -// This array allows to wrap Arduino pin number(Dx or x) -// to STM32 PinName (PX_n) -const PinName digitalPin[] = { - PA_9, // TX - PA_10, // RX - - // WIFI - PD_3, // CTS - PD_4, // RTS - PD_5, // TX - PD_6, // RX - PB_5, // WIFI_WAKEUP - PE_11, // WIFI_RESET - PE_12, // WIFI_BOOT - - // STATUS_LED - PE_1, //STATUS_LED - - // SPI USER - PB_12, // SPI_CS - PB_15, // SPI_MOSI - PB_14, // SPI_MISO - PB_13, // SPI_SCK - - // I2C USER - PB_7, // SDA - PB_6, // SCL - - // SPI - PA_4, // SPI_CS - PA_5, // SPI_SCK - PA_6, // SPI_MISO - PA_7, // SPI_MOSI - - // JTAG - PA_13, // JTAG_TMS/SWDIO - PA_14, // JTAG_TCK/SWCLK - PB_3, // JTAG_TDO/SWO - - // SDCARD - PC_8, // SDIO_D0 - PC_9, // SDIO_D1 - PA_15, // SD_CARD_DETECT - PC_10, // SDIO_D2 - PC_11, // SDIO_D3 - PC_12, // SDIO_CK - PD_2, // SDIO_CMD - - // OTG - PA_11, // OTG_DM - PA_12, // OTG_DP - - // IR/PROBE - PD_1, // IR_OUT - PC_1, // IR_ON - - // USER_PINS - PD_7, // USER3 - PB_9, // USER1 - PE_0, // USER2 - PB_4, // USER4 - - // USERKET - PE_7, // USER_BUTTON - - // ENDSTOPS - PD_8, // X_STOP - PD_9, // Y_STOP - PD_10, // Z_STOP - PD_11, // U_STOP - PA_8, // V_STOP - PD_0, // W_STOP - - // HEATERS - PD_13, // BED_HEAT_2 - PD_14, // BED_HEAT_1 - PD_15, // BED_HEAT_3 - PC_7, // E1_HEAT_PWM - PB_0, // E2_HEAT_PWM - PB_1, // E3_HEAT_PWM - - // THERMISTOR - PC_2, // BED_THERMISTOR_1 - PC_3, // BED_THERMISTOR_2 - PA_3, // BED_THERMISTOR_3 - PA_0, // E1_THERMISTOR - PA_1, // E2_THERMISTOR - PA_2, // E3_THERMISTOR - - // FANS - PC_4, // E1_FAN - PC_5, // E2_FAN - PE_8, // E3_FAN - - // X_MOTOR - PE_13, // X_RESET - PE_14, // X_PWM - PE_15, // X_DIR - - // Y_MOTOR - PE_10, // Y_RESET - PB_10, // Y_PWM - PE_9, // Y_DIR - - // Z_MOTOR - PC_15, // Z_RESET - PC_6, // Z_PWM - PC_0, // Z_DIR - - // E1_MOTOR - PC_14, // E1_RESET - PC_13, // E1_DIR - PD_12, // E1_PWM - - // E2_MOTOR - PE_4, // E2_RESET - PE_5, // E2_PWM - PE_6, // E2_DIR - - // E3_MOTOR - PE_3, // E3_RESET - PE_2, // E3_DIR - PB_8 // E3_PWM -}; -#endif - -#ifdef __cplusplus -} -#endif - -// ---------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @brief System Clock Configuration - * The system Clock is configured as follow : - * System Clock source = PLL (HSI) - * SYSCLK(Hz) = 84000000 - * HCLK(Hz) = 84000000 - * AHB Prescaler = 1 - * APB1 Prescaler = 2 - * APB2 Prescaler = 1 - * HSI Frequency(Hz) = 16000000 - * PLL_M = 16 - * PLL_N = 336 - * PLL_P = 4 - * PLL_Q = 7 - * VDD(V) = 3.3 - * Main regulator output voltage = Scale2 mode - * Flash Latency(WS) = 2 - * @param None - * @retval None - */ -WEAK void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {}; - - /* Configure the main internal regulator output voltage */ - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Initializes the CPU, AHB and APB busses clocks */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 15; - RCC_OscInitStruct.PLL.PLLN = 144; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 5; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - Error_Handler(); - } - /* Initializes the CPU, AHB and APB busses clocks */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { - Error_Handler(); - } -} - -#ifdef __cplusplus -} -#endif - - -// PA_0 54 // E1_THERMISTOR -// PA_1 55 // E2_THERMISTOR -// PA_2 56 // E3_THERMISTOR -// PA_3 53 // BED_THERMISTOR_3 -// PA_4 16 // SPI_CS -// PA_5 17 // SPI_SCK -// PA_6 18 // SPI_MISO -// PA_7 19 // SPI_MOSI -// PA_8 43 // V_STOP -// PA_9 0 //TX -// PA_10 1 //RX -// PA_11 30 //OTG_DM -// PA_12 31 //OTG_DP -// PA_13 20 // JTAG_TMS/SWDIO -// PA_14 21 // JTAG_TCK/SWCLK -// PA_15 25 // SD_CARD_DETECT -// PB_0 49 // E2_HEAT_PWM -// PB_1 50 // E3_HEAT_PWM -// PB_3 22 // JTAG_TDO/SWO -// PB_4 37 // USER4 -// PB_5 6 // WIFI_WAKEUP -// PB_6 15 // SCL -// PB_7 14 // SDA -// PB_8 77 // E3_PWM -// PB_9 35 // USER1 -// PB_10 64 // Y_PWM -// PB_12 10 // SPI_CS -// PB_13 13 // SPI_SCK -// PB_14 12 // SPI_MISO -// PB_15 11 // SPI_MOSI -// PC_0 68 // Z_DIR -// PC_1 33 //IR_ON -// PC_2 51 // BED_THERMISTOR_1 -// PC_3 52 // BED_THERMISTOR_2 -// PC_4 57 // E1_FAN -// PC_5 58 // E2_FAN -// PC_6 67 // Z_PWM -// PC_7 48 // E1_HEAT_PWM -// PC_8 23 // SDIO_D0 -// PC_9 24 // SDIO_D1 -// PC_10 26 // SDIO_D2 -// PC_11 27 // SDIO_D3 -// PC_12 28 // SDIO_CK -// PC_13 70 // E1_DIR -// PC_14 69 // E1_RESET -// PC_15 66 // Z_RESET -// PD_0 44 // W_STOP -// PD_1 32 //IR_OUT -// PD_2 29 // SDIO_CMD -// PD_3 2 // CTS -// PD_4 3 // RTS -// PD_5 4 // TX -// PD_6 5 // RX -// PD_7 34 // USER3 -// PD_8 39 // X_STOP -// PD_9 40 // Y_STOP -// PD_10 41 // Z_STOP -// PD_11 42 // U_STOP -// PD_12 71 // E1_PWM -// PD_13 45 // BED_HEAT_2 -// PD_14 46 // BED_HEAT_1 -// PD_15 47 // BED_HEAT_3 -// PE_0 36 // USER2 -// PE_1 9 // STATUS_LED -// PE_2 76 // E3_DIR -// PE_3 75 // E3_RESET -// PE_4 72 // E2_RESET -// PE_5 73 // E2_PWM -// PE_6 74 // E2_DIR -// PE_7 38 // USER_BUTTON -// PE_8 59 // E3_FAN -// PE_9 65 // Y_DIR -// PE_10 63 // Y_RESET -// PE_11 7 // WIFI_RESET -// PE_12 8 // WIFI_BOOT -// PE_13 60 // X_RESET -// PE_14 61 // X_PWM -// PE_15 62 // X_DIR diff --git a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.h deleted file mode 100644 index df7295ab17..0000000000 --- a/buildroot/share/PlatformIO/variants/MARLIN_STEVAL_F401VE/variant.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2017, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - */ - -#ifndef _VARIANT_ARDUINO_STM32_ -#define _VARIANT_ARDUINO_STM32_ -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/*---------------------------------------------------------------------------- - * Pins - *----------------------------------------------------------------------------*/ -#ifdef ARDUINO_STEVAL - - -/*---------------------------------------------------------------------------- - * Pins - *----------------------------------------------------------------------------*/ -// USART1_MAIN -#define PA9 0 //TX -#define PA10 1 //RX - -// WIFI (USART2) -#define PD3 2 // CTS -#define PD4 3 // RTS -#define PD5 4 // TX -#define PD6 5 // RX -#define PB5 6 // WIFI_WAKEUP -#define PE11 7 // WIFI_RESET -#define PE12 8 // WIFI_BOOT - -// STATUS_LED -#define PE1 9 // STATUS_LED - -// SPI USER -#define PB12 10 // SPI_CS -#define PB15 11 // SPI_MOSI -#define PB14 12 // SPI_MISO -#define PB13 13 // SPI_SCK - -// I2C USER -#define PB7 14 // SDA -#define PB6 15 // SCL - -// SPI -#define PA4 16 // SPI_CS -#define PA5 17 // SPI_SCK -#define PA6 18 // SPI_MISO -#define PA7 19 // SPI_MOSI - -// JTAG -#define PA13 20 // JTAG_TMS/SWDIO -#define PA14 21 // JTAG_TCK/SWCLK -#define PB3 22 // JTAG_TDO/SWO - -// SDCARD -#define PC8 23 // SDIO_D0 -#define PC9 24 // SDIO_D1 -#define PA15 25 // SD_CARD_DETECT -#define PC10 26 // SDIO_D2 -#define PC11 27 // SDIO_D3 -#define PC12 28 // SDIO_CK -#define PD2 29 // SDIO_CMD - -// OTG -#define PA11 30 //OTG_DM -#define PA12 31 //OTG_DP - -// IR/PROBE -#define PD1 32 //IR_OUT -#define PC1 33 //IR_ON - -// USER_PINS -#define PD7 34 // USER3 -#define PB9 35 // USER1 -#define PE0 36 // USER2 -#define PB4 37 // USER4 - -// USERKET -#define PE7 38 // USER_BUTTON - -// ENDSTOPS -#define PD8 39 // X_STOP -#define PD9 40 // Y_STOP -#define PD10 41 // Z_STOP -#define PD11 42 // U_STOP -#define PA8 43 // V_STOP -#define PD0 44 // W_STOP - -// HEATERS -#define PD13 45 // BED_HEAT_2 -#define PD14 46 // BED_HEAT_1 -#define PD15 47 // BED_HEAT_3 -#define PC7 48 // E1_HEAT_PWM -#define PB0 49 // E2_HEAT_PWM -#define PB1 50 // E3_HEAT_PWM - -// THERMISTOR -#define PC2 51 // BED_THERMISTOR_1 -#define PC3 52 // BED_THERMISTOR_2 -#define PA3 53 // BED_THERMISTOR_3 -#define PA0 54 // E1_THERMISTOR -#define PA1 55 // E2_THERMISTOR -#define PA2 56 // E3_THERMISTOR - -// FANS -#define PC4 57 // E1_FAN -#define PC5 58 // E2_FAN -#define PE8 59 // E3_FAN - -// X_MOTOR -#define PE13 60 // X_RESET -#define PE14 61 // X_PWM -#define PE15 62 // X_DIR - -// Y_MOTOR -#define PE10 63 // Y_RESET -#define PB10 64 // Y_PWM -#define PE9 65 // Y_DIR - -// Z_MOTOR -#define PC15 66 // Z_RESET -#define PC6 67 // Z_PWM -#define PC0 68 // Z_DIR - -// E1_MOTOR -#define PC14 69 // E1_RESET -#define PC13 70 // E1_DIR -#define PD12 71 // E1_PWM - -// E2_MOTOR -#define PE4 72 // E2_RESET -#define PE5 73 // E2_PWM -#define PE6 74 // E2_DIR - -// E3_MOTOR -#define PE3 75 // E3_RESET -#define PE2 76 // E3_DIR -#define PB8 77 // E3_PWM - -// This must be a literal -#define NUM_DIGITAL_PINS 78 -// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS -#define NUM_ANALOG_INPUTS 6 -#define NUM_ANALOG_FIRST 51 - -// On-board LED pin number -#define LED_BUILTIN PE1 -#define LED_GREEN LED_BUILTIN - -// On-board user button -#define USER_BTN PE7 - -// UART Definitions -#define SERIAL_UART_INSTANCE 1 // Connected to ST-Link -//#define SERIAL_UART_INSTANCE 2 // Connected to WIFI - -// Default pin used for 'Serial' instance (ex: ST-Link) -// Mandatory for Firmata -#if SERIAL_UART_INSTANCE == 1 // ST-Link & J23 - #define PIN_SERIAL_RX PA10 - #define PIN_SERIAL_TX PA9 -#elif SERIAL_UART_INSTANCE == 2 // WIFI interface - #define PIN_SERIAL2_RX PD6 - #define PIN_SERIAL2_TX PD5 -#else - #error "Invalid setting for SERIAL_UART_INSTANCE." -#endif - -// Timer Definitions -#define TIMER_SERVO TIM4 // TIMER_SERVO must be defined in this file -#define TIMER_TONE TIM5 // TIMER_TONE must be defined in this file - -/* SD detect signal */ -/* - * By default, R67 is not provided, so SD card detect is not used. - * Note: SD CD (pin 16 of expansion connector J23) can be connected - * to GND in order to be able to use SD_DETECT_PIN - */ -/*#define SD_DETECT_PIN PA15*/ - -/* HAL configuration */ -#define HSE_VALUE 25000000U - -/* Extra HAL modules */ -#define HAL_SD_MODULE_ENABLED - -#endif - -#ifdef __cplusplus -} // extern "C" -#endif -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -// These serial port names are intended to allow libraries and architecture-neutral -// sketches to automatically default to the correct port name for a particular type -// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, -// the first hardware serial port whose RX/TX pins are not dedicated to another use. -// -// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor -// -// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial -// -// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library -// -// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. -// -// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX -// pins are NOT connected to anything by default. -#define SERIAL_PORT_MONITOR Serial -#define SERIAL_PORT_HARDWARE Serial1 -#endif - -#endif // _VARIANT_ARDUINO_STM32_ - -// PA0 54 // E1_THERMISTOR -// PA1 55 // E2_THERMISTOR -// PA2 56 // E3_THERMISTOR -// PA3 53 // BED_THERMISTOR_3 -// PA4 16 // SPI_CS -// PA5 17 // SPI_SCK -// PA6 18 // SPI_MISO -// PA7 19 // SPI_MOSI -// PA8 43 // V_STOP -// PA9 0 //TX -// PA10 1 //RX -// PA11 30 //OTG_DM -// PA12 31 //OTG_DP -// PA13 20 // JTAG_TMS/SWDIO -// PA14 21 // JTAG_TCK/SWCLK -// PA15 25 // SD_CARD_DETECT -// PB0 49 // E2_HEAT_PWM -// PB1 50 // E3_HEAT_PWM -// PB3 22 // JTAG_TDO/SWO -// PB4 37 // USER4 -// PB5 6 // WIFI_WAKEUP -// PB6 15 // SCL -// PB7 14 // SDA -// PB8 77 // E3_PWM -// PB9 35 // USER1 -// PB10 64 // Y_PWM -// PB12 10 // SPI_CS -// PB13 13 // SPI_SCK -// PB14 12 // SPI_MISO -// PB15 11 // SPI_MOSI -// PC0 68 // Z_DIR -// PC1 33 //IR_ON -// PC2 51 // BED_THERMISTOR_1 -// PC3 52 // BED_THERMISTOR_2 -// PC4 57 // E1_FAN -// PC5 58 // E2_FAN -// PC6 67 // Z_PWM -// PC7 48 // E1_HEAT_PWM -// PC8 23 // SDIO_D0 -// PC9 24 // SDIO_D1 -// PC10 26 // SDIO_D2 -// PC11 27 // SDIO_D3 -// PC12 28 // SDIO_CK -// PC13 70 // E1_DIR -// PC14 69 // E1_RESET -// PC15 66 // Z_RESET -// PD0 44 // W_STOP -// PD1 32 //IR_OUT -// PD2 29 // SDIO_CMD -// PD3 2 // CTS -// PD4 3 // RTS -// PD5 4 // TX -// PD6 5 // RX -// PD7 34 // USER3 -// PD8 39 // X_STOP -// PD9 40 // Y_STOP -// PD10 41 // Z_STOP -// PD11 42 // U_STOP -// PD12 71 // E1_PWM -// PD13 45 // BED_HEAT_2 -// PD14 46 // BED_HEAT_1 -// PD15 47 // BED_HEAT_3 -// PE0 36 // USER2 -// PE1 9 // STATUS_LED -// PE2 76 // E3_DIR -// PE3 75 // E3_RESET -// PE4 72 // E2_RESET -// PE5 73 // E2_PWM -// PE6 74 // E2_DIR -// PE7 38 // USER_BUTTON -// PE8 59 // E3_FAN -// PE9 65 // Y_DIR -// PE10 63 // Y_RESET -// PE11 7 // WIFI_RESET -// PE12 8 // WIFI_BOOT -// PE13 60 // X_RESET -// PE14 61 // X_PWM -// PE15 62 // X_DIR diff --git a/buildroot/tests/FYSETC_F6 b/buildroot/tests/FYSETC_F6 index 17f8eb42b1..91b1f899ff 100755 --- a/buildroot/tests/FYSETC_F6 +++ b/buildroot/tests/FYSETC_F6 @@ -18,15 +18,11 @@ exec_test $1 $2 "FYSETC F6 1.3 with DGUS" "$3" # Delta Config (generic) + UBL + ALLEN_KEY + EEPROM_SETTINGS + OLED_PANEL_TINYBOY2 # use_example_configs delta/generic -opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \ - LCD_LANGUAGE ko_KR \ - X_DRIVER_TYPE L6470 Y_DRIVER_TYPE L6470 Z_DRIVER_TYPE L6470 \ - L6470_CHAIN_SCK_PIN 53 L6470_CHAIN_MISO_PIN 49 L6470_CHAIN_MOSI_PIN 40 L6470_CHAIN_SS_PIN 42 \ - 'ENABLE_RESET_L64XX_CHIPS(V)' NOOP +opt_set MOTHERBOARD BOARD_FYSETC_F6_13 LCD_LANGUAGE ko_KR opt_enable RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS EEPROM_CHITCHAT \ Z_PROBE_ALLEN_KEY AUTO_BED_LEVELING_UBL UBL_MESH_WIZARD \ OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY DELTA_CALIBRATION_MENU -exec_test $1 $2 "DELTA, RAMPS, L6470, UBL, Allen Key, EEPROM, OLED_PANEL_TINYBOY2..." "$3" +exec_test $1 $2 "DELTA, FYSETC F6 1.3, UBL, Allen Key, EEPROM, OLED_PANEL_TINYBOY2..." "$3" # # Test mixed TMC config diff --git a/buildroot/tests/STM32F401VE_STEVAL b/buildroot/tests/STM32F401VE_STEVAL deleted file mode 100755 index 1704f3d2f0..0000000000 --- a/buildroot/tests/STM32F401VE_STEVAL +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# -# Build tests for STM32F401VE_STEVAL -# - -# exit on first failure -set -e - -# Build examples -restore_configs -opt_set MOTHERBOARD BOARD_STEVAL_3DP001V1 SERIAL_PORT -1 -exec_test $1 $2 "STM32F401VE_STEVAL Default Config" "$3" - -# cleanup -restore_configs diff --git a/ini/features.ini b/ini/features.ini index 6fd8a7950b..3e34e01d5c 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -26,8 +26,6 @@ HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster src_filter=+ HAS_TMC26X = TMC26XStepper=https://github.com/MarlinFirmware/TMC26XStepper/archive/master.zip src_filter=+ -HAS_L64XX = Arduino-L6470@0.8.0 - src_filter=+ + + + LIB_INTERNAL_MAX31865 = src_filter=+ NEOPIXEL_LED = adafruit/Adafruit NeoPixel@~1.8.0 src_filter=+ diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index a663d31483..5e0d4a13ec 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -28,17 +28,6 @@ board = armed_v1 build_flags = ${common_stm32.build_flags} -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -# -# STM32F401VE -# 'STEVAL-3DP001V1' STM32F401VE board - https://www.st.com/en/evaluation-tools/steval-3dp001v1.html -# -[env:STM32F401VE_STEVAL] -extends = stm32_variant -board = marlin_STEVAL_STM32F401VE -build_flags = ${stm32_variant.build_flags} - -DSTM32F401xE -DDISABLE_GENERIC_SERIALUSB - -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS - # # STM32F401RC # From c47575f244dc8843a49aa93e9727fb0a6351e262 Mon Sep 17 00:00:00 2001 From: toomuchwonder <43323256+toomuchwonder@users.noreply.github.com> Date: Thu, 14 Jul 2022 04:17:53 +0100 Subject: [PATCH 07/31] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20MKS=20UI=20extruder?= =?UTF-8?q?=20speed=20(#24476)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/mks_ui/draw_ui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/mks_ui/draw_ui.h index 798e662220..9bc583d3ad 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.h @@ -236,9 +236,9 @@ typedef struct UI_Config_Struct { eStepMax = 10; // Extruder speed (mm/s) uint8_t extruSpeed; - static constexpr uint8_t eSpeedH = 1, + static constexpr uint8_t eSpeedH = 20, eSpeedN = 10, - eSpeedL = 20; + eSpeedL = 1; uint8_t print_state; uint8_t stepPrintSpeed; uint8_t waitEndMoves; From 8fb54d4621c5f571d613fca2943393d4a95cb8e4 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Thu, 14 Jul 2022 00:00:33 -0500 Subject: [PATCH 08/31] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20and=20update=20ProUI?= =?UTF-8?q?=20(#24477)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/common/dwin_font.h | 2 + .../{ubl_tools.cpp => bedlevel_tools.cpp} | 82 ++++--- .../proui/{ubl_tools.h => bedlevel_tools.h} | 46 ++-- Marlin/src/lcd/e3v2/proui/dwin.cpp | 223 +++++++++--------- Marlin/src/lcd/e3v2/proui/dwin.h | 11 +- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 15 +- Marlin/src/lcd/e3v2/proui/dwinui.cpp | 60 +++-- Marlin/src/lcd/e3v2/proui/dwinui.h | 157 ++++++------ Marlin/src/lcd/e3v2/proui/lockscreen.cpp | 8 +- Marlin/src/lcd/e3v2/proui/menus.cpp | 26 +- Marlin/src/lcd/e3v2/proui/menus.h | 6 +- Marlin/src/lcd/e3v2/proui/meshviewer.cpp | 15 +- Marlin/src/lcd/e3v2/proui/meshviewer.h | 3 - Marlin/src/lcd/e3v2/proui/plot.cpp | 9 +- Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/module/planner.h | 2 +- Marlin/src/module/settings.cpp | 13 +- 17 files changed, 376 insertions(+), 303 deletions(-) rename Marlin/src/lcd/e3v2/proui/{ubl_tools.cpp => bedlevel_tools.cpp} (78%) rename Marlin/src/lcd/e3v2/proui/{ubl_tools.h => bedlevel_tools.h} (64%) diff --git a/Marlin/src/lcd/e3v2/common/dwin_font.h b/Marlin/src/lcd/e3v2/common/dwin_font.h index 5a4b1a61cf..10bb104d27 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_font.h +++ b/Marlin/src/lcd/e3v2/common/dwin_font.h @@ -21,6 +21,8 @@ */ #pragma once +typedef uint8_t fontid_t; + /** * 3-.0:The font size, 0x00-0x09, corresponds to the font size below: * 0x00=6*12 0x01=8*16 0x02=10*20 0x03=12*24 0x04=14*28 diff --git a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp similarity index 78% rename from Marlin/src/lcd/e3v2/proui/ubl_tools.cpp rename to Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp index 87909d2dd2..e967c26198 100644 --- a/Marlin/src/lcd/e3v2/proui/ubl_tools.cpp +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.cpp @@ -21,19 +21,20 @@ */ /** - * UBL Tools and Mesh Viewer for Pro UI - * Version: 1.0.0 - * Date: 2022/04/13 + * Bed Level Tools for Pro UI + * Extended by: Miguel A. Risco-Castillo (MRISCOC) + * Version: 2.0.0 + * Date: 2022/05/23 * - * Original Author: Henri-J-Norden - * Original Source: https://github.com/Jyers/Marlin/pull/126 + * Based on the original work of: Henri-J-Norden + * https://github.com/Jyers/Marlin/pull/126 */ #include "../../../inc/MarlinConfigPre.h" +#include "bedlevel_tools.h" -#if BOTH(DWIN_LCD_PROUI, AUTO_BED_LEVELING_UBL) +#if BOTH(DWIN_LCD_PROUI, HAS_LEVELING) -#include "ubl_tools.h" #include "../../marlinui.h" #include "../../../core/types.h" #include "dwin.h" @@ -47,27 +48,29 @@ #include "../../../libs/least_squares_fit.h" #include "../../../libs/vector_3.h" -UBLMeshToolsClass ubl_tools; +BedLevelToolsClass BedLevelTools; -#if ENABLED(USE_UBL_VIEWER) - bool UBLMeshToolsClass::viewer_asymmetric_range = false; - bool UBLMeshToolsClass::viewer_print_value = false; +#if USE_UBL_VIEWER + bool BedLevelToolsClass::viewer_asymmetric_range = false; + bool BedLevelToolsClass::viewer_print_value = false; #endif -bool UBLMeshToolsClass::goto_mesh_value = false; -uint8_t UBLMeshToolsClass::tilt_grid = 1; +bool BedLevelToolsClass::goto_mesh_value = false; +uint8_t BedLevelToolsClass::mesh_x = 0; +uint8_t BedLevelToolsClass::mesh_y = 0; +uint8_t BedLevelToolsClass::tilt_grid = 1; bool drawing_mesh = false; char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; #if ENABLED(AUTO_BED_LEVELING_UBL) - void UBLMeshToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined/*=false*/) { + void BedLevelToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y, bool undefined/*=false*/) { sprintf_P(cmd, PSTR("M421 I%i J%i Z%s %s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1), undefined ? "N" : ""); gcode.process_subcommands_now(cmd); planner.synchronize(); } - bool UBLMeshToolsClass::create_plane_from_mesh() { + bool BedLevelToolsClass::create_plane_from_mesh() { struct linear_fit_data lsf_results; incremental_LSF_reset(&lsf_results); GRID_LOOP(x, y) { @@ -119,7 +122,7 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; #else - void UBLMeshToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y) { + void BedLevelToolsClass::manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y) { sprintf_P(cmd, PSTR("G29 I%i J%i Z%s"), mesh_x, mesh_y, dtostrf(current_position.z, 1, 3, str_1)); gcode.process_subcommands_now(cmd); planner.synchronize(); @@ -127,7 +130,8 @@ char cmd[MAX_CMD_SIZE+16], str_1[16], str_2[16], str_3[16]; #endif -void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove/*=false*/) { +void BedLevelToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove/*=false*/) { + gcode.process_subcommands_now(F("G28O")); if (zmove) { planner.synchronize(); current_position.z = goto_mesh_value ? bedlevel.z_values[mesh_x][mesh_y] : Z_CLEARANCE_BETWEEN_PROBES; @@ -149,8 +153,28 @@ void UBLMeshToolsClass::manual_move(const uint8_t mesh_x, const uint8_t mesh_y, } } -float UBLMeshToolsClass::get_max_value() { - float max = __FLT_MIN__; +void BedLevelToolsClass::MoveToXYZ() { + BedLevelTools.goto_mesh_value = true; + BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false); +} +void BedLevelToolsClass::MoveToXY() { + BedLevelTools.goto_mesh_value = false; + BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, false); +} +void BedLevelToolsClass::MoveToZ() { + BedLevelTools.goto_mesh_value = true; + BedLevelTools.manual_move(BedLevelTools.mesh_x, BedLevelTools.mesh_y, true); +} +void BedLevelToolsClass::ProbeXY() { + sprintf_P(cmd, PSTR("G30X%sY%s"), + dtostrf(bedlevel.get_mesh_x(BedLevelTools.mesh_x), 1, 2, str_1), + dtostrf(bedlevel.get_mesh_y(BedLevelTools.mesh_y), 1, 2, str_2) + ); + gcode.process_subcommands_now(cmd); +} + +float BedLevelToolsClass::get_max_value() { + float max = __FLT_MAX__ * -1; GRID_LOOP(x, y) { if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] > max) max = bedlevel.z_values[x][y]; @@ -158,7 +182,7 @@ float UBLMeshToolsClass::get_max_value() { return max; } -float UBLMeshToolsClass::get_min_value() { +float BedLevelToolsClass::get_min_value() { float min = __FLT_MAX__; GRID_LOOP(x, y) { if (!isnan(bedlevel.z_values[x][y]) && bedlevel.z_values[x][y] < min) @@ -167,19 +191,20 @@ float UBLMeshToolsClass::get_min_value() { return min; } -bool UBLMeshToolsClass::validate() { - float min = __FLT_MAX__, max = __FLT_MIN__; +bool BedLevelToolsClass::meshvalidate() { + float min = __FLT_MAX__, max = __FLT_MAX__ * -1; GRID_LOOP(x, y) { if (isnan(bedlevel.z_values[x][y])) return false; if (bedlevel.z_values[x][y] < min) min = bedlevel.z_values[x][y]; if (bedlevel.z_values[x][y] > max) max = bedlevel.z_values[x][y]; } - return max <= UBL_Z_OFFSET_MAX && min >= UBL_Z_OFFSET_MIN; + return WITHIN(max, MESH_Z_OFFSET_MIN, MESH_Z_OFFSET_MAX); } -#if ENABLED(USE_UBL_VIEWER) - void UBLMeshToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) { +#if USE_UBL_VIEWER + + void BedLevelToolsClass::Draw_Bed_Mesh(int16_t selected /*= -1*/, uint8_t gridline_width /*= 1*/, uint16_t padding_x /*= 8*/, uint16_t padding_y_top /*= 40 + 53 - 7*/) { drawing_mesh = true; const uint16_t total_width_px = DWIN_WIDTH - padding_x - padding_x; const uint16_t cell_width_px = total_width_px / (GRID_MAX_POINTS_X); @@ -237,7 +262,7 @@ bool UBLMeshToolsClass::validate() { } } - void UBLMeshToolsClass::Set_Mesh_Viewer_Status() { // TODO: draw gradient with values as a legend instead + void BedLevelToolsClass::Set_Mesh_Viewer_Status() { // TODO: draw gradient with values as a legend instead float v_max = abs(get_max_value()), v_min = abs(get_min_value()), range = _MAX(v_min, v_max); if (v_min > 3e+10F) v_min = 0.0000001; if (v_max > 3e+10F) v_max = 0.0000001; @@ -255,6 +280,7 @@ bool UBLMeshToolsClass::validate() { ui.set_status(msg); drawing_mesh = false; } -#endif -#endif // DWIN_LCD_PROUI && AUTO_BED_LEVELING_UBL +#endif // USE_UBL_VIEWER + +#endif // DWIN_LCD_PROUI && HAS_LEVELING diff --git a/Marlin/src/lcd/e3v2/proui/ubl_tools.h b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h similarity index 64% rename from Marlin/src/lcd/e3v2/proui/ubl_tools.h rename to Marlin/src/lcd/e3v2/proui/bedlevel_tools.h index 563794a463..9373d593f9 100644 --- a/Marlin/src/lcd/e3v2/proui/ubl_tools.h +++ b/Marlin/src/lcd/e3v2/proui/bedlevel_tools.h @@ -1,10 +1,9 @@ -/** - * UBL Tools and Mesh Viewer for Pro UI - * Version: 1.0.0 - * Date: 2022/04/13 +/* + * Marlin 3D Printer Firmware + * Copyright (c) 2022 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * - * Original Author: Henri-J-Norden (https://github.com/Henri-J-Norden) - * Original Source: https://github.com/Jyers/Marlin/pull/135 + * 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 @@ -20,22 +19,37 @@ * along with this program. If not, see . * */ + +/** + * Bed Level Tools for Pro UI + * Extended by: Miguel A. Risco-Castillo (MRISCOC) + * Version: 2.0.0 + * Date: 2022/05/23 + * + * Based on the original work of: Henri-J-Norden + * https://github.com/Jyers/Marlin/pull/126 + */ + #pragma once #include "../../../inc/MarlinConfigPre.h" -//#define USE_UBL_VIEWER 1 +#if ENABLED(AUTO_BED_LEVELING_UBL) + //#define USE_UBL_VIEWER 1 +#endif -#define UBL_Z_OFFSET_MIN -3.0 -#define UBL_Z_OFFSET_MAX 3.0 +#define MESH_Z_OFFSET_MIN -3.0 +#define MESH_Z_OFFSET_MAX 3.0 -class UBLMeshToolsClass { +class BedLevelToolsClass { public: - #if ENABLED(USE_UBL_VIEWER) + #if USE_UBL_VIEWER static bool viewer_asymmetric_range; static bool viewer_print_value; #endif static bool goto_mesh_value; + static uint8_t mesh_x; + static uint8_t mesh_y; static uint8_t tilt_grid; #if ENABLED(AUTO_BED_LEVELING_UBL) @@ -45,15 +59,19 @@ public: static void manual_value_update(const uint8_t mesh_x, const uint8_t mesh_y); #endif static void manual_move(const uint8_t mesh_x, const uint8_t mesh_y, bool zmove=false); + static void MoveToXYZ(); + static void MoveToXY(); + static void MoveToZ(); + static void ProbeXY(); static float get_max_value(); static float get_min_value(); - static bool validate(); - #if ENABLED(USE_UBL_VIEWER) + static bool meshvalidate(); + #if USE_UBL_VIEWER static void Draw_Bed_Mesh(int16_t selected = -1, uint8_t gridline_width = 1, uint16_t padding_x = 8, uint16_t padding_y_top = 40 + 53 - 7); static void Set_Mesh_Viewer_Status(); #endif }; -extern UBLMeshToolsClass ubl_tools; +extern BedLevelToolsClass BedLevelTools; void Goto_MeshViewer(); diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 07b134471b..27e1003ab6 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -101,17 +101,18 @@ #if HAS_MESH || HAS_ONESTEP_LEVELING #include "../../../feature/bedlevel/bedlevel.h" + #include "bedlevel_tools.h" #endif #if HAS_BED_PROBE #include "../../../module/probe.h" #endif -#ifdef BLTOUCH_HS_MODE +#if ENABLED(BLTOUCH) #include "../../../feature/bltouch.h" #endif -#if ANY(BABYSTEPPING, HAS_BED_PROBE, HAS_WORKSPACE_OFFSET) +#if EITHER(BABYSTEPPING, HAS_BED_PROBE) #define HAS_ZOFFSET_ITEM 1 #if ENABLED(BABYSTEPPING) #include "../../../feature/babystep.h" @@ -141,10 +142,6 @@ #include "meshviewer.h" #endif -#if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl_tools.h" -#endif - #if ENABLED(PRINTCOUNTER) #include "printstats.h" #endif @@ -157,16 +154,14 @@ #include "../../../feature/leds/leds.h" #endif -#include -#include -#include +#if HAS_LOCKSCREEN + #include "lockscreen.h" +#endif #ifndef MACHINE_SIZE #define MACHINE_SIZE STRINGIFY(X_BED_SIZE) "x" STRINGIFY(Y_BED_SIZE) "x" STRINGIFY(Z_MAX_POS) #endif -#include "lockscreen.h" - #define PAUSE_HEAT #define MENU_CHAR_LIMIT 24 @@ -251,6 +246,7 @@ constexpr float max_feedrate_edit_values[] = { 1000, 1000, 10, 50 } #endif ; + constexpr float max_acceleration_edit_values[] = #ifdef MAX_ACCEL_EDIT_VALUES MAX_ACCEL_EDIT_VALUES @@ -258,6 +254,7 @@ constexpr float max_acceleration_edit_values[] = { 1000, 1000, 200, 2000 } #endif ; + #if HAS_CLASSIC_JERK constexpr float max_jerk_edit_values[] = #ifdef MAX_JERK_EDIT_VALUES @@ -305,7 +302,9 @@ MenuClass *FilamentMenu = nullptr; MenuClass *TemperatureMenu = nullptr; MenuClass *MaxSpeedMenu = nullptr; MenuClass *MaxAccelMenu = nullptr; -MenuClass *MaxJerkMenu = nullptr; +#if HAS_CLASSIC_JERK + MenuClass *MaxJerkMenu = nullptr; +#endif MenuClass *StepsMenu = nullptr; MenuClass *HotendPIDMenu = nullptr; MenuClass *BedPIDMenu = nullptr; @@ -552,14 +551,9 @@ void Popup_window_PauseOrStop() { #endif // Draw status line -void DWIN_DrawStatusLine(const char *text) { +void DWIN_DrawStatusLine() { DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); - if (text) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, text); -} - -void DWIN_DrawStatusLine(FSTR_P fstr) { - DWIN_Draw_Rectangle(1, HMI_data.StatusBg_Color, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20); - if (fstr) DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, fstr); + DWINUI::Draw_CenteredString(HMI_data.StatusTxt_Color, STATUS_Y + 2, ui.status_message); } // Clear & reset status line @@ -588,7 +582,7 @@ void DWIN_DrawStatusMessage() { // If the string fits the status line do not scroll it if (slen <= LCD_WIDTH) { if (hash_changed) { - DWIN_DrawStatusLine(ui.status_message); + DWIN_DrawStatusLine(); hash_changed = false; } } @@ -620,7 +614,7 @@ void DWIN_DrawStatusMessage() { if (hash_changed) { ui.status_message[LCD_WIDTH] = 0; - DWIN_DrawStatusLine(ui.status_message); + DWIN_DrawStatusLine(); hash_changed = false; } @@ -663,7 +657,7 @@ void ICON_ResumeOrPause() { } // Update filename on print -void DWIN_Print_Header(const char *text = nullptr) { +void DWIN_Print_Header(const char *text=nullptr) { static char headertxt[31] = ""; // Print header text if (text) { const int8_t size = _MIN(30U, strlen_P(text)); @@ -1099,7 +1093,7 @@ void DWIN_Draw_Dashboard() { DWINUI::Draw_Int(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 3, 195 + 2 * STAT_CHR_W, 384, thermalManager.fan_speed[0]); #endif - #if BOTH(BABYSTEPPING, HAS_BED_PROBE) + #if HAS_ZOFFSET_ITEM DWINUI::Draw_Icon(planner.leveling_active ? ICON_SetZOffset : ICON_Zoffset, 187, 416); #endif @@ -1370,13 +1364,15 @@ void Draw_Main_Area() { case ESDiagProcess: Draw_EndStopDiag(); break; #endif case Popup: popupDraw(); break; - case Locked: lockScreen.draw(); break; + #if HAS_LOCKSCREEN + case Locked: lockScreen.draw(); break; + #endif case Menu: case SetInt: case SetPInt: case SetIntNoDraw: case SetFloat: - case SetPFloat: ReDrawMenu(); break; + case SetPFloat: ReDrawMenu(true); break; default: break; } } @@ -1567,7 +1563,9 @@ void DWIN_HandleScreen() { case PrintProcess: HMI_Printing(); break; case Popup: HMI_Popup(); break; case Leveling: break; - case Locked: HMI_LockScreen(); break; + #if HAS_LOCKSCREEN + case Locked: HMI_LockScreen(); break; + #endif case PrintDone: TERN_(HAS_ESDIAG, case ESDiagProcess:) case WaitResponse: HMI_WaitForUser(); break; @@ -1769,7 +1767,7 @@ void DWIN_Print_Aborted() { Goto_PrintDone(); } -// Progress Bar update +// Progress and remaining time update void DWIN_M73() { if (parser.seenval('P')) { _percent_done = parser.value_byte(); @@ -1843,11 +1841,6 @@ void DWIN_CopySettingsFrom(const char * const buff) { TERN_(PREVENT_COLD_EXTRUSION, ApplyExtMinT()); feedrate_percentage = 100; TERN_(BAUD_RATE_GCODE, HMI_SetBaudRate()); - #if BOTH(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS) - // Apply Case light brightness - caselight.brightness = HMI_data.CaseLight_Brightness; - caselight.update_brightness(); - #endif #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) leds.set_color( (HMI_data.LED_Color >> 16) & 0xFF, @@ -1880,7 +1873,7 @@ void DWIN_InitScreen() { index_file = MROWS; hash_changed = true; last_E = 0; - DWIN_DrawStatusLine(FSTR_P(nullptr)); + DWIN_DrawStatusLine(); DWIN_Draw_Dashboard(); Goto_Main_Menu(); } @@ -1935,7 +1928,7 @@ void DWIN_RedrawScreen() { case PAUSE_MESSAGE_PARKING: DWIN_Popup_Pause(GET_TEXT_F(MSG_PAUSE_PRINT_PARKING)); break; // M125 case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; // pause_print (M125, M600) case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), BTN_Continue); break; - case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; + case PAUSE_MESSAGE_INSERT: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT), BTN_Continue); break; case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; // Unload of pause and Unload of M702 case PAUSE_MESSAGE_PURGE: @@ -1988,28 +1981,32 @@ void DWIN_RedrawScreen() { } #endif // HAS_MESH -void DWIN_LockScreen() { - if (checkkey != Locked) { - lockScreen.rprocess = checkkey; - checkkey = Locked; - lockScreen.init(); + +#if HAS_LOCKSCREEN + + void DWIN_LockScreen() { + if (checkkey != Locked) { + lockScreen.rprocess = checkkey; + checkkey = Locked; + lockScreen.init(); + } } -} -void DWIN_UnLockScreen() { - if (checkkey == Locked) { - checkkey = lockScreen.rprocess; - Draw_Main_Area(); + void DWIN_UnLockScreen() { + if (checkkey == Locked) { + checkkey = lockScreen.rprocess; + Draw_Main_Area(); + } } -} -void HMI_LockScreen() { - EncoderState encoder_diffState = get_encoder_state(); - if (encoder_diffState == ENCODER_DIFF_NO) return; - lockScreen.onEncoder(encoder_diffState); - if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); -} + void HMI_LockScreen() { + EncoderState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + lockScreen.onEncoder(encoder_diffState); + if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); + } +#endif // HAS_LOCKSCREEN #if HAS_GCODE_PREVIEW @@ -2051,7 +2048,8 @@ void HMI_LockScreen() { #if ENABLED(EEPROM_SETTINGS) void WriteEeprom() { - DWIN_DrawStatusLine(GET_TEXT_F(MSG_STORE_EEPROM)); + ui.set_status(GET_TEXT_F(MSG_STORE_EEPROM)); + DWIN_DrawStatusLine(); DWIN_UpdateLCD(); DONE_BUZZ(settings.save()); } @@ -2106,11 +2104,13 @@ void HomeX() { queue.inject(F("G28X")); } void HomeY() { queue.inject(F("G28Y")); } void HomeZ() { queue.inject(F("G28Z")); } -void SetHome() { +#if HAS_HOME_OFFSET // Apply workspace offset, making the current position 0,0,0 + void SetHome() { queue.inject(F("G92X0Y0Z0")); DONE_BUZZ(true); -} + } +#endif #if HAS_ZOFFSET_ITEM @@ -2132,22 +2132,25 @@ void SetHome() { void SetMoveZto0() { #if ENABLED(Z_SAFE_HOMING) char cmd[54], str_1[5], str_2[5]; - sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nM420S0\nG0Z0F300\nM400"), + sprintf_P(cmd, PSTR("G28XYO\nG28Z\nG0X%sY%sF5000\nG0Z0F300\nM400"), dtostrf(Z_SAFE_HOMING_X_POINT, 1, 1, str_1), dtostrf(Z_SAFE_HOMING_Y_POINT, 1, 1, str_2) ); gcode.process_subcommands_now(cmd); #else - gcode.process_subcommands_now(F("G28O\nM420S0\nG0Z0F300\nM400")); + set_bed_leveling_enabled(false); + gcode.process_subcommands_now(F("G28O\nG0Z0F300\nM400")); #endif ui.reset_status(); DONE_BUZZ(true); } - void HomeZandDisable() { - SetMoveZto0(); - DisableMotors(); - } + #if !HAS_BED_PROBE + void HomeZandDisable() { + SetMoveZto0(); + DisableMotors(); + } + #endif #endif // HAS_ZOFFSET_ITEM @@ -2840,9 +2843,6 @@ void onDrawGetColorItem(MenuItemClass* menuitem, int8_t line) { DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); } -#if HAS_FILAMENT_SENSOR - void onDrawRunoutEnable(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, runout.enabled); } -#endif void onDrawPIDi(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_i(*(float*)static_cast(menuitem)->value)); } void onDrawPIDd(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 2, unscalePID_d(*(float*)static_cast(menuitem)->value)); } @@ -3249,7 +3249,9 @@ void Draw_AdvancedSettings_Menu() { MENU_ITEM_F(ICON_PrintStats, MSG_INFO_STATS_MENU, onDrawSubMenu, Goto_PrintStats); MENU_ITEM_F(ICON_PrintStatsReset, MSG_INFO_PRINT_COUNT_RESET, onDrawSubMenu, PrintStats.Reset); #endif - MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); + #if HAS_LOCKSCREEN + MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); + #endif } ui.reset_status(true); UpdateMenu(AdvancedSettings); @@ -3295,12 +3297,15 @@ void Draw_Move_Menu() { EDIT_ITEM_F(ICON_ProbeOffsetX, MSG_ZPROBE_XOFFSET, onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); EDIT_ITEM_F(ICON_ProbeOffsetY, MSG_ZPROBE_YOFFSET, onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); EDIT_ITEM_F(ICON_ProbeOffsetZ, MSG_ZPROBE_ZOFFSET, onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); - #ifdef BLTOUCH_HS_MODE - EDIT_ITEM_F(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, SetHSMode, &bltouch.high_speed_mode); + #if ENABLED(BLTOUCH) + MENU_ITEM_F(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, ProbeStow); + MENU_ITEM_F(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, ProbeDeploy); + MENU_ITEM_F(ICON_BltouchReset, MSG_BLTOUCH_RESET, onDrawMenuItem, bltouch._reset); + #ifdef BLTOUCH_HS_MODE + EDIT_ITEM_F(ICON_HSMode, MSG_ENABLE_HS_MODE, onDrawChkbMenu, SetHSMode, &bltouch.high_speed_mode); + #endif #endif MENU_ITEM_F(ICON_ProbeTest, MSG_M48_TEST, onDrawMenuItem, ProbeTest); - MENU_ITEM_F(ICON_ProbeStow, MSG_MANUAL_STOW, onDrawMenuItem, ProbeStow); - MENU_ITEM_F(ICON_ProbeDeploy, MSG_MANUAL_DEPLOY, onDrawMenuItem, ProbeDeploy); } UpdateMenu(ProbeSetMenu); } @@ -3384,14 +3389,24 @@ void Draw_GetColor_Menu() { #endif #if ENABLED(LED_CONTROL_MENU) - void Draw_LedControl_Menu() { - checkkey = Menu; - if (SetMenu(LedControlMenu, GET_TEXT_F(MSG_LED_CONTROL), 6)) { - BACK_ITEM(Draw_Control_Menu); - #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) - EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); - #endif - #if HAS_COLOR_LEDS + void Draw_LedControl_Menu() { + checkkey = Menu; + if (SetMenu(LedControlMenu, GET_TEXT_F(MSG_LED_CONTROL), 6)) { + BACK_ITEM(Draw_Control_Menu); + #if !BOTH(CASE_LIGHT_MENU, CASE_LIGHT_USE_NEOPIXEL) + EDIT_ITEM_F(ICON_LedControl, MSG_LEDS, onDrawChkbMenu, SetLedStatus, &leds.lights_on); + #endif + #if HAS_COLOR_LEDS + #if ENABLED(LED_COLOR_PRESETS) + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_WHITE, onDrawMenuItem, leds.set_white); + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_RED, onDrawMenuItem, leds.set_red); + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_ORANGE, onDrawMenuItem, leds.set_orange); + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_YELLOW, onDrawMenuItem, leds.set_yellow); + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_GREEN, onDrawMenuItem, leds.set_green); + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_BLUE, onDrawMenuItem, leds.set_blue); + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_INDIGO, onDrawMenuItem, leds.set_indigo); + MENU_ITEM_F(ICON_LedControl, MSG_SET_LEDS_VIOLET, onDrawMenuItem, leds.set_violet); + #else EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_RED, onDrawPInt8Menu, SetLEDColorR, &leds.color.r); EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_GREEN, onDrawPInt8Menu, SetLEDColorG, &leds.color.g); EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_BLUE, onDrawPInt8Menu, SetLEDColorB, &leds.color.b); @@ -3399,9 +3414,10 @@ void Draw_GetColor_Menu() { EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLedColorW, &leds.color.w); #endif #endif - } - UpdateMenu(LedControlMenu); + #endif } + UpdateMenu(LedControlMenu); + } #endif void Draw_Tune_Menu() { @@ -3432,7 +3448,9 @@ void Draw_Tune_Menu() { #if ENABLED(FWRETRACT) MENU_ITEM_F(ICON_FWRetract, MSG_FWRETRACT, onDrawSubMenu, Draw_FWRetract_Menu); #endif - MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); + #if HAS_LOCKSCREEN + MENU_ITEM_F(ICON_Lock, MSG_LOCKSCREEN, onDrawMenuItem, DWIN_LockScreen); + #endif #if HAS_LCD_BRIGHTNESS EDIT_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS, onDrawPInt8Menu, SetBrightness, &ui.brightness); MENU_ITEM_F(ICON_Brightness, MSG_BRIGHTNESS_OFF, onDrawMenuItem, TurnOffBacklight); @@ -3750,15 +3768,14 @@ void Draw_Steps_Menu() { #endif #if ENABLED(MESH_EDIT_MENU) - uint8_t mesh_x = 0, mesh_y = 0; #define Z_OFFSET_MIN -3 #define Z_OFFSET_MAX 3 - void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : mesh_y]; EditZValueItem->redraw(); } - void ApplyEditMeshX() { mesh_x = MenuData.Value; } - void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, mesh_x, ApplyEditMeshX, LiveEditMesh); } - void ApplyEditMeshY() { mesh_y = MenuData.Value; } - void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, mesh_y, ApplyEditMeshY, LiveEditMesh); } + void LiveEditMesh() { ((MenuItemPtrClass*)EditZValueItem)->value = &bedlevel.z_values[HMI_value.Select ? BedLevelTools.mesh_x : MenuData.Value][HMI_value.Select ? MenuData.Value : BedLevelTools.mesh_y]; EditZValueItem->redraw(); } + void ApplyEditMeshX() { BedLevelTools.mesh_x = MenuData.Value; } + void SetEditMeshX() { HMI_value.Select = 0; SetIntOnClick(0, GRID_MAX_POINTS_X - 1, BedLevelTools.mesh_x, ApplyEditMeshX, LiveEditMesh); } + void ApplyEditMeshY() { BedLevelTools.mesh_y = MenuData.Value; } + void SetEditMeshY() { HMI_value.Select = 1; SetIntOnClick(0, GRID_MAX_POINTS_Y - 1, BedLevelTools.mesh_y, ApplyEditMeshY, LiveEditMesh); } void SetEditZValue() { SetPFloatOnClick(Z_OFFSET_MIN, Z_OFFSET_MAX, 3); } #endif #endif @@ -3772,14 +3789,14 @@ void Draw_Steps_Menu() { onDrawIntMenu(menuitem, line, bedlevel.storage_slot); } - void ApplyUBLTiltGrid() { ubl_tools.tilt_grid = MenuData.Value; } - void SetUBLTiltGrid() { SetIntOnClick(1, 3, ubl_tools.tilt_grid, ApplyUBLTiltGrid); } + void ApplyUBLTiltGrid() { BedLevelTools.tilt_grid = MenuData.Value; } + void SetUBLTiltGrid() { SetIntOnClick(1, 3, BedLevelTools.tilt_grid, ApplyUBLTiltGrid); } void UBLTiltMesh() { if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; char buf[15]; - if (ubl_tools.tilt_grid > 1) { - sprintf_P(buf, PSTR("G28O\nG29 J%i"), ubl_tools.tilt_grid); + if (BedLevelTools.tilt_grid > 1) { + sprintf_P(buf, PSTR("G28O\nG29 J%i"), BedLevelTools.tilt_grid); gcode.process_subcommands_now(buf); } else @@ -3788,16 +3805,10 @@ void Draw_Steps_Menu() { } void UBLSmartFillMesh() { - bedlevel.smart_fill_mesh(); + LOOP_L_N(x, GRID_MAX_POINTS_Y) bedlevel.smart_fill_mesh(); LCD_MESSAGE(MSG_UBL_MESH_FILLED); } - bool UBLValidMesh() { - const bool valid = ubl_tools.validate(); - if (!valid) bedlevel.invalidate(); - return valid; - } - void UBLSaveMesh() { if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; settings.store_mesh(bedlevel.storage_slot); @@ -3808,14 +3819,6 @@ void Draw_Steps_Menu() { void UBLLoadMesh() { if (bedlevel.storage_slot < 0) bedlevel.storage_slot = 0; settings.load_mesh(bedlevel.storage_slot); - if (UBLValidMesh()) { - ui.status_printf(0, GET_TEXT_F(MSG_MESH_LOADED), bedlevel.storage_slot); - DONE_BUZZ(true); - } - else { - LCD_MESSAGE_F("Invalid Mesh Loaded"); - DONE_BUZZ(false); - } } #endif // AUTO_BED_LEVELING_UBL @@ -3837,7 +3840,7 @@ void Draw_Steps_Menu() { EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_STORAGE_SLOT, onDrawUBLSlot, SetUBLSlot, &bedlevel.storage_slot); MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SAVE_MESH, onDrawMenuItem, UBLSaveMesh); MENU_ITEM_F(ICON_UBLActive, MSG_UBL_LOAD_MESH, onDrawMenuItem, UBLLoadMesh); - EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &ubl_tools.tilt_grid); + EDIT_ITEM_F(ICON_UBLActive, MSG_UBL_TILTING_GRID, onDrawPInt8Menu, SetUBLTiltGrid, &BedLevelTools.tilt_grid); MENU_ITEM_F(ICON_UBLActive, MSG_UBL_TILT_MESH, onDrawMenuItem, UBLTiltMesh); MENU_ITEM_F(ICON_UBLActive, MSG_UBL_SMART_FILLIN, onDrawMenuItem, UBLSmartFillMesh); #endif @@ -3851,13 +3854,15 @@ void Draw_Steps_Menu() { #if ENABLED(MESH_EDIT_MENU) void Draw_EditMesh_Menu() { + if (!leveling_is_valid()) { LCD_MESSAGE(MSG_UBL_MESH_INVALID); return; } + set_bed_leveling_enabled(false); checkkey = Menu; if (SetMenu(EditMeshMenu, GET_TEXT_F(MSG_EDIT_MESH), 4)) { - mesh_x = mesh_y = 0; + BedLevelTools.mesh_x = BedLevelTools.mesh_y = 0; BACK_ITEM(Draw_MeshSet_Menu); - EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX, &mesh_x); - EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY, &mesh_y); - EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &bedlevel.z_values[mesh_x][mesh_y]); + EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_X, onDrawPInt8Menu, SetEditMeshX,&BedLevelTools.mesh_x); + EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_Y, onDrawPInt8Menu, SetEditMeshY,&BedLevelTools.mesh_y); + EditZValueItem = EDIT_ITEM_F(ICON_UBLActive, MSG_MESH_EDIT_Z, onDrawPFloat3Menu, SetEditZValue, &bedlevel.z_values[BedLevelTools.mesh_x][BedLevelTools.mesh_y]); } UpdateMenu(EditMeshMenu); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 4f992b3a78..6d36cca92a 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -160,8 +160,7 @@ void Goto_PowerLossRecovery(); void Goto_ConfirmToPrint(); void DWIN_Draw_Dashboard(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area -void DWIN_DrawStatusLine(const char *text); // Draw simple status text -void DWIN_DrawStatusLine(FSTR_P fstr); +void DWIN_DrawStatusLine(); // Draw simple status text void DWIN_RedrawDash(); // Redraw Dash and Status line void DWIN_RedrawScreen(); // Redraw all screen elements void HMI_MainMenu(); // Main process screen @@ -210,9 +209,11 @@ void DWIN_RebootScreen(); #endif // Utility and extensions -void DWIN_LockScreen(); -void DWIN_UnLockScreen(); -void HMI_LockScreen(); +#if HAS_LOCKSCREEN + void DWIN_LockScreen(); + void DWIN_UnLockScreen(); + void HMI_LockScreen(); +#endif #if HAS_MESH void DWIN_MeshViewer(); #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 1517acd238..0c4e0104f4 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -28,23 +28,21 @@ * Date: 2022/02/28 */ +#define HAS_GCODE_PREVIEW 1 +#define HAS_PIDPLOT 1 +#define HAS_ESDIAG 1 +#define HAS_LOCKSCREEN 1 //#define DEBUG_DWIN 1 //#define NEED_HEX_PRINT 1 #include "../../../inc/MarlinConfigPre.h" +#include "../common/dwin_color.h" #include -#define HAS_ESDIAG 1 -#define HAS_PIDPLOT 1 -#define HAS_GCODE_PREVIEW 1 #if defined(__STM32F1__) || defined(STM32F1) #define DASH_REDRAW 1 #endif -#include "../common/dwin_color.h" -#if ENABLED(LED_CONTROL_MENU) - #include "../../../feature/leds/leds.h" -#endif #define Def_Background_Color RGB( 1, 12, 8) #define Def_Cursor_color RGB(20, 49, 31) @@ -65,9 +63,6 @@ #define Def_Indicator_Color Color_White #define Def_Coordinate_Color Color_White #define Def_Button_Color RGB( 0, 23, 16) - -#define HAS_ESDIAG 1 - #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) #define Def_Leds_Color 0xFFFFFFFF #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.cpp b/Marlin/src/lcd/e3v2/proui/dwinui.cpp index ecb4754a0f..5ed36e7dac 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwinui.cpp @@ -23,8 +23,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.17.1 - * Date: 2022/04/12 + * Version: 3.18.1 + * Date: 2022/07/05 */ #include "../../../inc/MarlinConfigPre.h" @@ -44,7 +44,7 @@ uint16_t DWINUI::pencolor = Color_White; uint16_t DWINUI::textcolor = Def_Text_Color; uint16_t DWINUI::backcolor = Def_Background_Color; uint16_t DWINUI::buttoncolor = Def_Button_Color; -uint8_t DWINUI::font = font8x16; +uint8_t DWINUI::fontid = font8x16; FSTR_P const DWINUI::Author = F(STRING_CONFIG_H_AUTHOR); void (*DWINUI::onTitleDraw)(TitleClass* title) = nullptr; @@ -62,17 +62,15 @@ void DWINUI::init() { textcolor = Def_Text_Color; backcolor = Def_Background_Color; buttoncolor = Def_Button_Color; - font = font8x16; + fontid = font8x16; } // Set text/number font -void DWINUI::setFont(uint8_t cfont) { - font = cfont; -} +void DWINUI::setFont(fontid_t fid) { fontid = fid; } // Get font character width -uint8_t DWINUI::fontWidth(uint8_t cfont) { - switch (cfont) { +uint8_t DWINUI::fontWidth(fontid_t fid) { + switch (fid) { case font6x12 : return 6; case font8x16 : return 8; case font10x20: return 10; @@ -88,8 +86,8 @@ uint8_t DWINUI::fontWidth(uint8_t cfont) { } // Get font character height -uint8_t DWINUI::fontHeight(uint8_t cfont) { - switch (cfont) { +uint8_t DWINUI::fontHeight(fontid_t fid) { + switch (fid) { case font6x12 : return 12; case font8x16 : return 16; case font10x20: return 20; @@ -105,14 +103,10 @@ uint8_t DWINUI::fontHeight(uint8_t cfont) { } // Get screen x coordinates from text column -uint16_t DWINUI::ColToX(uint8_t col) { - return col * fontWidth(font); -} +uint16_t DWINUI::ColToX(uint8_t col) { return col * fontWidth(fontid); } // Get screen y coordinates from text row -uint16_t DWINUI::RowToY(uint8_t row) { - return row * fontHeight(font); -} +uint16_t DWINUI::RowToY(uint8_t row) { return row * fontHeight(fontid); } // Set text/number color void DWINUI::SetColors(uint16_t fgcolor, uint16_t bgcolor, uint16_t alcolor) { @@ -152,9 +146,9 @@ void DWINUI::MoveBy(xy_int_t point) { } // Draw a Centered string using arbitrary x1 and x2 margins -void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string) { - const uint16_t x = _MAX(0U, x2 + x1 - strlen_P(string) * fontWidth(size)) / 2 - 1; - DWIN_Draw_String(bShow, size, color, bColor, x, y, string); +void DWINUI::Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string) { + const uint16_t x = _MAX(0U, x2 + x1 - strlen_P(string) * fontWidth(fid)) / 2 - 1; + DWIN_Draw_String(bShow, fid, color, bColor, x, y, string); } // Draw a char @@ -164,13 +158,13 @@ void DWINUI::Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint1 // c: ASCII code of char void DWINUI::Draw_Char(uint16_t color, uint16_t x, uint16_t y, const char c) { const char string[2] = { c, 0}; - DWIN_Draw_String(false, font, color, backcolor, x, y, string, 1); + DWIN_Draw_String(false, fontid, color, backcolor, x, y, string, 1); } // Draw a char at cursor position and increment cursor void DWINUI::Draw_Char(uint16_t color, const char c) { Draw_Char(color, cursor.x, cursor.y, c); - MoveBy(fontWidth(font), 0); + MoveBy(fontWidth(fontid), 0); } // Draw a string at cursor position @@ -178,49 +172,49 @@ void DWINUI::Draw_Char(uint16_t color, const char c) { // *string: The string // rlimit: For draw less chars than string length use rlimit void DWINUI::Draw_String(const char * const string, uint16_t rlimit) { - DWIN_Draw_String(false, font, textcolor, backcolor, cursor.x, cursor.y, string, rlimit); - MoveBy(strlen(string) * fontWidth(font), 0); + DWIN_Draw_String(false, fontid, textcolor, backcolor, cursor.x, cursor.y, string, rlimit); + MoveBy(strlen(string) * fontWidth(fontid), 0); } void DWINUI::Draw_String(uint16_t color, const char * const string, uint16_t rlimit) { - DWIN_Draw_String(false, font, color, backcolor, cursor.x, cursor.y, string, rlimit); - MoveBy(strlen(string) * fontWidth(font), 0); + DWIN_Draw_String(false, fontid, color, backcolor, cursor.x, cursor.y, string, rlimit); + MoveBy(strlen(string) * fontWidth(fontid), 0); } // Draw a numeric integer value // bShow: true=display background color; false=don't display background color // signedMode: 1=signed; 0=unsigned -// size: Font size +// fid: Font ID // color: Character color // bColor: Background color // iNum: Number of digits // x/y: Upper-left coordinate // value: Integer value -void DWINUI::Draw_Int(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value) { +void DWINUI::Draw_Int(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value) { char nstr[10]; sprintf_P(nstr, PSTR("%*li"), (signedMode ? iNum + 1 : iNum), value); - DWIN_Draw_String(bShow, size, color, bColor, x, y, nstr); + DWIN_Draw_String(bShow, fid, color, bColor, x, y, nstr); } // Draw a numeric float value // bShow: true=display background color; false=don't display background color // signedMode: 1=signed; 0=unsigned -// size: Font size +// fid: Font ID // color: Character color // bColor: Background color // iNum: Number of digits // fNum: Number of decimal digits // x/y: Upper-left coordinate // value: float value -void DWINUI::Draw_Float(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { +void DWINUI::Draw_Float(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { char nstr[10]; - DWIN_Draw_String(bShow, size, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr)); + DWIN_Draw_String(bShow, fid, color, bColor, x, y, dtostrf(value, iNum + (signedMode ? 2:1) + fNum, fNum, nstr)); } // ------------------------- Buttons ------------------------------// void DWINUI::Draw_Button(uint16_t color, uint16_t bcolor, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char * const caption) { DWIN_Draw_Rectangle(1, bcolor, x1, y1, x2, y2); - Draw_CenteredString(0, font, color, bcolor, x1, x2, (y2 + y1 - fontHeight())/2, caption); + Draw_CenteredString(0, fontid, color, bcolor, x1, x2, (y2 + y1 - fontHeight())/2, caption); } void DWINUI::Draw_Button(uint8_t id, uint16_t x, uint16_t y) { diff --git a/Marlin/src/lcd/e3v2/proui/dwinui.h b/Marlin/src/lcd/e3v2/proui/dwinui.h index f8ff091769..a544471831 100644 --- a/Marlin/src/lcd/e3v2/proui/dwinui.h +++ b/Marlin/src/lcd/e3v2/proui/dwinui.h @@ -24,8 +24,8 @@ /** * DWIN Enhanced implementation for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) - * Version: 3.17.1 - * Date: 2022/04/12 + * Version: 3.18.1 + * Date: 2022/07/05 */ #include "dwin_lcd.h" @@ -39,6 +39,7 @@ #define ICON_BedSizeY ICON_PrintSize #define ICON_BedTramming ICON_SetHome #define ICON_Binary ICON_Contact +#define ICON_BltouchReset ICON_StockConfiguration #define ICON_Brightness ICON_Motion #define ICON_Cancel ICON_StockConfiguration #define ICON_CustomPreheat ICON_SetEndTemp @@ -145,7 +146,7 @@ #define DWIN_FONT_HEAD font10x20 #define DWIN_FONT_ALERT font10x20 #define STATUS_Y 354 -#define LCD_WIDTH (DWIN_WIDTH / 8) // only if the default font is font8x16 +#define LCD_WIDTH (DWIN_WIDTH / 8) // only if the default fontid is font8x16 // Minimum unit (0.1) : multiple (10) #define UNITFDIGITS 1 @@ -156,7 +157,7 @@ constexpr uint8_t TITLE_HEIGHT = 30, // Title bar heig TROWS = (STATUS_Y - TITLE_HEIGHT) / MLINE, // Total rows MROWS = TROWS - 1, // Other-than-Back ICOX = 26, // Menu item icon X position - LBLX = 60, // Menu item label X position + LBLX = 55, // Menu item label X position VALX = 210, // Menu item value X position MENU_CHR_W = 8, MENU_CHR_H = 16, // Menu font 8x16 STAT_CHR_W = 10; @@ -196,7 +197,7 @@ namespace DWINUI { extern uint16_t textcolor; extern uint16_t backcolor; extern uint16_t buttoncolor; - extern uint8_t font; + extern fontid_t fontid; extern FSTR_P const Author; extern void (*onTitleDraw)(TitleClass* title); @@ -205,15 +206,15 @@ namespace DWINUI { void init(); // Set text/number font - void setFont(uint8_t cfont); + void setFont(fontid_t cfont); // Get font character width - uint8_t fontWidth(uint8_t cfont); - inline uint8_t fontWidth() { return fontWidth(font); }; + uint8_t fontWidth(fontid_t cfont); + inline uint8_t fontWidth() { return fontWidth(fontid); }; // Get font character height - uint8_t fontHeight(uint8_t cfont); - inline uint8_t fontHeight() { return fontHeight(font); }; + uint8_t fontHeight(fontid_t cfont); + inline uint8_t fontHeight() { return fontHeight(fontid); }; // Get screen x coordinates from text column uint16_t ColToX(uint8_t col); @@ -278,108 +279,108 @@ namespace DWINUI { // Draw a numeric integer value // bShow: true=display background color; false=don't display background color // signedMode: 1=signed; 0=unsigned - // size: Font size + // fid: Font ID // color: Character color // bColor: Background color // iNum: Number of digits // x/y: Upper-left coordinate // value: Integer value - void Draw_Int(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value); + void Draw_Int(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, int32_t value); // Draw a positive integer - inline void Draw_Int(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(bShow, 0, size, color, bColor, iNum, x, y, value); + inline void Draw_Int(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + Draw_Int(bShow, 0, fid, color, bColor, iNum, x, y, value); } inline void Draw_Int(uint8_t iNum, long value) { - Draw_Int(false, 0, font, textcolor, backcolor, iNum, cursor.x, cursor.y, value); - MoveBy(iNum * fontWidth(font), 0); + Draw_Int(false, 0, fontid, textcolor, backcolor, iNum, cursor.x, cursor.y, value); + MoveBy(iNum * fontWidth(fontid), 0); } inline void Draw_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(false, 0, font, textcolor, backcolor, iNum, x, y, value); + Draw_Int(false, 0, fontid, textcolor, backcolor, iNum, x, y, value); } inline void Draw_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(false, 0, font, color, backcolor, iNum, x, y, value); + Draw_Int(false, 0, fontid, color, backcolor, iNum, x, y, value); } inline void Draw_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(true, 0, font, color, bColor, iNum, x, y, value); + Draw_Int(true, 0, fontid, color, bColor, iNum, x, y, value); } - inline void Draw_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(true, 0, size, color, bColor, iNum, x, y, value); + inline void Draw_Int(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + Draw_Int(true, 0, fid, color, bColor, iNum, x, y, value); } // Draw a signed integer - inline void Draw_Signed_Int(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(bShow, 1, size, color, bColor, iNum, x, y, value); + inline void Draw_Signed_Int(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + Draw_Int(bShow, 1, fid, color, bColor, iNum, x, y, value); } inline void Draw_Signed_Int(uint8_t iNum, long value) { - Draw_Int(false, 1, font, textcolor, backcolor, iNum, cursor.x, cursor.y, value); - MoveBy(iNum * fontWidth(font), 0); + Draw_Int(false, 1, fontid, textcolor, backcolor, iNum, cursor.x, cursor.y, value); + MoveBy(iNum * fontWidth(fontid), 0); } inline void Draw_Signed_Int(uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(false, 1, font, textcolor, backcolor, iNum, x, y, value); + Draw_Int(false, 1, fontid, textcolor, backcolor, iNum, x, y, value); } inline void Draw_Signed_Int(uint16_t color, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(false, 1, font, color, backcolor, iNum, x, y, value); + Draw_Int(false, 1, fontid, color, backcolor, iNum, x, y, value); } inline void Draw_Signed_Int(uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(true, 1, font, color, bColor, iNum, x, y, value); + Draw_Int(true, 1, fontid, color, bColor, iNum, x, y, value); } - inline void Draw_Signed_Int(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { - Draw_Int(true, 1, size, color, bColor, iNum, x, y, value); + inline void Draw_Signed_Int(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint16_t x, uint16_t y, long value) { + Draw_Int(true, 1, fid, color, bColor, iNum, x, y, value); } // Draw a numeric float value // bShow: true=display background color; false=don't display background color // signedMode: 1=signed; 0=unsigned - // size: Font size + // fid: Font ID // color: Character color // bColor: Background color // iNum: Number of digits // fNum: Number of decimal digits // x/y: Upper-left coordinate // value: float value - void Draw_Float(uint8_t bShow, bool signedMode, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value); + void Draw_Float(uint8_t bShow, bool signedMode, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value); // Draw a positive floating point number - inline void Draw_Float(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(bShow, 0, size, color, bColor, iNum, fNum, x, y, value); + inline void Draw_Float(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(bShow, 0, fid, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Float(uint8_t iNum, uint8_t fNum, float value) { - Draw_Float(false, 0, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); - MoveBy((iNum + fNum + 1) * fontWidth(font), 0); + Draw_Float(false, 0, fontid, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); + MoveBy((iNum + fNum + 1) * fontWidth(fontid), 0); } inline void Draw_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(false, 0, font, textcolor, backcolor, iNum, fNum, x, y, value); + Draw_Float(false, 0, fontid, textcolor, backcolor, iNum, fNum, x, y, value); } - inline void Draw_Float(uint8_t size, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(false, 0, size, textcolor, backcolor, iNum, fNum, x, y, value); + inline void Draw_Float(fontid_t fid, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(false, 0, fid, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(true, 0, font, color, bColor, iNum, fNum, x, y, value); + Draw_Float(true, 0, fontid, color, bColor, iNum, fNum, x, y, value); } - inline void Draw_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(true, 0, size, color, bColor, iNum, fNum, x, y, value); + inline void Draw_Float(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(true, 0, fid, color, bColor, iNum, fNum, x, y, value); } // Draw a signed floating point number - inline void Draw_Signed_Float(uint8_t bShow, uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(bShow, 1, size, color, bColor, iNum, fNum, x, y, value); + inline void Draw_Signed_Float(uint8_t bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(bShow, 1, fid, color, bColor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, float value) { - Draw_Float(false, 1, font, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); - MoveBy((iNum + fNum + 1) * fontWidth(font), 0); + Draw_Float(false, 1, fontid, textcolor, backcolor, iNum, fNum, cursor.x, cursor.y, value); + MoveBy((iNum + fNum + 1) * fontWidth(fontid), 0); } inline void Draw_Signed_Float(uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(false, 1, font, textcolor, backcolor, iNum, fNum, x, y, value); + Draw_Float(false, 1, fontid, textcolor, backcolor, iNum, fNum, x, y, value); } - inline void Draw_Signed_Float(uint8_t size, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(false, 1, size, textcolor, backcolor, iNum, fNum, x, y, value); + inline void Draw_Signed_Float(fontid_t fid, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(false, 1, fid, textcolor, backcolor, iNum, fNum, x, y, value); } inline void Draw_Signed_Float(uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(true, 1, font, color, bColor, iNum, fNum, x, y, value); + Draw_Float(true, 1, fontid, color, bColor, iNum, fNum, x, y, value); } - inline void Draw_Signed_Float(uint8_t size, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { - Draw_Float(true, 1, size, color, bColor, iNum, fNum, x, y, value); + inline void Draw_Signed_Float(fontid_t fid, uint16_t color, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, float value) { + Draw_Float(true, 1, fid, color, bColor, iNum, fNum, x, y, value); } // Draw a char @@ -407,70 +408,70 @@ namespace DWINUI { } // Draw a string - // size: Font size + // fid: Font ID // color: Character color // bColor: Background color // x/y: Upper-left coordinate of the string // *string: The string inline void Draw_String(uint16_t x, uint16_t y, const char * const string) { - DWIN_Draw_String(false, font, textcolor, backcolor, x, y, string); + DWIN_Draw_String(false, fontid, textcolor, backcolor, x, y, string); } inline void Draw_String(uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(false, font, textcolor, backcolor, x, y, FTOP(title)); + DWIN_Draw_String(false, fontid, textcolor, backcolor, x, y, FTOP(title)); } inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, const char * const string) { - DWIN_Draw_String(false, font, color, backcolor, x, y, string); + DWIN_Draw_String(false, fontid, color, backcolor, x, y, string); } inline void Draw_String(uint16_t color, uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(false, font, color, backcolor, x, y, title); + DWIN_Draw_String(false, fontid, color, backcolor, x, y, title); } inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) { - DWIN_Draw_String(true, font, color, bgcolor, x, y, string); + DWIN_Draw_String(true, fontid, color, bgcolor, x, y, string); } inline void Draw_String(uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(true, font, color, bgcolor, x, y, title); + DWIN_Draw_String(true, fontid, color, bgcolor, x, y, title); } - inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) { - DWIN_Draw_String(true, size, color, bgcolor, x, y, string); + inline void Draw_String(fontid_t fid, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, const char * const string) { + DWIN_Draw_String(true, fid, color, bgcolor, x, y, string); } - inline void Draw_String(uint8_t size, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) { - DWIN_Draw_String(true, size, color, bgcolor, x, y, title); + inline void Draw_String(fontid_t fid, uint16_t color, uint16_t bgcolor, uint16_t x, uint16_t y, FSTR_P title) { + DWIN_Draw_String(true, fid, color, bgcolor, x, y, title); } // Draw a centered string using DWIN_WIDTH // bShow: true=display background color; false=don't display background color - // size: Font size + // fid: Font ID // color: Character color // bColor: Background color // y: Upper coordinate of the string // *string: The string - void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string); - inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) { - Draw_CenteredString(bShow, size, color, bColor, 0, DWIN_WIDTH, y, string); + void Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t x1, uint16_t x2, uint16_t y, const char * const string); + inline void Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t y, const char * const string) { + Draw_CenteredString(bShow, fid, color, bColor, 0, DWIN_WIDTH, y, string); } - inline void Draw_CenteredString(bool bShow, uint8_t size, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P string) { - Draw_CenteredString(bShow, size, color, bColor, y, FTOP(string)); + inline void Draw_CenteredString(bool bShow, fontid_t fid, uint16_t color, uint16_t bColor, uint16_t y, FSTR_P string) { + Draw_CenteredString(bShow, fid, color, bColor, y, FTOP(string)); } inline void Draw_CenteredString(uint16_t color, uint16_t bcolor, uint16_t y, const char * const string) { - Draw_CenteredString(true, font, color, bcolor, y, string); + Draw_CenteredString(true, fontid, color, bcolor, y, string); } - inline void Draw_CenteredString(uint8_t size, uint16_t color, uint16_t y, const char * const string) { - Draw_CenteredString(false, size, color, backcolor, y, string); + inline void Draw_CenteredString(fontid_t fid, uint16_t color, uint16_t y, const char * const string) { + Draw_CenteredString(false, fid, color, backcolor, y, string); } - inline void Draw_CenteredString(uint8_t size, uint16_t color, uint16_t y, FSTR_P title) { - Draw_CenteredString(false, size, color, backcolor, y, title); + inline void Draw_CenteredString(fontid_t fid, uint16_t color, uint16_t y, FSTR_P title) { + Draw_CenteredString(false, fid, color, backcolor, y, title); } inline void Draw_CenteredString(uint16_t color, uint16_t y, const char * const string) { - Draw_CenteredString(false, font, color, backcolor, y, string); + Draw_CenteredString(false, fontid, color, backcolor, y, string); } inline void Draw_CenteredString(uint16_t color, uint16_t y, FSTR_P title) { - Draw_CenteredString(false, font, color, backcolor, y, title); + Draw_CenteredString(false, fontid, color, backcolor, y, title); } inline void Draw_CenteredString(uint16_t y, const char * const string) { - Draw_CenteredString(false, font, textcolor, backcolor, y, string); + Draw_CenteredString(false, fontid, textcolor, backcolor, y, string); } inline void Draw_CenteredString(uint16_t y, FSTR_P title) { - Draw_CenteredString(false, font, textcolor, backcolor, y, title); + Draw_CenteredString(false, fontid, textcolor, backcolor, y, title); } // Draw a box diff --git a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp index 44b595096a..86c2095294 100644 --- a/Marlin/src/lcd/e3v2/proui/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/proui/lockscreen.cpp @@ -31,8 +31,10 @@ #if ENABLED(DWIN_LCD_PROUI) -#include "../../../core/types.h" -#include "dwin_lcd.h" +#include "dwin_defines.h" + +#if HAS_LOCKSCREEN + #include "dwinui.h" #include "dwin.h" #include "lockscreen.h" @@ -73,4 +75,6 @@ void LockScreenClass::onEncoder(EncoderState encoder_diffState) { DWIN_UpdateLCD(); } +#endif // HAS_LOCKSCREEN + #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/menus.cpp b/Marlin/src/lcd/e3v2/proui/menus.cpp index 6438545cb2..85594fecdb 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.cpp +++ b/Marlin/src/lcd/e3v2/proui/menus.cpp @@ -23,8 +23,8 @@ /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo - * Version: 1.4.1 - * Date: 2022/04/14 + * Version: 1.5.1 + * Date: 2022/05/23 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -166,6 +166,17 @@ void onDrawChkbMenu(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, val); } +void DrawItemEdit() { + switch (checkkey) { + case SetIntNoDraw: if (MenuData.LiveUpdate) MenuData.LiveUpdate(); break; + case SetInt: + case SetPInt: DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); break; + case SetFloat: + case SetPFloat: DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, MenuData.dp, VALX - MenuData.dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, MenuData.dp)); break; + default: break; + } +} + //----------------------------------------------------------------------------- // On click functions //----------------------------------------------------------------------------- @@ -307,7 +318,7 @@ int8_t HMI_GetInt(const int32_t lo, const int32_t hi) { return 2; } LIMIT(MenuData.Value, lo, hi); - DWINUI::Draw_Signed_Int(HMI_data.Text_Color, HMI_data.Selected_Color, 4 , VALX, MBASE(CurrentMenu->line()) - 1, MenuData.Value); + DrawItemEdit(); return 1; } return 0; @@ -361,7 +372,7 @@ int8_t HMI_GetFloat(uint8_t dp, int32_t lo, int32_t hi) { return 2; } LIMIT(MenuData.Value, lo, hi); - DWINUI::Draw_Signed_Float(HMI_data.Text_Color, HMI_data.Selected_Color, 3, dp, VALX - dp * DWINUI::fontWidth(DWIN_FONT_MENU), MBASE(CurrentMenu->line()), MenuData.Value / POW(10, dp)); + DrawItemEdit(); return 1; } return 0; @@ -469,7 +480,7 @@ void MenuItemClass::SetFrame(uint8_t id, uint16_t x1, uint16_t y1, uint16_t x2, } void MenuItemClass::draw(int8_t line) { - if (line < 0 || line >= TROWS) return; + if (!WITHIN(line, 0, TROWS - 1)) return; if (onDraw != nullptr) (*onDraw)(this, line); }; @@ -547,6 +558,9 @@ void UpdateMenu(MenuClass* &menu) { menu->draw(); } -void ReDrawMenu() { if (CurrentMenu && checkkey==Menu) CurrentMenu->draw(); } +void ReDrawMenu(const bool force/*=false*/) { + if (CurrentMenu && (force || checkkey == Menu)) CurrentMenu->draw(); + if (force) DrawItemEdit(); +} #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/e3v2/proui/menus.h b/Marlin/src/lcd/e3v2/proui/menus.h index d4514d1732..6a5f8786ca 100644 --- a/Marlin/src/lcd/e3v2/proui/menus.h +++ b/Marlin/src/lcd/e3v2/proui/menus.h @@ -23,8 +23,8 @@ /** * Menu functions for ProUI * Author: Miguel A. Risco-Castillo - * Version: 1.4.1 - * Date: 2022/04/14 + * Version: 1.5.1 + * Date: 2022/05/23 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -168,7 +168,7 @@ bool SetMenu(MenuClass* &menu, FSTR_P title, int8_t totalitems); void UpdateMenu(MenuClass* &menu); //Redraw the current Menu if it is valid -void ReDrawMenu(); +void ReDrawMenu(const bool force=false); // Clear MenuItems array and free MenuItems elements void MenuItemsClear(); diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp index c2d01a07eb..2511d33ff1 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.cpp @@ -31,8 +31,6 @@ #if BOTH(DWIN_LCD_PROUI, HAS_MESH) -#include "meshviewer.h" - #include "../../../core/types.h" #include "../../marlinui.h" #include "dwin_lcd.h" @@ -40,9 +38,10 @@ #include "dwin.h" #include "dwin_popup.h" #include "../../../feature/bedlevel/bedlevel.h" +#include "meshviewer.h" #if ENABLED(AUTO_BED_LEVELING_UBL) - #include "ubl_tools.h" + #include "bedlevel_tools.h" #endif MeshViewerClass MeshViewer; @@ -112,10 +111,10 @@ void MeshViewerClass::DrawMesh(bed_mesh_t zval, const uint8_t sizex, const uint8 void MeshViewerClass::Draw(bool withsave /*= false*/) { Title.ShowCaption(GET_TEXT_F(MSG_MESH_VIEWER)); - #if ENABLED(USE_UBL_VIEWER) + #if USE_UBL_VIEWER DWINUI::ClearMainArea(); - ubl_tools.viewer_print_value = true; - ubl_tools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT); + BedLevelTools.viewer_print_value = true; + BedLevelTools.Draw_Bed_Mesh(-1, 1, 8, 10 + TITLE_HEIGHT); #else DrawMesh(bedlevel.z_values, GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y); #endif @@ -127,8 +126,8 @@ void MeshViewerClass::Draw(bool withsave /*= false*/) { else DWINUI::Draw_Button(BTN_Continue, 86, 305); - #if ENABLED(USE_UBL_VIEWER) - ubl_tools.Set_Mesh_Viewer_Status(); + #if USE_UBL_VIEWER + BedLevelTools.Set_Mesh_Viewer_Status(); #else char str_1[6], str_2[6] = ""; ui.status_printf(0, F("Mesh minZ: %s, maxZ: %s"), diff --git a/Marlin/src/lcd/e3v2/proui/meshviewer.h b/Marlin/src/lcd/e3v2/proui/meshviewer.h index 1e78ff2657..3aafe16984 100644 --- a/Marlin/src/lcd/e3v2/proui/meshviewer.h +++ b/Marlin/src/lcd/e3v2/proui/meshviewer.h @@ -21,9 +21,6 @@ */ #pragma once -#include "../../../core/types.h" -#include "../../../feature/bedlevel/bedlevel.h" - /** * Mesh Viewer for PRO UI * Author: Miguel A. Risco-Castillo (MRISCOC) diff --git a/Marlin/src/lcd/e3v2/proui/plot.cpp b/Marlin/src/lcd/e3v2/proui/plot.cpp index ebc685fa24..cb1f6c2dda 100644 --- a/Marlin/src/lcd/e3v2/proui/plot.cpp +++ b/Marlin/src/lcd/e3v2/proui/plot.cpp @@ -46,13 +46,16 @@ #ifdef DWIN_LCD_PROUI +#include "dwin_defines.h" + +#if HAS_PIDPLOT + #include "plot.h" #include "../../../core/types.h" #include "../../marlinui.h" #include "dwin_lcd.h" #include "dwinui.h" -#include "dwin_popup.h" #include "dwin.h" #define Plot_Bg_Color RGB( 1, 12, 8) @@ -71,7 +74,7 @@ void PlotClass::Draw(const frame_rect_t frame, const float max, const float ref) y2 = frame.y + frame.h - 1; r = round((y2) - ref * scale); DWINUI::Draw_Box(1, Plot_Bg_Color, frame); - for (uint8_t i = 1; i < 4; i++) if (i*50 < frame.w) DWIN_Draw_VLine(Line_Color, i*50 + frame.x, frame.y, frame.h); + for (uint8_t i = 1; i < 4; i++) if (i * 50 < frame.w) DWIN_Draw_VLine(Line_Color, i * 50 + frame.x, frame.y, frame.h); DWINUI::Draw_Box(0, Color_White, DWINUI::ExtendFrame(frame, 1)); DWIN_Draw_HLine(Color_Red, frame.x, r, frame.w); } @@ -91,4 +94,6 @@ void PlotClass::Update(const float value) { grphpoints++; } +#endif // HAS_PIDPLOT + #endif // DWIN_LCD_PROUI diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index f2a9cb0c08..57cae3d328 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -254,6 +254,7 @@ namespace Language_en { LSTR MSG_UBL_SMART_FILLIN = _UxGT("Smart Fill-in"); LSTR MSG_UBL_FILLIN_MESH = _UxGT("Fill-in Mesh"); LSTR MSG_UBL_MESH_FILLED = _UxGT("Missing Points Filled"); + LSTR MSG_UBL_MESH_INVALID = _UxGT("Invalid Mesh"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Invalidate All"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Invalidate Closest"); LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Fine Tune All"); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 5a0de47bf2..389ae6d4bf 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -188,7 +188,7 @@ typedef struct { * The "nominal" values are as-specified by G-code, and * may never actually be reached due to acceleration limits. */ -typedef struct block_t { +typedef struct PlannerBlock { volatile block_flags_t flag; // Block flags diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index d21dc92c67..a37dfc0257 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -76,6 +76,7 @@ #include "../lcd/extui/ui_api.h" #elif ENABLED(DWIN_LCD_PROUI) #include "../lcd/e3v2/proui/dwin.h" + #include "../lcd/e3v2/proui/bedlevel_tools.h" #endif #if ENABLED(HOST_PROMPT_SUPPORT) @@ -2756,7 +2757,7 @@ void MarlinSettings::postprocess() { #endif persistentStore.access_start(); - const uint16_t status = persistentStore.read_data(pos, dest, MESH_STORE_SIZE, &crc); + uint16_t status = persistentStore.read_data(pos, dest, MESH_STORE_SIZE, &crc); persistentStore.access_finish(); #if ENABLED(OPTIMIZED_MESH_STORAGE) @@ -2769,6 +2770,16 @@ void MarlinSettings::postprocess() { bedlevel.set_mesh_from_store(z_mesh_store, bedlevel.z_values); #endif + #if ENABLED(DWIN_LCD_PROUI) + status = !BedLevelTools.meshvalidate(); + if (status) { + bedlevel.invalidate(); + LCD_MESSAGE(MSG_UBL_MESH_INVALID); + } + else + ui.status_printf(0, GET_TEXT_F(MSG_MESH_LOADED), bedlevel.storage_slot); + #endif + if (status) SERIAL_ECHOLNPGM("?Unable to load mesh data."); else DEBUG_ECHOLNPGM("Mesh loaded from slot ", slot); From 30ec700a1d22d586d00688a7b94fd84e2a32c929 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Thu, 14 Jul 2022 07:03:27 +0200 Subject: [PATCH 09/31] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20ProUI=20LED=20compil?= =?UTF-8?q?e=20(#24473)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 14 +++++++++----- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 9 +++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 27e1003ab6..762a4fb627 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1843,10 +1843,10 @@ void DWIN_CopySettingsFrom(const char * const buff) { TERN_(BAUD_RATE_GCODE, HMI_SetBaudRate()); #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) leds.set_color( - (HMI_data.LED_Color >> 16) & 0xFF, - (HMI_data.LED_Color >> 8) & 0xFF, - (HMI_data.LED_Color >> 0) & 0xFF - OPTARG(HAS_WHITE_LED, (HMI_data.LED_Color >> 24) & 0xFF) + HMI_data.Led_Color.r, + HMI_data.Led_Color.g, + HMI_data.Led_Color.b + OPTARG(HAS_WHITE_LED, HMI_data.Led_Color.w) ); leds.update(); #endif @@ -2267,7 +2267,11 @@ void SetPID(celsius_t t, heater_id_t h) { } #endif #if HAS_COLOR_LEDS - void ApplyLEDColor() { HMI_data.LED_Color = TERN0(HAS_WHITE_LED, (leds.color.w << 24)) | (leds.color.r << 16) | (leds.color.g << 8) | leds.color.b; } + void ApplyLEDColor() { + HMI_data.Led_Color = LEDColor( + TERN(HAS_WHITE_LED, { 0, 0, 0, leds.color.w }, { leds.color.r, leds.color.g, leds.color.b }) + ); + } void LiveLEDColor(uint8_t *color) { *color = MenuData.Value; leds.update(); } void LiveLEDColorR() { LiveLEDColor(&leds.color.r); } void LiveLEDColorG() { LiveLEDColor(&leds.color.g); } diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 0c4e0104f4..98aadb8e73 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -64,10 +64,7 @@ #define Def_Coordinate_Color Color_White #define Def_Button_Color RGB( 0, 23, 16) #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - #define Def_Leds_Color 0xFFFFFFFF -#endif -#if ENABLED(CASELIGHT_USES_BRIGHTNESS) - #define Def_CaseLight_Brightness 255 + #define Def_Leds_Color LEDColorWhite() #endif typedef struct { @@ -110,12 +107,12 @@ typedef struct { bool Baud115K = false; #endif bool FullManualTramming = false; - // Led #if ENABLED(MESH_BED_LEVELING) float ManualZOffset = 0; #endif + // Led #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - uint32_t LED_Color = Def_Leds_Color; + LEDColor Led_Color = Def_Leds_Color; #endif } HMI_data_t; From 0dc46a8d279ba4ab6c53b5a6dc3848b8943cea69 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Thu, 14 Jul 2022 06:22:49 +0000 Subject: [PATCH 10/31] [cron] Bump distribution date (2022-07-14) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index d53dffc2e1..c5e7c72e19 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2022-07-13" +//#define STRING_DISTRIBUTION_DATE "2022-07-14" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 8e22a5b5a3..ecd5e97a79 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 "2022-07-13" + #define STRING_DISTRIBUTION_DATE "2022-07-14" #endif /** From a61fab7302c56f87827eccb47ec67025ccd2b645 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Thu, 14 Jul 2022 03:30:00 -0300 Subject: [PATCH 11/31] =?UTF-8?q?=E2=9C=A8=20Creality3D=20v4.2.5=20/=20CR2?= =?UTF-8?q?00B=20(#24491)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 47 ++++---- Marlin/src/pins/pins.h | 2 + Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 108 +++++++++++++------ Marlin/src/pins/stm32f1/pins_CREALITY_V425.h | 77 +++++++++++++ 4 files changed, 176 insertions(+), 58 deletions(-) create mode 100644 Marlin/src/pins/stm32f1/pins_CREALITY_V425.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index 2e71c632de..fa11c97380 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -343,29 +343,30 @@ #define BOARD_CREALITY_V4 4040 // Creality v4.x (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V422 4041 // Creality v4.2.2 (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V423 4042 // Creality v4.2.3 (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V427 4043 // Creality v4.2.7 (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V4210 4044 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30 -#define BOARD_CREALITY_V431 4045 // Creality v4.3.1 (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V431_A 4046 // Creality v4.3.1a (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V431_B 4047 // Creality v4.3.1b (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V431_C 4048 // Creality v4.3.1c (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V431_D 4049 // Creality v4.3.1d (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V452 4050 // Creality v4.5.2 (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V453 4051 // Creality v4.5.3 (STM32F103RC / STM32F103RE) -#define BOARD_CREALITY_V24S1 4052 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7 -#define BOARD_CREALITY_V24S1_301 4053 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1 -#define BOARD_CREALITY_V25S1 4054 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro -#define BOARD_TRIGORILLA_PRO 4055 // Trigorilla Pro (STM32F103ZE) -#define BOARD_FLY_MINI 4056 // FLYmaker FLY MINI (STM32F103RC) -#define BOARD_FLSUN_HISPEED 4057 // FLSUN HiSpeedV1 (STM32F103VE) -#define BOARD_BEAST 4058 // STM32F103RE Libmaple-based controller -#define BOARD_MINGDA_MPX_ARM_MINI 4059 // STM32F103ZE Mingda MD-16 -#define BOARD_GTM32_PRO_VD 4060 // STM32F103VE controller -#define BOARD_ZONESTAR_ZM3E2 4061 // Zonestar ZM3E2 (STM32F103RC) -#define BOARD_ZONESTAR_ZM3E4 4062 // Zonestar ZM3E4 V1 (STM32F103VC) -#define BOARD_ZONESTAR_ZM3E4V2 4063 // Zonestar ZM3E4 V2 (STM32F103VC) -#define BOARD_ERYONE_ERY32_MINI 4064 // Eryone Ery32 mini (STM32F103VE) -#define BOARD_PANDA_PI_V29 4065 // Panda Pi V2.9 - Standalone (STM32F103RC) +#define BOARD_CREALITY_V425 4043 // Creality v4.2.5 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V427 4044 // Creality v4.2.7 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V4210 4045 // Creality v4.2.10 (STM32F103RC / STM32F103RE) as found in the CR-30 +#define BOARD_CREALITY_V431 4046 // Creality v4.3.1 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_A 4047 // Creality v4.3.1a (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_B 4048 // Creality v4.3.1b (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_C 4049 // Creality v4.3.1c (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V431_D 4050 // Creality v4.3.1d (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V452 4051 // Creality v4.5.2 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V453 4052 // Creality v4.5.3 (STM32F103RC / STM32F103RE) +#define BOARD_CREALITY_V24S1 4053 // Creality v2.4.S1 (STM32F103RC / STM32F103RE) v101 as found in the Ender-7 +#define BOARD_CREALITY_V24S1_301 4054 // Creality v2.4.S1_301 (STM32F103RC / STM32F103RE) v301 as found in the Ender-3 S1 +#define BOARD_CREALITY_V25S1 4055 // Creality v2.5.S1 (STM32F103RE) as found in the CR-10 Smart Pro +#define BOARD_TRIGORILLA_PRO 4056 // Trigorilla Pro (STM32F103ZE) +#define BOARD_FLY_MINI 4057 // FLYmaker FLY MINI (STM32F103RC) +#define BOARD_FLSUN_HISPEED 4058 // FLSUN HiSpeedV1 (STM32F103VE) +#define BOARD_BEAST 4059 // STM32F103RE Libmaple-based controller +#define BOARD_MINGDA_MPX_ARM_MINI 4060 // STM32F103ZE Mingda MD-16 +#define BOARD_GTM32_PRO_VD 4061 // STM32F103VE controller +#define BOARD_ZONESTAR_ZM3E2 4062 // Zonestar ZM3E2 (STM32F103RC) +#define BOARD_ZONESTAR_ZM3E4 4063 // Zonestar ZM3E4 V1 (STM32F103VC) +#define BOARD_ZONESTAR_ZM3E4V2 4064 // Zonestar ZM3E4 V2 (STM32F103VC) +#define BOARD_ERYONE_ERY32_MINI 4065 // Eryone Ery32 mini (STM32F103VE) +#define BOARD_PANDA_PI_V29 4066 // Panda Pi V2.9 - Standalone (STM32F103RC) // // ARM Cortex-M4F diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 8457cdc4ff..8925993c36 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -567,6 +567,8 @@ #include "stm32f1/pins_CREALITY_V4.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V4210) #include "stm32f1/pins_CREALITY_V4210.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple +#elif MB(CREALITY_V425) + #include "stm32f1/pins_CREALITY_V425.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V422) #include "stm32f1/pins_CREALITY_V422.h" // STM32F1 env:STM32F103RE_creality env:STM32F103RE_creality_xfer env:STM32F103RC_creality env:STM32F103RC_creality_xfer env:STM32F103RE_creality_maple #elif MB(CREALITY_V423) diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index cb11c3e53b..7e3979b87e 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -77,8 +77,12 @@ // // Limit Switches // -#define X_STOP_PIN PA5 -#define Y_STOP_PIN PA6 +#ifndef X_STOP_PIN + #define X_STOP_PIN PA5 +#endif +#ifndef Y_STOP_PIN + #define Y_STOP_PIN PA6 +#endif #ifndef Z_STOP_PIN #define Z_STOP_PIN PA7 #endif @@ -153,7 +157,7 @@ // SD Card // #define SD_DETECT_PIN PC7 -#define SDCARD_CONNECTION ONBOARD +#define SDCARD_CONNECTION ONBOARD #define SDIO_SUPPORT #define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer @@ -161,53 +165,87 @@ #if ENABLED(RET6_12864_LCD) - // RET6 12864 LCD - #define LCD_PINS_RS PB12 - #define LCD_PINS_ENABLE PB15 - #define LCD_PINS_D4 PB13 - - #define BTN_ENC PB2 - #define BTN_EN1 PB10 - #define BTN_EN2 PB14 + /** + * RET6 12864 LCD + * ------ + * PC6 |10 9 | PB2 + * PB10 | 8 7 | PE8 + * PB14 6 5 | PB13 + * PB12 | 4 3 | PB15 + * GND | 2 1 | 5V + * ------ + * EXP1 + */ + #define EXP1_03_PIN PB15 + #define EXP1_04_PIN PB12 + #define EXP1_05_PIN PB13 + #define EXP1_06_PIN PB14 + #define EXP1_07_PIN PE8 + #define EXP1_08_PIN PB10 + #define EXP1_09_PIN PB2 + #define EXP1_10_PIN PC6 #ifndef HAS_PIN_27_BOARD - #define BEEPER_PIN PC6 + #define BEEPER_PIN EXP1_10_PIN #endif #elif ENABLED(VET6_12864_LCD) - // VET6 12864 LCD - #define LCD_PINS_RS PA4 - #define LCD_PINS_ENABLE PA7 - #define LCD_PINS_D4 PA5 - - #define BTN_ENC PC5 - #define BTN_EN1 PB10 - #define BTN_EN2 PA6 + /** + * VET6 12864 LCD + * ------ + * ? |10 9 | PC5 + * PB10 | 8 7 | ? + * PA6 6 5 | PA5 + * PA4 | 4 3 | PA7 + * GND | 2 1 | 5V + * ------ + * EXP1 + */ + #define EXP1_03_PIN PA7 + #define EXP1_04_PIN PA4 + #define EXP1_05_PIN PA5 + #define EXP1_06_PIN PA6 + #define EXP1_07_PIN -1 + #define EXP1_08_PIN PB10 + #define EXP1_09_PIN PC5 + #define EXP1_10_PIN -1 #else #error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller." #endif -#elif HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN - // RET6 DWIN ENCODER LCD - #define BTN_ENC PB14 - #define BTN_EN1 PB15 - #define BTN_EN2 PB12 + #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_06_PIN - //#define LCD_LED_PIN PB2 - #ifndef BEEPER_PIN - #define BEEPER_PIN PB13 +#elif ANY(HAS_DWIN_E3V2, IS_DWIN_MARLINUI, DWIN_VET6_CREALITY_LCD) + + #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + // RET6 DWIN ENCODER LCD + #define EXP1_03_PIN PB15 + #define EXP1_04_PIN PB12 + #define EXP1_05_PIN PB13 + #define EXP1_06_PIN PB14 + //#define LCD_LED_PIN PB2 + #else + // VET6 DWIN ENCODER LCD + #define EXP1_03_PIN PA7 + #define EXP1_04_PIN PA4 + #define EXP1_05_PIN PA5 + #define EXP1_06_PIN PA6 #endif -#elif ENABLED(DWIN_VET6_CREALITY_LCD) + #define BTN_ENC EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_04_PIN - // VET6 DWIN ENCODER LCD - #define BTN_ENC PA6 - #define BTN_EN1 PA7 - #define BTN_EN2 PA4 - - #define BEEPER_PIN PA5 + #ifndef BEEPER_PIN + #define BEEPER_PIN EXP1_05_PIN + #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V425.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V425.h new file mode 100644 index 0000000000..46f437ecaf --- /dev/null +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V425.h @@ -0,0 +1,77 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2022 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 + +/** + * CREALITY 4.2.5 (STM32F103RE / STM32F103RC) board pin assignments + */ + +#include "env_validate.h" + +#if HAS_MULTI_HOTEND || E_STEPPERS > 1 + #error "Creality v4.2.5 only supports 1 hotend / E stepper." +#endif + +#define BOARD_INFO_NAME "Creality V4.2.5" +#define DEFAULT_MACHINE_NAME "CR200B" + +// +// EEPROM +// +#if NO_EEPROM_SELECTED + #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 + #undef NO_EEPROM_SELECTED +#elif DISABLED(IIC_BL24CXX_EEPROM) + #define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX +#endif + +// +// Servos +// +#define SERVO0_PIN PB1 // BLTouch OUT + +// +// Limit Switches +// +#define X_STOP_PIN PA3 +#define Y_STOP_PIN PA4 +#define Z_STOP_PIN PA5 + +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN PB0 // BLTouch IN +#endif + +// +// Filament Runout Sensor +// +#ifndef FIL_RUNOUT_PIN + #define FIL_RUNOUT_PIN PA6 // "Pulled-high" +#endif + +// +// Heaters / Fans +// +#define HEATER_0_PIN PA0 // HEATER1 +#define HEATER_BED_PIN PA1 // HOT BED +#define FAN_PIN PA2 // FAN + +#include "pins_CREALITY_V4.h" From 0941e8e869cfbf3eedf37660ebf3010f5e7a3f77 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Wed, 13 Jul 2022 23:31:47 -0700 Subject: [PATCH 12/31] =?UTF-8?q?=F0=9F=93=8C=20Pin=20ESP32SSDP=20to=201.1?= =?UTF-8?q?.1=20(#24489)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ini/features.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ini/features.ini b/ini/features.ini index 3e34e01d5c..6eebbe8fd2 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -236,5 +236,5 @@ HAS_MICROSTEPS = src_filter=+ Date: Thu, 14 Jul 2022 02:56:55 -0500 Subject: [PATCH 13/31] =?UTF-8?q?=F0=9F=94=A8=20Fix=20and=20update=20Makef?= =?UTF-8?q?ile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to 89fe5f6d --- Marlin/Makefile | 121 ++---------------------------------------------- 1 file changed, 4 insertions(+), 117 deletions(-) diff --git a/Marlin/Makefile b/Marlin/Makefile index 563354fdbe..c72c1d5896 100644 --- a/Marlin/Makefile +++ b/Marlin/Makefile @@ -317,123 +317,10 @@ else ifeq ($(HARDWARE_MOTHERBOARD),1159) else ifeq ($(HARDWARE_MOTHERBOARD),1160) # Longer LKx PRO / Alfawise Uxx Pro (PRO version) else ifeq ($(HARDWARE_MOTHERBOARD),1161) - - -# 3Drag Controller -else ifeq ($(HARDWARE_MOTHERBOARD),1100) -# Velleman K8200 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),1101) -# Velleman K8400 Controller (derived from 3Drag Controller) -else ifeq ($(HARDWARE_MOTHERBOARD),1102) -# Velleman K8600 Controller (Vertex Nano) -else ifeq ($(HARDWARE_MOTHERBOARD),1103) -# Velleman K8800 Controller (Vertex Delta) -else ifeq ($(HARDWARE_MOTHERBOARD),1104) -# 2PrintBeta BAM&DICE with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1105) -# 2PrintBeta BAM&DICE Due with STK drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1106) -# MKS BASE v1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1107) -# MKS v1.4 with A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1108) -# MKS v1.5 with Allegro A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1109) -# MKS v1.6 with Allegro A4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1110) -# MKS BASE 1.0 with Heroic HR4982 stepper drivers -else ifeq ($(HARDWARE_MOTHERBOARD),1111) -# MKS GEN v1.3 or 1.4 -else ifeq ($(HARDWARE_MOTHERBOARD),1112) -# MKS GEN L -else ifeq ($(HARDWARE_MOTHERBOARD),1113) -# zrib V2.0 control board (Chinese RAMPS replica) -else ifeq ($(HARDWARE_MOTHERBOARD),1114) -# BigTreeTech or BIQU KFB2.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1115) -# Felix 2.0+ Electronics Board (RAMPS like) -else ifeq ($(HARDWARE_MOTHERBOARD),1116) -# Invent-A-Part RigidBoard -else ifeq ($(HARDWARE_MOTHERBOARD),1117) -# Invent-A-Part RigidBoard V2 -else ifeq ($(HARDWARE_MOTHERBOARD),1118) -# Sainsmart 2-in-1 board -else ifeq ($(HARDWARE_MOTHERBOARD),1119) -# Ultimaker -else ifeq ($(HARDWARE_MOTHERBOARD),1120) -# Ultimaker (Older electronics. Pre 1.5.4. This is rare) -else ifeq ($(HARDWARE_MOTHERBOARD),1121) - MCU ?= atmega1280 - PROG_MCU ?= m1280 - -# Azteeg X3 -else ifeq ($(HARDWARE_MOTHERBOARD),1122) -# Azteeg X3 Pro -else ifeq ($(HARDWARE_MOTHERBOARD),1123) -# Ultimainboard 2.x (Uses TEMP_SENSOR 20) -else ifeq ($(HARDWARE_MOTHERBOARD),1124) -# Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),1125) -# Raise3D Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),1126) -# Rapide Lite RL200 Rumba -else ifeq ($(HARDWARE_MOTHERBOARD),1127) -# Formbot T-Rex 2 Plus -else ifeq ($(HARDWARE_MOTHERBOARD),1128) -# Formbot T-Rex 3 -else ifeq ($(HARDWARE_MOTHERBOARD),1129) -# Formbot Raptor -else ifeq ($(HARDWARE_MOTHERBOARD),1130) -# Formbot Raptor 2 -else ifeq ($(HARDWARE_MOTHERBOARD),1131) -# bq ZUM Mega 3D -else ifeq ($(HARDWARE_MOTHERBOARD),1132) -# MakeBoard Mini v2.1.2 is a control board sold by MicroMake -else ifeq ($(HARDWARE_MOTHERBOARD),1133) -# TriGorilla Anycubic version 1.3 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),1134) -# TriGorilla Anycubic version 1.4 based on RAMPS EFB -else ifeq ($(HARDWARE_MOTHERBOARD),1135) -# TriGorilla Anycubic version 1.4 Rev 1.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1136) -# Creality: Ender-4, CR-8 -else ifeq ($(HARDWARE_MOTHERBOARD),1137) -# Creality: CR10S, CR20, CR-X -else ifeq ($(HARDWARE_MOTHERBOARD),1138) -# Dagoma F5 -else ifeq ($(HARDWARE_MOTHERBOARD),1139) -# FYSETC F6 1.3 -else ifeq ($(HARDWARE_MOTHERBOARD),1140) -# FYSETC F6 1.5 -else ifeq ($(HARDWARE_MOTHERBOARD),1141) -# Duplicator i3 Plus -else ifeq ($(HARDWARE_MOTHERBOARD),1142) -# VORON -else ifeq ($(HARDWARE_MOTHERBOARD),1143) -# TRONXY V3 1.0 -else ifeq ($(HARDWARE_MOTHERBOARD),1144) -# Z-Bolt X Series -else ifeq ($(HARDWARE_MOTHERBOARD),1145) -# TT OSCAR -else ifeq ($(HARDWARE_MOTHERBOARD),1146) -# Overlord/Overlord Pro -else ifeq ($(HARDWARE_MOTHERBOARD),1147) -# ADIMLab Gantry v1 -else ifeq ($(HARDWARE_MOTHERBOARD),1148) -# ADIMLab Gantry v2 -else ifeq ($(HARDWARE_MOTHERBOARD),1149) -# BIQU Tango V1 -else ifeq ($(HARDWARE_MOTHERBOARD),1150) -# MKS GEN L V2 -else ifeq ($(HARDWARE_MOTHERBOARD),1151) -# MKS GEN L V2.1 -else ifeq ($(HARDWARE_MOTHERBOARD),1152) -# Copymaster 3D -else ifeq ($(HARDWARE_MOTHERBOARD),1153) -# Ortur 4 -else ifeq ($(HARDWARE_MOTHERBOARD),1154) -# Tenlog D3 Hero -else ifeq ($(HARDWARE_MOTHERBOARD),1155) +# Zonestar zrib V5.3 (Chinese RAMPS replica) +else ifeq ($(HARDWARE_MOTHERBOARD),1162) +# Pxmalion Core I3 +else ifeq ($(HARDWARE_MOTHERBOARD),1163) # # RAMBo and derivatives From 7361c03aa4c8a0d375e6f1a6f3d9f738b8ea4ad1 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Fri, 15 Jul 2022 00:26:29 +0000 Subject: [PATCH 14/31] [cron] Bump distribution date (2022-07-15) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index c5e7c72e19..6ca9ce5919 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2022-07-14" +//#define STRING_DISTRIBUTION_DATE "2022-07-15" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index ecd5e97a79..a57d4a2e16 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 "2022-07-14" + #define STRING_DISTRIBUTION_DATE "2022-07-15" #endif /** From de0706e52cbc94a18502f81d56145bedf3ee2cbb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2022 21:03:11 -0500 Subject: [PATCH 15/31] =?UTF-8?q?=F0=9F=94=A8=20Fix=20Warnings.cpp=20force?= =?UTF-8?q?-recompile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/preflight-checks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index e4bcc83cb3..40a31417e1 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -86,10 +86,12 @@ if pioutil.is_pio_build(): # # Give warnings on every build # - srcpath = os.path.join(env['PROJECT_BUILD_DIR'], build_env, "src", "src") - warnfile = os.path.join(srcpath, "inc", "Warnings.cpp.o") - if os.path.exists(warnfile): - os.remove(warnfile) + build_dir = os.path.join(env['PROJECT_BUILD_DIR'], build_env); + for outdir in [ build_dir, os.path.join(build_dir, "debug") ]: + for wext in [ ".cpp", "" ]: + warnfile = os.path.join(outdir, "src", "src", "inc", "Warnings" + wext + ".o") + if os.path.exists(warnfile): + os.remove(warnfile) # # Rebuild 'settings.cpp' for EEPROM_INIT_NOW From 0f5703a83749ab6335c5f1d5e5d3476ccb1facbe Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2022 21:56:13 -0500 Subject: [PATCH 16/31] =?UTF-8?q?=F0=9F=94=A8=20PlatformIO=20"--target=20u?= =?UTF-8?q?pload"=20=3D=3D=20"--target=20exec"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/simulator.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/simulator.py b/buildroot/share/PlatformIO/scripts/simulator.py index c6a5277b92..2961d2826d 100644 --- a/buildroot/share/PlatformIO/scripts/simulator.py +++ b/buildroot/share/PlatformIO/scripts/simulator.py @@ -50,5 +50,3 @@ if pioutil.is_pio_build(): # Break out of the PIO build immediately sys.exit(1) - - env.AddCustomTarget("upload", "$BUILD_DIR/${PROGNAME}", "$BUILD_DIR/${PROGNAME}") From 6eef8075205cc61abedd50f318e089d44c07209f Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Fri, 15 Jul 2022 10:18:57 +0200 Subject: [PATCH 17/31] =?UTF-8?q?=F0=9F=94=A8=20Fix=20firmware=20upload=20?= =?UTF-8?q?(#24499)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/scripts/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/scripts/upload.py b/buildroot/share/scripts/upload.py index 31d5620f4e..52fa1abc54 100644 --- a/buildroot/share/scripts/upload.py +++ b/buildroot/share/scripts/upload.py @@ -84,9 +84,9 @@ def Upload(source, target, env): try: clean_response = Resp.decode('utf8').rstrip().lstrip() clean_responses.append(clean_response) + debugPrint(f'<< {clean_response}') except: pass - debugPrint(f'<< {clean_response}') return clean_responses #------------------# From 48f0d55097e34c661fa7c53a3eeb331aa504680d Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Fri, 15 Jul 2022 15:43:43 -0700 Subject: [PATCH 18/31] =?UTF-8?q?=F0=9F=93=9D=20Update=20board=20MCU=20com?= =?UTF-8?q?ments=20(#24486)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index fa11c97380..b589b72b89 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -332,14 +332,14 @@ #define BOARD_BTT_SKR_E3_DIP 4029 // BigTreeTech SKR E3 DIP V1.0 (STM32F103RC / STM32F103RE) #define BOARD_BTT_SKR_CR6 4030 // BigTreeTech SKR CR6 v1.0 (STM32F103RE) #define BOARD_JGAURORA_A5S_A1 4031 // JGAurora A5S A1 (STM32F103ZE) -#define BOARD_FYSETC_AIO_II 4032 // FYSETC AIO_II -#define BOARD_FYSETC_CHEETAH 4033 // FYSETC Cheetah -#define BOARD_FYSETC_CHEETAH_V12 4034 // FYSETC Cheetah V1.2 -#define BOARD_LONGER3D_LK 4035 // Alfawise U20/U20+/U30 (Longer3D LK1/2) / STM32F103VE +#define BOARD_FYSETC_AIO_II 4032 // FYSETC AIO_II (STM32F103RC) +#define BOARD_FYSETC_CHEETAH 4033 // FYSETC Cheetah (STM32F103RC) +#define BOARD_FYSETC_CHEETAH_V12 4034 // FYSETC Cheetah V1.2 (STM32F103RC) +#define BOARD_LONGER3D_LK 4035 // Longer3D LK1/2 - Alfawise U20/U20+/U30 (STM32F103VE) #define BOARD_CCROBOT_MEEB_3DP 4036 // ccrobot-online.com MEEB_3DP (STM32F103RC) -#define BOARD_CHITU3D_V5 4037 // Chitu3D TronXY X5SA V5 Board -#define BOARD_CHITU3D_V6 4038 // Chitu3D TronXY X5SA V6 Board -#define BOARD_CHITU3D_V9 4039 // Chitu3D TronXY X5SA V9 Board +#define BOARD_CHITU3D_V5 4037 // Chitu3D TronXY X5SA V5 Board (STM32F103ZE) +#define BOARD_CHITU3D_V6 4038 // Chitu3D TronXY X5SA V6 Board (STM32F103ZE) +#define BOARD_CHITU3D_V9 4039 // Chitu3D TronXY X5SA V9 Board (STM32F103ZE) #define BOARD_CREALITY_V4 4040 // Creality v4.x (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V422 4041 // Creality v4.2.2 (STM32F103RC / STM32F103RE) #define BOARD_CREALITY_V423 4042 // Creality v4.2.3 (STM32F103RC / STM32F103RE) @@ -395,7 +395,7 @@ #define BOARD_BTT_GTR_V1_0 4214 // BigTreeTech GTR v1.0 (STM32F407IGT) #define BOARD_BTT_OCTOPUS_V1_0 4215 // BigTreeTech Octopus v1.0 (STM32F446ZE) #define BOARD_BTT_OCTOPUS_V1_1 4216 // BigTreeTech Octopus v1.1 (STM32F446ZE) -#define BOARD_BTT_OCTOPUS_PRO_V1_0 4217 // BigTreeTech Octopus Pro v1.0 (STM32F446ZE/STM32F429ZG) +#define BOARD_BTT_OCTOPUS_PRO_V1_0 4217 // BigTreeTech Octopus Pro v1.0 (STM32F446ZE / STM32F429ZG) #define BOARD_LERDGE_K 4218 // Lerdge K (STM32F407ZG) #define BOARD_LERDGE_S 4219 // Lerdge S (STM32F407VE) #define BOARD_LERDGE_X 4220 // Lerdge X (STM32F407VE) @@ -408,13 +408,13 @@ #define BOARD_MKS_ROBIN_PRO_V2 4227 // MKS Robin Pro V2 (STM32F407VE) #define BOARD_MKS_ROBIN_NANO_V3 4228 // MKS Robin Nano V3 (STM32F407VG) #define BOARD_MKS_ROBIN_NANO_V3_1 4229 // MKS Robin Nano V3.1 (STM32F407VE) -#define BOARD_MKS_MONSTER8_V1 4230 // MKS Monster8 V1 (STM32F407VG) -#define BOARD_MKS_MONSTER8_V2 4231 // MKS Monster8 V2 (STM32F407VG) +#define BOARD_MKS_MONSTER8_V1 4230 // MKS Monster8 V1 (STM32F407VE) +#define BOARD_MKS_MONSTER8_V2 4231 // MKS Monster8 V2 (STM32F407VE) #define BOARD_ANET_ET4 4232 // ANET ET4 V1.x (STM32F407VG) #define BOARD_ANET_ET4P 4233 // ANET ET4P V1.x (STM32F407VG) -#define BOARD_FYSETC_CHEETAH_V20 4234 // FYSETC Cheetah V2.0 -#define BOARD_TH3D_EZBOARD_V2 4235 // TH3D EZBoard v2.0 -#define BOARD_OPULO_LUMEN_REV3 4236 // Opulo Lumen PnP Controller REV3 (STM32F407VE/VG) +#define BOARD_FYSETC_CHEETAH_V20 4234 // FYSETC Cheetah V2.0 (STM32F401RC) +#define BOARD_TH3D_EZBOARD_V2 4235 // TH3D EZBoard v2.0 (STM32F405RG) +#define BOARD_OPULO_LUMEN_REV3 4236 // Opulo Lumen PnP Controller REV3 (STM32F407VE / STM32F407VG) #define BOARD_MKS_ROBIN_NANO_V1_3_F4 4237 // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VE) #define BOARD_MKS_EAGLE 4238 // MKS Eagle (STM32F407VE) #define BOARD_ARTILLERY_RUBY 4239 // Artillery Ruby (STM32F401RC) From fc0615fbd12a2609fb937afa94fa092cc9cfebdd Mon Sep 17 00:00:00 2001 From: tombrazier <68918209+tombrazier@users.noreply.github.com> Date: Sat, 16 Jul 2022 00:15:51 +0100 Subject: [PATCH 19/31] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Optimize=20Planner?= =?UTF-8?q?=20calculations=20(#24484)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/planner.cpp | 160 ++++++++++++++++------------------ Marlin/src/module/planner.h | 26 +----- 2 files changed, 78 insertions(+), 108 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 7b00552dff..de1351babf 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -28,12 +28,14 @@ * Derived from Grbl * Copyright (c) 2009-2011 Simen Svale Skogsrud * - * The ring buffer implementation gleaned from the wiring_serial library by David A. Mellis. + * Ring buffer gleaned from wiring_serial library by David A. Mellis. * + * Fast inverse function needed for Bézier interpolation for AVR + * was designed, written and tested by Eduardo José Tagle, April 2018. * - * Reasoning behind the mathematics in this module (in the key of 'Mathematica'): + * Planner mathematics (Mathematica-style): * - * s == speed, a == acceleration, t == time, d == distance + * Where: s == speed, a == acceleration, t == time, d == distance * * Basic definitions: * Speed[s_, a_, t_] := s + (a*t) @@ -41,7 +43,7 @@ * * Distance to reach a specific speed with a constant acceleration: * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, d, t] - * d -> (m^2 - s^2)/(2 a) --> estimate_acceleration_distance() + * d -> (m^2 - s^2) / (2 a) * * Speed after a given distance of travel with constant acceleration: * Solve[{Speed[s, a, t] == m, Travel[s, a, t] == d}, m, t] @@ -49,17 +51,18 @@ * * DestinationSpeed[s_, a_, d_] := Sqrt[2 a d + s^2] * - * When to start braking (di) to reach a specified destination speed (s2) after accelerating - * from initial speed s1 without ever stopping at a plateau: + * When to start braking (di) to reach a specified destination speed (s2) after + * acceleration from initial speed s1 without ever reaching a plateau: * Solve[{DestinationSpeed[s1, a, di] == DestinationSpeed[s2, a, d - di]}, di] - * di -> (2 a d - s1^2 + s2^2)/(4 a) --> intersection_distance() + * di -> (2 a d - s1^2 + s2^2)/(4 a) * - * IntersectionDistance[s1_, s2_, a_, d_] := (2 a d - s1^2 + s2^2)/(4 a) + * We note, as an optimization, that if we have already calculated an + * acceleration distance d1 from s1 to m and a deceration distance d2 + * from m to s2 then * - * -- - * - * The fast inverse function needed for Bézier interpolation for AVR - * was designed, written and tested by Eduardo José Tagle on April/2018 + * d1 -> (m^2 - s1^2) / (2 a) + * d2 -> (m^2 - s2^2) / (2 a) + * di -> (d + d1 - d2) / 2 */ #include "planner.h" @@ -211,7 +214,7 @@ xyze_long_t Planner::position{0}; uint32_t Planner::acceleration_long_cutoff; xyze_float_t Planner::previous_speed; -float Planner::previous_nominal_speed_sqr; +float Planner::previous_nominal_speed; #if ENABLED(DISABLE_INACTIVE_EXTRUDER) last_move_t Planner::g_uc_extruder_last_move[E_STEPPERS] = { 0 }; @@ -220,7 +223,7 @@ float Planner::previous_nominal_speed_sqr; #ifdef XY_FREQUENCY_LIMIT int8_t Planner::xy_freq_limit_hz = XY_FREQUENCY_LIMIT; float Planner::xy_freq_min_speed_factor = (XY_FREQUENCY_MIN_PERCENT) * 0.01f; - int32_t Planner::xy_freq_min_interval_us = LROUND(1000000.0 / (XY_FREQUENCY_LIMIT)); + int32_t Planner::xy_freq_min_interval_us = LROUND(1000000.0f / (XY_FREQUENCY_LIMIT)); #endif #if ENABLED(LIN_ADVANCE) @@ -250,7 +253,7 @@ void Planner::init() { TERN_(HAS_POSITION_FLOAT, position_float.reset()); TERN_(IS_KINEMATIC, position_cart.reset()); previous_speed.reset(); - previous_nominal_speed_sqr = 0; + previous_nominal_speed = 0; TERN_(ABL_PLANAR, bed_level_matrix.set_to_identity()); clear_block_buffer(); delay_before_delivering = 0; @@ -786,41 +789,48 @@ void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t NOLESS(final_rate, uint32_t(MINIMAL_STEP_RATE)); #if ENABLED(S_CURVE_ACCELERATION) - uint32_t cruise_rate = initial_rate; + // If we have some plateau time, the cruise rate will be the nominal rate + uint32_t cruise_rate = block->nominal_rate; #endif const int32_t accel = block->acceleration_steps_per_s2; - // Steps required for acceleration, deceleration to/from nominal rate - uint32_t accelerate_steps = CEIL(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel)), - decelerate_steps = FLOOR(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel)); - // Steps between acceleration and deceleration, if any - int32_t plateau_steps = block->step_event_count - accelerate_steps - decelerate_steps; + // Steps for acceleration, plateau and deceleration + int32_t plateau_steps = block->step_event_count; + uint32_t accelerate_steps = 0, + decelerate_steps = 0; - // Does accelerate_steps + decelerate_steps exceed step_event_count? - // Then we can't possibly reach the nominal rate, there will be no cruising. - // Use intersection_distance() to calculate accel / braking time in order to - // reach the final_rate exactly at the end of this block. - if (plateau_steps < 0) { - const float accelerate_steps_float = CEIL(intersection_distance(initial_rate, final_rate, accel, block->step_event_count)); - accelerate_steps = _MIN(uint32_t(_MAX(accelerate_steps_float, 0)), block->step_event_count); - decelerate_steps = block->step_event_count - accelerate_steps; - plateau_steps = 0; + if (accel != 0) { + // Steps required for acceleration, deceleration to/from nominal rate + const float nominal_rate_sq = sq(float(block->nominal_rate)); + float accelerate_steps_float = (nominal_rate_sq - sq(float(initial_rate))) * (0.5f / accel); + accelerate_steps = CEIL(accelerate_steps_float); + const float decelerate_steps_float = (nominal_rate_sq - sq(float(final_rate))) * (0.5f / accel); + decelerate_steps = decelerate_steps_float; - #if ENABLED(S_CURVE_ACCELERATION) - // We won't reach the cruising rate. Let's calculate the speed we will reach - cruise_rate = final_speed(initial_rate, accel, accelerate_steps); - #endif + // Steps between acceleration and deceleration, if any + plateau_steps -= accelerate_steps + decelerate_steps; + + // Does accelerate_steps + decelerate_steps exceed step_event_count? + // Then we can't possibly reach the nominal rate, there will be no cruising. + // Calculate accel / braking time in order to reach the final_rate exactly + // at the end of this block. + if (plateau_steps < 0) { + accelerate_steps_float = CEIL((block->step_event_count + accelerate_steps_float - decelerate_steps_float) * 0.5f); + accelerate_steps = _MIN(uint32_t(_MAX(accelerate_steps_float, 0)), block->step_event_count); + decelerate_steps = block->step_event_count - accelerate_steps; + + #if ENABLED(S_CURVE_ACCELERATION) + // We won't reach the cruising rate. Let's calculate the speed we will reach + cruise_rate = final_speed(initial_rate, accel, accelerate_steps); + #endif + } } - #if ENABLED(S_CURVE_ACCELERATION) - else // We have some plateau time, so the cruise rate will be the nominal rate - cruise_rate = block->nominal_rate; - #endif #if ENABLED(S_CURVE_ACCELERATION) // Jerk controlled speed requires to express speed versus time, NOT steps - uint32_t acceleration_time = ((float)(cruise_rate - initial_rate) / accel) * (STEPPER_TIMER_RATE), - deceleration_time = ((float)(cruise_rate - final_rate) / accel) * (STEPPER_TIMER_RATE), + uint32_t acceleration_time = (float(cruise_rate - initial_rate) / accel) * (STEPPER_TIMER_RATE), + deceleration_time = (float(cruise_rate - final_rate) / accel) * (STEPPER_TIMER_RATE), // And to offload calculations from the ISR, we also calculate the inverse of those times here acceleration_time_inverse = get_period_inverse(acceleration_time), deceleration_time_inverse = get_period_inverse(deceleration_time); @@ -1175,7 +1185,7 @@ void Planner::recalculate_trapezoids(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t // Go from the tail (currently executed block) to the first block, without including it) block_t *block = nullptr, *next = nullptr; - float current_entry_speed = 0.0, next_entry_speed = 0.0; + float current_entry_speed = 0.0f, next_entry_speed = 0.0f; while (block_index != head_block_index) { next = &block_buffer[block_index]; @@ -1199,13 +1209,12 @@ void Planner::recalculate_trapezoids(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t // Block is not BUSY, we won the race against the Stepper ISR: // NOTE: Entry and exit factors always > 0 by all previous logic operations. - const float current_nominal_speed = SQRT(block->nominal_speed_sqr), - nomr = 1.0f / current_nominal_speed; + const float nomr = 1.0f / block->nominal_speed; calculate_trapezoid_for_block(block, current_entry_speed * nomr, next_entry_speed * nomr); #if ENABLED(LIN_ADVANCE) if (block->use_advance_lead) { const float comp = block->e_D_ratio * extruder_advance_K[active_extruder] * settings.axis_steps_per_mm[E_AXIS]; - block->max_adv_steps = current_nominal_speed * comp; + block->max_adv_steps = block->nominal_speed * comp; block->final_adv_steps = next_entry_speed * comp; } #endif @@ -1240,13 +1249,12 @@ void Planner::recalculate_trapezoids(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t if (!stepper.is_block_busy(block)) { // Block is not BUSY, we won the race against the Stepper ISR: - const float current_nominal_speed = SQRT(block->nominal_speed_sqr), - nomr = 1.0f / current_nominal_speed; + const float nomr = 1.0f / block->nominal_speed; calculate_trapezoid_for_block(block, current_entry_speed * nomr, next_entry_speed * nomr); #if ENABLED(LIN_ADVANCE) if (block->use_advance_lead) { const float comp = block->e_D_ratio * extruder_advance_K[active_extruder] * settings.axis_steps_per_mm[E_AXIS]; - block->max_adv_steps = current_nominal_speed * comp; + block->max_adv_steps = block->nominal_speed * comp; block->final_adv_steps = next_entry_speed * comp; } #endif @@ -1290,14 +1298,10 @@ void Planner::recalculate(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t safe_exit_s #define FAN_SET(F) do{ kickstart_fan(fan_speed, ms, F); _FAN_SET(F); }while(0) const millis_t ms = millis(); - TERN_(HAS_FAN0, FAN_SET(0)); - TERN_(HAS_FAN1, FAN_SET(1)); - TERN_(HAS_FAN2, FAN_SET(2)); - TERN_(HAS_FAN3, FAN_SET(3)); - TERN_(HAS_FAN4, FAN_SET(4)); - TERN_(HAS_FAN5, FAN_SET(5)); - TERN_(HAS_FAN6, FAN_SET(6)); - TERN_(HAS_FAN7, FAN_SET(7)); + TERN_(HAS_FAN0, FAN_SET(0)); TERN_(HAS_FAN1, FAN_SET(1)); + TERN_(HAS_FAN2, FAN_SET(2)); TERN_(HAS_FAN3, FAN_SET(3)); + TERN_(HAS_FAN4, FAN_SET(4)); TERN_(HAS_FAN5, FAN_SET(5)); + TERN_(HAS_FAN6, FAN_SET(6)); TERN_(HAS_FAN7, FAN_SET(7)); } #if FAN_KICKSTART_TIME @@ -1485,7 +1489,7 @@ void Planner::check_axes_activity() { for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { const block_t * const block = &block_buffer[b]; if (NUM_AXIS_GANG(block->steps.x, || block->steps.y, || block->steps.z, || block->steps.i, || block->steps.j, || block->steps.k, || block->steps.u, || block->steps.v, || block->steps.w)) { - const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; + const float se = float(block->steps.e) / block->step_event_count * block->nominal_speed; // mm/sec NOLESS(high, se); } } @@ -1936,7 +1940,7 @@ bool Planner::_populate_block( #if ENABLED(MIXING_EXTRUDER) bool ignore_e = false; float collector[MIXING_STEPPERS]; - mixer.refresh_collector(1.0, mixer.get_current_vtool(), collector); + mixer.refresh_collector(1.0f, mixer.get_current_vtool(), collector); MIXER_STEPPER_LOOP(e) if (e_steps * collector[e] > max_e_steps) { ignore_e = true; break; } #else @@ -2193,7 +2197,7 @@ bool Planner::_populate_block( #if SECONDARY_LINEAR_AXES >= 1 && NONE(FOAMCUTTER_XYUV, ARTICULATED_ROBOT_ARM) if (NEAR_ZERO(distance_sqr)) { // Move does not involve any primary linear axes (xyz) but might involve secondary linear axes - distance_sqr = (0.0 + distance_sqr = (0.0f SECONDARY_AXIS_GANG( IF_DISABLED(AXIS4_ROTATES, + sq(steps_dist_mm.i)), IF_DISABLED(AXIS5_ROTATES, + sq(steps_dist_mm.j)), @@ -2396,7 +2400,7 @@ bool Planner::_populate_block( if (was_enabled) stepper.wake_up(); #endif - block->nominal_speed_sqr = sq(block->millimeters * inverse_secs); // (mm/sec)^2 Always > 0 + block->nominal_speed = block->millimeters * inverse_secs; // (mm/sec) Always > 0 block->nominal_rate = CEIL(block->step_event_count * inverse_secs); // (step/sec) Always > 0 #if ENABLED(FILAMENT_WIDTH_SENSOR) @@ -2492,7 +2496,7 @@ bool Planner::_populate_block( if (speed_factor < 1.0f) { current_speed *= speed_factor; block->nominal_rate *= speed_factor; - block->nominal_speed_sqr = block->nominal_speed_sqr * sq(speed_factor); + block->nominal_speed *= speed_factor; } // Compute and limit the acceleration rate for the trapezoid generator. @@ -2592,7 +2596,7 @@ bool Planner::_populate_block( if (block->use_advance_lead) { block->advance_speed = (STEPPER_TIMER_RATE) / (extruder_advance_K[active_extruder] * block->e_D_ratio * block->acceleration * settings.axis_steps_per_mm[E_AXIS_N(extruder)]); #if ENABLED(LA_DEBUG) - if (extruder_advance_K[active_extruder] * block->e_D_ratio * block->acceleration * 2 < SQRT(block->nominal_speed_sqr) * block->e_D_ratio) + if (extruder_advance_K[active_extruder] * block->e_D_ratio * block->acceleration * 2 < block->nominal_speed * block->e_D_ratio) SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed."); if (block->advance_speed < 200) SERIAL_ECHOLNPGM("eISR running at > 10kHz."); @@ -2663,7 +2667,7 @@ bool Planner::_populate_block( unit_vec *= inverse_millimeters; // Use pre-calculated (1 / SQRT(x^2 + y^2 + z^2)) // Skip first block or when previous_nominal_speed is used as a flag for homing and offset cycles. - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { + if (moves_queued && !UNEAR_ZERO(previous_nominal_speed)) { // Compute cosine of angle between previous and current path. (prev_unit_vec is negative) // NOTE: Max junction velocity is computed without sin() or acos() by trig half angle identity. float junction_cos_theta = LOGICAL_AXIS_GANG( @@ -2792,7 +2796,7 @@ bool Planner::_populate_block( } // Get the lowest speed - vmax_junction_sqr = _MIN(vmax_junction_sqr, block->nominal_speed_sqr, previous_nominal_speed_sqr); + vmax_junction_sqr = _MIN(vmax_junction_sqr, sq(block->nominal_speed), sq(previous_nominal_speed)); } else // Init entry speed to zero. Assume it starts from rest. Planner will correct this later. vmax_junction_sqr = 0; @@ -2801,27 +2805,17 @@ bool Planner::_populate_block( #endif - #ifdef USE_CACHED_SQRT - #define CACHED_SQRT(N, V) \ - static float saved_V, N; \ - if (V != saved_V) { N = SQRT(V); saved_V = V; } - #else - #define CACHED_SQRT(N, V) const float N = SQRT(V) - #endif - #if HAS_CLASSIC_JERK /** * Adapted from Průša MKS firmware * https://github.com/prusa3d/Prusa-Firmware */ - CACHED_SQRT(nominal_speed, block->nominal_speed_sqr); - // Exit speed limited by a jerk to full halt of a previous last segment static float previous_safe_speed; // Start with a safe speed (from which the machine may halt to stop immediately). - float safe_speed = nominal_speed; + float safe_speed = block->nominal_speed; #ifndef TRAVEL_EXTRA_XYJERK #define TRAVEL_EXTRA_XYJERK 0 @@ -2834,7 +2828,7 @@ bool Planner::_populate_block( maxj = (max_jerk[i] + (i == X_AXIS || i == Y_AXIS ? extra_xyjerk : 0.0f)); // mj : The max jerk setting for this axis if (jerk > maxj) { // cs > mj : New current speed too fast? if (limited) { // limited already? - const float mjerk = nominal_speed * maxj; // ns*mj + const float mjerk = block->nominal_speed * maxj; // ns*mj if (jerk * safe_speed > mjerk) safe_speed = mjerk / jerk; // ns*mj/cs } else { @@ -2845,7 +2839,7 @@ bool Planner::_populate_block( } float vmax_junction; - if (moves_queued && !UNEAR_ZERO(previous_nominal_speed_sqr)) { + if (moves_queued && !UNEAR_ZERO(previous_nominal_speed)) { // Estimate a maximum velocity allowed at a joint of two successive segments. // If this maximum velocity allowed is lower than the minimum of the entry / exit safe velocities, // then the machine is not coasting anymore and the safe entry / exit velocities shall be used. @@ -2856,11 +2850,9 @@ bool Planner::_populate_block( // The junction velocity will be shared between successive segments. Limit the junction velocity to their minimum. // Pick the smaller of the nominal speeds. Higher speed shall not be achieved at the junction during coasting. - CACHED_SQRT(previous_nominal_speed, previous_nominal_speed_sqr); - float smaller_speed_factor = 1.0f; - if (nominal_speed < previous_nominal_speed) { - vmax_junction = nominal_speed; + if (block->nominal_speed < previous_nominal_speed) { + vmax_junction = block->nominal_speed; smaller_speed_factor = vmax_junction / previous_nominal_speed; } else @@ -2927,11 +2919,11 @@ bool Planner::_populate_block( // block nominal speed limits both the current and next maximum junction speeds. Hence, in both // the reverse and forward planners, the corresponding block junction speed will always be at the // the maximum junction speed and may always be ignored for any speed reduction checks. - block->flag.set_nominal(block->nominal_speed_sqr <= v_allowable_sqr); + block->flag.set_nominal(sq(block->nominal_speed) <= v_allowable_sqr); // Update previous path unit_vector and nominal speed previous_speed = current_speed; - previous_nominal_speed_sqr = block->nominal_speed_sqr; + previous_nominal_speed = block->nominal_speed; position = target; // Update the position @@ -3268,7 +3260,7 @@ void Planner::set_machine_position_mm(const abce_pos_t &abce) { ); if (has_blocks_queued()) { - //previous_nominal_speed_sqr = 0.0; // Reset planner junction speeds. Assume start from rest. + //previous_nominal_speed = 0.0f; // Reset planner junction speeds. Assume start from rest. //previous_speed.reset(); buffer_sync_block(BLOCK_BIT_SYNC_POSITION); } @@ -3344,7 +3336,7 @@ void Planner::refresh_positioning() { inline void limit_and_warn(float &val, const AxisEnum axis, PGM_P const setting_name, const xyze_float_t &max_limit) { const uint8_t lim_axis = TERN_(HAS_EXTRUDERS, axis > E_AXIS ? E_AXIS :) axis; const float before = val; - LIMIT(val, 0.1, max_limit[lim_axis]); + LIMIT(val, 0.1f, max_limit[lim_axis]); if (before != val) { SERIAL_CHAR(AXIS_CHAR(lim_axis)); SERIAL_ECHOPGM(" Max "); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 389ae6d4bf..6eb5272071 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -199,7 +199,7 @@ typedef struct PlannerBlock { volatile bool is_move() { return !(is_sync() || is_page()); } // Fields used by the motion planner to manage acceleration - float nominal_speed_sqr, // The nominal speed for this block in (mm/sec)^2 + float nominal_speed, // The nominal speed for this block in (mm/sec) entry_speed_sqr, // Entry speed at previous-current junction in (mm/sec)^2 max_entry_speed_sqr, // Maximum allowable junction entry speed in (mm/sec)^2 millimeters, // The total travel of this block in mm @@ -510,7 +510,7 @@ class Planner { /** * Nominal speed of previous path line segment (mm/s)^2 */ - static float previous_nominal_speed_sqr; + static float previous_nominal_speed; /** * Limit where 64bit math is necessary for acceleration calculation @@ -1009,28 +1009,6 @@ class Planner { static constexpr uint8_t next_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index + 1); } static constexpr uint8_t prev_block_index(const uint8_t block_index) { return BLOCK_MOD(block_index - 1); } - /** - * Calculate the distance (not time) it takes to accelerate - * from initial_rate to target_rate using the given acceleration: - */ - static float estimate_acceleration_distance(const_float_t initial_rate, const_float_t target_rate, const_float_t accel) { - if (accel == 0) return 0; // accel was 0, set acceleration distance to 0 - return (sq(target_rate) - sq(initial_rate)) / (accel * 2); - } - - /** - * Return the point at which you must start braking (at the rate of -'accel') if - * you start at 'initial_rate', accelerate (until reaching the point), and want to end at - * 'final_rate' after traveling 'distance'. - * - * This is used to compute the intersection point between acceleration and deceleration - * in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed) - */ - static float intersection_distance(const_float_t initial_rate, const_float_t final_rate, const_float_t accel, const_float_t distance) { - if (accel == 0) return 0; // accel was 0, set intersection distance to 0 - return (accel * 2 * distance - sq(initial_rate) + sq(final_rate)) / (accel * 4); - } - /** * Calculate the maximum allowable speed squared at this point, in order * to reach 'target_velocity_sqr' using 'acceleration' within a given From 33d261141a1a1cbf015171d706c1fc5a3eb42ab0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 15 Jul 2022 16:40:51 -0500 Subject: [PATCH 20/31] =?UTF-8?q?=F0=9F=94=A8=20Also=20update=20rm=20for?= =?UTF-8?q?=20settings.o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PlatformIO/scripts/preflight-checks.py | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 40a31417e1..bbcf40e885 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -83,23 +83,27 @@ if pioutil.is_pio_build(): err = "ERROR: Config files found in directory %s. Please move them into the Marlin subfolder." % p raise SystemExit(err) + # + # Find the name.cpp.o or name.o and remove it + # + def rm_ofile(subdir, name): + build_dir = os.path.join(env['PROJECT_BUILD_DIR'], build_env); + for outdir in [ build_dir, os.path.join(build_dir, "debug") ]: + for ext in [ ".cpp.o", ".o" ]: + fpath = os.path.join(outdir, "src", "src", subdir, name + ext) + if os.path.exists(fpath): + os.remove(fpath) + # # Give warnings on every build # - build_dir = os.path.join(env['PROJECT_BUILD_DIR'], build_env); - for outdir in [ build_dir, os.path.join(build_dir, "debug") ]: - for wext in [ ".cpp", "" ]: - warnfile = os.path.join(outdir, "src", "src", "inc", "Warnings" + wext + ".o") - if os.path.exists(warnfile): - os.remove(warnfile) + rm_ofile("inc", "Warnings") # # Rebuild 'settings.cpp' for EEPROM_INIT_NOW # if 'EEPROM_INIT_NOW' in env['MARLIN_FEATURES']: - setfile = os.path.join(srcpath, "module", "settings.cpp.o") - if os.path.exists(setfile): - os.remove(setfile) + rm_ofile("module", "settings") # # Check for old files indicating an entangled Marlin (mixing old and new code) From 2f219d6824a246ef585615bd36972779cf703f14 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sat, 16 Jul 2022 00:24:41 +0000 Subject: [PATCH 21/31] [cron] Bump distribution date (2022-07-16) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index 6ca9ce5919..ab34f3e4bb 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2022-07-15" +//#define STRING_DISTRIBUTION_DATE "2022-07-16" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index a57d4a2e16..97b750851e 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 "2022-07-15" + #define STRING_DISTRIBUTION_DATE "2022-07-16" #endif /** From 8a1643587becba9a303572a451ee250de1865919 Mon Sep 17 00:00:00 2001 From: Nikolay-Po <54221205+Nikolay-Po@users.noreply.github.com> Date: Sat, 16 Jul 2022 03:56:15 +0300 Subject: [PATCH 22/31] =?UTF-8?q?=E2=9C=A8=20Steinhart-Hart=20C=20Coeff=20?= =?UTF-8?q?for=20Custom=20Thermistor=20(#24428)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 98 ++++++++++++++++++------------- Marlin/src/module/temperature.cpp | 28 ++++----- 2 files changed, 70 insertions(+), 56 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index bf305741dd..1a327e769a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -54,87 +54,101 @@ // Custom Thermistor 1000 parameters // #if TEMP_SENSOR_0 == 1000 - #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define HOTEND0_BETA 3950 // Beta value + #define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND0_BETA 3950 // Beta value + #define HOTEND0_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_1 == 1000 - #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define HOTEND1_BETA 3950 // Beta value + #define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND1_BETA 3950 // Beta value + #define HOTEND1_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_2 == 1000 - #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define HOTEND2_BETA 3950 // Beta value + #define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND2_BETA 3950 // Beta value + #define HOTEND2_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_3 == 1000 - #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define HOTEND3_BETA 3950 // Beta value + #define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND3_BETA 3950 // Beta value + #define HOTEND3_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_4 == 1000 - #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define HOTEND4_BETA 3950 // Beta value + #define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND4_BETA 3950 // Beta value + #define HOTEND4_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_5 == 1000 - #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define HOTEND5_BETA 3950 // Beta value + #define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND5_BETA 3950 // Beta value + #define HOTEND5_SH_C_COEFF 0 // Steinhart-Hart C coefficient #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 + #define HOTEND6_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND6_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND6_BETA 3950 // Beta value + #define HOTEND6_SH_C_COEFF 0 // Steinhart-Hart C coefficient #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 + #define HOTEND7_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define HOTEND7_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define HOTEND7_BETA 3950 // Beta value + #define HOTEND7_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_BED == 1000 - #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define BED_BETA 3950 // Beta value + #define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BED_BETA 3950 // Beta value + #define BED_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_CHAMBER == 1000 - #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define CHAMBER_BETA 3950 // Beta value + #define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define CHAMBER_BETA 3950 // Beta value + #define CHAMBER_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_COOLER == 1000 - #define COOLER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define COOLER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define COOLER_BETA 3950 // Beta value + #define COOLER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define COOLER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define COOLER_BETA 3950 // Beta value + #define COOLER_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_PROBE == 1000 - #define PROBE_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define PROBE_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define PROBE_BETA 3950 // Beta value + #define PROBE_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define PROBE_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define PROBE_BETA 3950 // Beta value + #define PROBE_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_BOARD == 1000 - #define BOARD_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define BOARD_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define BOARD_BETA 3950 // Beta value + #define BOARD_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define BOARD_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define BOARD_BETA 3950 // Beta value + #define BOARD_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif #if TEMP_SENSOR_REDUNDANT == 1000 - #define REDUNDANT_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor - #define REDUNDANT_RESISTANCE_25C_OHMS 100000 // Resistance at 25C - #define REDUNDANT_BETA 3950 // Beta value + #define REDUNDANT_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor + #define REDUNDANT_RESISTANCE_25C_OHMS 100000 // Resistance at 25C + #define REDUNDANT_BETA 3950 // Beta value + #define REDUNDANT_SH_C_COEFF 0 // Steinhart-Hart C coefficient #endif /** diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 97d248864e..e15e843051 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1947,46 +1947,46 @@ void Temperature::task() { void Temperature::reset_user_thermistors() { user_thermistor_t default_user_thermistor[USER_THERMISTORS] = { #if TEMP_SENSOR_0_IS_CUSTOM - { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 }, + { true, HOTEND0_SH_C_COEFF, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 }, #endif #if TEMP_SENSOR_1_IS_CUSTOM - { true, 0, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 }, + { true, HOTEND1_SH_C_COEFF, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 }, #endif #if TEMP_SENSOR_2_IS_CUSTOM - { true, 0, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 }, + { true, HOTEND2_SH_C_COEFF, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 }, #endif #if TEMP_SENSOR_3_IS_CUSTOM - { true, 0, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 }, + { true, HOTEND3_SH_C_COEFF, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 }, #endif #if TEMP_SENSOR_4_IS_CUSTOM - { true, 0, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 }, + { true, HOTEND4_SH_C_COEFF, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 }, #endif #if TEMP_SENSOR_5_IS_CUSTOM - { true, 0, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 }, + { true, HOTEND5_SH_C_COEFF, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 }, #endif #if TEMP_SENSOR_6_IS_CUSTOM - { true, 0, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 }, + { true, HOTEND6_SH_C_COEFF, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 }, #endif #if TEMP_SENSOR_7_IS_CUSTOM - { true, 0, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 }, + { true, HOTEND7_SH_C_COEFF, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 }, #endif #if TEMP_SENSOR_BED_IS_CUSTOM - { true, 0, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 }, + { true, BED_SH_C_COEFF, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 }, #endif #if TEMP_SENSOR_CHAMBER_IS_CUSTOM - { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 }, + { true, CHAMBER_SH_C_COEFF, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 }, #endif #if TEMP_SENSOR_COOLER_IS_CUSTOM - { true, 0, 0, COOLER_PULLUP_RESISTOR_OHMS, COOLER_RESISTANCE_25C_OHMS, 0, 0, COOLER_BETA, 0 }, + { true, COOLER_SH_C_COEFF, 0, COOLER_PULLUP_RESISTOR_OHMS, COOLER_RESISTANCE_25C_OHMS, 0, 0, COOLER_BETA, 0 }, #endif #if TEMP_SENSOR_PROBE_IS_CUSTOM - { true, 0, 0, PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS, 0, 0, PROBE_BETA, 0 }, + { true, PROBE_SH_C_COEFF, 0, PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS, 0, 0, PROBE_BETA, 0 }, #endif #if TEMP_SENSOR_BOARD_IS_CUSTOM - { true, 0, 0, BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS, 0, 0, BOARD_BETA, 0 }, + { true, BOARD_SH_C_COEFF, 0, BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS, 0, 0, BOARD_BETA, 0 }, #endif #if TEMP_SENSOR_REDUNDANT_IS_CUSTOM - { true, 0, 0, REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS, 0, 0, REDUNDANT_BETA, 0 }, + { true, REDUNDANT_SH_C_COEFF, 0, REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS, 0, 0, REDUNDANT_BETA, 0 }, #endif }; COPY(user_thermistor, default_user_thermistor); From 147fbd9d391a55a8d2f41600e7380af691da9bb3 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Sat, 16 Jul 2022 03:11:47 +0200 Subject: [PATCH 23/31] =?UTF-8?q?=F0=9F=94=A8=20Remove=20log2file=20monito?= =?UTF-8?q?r=20filter=20(#24502)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 06ab120966..26f58662cc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -270,7 +270,7 @@ lib_deps = ${common.lib_deps} monitor_speed = 250000 monitor_eol = LF monitor_echo = yes -monitor_filters = colorize, time, send_on_enter, log2file +monitor_filters = colorize, time, send_on_enter # # Just print the dependency tree From 9be1de54ae11b20cc3f47008080bc4afb80369c5 Mon Sep 17 00:00:00 2001 From: GHGiampy <83699429+GHGiampy@users.noreply.github.com> Date: Sat, 16 Jul 2022 03:14:15 +0200 Subject: [PATCH 24/31] =?UTF-8?q?=F0=9F=A9=B9=20Add'l=20ProUI=20fixes=20(#?= =?UTF-8?q?24500)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/proui/dwin.cpp | 13 +++++-------- Marlin/src/lcd/e3v2/proui/dwin_defines.h | 4 +++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp index 762a4fb627..111af5acd7 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp @@ -1825,7 +1825,7 @@ void DWIN_SetDataDefaults() { #endif TERN_(BAUD_RATE_GCODE, SetBaud250K()); #if BOTH(LED_CONTROL_MENU, HAS_COLOR_LEDS) - leds.set_default(); + TERN_(LED_COLOR_PRESETS, leds.set_default()); ApplyLEDColor(); #endif } @@ -2226,10 +2226,9 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #if ENABLED(BAUD_RATE_GCODE) - void HMI_SetBaudRate() { - if (HMI_data.Baud115K) SetBaud115K(); else SetBaud250K(); - } + void HMI_SetBaudRate() { HMI_data.Baud115K ? SetBaud115K() : SetBaud250K(); } void SetBaudRate() { + HMI_data.Baud115K ^= true; HMI_SetBaudRate(); Draw_Chkb_Line(CurrentMenu->line(), HMI_data.Baud115K); DWIN_UpdateLCD(); @@ -2268,9 +2267,7 @@ void SetPID(celsius_t t, heater_id_t h) { #endif #if HAS_COLOR_LEDS void ApplyLEDColor() { - HMI_data.Led_Color = LEDColor( - TERN(HAS_WHITE_LED, { 0, 0, 0, leds.color.w }, { leds.color.r, leds.color.g, leds.color.b }) - ); + HMI_data.Led_Color = LEDColor( {leds.color.r, leds.color.g, leds.color.b OPTARG(HAS_WHITE_LED, HMI_data.Led_Color.w) } ); } void LiveLEDColor(uint8_t *color) { *color = MenuData.Value; leds.update(); } void LiveLEDColorR() { LiveLEDColor(&leds.color.r); } @@ -3415,7 +3412,7 @@ void Draw_GetColor_Menu() { EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_GREEN, onDrawPInt8Menu, SetLEDColorG, &leds.color.g); EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_BLUE, onDrawPInt8Menu, SetLEDColorB, &leds.color.b); #if ENABLED(HAS_WHITE_LED) - EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLedColorW, &leds.color.w); + EDIT_ITEM_F(ICON_LedControl, MSG_COLORS_WHITE, onDrawPInt8Menu, SetLEDColorW, &leds.color.w); #endif #endif #endif diff --git a/Marlin/src/lcd/e3v2/proui/dwin_defines.h b/Marlin/src/lcd/e3v2/proui/dwin_defines.h index 98aadb8e73..dffc26478d 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin_defines.h +++ b/Marlin/src/lcd/e3v2/proui/dwin_defines.h @@ -37,13 +37,15 @@ #include "../../../inc/MarlinConfigPre.h" #include "../common/dwin_color.h" +#if ENABLED(LED_CONTROL_MENU) + #include "../../../feature/leds/leds.h" +#endif #include #if defined(__STM32F1__) || defined(STM32F1) #define DASH_REDRAW 1 #endif - #define Def_Background_Color RGB( 1, 12, 8) #define Def_Cursor_color RGB(20, 49, 31) #define Def_TitleBg_color RGB( 0, 23, 16) From e84de791ab3580feb3fd17f413165951f6488076 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2022 16:01:24 -0500 Subject: [PATCH 25/31] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20TFT=20tImage=20struc?= =?UTF-8?q?t=20packing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/tft/tft_image.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/tft/tft_image.h b/Marlin/src/lcd/tft/tft_image.h index de046fb0c4..0697510774 100644 --- a/Marlin/src/lcd/tft/tft_image.h +++ b/Marlin/src/lcd/tft/tft_image.h @@ -114,7 +114,13 @@ enum colorMode_t : uint8_t { typedef colorMode_t ColorMode; -typedef struct __attribute__((__packed__)) { +#ifdef __AVR__ + #define PACKED __attribute__((__packed__)) +#else + #define PACKED +#endif + +typedef struct PACKED { void *data; uint16_t width; uint16_t height; From fa0ad4b594e18f7c7a5c0c53d2f0ea0d0da7dc29 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2022 16:11:33 -0500 Subject: [PATCH 26/31] =?UTF-8?q?=F0=9F=94=A8=20Add=20mftest=20--default?= =?UTF-8?q?=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/bin/mftest | 12 ++++++++++- buildroot/bin/use_example_configs | 33 +++++++++++++++++++------------ 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/buildroot/bin/mftest b/buildroot/bin/mftest index 9aa5e12732..edb4068546 100755 --- a/buildroot/bin/mftest +++ b/buildroot/bin/mftest @@ -30,6 +30,7 @@ OPTIONS -u --autoupload PIO Upload using the MOTHERBOARD environment. -v --verbose Extra output for debugging. -s --silent Silence build output from PlatformIO. + -d --default Restore to defaults before applying configs. env shortcuts: tree due esp lin lp8|lpc8 lp9|lpc9 m128 m256|mega stm|f1 f4 f7 s6 teensy|t31|t32 t35|t36 t40|t41 " @@ -44,6 +45,7 @@ shopt -s extglob nocasematch # Matching patterns ISNUM='^[0-9]+$' +ISRST='^(restore)_' ISCMD='^(restore|opt|exec|use|pins|env)_' ISEXEC='^exec_' ISCONT='\\ *$' @@ -53,9 +55,10 @@ TESTENV='-' CHOICE=0 DEBUG=0 -while getopts 'abhmrsuvyn:t:-:' OFLAG; do +while getopts 'abdhmrsuvyn:t:-:' OFLAG; do case "${OFLAG}" in a) AUTO_BUILD=1 ; bugout "Auto-Build target..." ;; + d) DL_DEFAULTS=1 ; bugout "Restore to defaults..." ;; h) EXIT_USAGE=1 ;; m) USE_MAKE=1 ; bugout "Using make with Docker..." ;; n) case "$OPTARG" in @@ -88,6 +91,7 @@ while getopts 'abhmrsuvyn:t:-:' OFLAG; do silent) SILENT_FLAG="-s" ;; make) USE_MAKE=1 ; bugout "Using make with Docker..." ;; debug|verbose) DEBUG=1 ; bugout "Debug ON" ;; + default) DL_DEFAULTS=1 ; bugout "Restore to defaults..." ;; build) case "$OVAL" in ''|y|yes) BUILD_YES='Y' ;; n|no) BUILD_YES='N' ;; @@ -282,6 +286,11 @@ if [[ $CHOICE == 0 ]]; then fi fi +# +# Restore to defaults if requested +# +((DL_DEFAULTS)) && use_example_configs + # # Run the specified test lines # @@ -303,6 +312,7 @@ echo "$OUT" | { } ((IND == CHOICE)) && { GOTX=1 + [[ -n $DL_DEFAULTS && $LINE =~ $ISRST ]] && LINE="use_example_configs" [[ $CMD == "" ]] && CMD="$LINE" || CMD=$( echo -e "$CMD$LINE" | $SED -e 's/\\//g' | $SED -E 's/ +/ /g' ) [[ $LINE =~ $ISCONT ]] || { echo "$CMD" ; eval "$CMD" ; CMD="" ; } } diff --git a/buildroot/bin/use_example_configs b/buildroot/bin/use_example_configs index cb3c2424d6..de2edc2468 100755 --- a/buildroot/bin/use_example_configs +++ b/buildroot/bin/use_example_configs @@ -9,28 +9,35 @@ # If a configpath has spaces (or quotes) escape them or enquote the path # +which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot' +which wget >/dev/null && TOOL='wget -q -O wgot' + CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g') [[ $CURR == "bugfix-2.0.x" ]] && BRANCH=bugfix-2.0.x || BRANCH=bugfix-2.1.x -IFS=: read -r PART1 PART2 <<< "$@" -[[ -n $PART2 ]] && { REPO="$PART1" ; UDIR="$PART2" ; } \ - || { REPO=$BRANCH ; UDIR="$PART1" ; } -EXAMPLES="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO/config/examples" +REPO=$BRANCH -which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot' -which wget >/dev/null && TOOL='wget -q -O wgot' +if [[ $# > 0 ]]; then + IFS=: read -r PART1 PART2 <<< "$@" + [[ -n $PART2 ]] && { UDIR="$PART2" ; REPO="$PART1" ; } \ + || { UDIR="$PART1" ; } + RDIR="${UDIR// /%20}" + echo "Fetching $UDIR configurations from $REPO..." + EXAMPLES="examples/$RDIR" +else + EXAMPLES="default" +fi + +CONFIGS="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO/config/${EXAMPLES}" restore_configs cd Marlin -RDIR="${UDIR// /%20}" -echo "Fetching $UDIR configurations from $REPO..." - -$TOOL "$EXAMPLES/$RDIR/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h -$TOOL "$EXAMPLES/$RDIR/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration_adv.h -$TOOL "$EXAMPLES/$RDIR/_Bootscreen.h" >/dev/null 2>&1 && mv wgot _Bootscreen.h -$TOOL "$EXAMPLES/$RDIR/_Statusscreen.h" >/dev/null 2>&1 && mv wgot _Statusscreen.h +$TOOL "$CONFIGS/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h +$TOOL "$CONFIGS/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration_adv.h +$TOOL "$CONFIGS/_Bootscreen.h" >/dev/null 2>&1 && mv wgot _Bootscreen.h +$TOOL "$CONFIGS/_Statusscreen.h" >/dev/null 2>&1 && mv wgot _Statusscreen.h rm -f wgot cd - >/dev/null From 05a7be7b25e3659fe10da7c4090765250dc2fdd9 Mon Sep 17 00:00:00 2001 From: Christophe Huriaux Date: Sat, 16 Jul 2022 23:35:40 +0200 Subject: [PATCH 27/31] =?UTF-8?q?=E2=9C=A8=20eMotion-Tech=20eMotronic=20(M?= =?UTF-8?q?icro-Delta=20rework)=20(#24488)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/core/boards.h | 1 + Marlin/src/inc/Conditionals_post.h | 2 + Marlin/src/pins/lpc1768/pins_EMOTRONIC.h | 151 +++++++++++++++++++++++ Marlin/src/pins/pins.h | 2 + 4 files changed, 156 insertions(+) create mode 100644 Marlin/src/pins/lpc1768/pins_EMOTRONIC.h diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h index b589b72b89..506b9cbd0e 100644 --- a/Marlin/src/core/boards.h +++ b/Marlin/src/core/boards.h @@ -238,6 +238,7 @@ #define BOARD_BTT_SKR_V1_1 2012 // BigTreeTech SKR v1.1 #define BOARD_BTT_SKR_V1_3 2013 // BigTreeTech SKR v1.3 #define BOARD_BTT_SKR_V1_4 2014 // BigTreeTech SKR v1.4 +#define BOARD_EMOTRONIC 2015 // eMotion-Tech eMotronic // // LPC1769 ARM Cortex M3 diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 5f9ab3dc7d..517e95c83e 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -471,6 +471,8 @@ #elif ENABLED(ZONESTAR_12864OLED) #define _LCD_CONTRAST_MIN 64 #define _LCD_CONTRAST_INIT 128 +#elif ENABLED(EMOTION_TECH_LCD) + #define _LCD_CONTRAST_INIT 140 #elif IS_TFTGLCD_PANEL #define _LCD_CONTRAST_INIT 250 #endif diff --git a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h new file mode 100644 index 0000000000..1cda5db669 --- /dev/null +++ b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h @@ -0,0 +1,151 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2022 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 + +/** + * eMotion-Tech eMotronic pin assignments + * + * Board pins<->features assignments are based on the + * Micro-Delta Rework printer default connections. + */ + +#include "env_validate.h" + +#define BOARD_INFO_NAME "eMotronic" +#define BOARD_WEBSITE_URL "www.reprap-france.com/article/lemotronic-quesaco" + +// +// Limit Switches +// +#define X_STOP_PIN P1_22 // S0 +#define Y_STOP_PIN P1_23 // S1 +#define Z_STOP_PIN P1_24 // S2 +#define I_STOP_PIN P1_25 // S3 + +#ifndef Z_MIN_PROBE_PIN + #define Z_MIN_PROBE_PIN P0_26 // S4 (opto) +#endif + +// +// Steppers +// +#define X_STEP_PIN P2_02 // M3 +#define X_DIR_PIN P4_28 +#define X_ENABLE_PIN P4_29 + +#define Y_STEP_PIN P2_01 // M2 +#define Y_DIR_PIN P0_22 +#define Y_ENABLE_PIN P0_21 + +#define Z_STEP_PIN P2_00 // M1 +#define Z_DIR_PIN P3_26 +#define Z_ENABLE_PIN P3_25 + +#define E0_STEP_PIN P2_03 // M4 +#define E0_DIR_PIN P0_04 +#define E0_ENABLE_PIN P0_05 // Correct! + +#define E1_STEP_PIN P2_08 // M5 +#define E1_DIR_PIN P0_20 +#define E1_ENABLE_PIN P0_19 + +// +// Temperature Sensors +// 3.3V max when defined as an analog input +// +#define TEMP_0_PIN P0_24_A1 // A1 (TH1) +#define TEMP_1_PIN P0_23_A0 // A0 (TH0) +#define TEMP_BED_PIN P0_25_A2 // A2 (TH2) + +// +// Heaters / Fans +// +#define _H0_PIN P2_04 // (H0: 15A) + +#define HEATER_BED_PIN P2_05 // (H1: 10A shared) +#define HEATER_0_PIN P2_06 // (H2: 10A shared) +#define HEATER_1_PIN P2_07 // (H3: 10A shared) + +#define FAN_PIN P2_11 // (FAN0: 1A) +#define FAN1_PIN P2_13 // (FAN1: 1A) + +// +// Extension ports +// +// warning: pins are backward numbered w.r.t. to the +// schematics, e.g. EXP1_01 / EXP1_02 are X1-10 / X1-9. +#define EXP1_01_PIN P0_28 // SCL0 +#define EXP1_02_PIN P0_27 // SDA0 +#define EXP1_03_PIN P0_16 // SSEL0 +#define EXP1_04_PIN P0_15 // SCK0 +#define EXP1_05_PIN P0_18 // MOSI0 +#define EXP1_06_PIN P0_17 // MISO0 +#define EXP1_07_PIN P1_31 +#define EXP1_08_PIN P1_30 +#define EXP1_09_PIN P0_02 // TX0 +#define EXP1_10_PIN P0_03 // RX0 + +#define EXP2_03_PIN P1_27 +#define EXP2_04_PIN P1_26 +#define EXP2_05_PIN P1_29 +#define EXP2_06_PIN P1_28 +#define EXP2_07_PIN P0_01 // SCL1 +#define EXP2_08_PIN P0_00 // SDA1 +#define EXP2_09_PIN P0_11 +#define EXP2_10_PIN P0_10 + +// +// SD Support +// +#ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD +#endif + +#if SD_CONNECTION_IS(ONBOARD) + #define SD_SCK_PIN P0_07 + #define SD_MISO_PIN P0_08 + #define SD_MOSI_PIN P0_09 + #define SD_SS_PIN P0_06 +#elif SD_CONNECTION_IS(LCD) + #define SD_SCK_PIN EXP1_04_PIN + #define SD_MISO_PIN EXP1_06_PIN + #define SD_MOSI_PIN EXP1_05_PIN + #define SD_SS_PIN EXP1_03_PIN + #define SD_DETECT_PIN EXP1_07_PIN +#elif SD_CONNECTION_IS(CUSTOM_CABLE) + #error "No custom SD drive cable defined for this board." +#endif + +// +// LCD / Controller +// +#if ENABLED(EMOTION_TECH_LCD) + #define BEEPER_PIN EXP2_10_PIN + #define DOGLCD_A0 EXP2_05_PIN + #define DOGLCD_CS EXP2_07_PIN + #define DOGLCD_SCK EXP1_04_PIN + #define DOGLCD_MOSI EXP1_05_PIN + + #define BTN_EN1 EXP2_04_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP2_09_PIN +#endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 8925993c36..a60365d980 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -402,6 +402,8 @@ #include "lpc1768/pins_BTT_SKR_V1_3.h" // LPC1768 env:LPC1768 #elif MB(BTT_SKR_V1_4) #include "lpc1768/pins_BTT_SKR_V1_4.h" // LPC1768 env:LPC1768 +#elif MB(EMOTRONIC) + #include "lpc1768/pins_EMOTRONIC.h" // LPC1768 env:LPC1768 // // LPC1769 ARM Cortex M3 From 504fec98237a1042819eba145ae39ad14cc49a1e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2022 16:26:36 -0500 Subject: [PATCH 28/31] =?UTF-8?q?=F0=9F=9A=B8=20Renumber=20EXP=20pins=20to?= =?UTF-8?q?=20match=20schematics/RRF/Klipper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/esp32/pins_MKS_TINYBEE.h | 84 +++---- Marlin/src/pins/esp32/pins_PANDA_common.h | 58 ++--- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 80 +++--- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 210 ++++++++-------- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 208 ++++++++-------- Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h | 54 ++-- Marlin/src/pins/lpc1768/pins_EMOTRONIC.h | 64 +++-- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 140 +++++------ .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 84 +++---- Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 136 +++++------ Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h | 70 +++--- Marlin/src/pins/ramps/pins_MKS_GEN_13.h | 42 ++-- Marlin/src/pins/ramps/pins_RAMPS.h | 230 +++++++++--------- Marlin/src/pins/ramps/pins_RAMPS_PLUS.h | 42 ++-- Marlin/src/pins/ramps/pins_ZRIB_V53.h | 56 ++--- Marlin/src/pins/sam/pins_RAMPS_FD_V1.h | 96 ++++---- Marlin/src/pins/sam/pins_RAMPS_SMART.h | 42 ++-- Marlin/src/pins/sam/pins_RURAMPS4D_11.h | 94 +++---- Marlin/src/pins/sam/pins_RURAMPS4D_13.h | 98 ++++---- .../src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h | 168 ++++++------- Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h | 172 ++++++------- .../src/pins/sanguino/pins_MELZI_CREALITY.h | 10 +- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 48 ++-- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 30 +-- .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 60 ++--- .../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 110 ++++----- .../src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 40 +-- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 20 +- Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h | 66 ++--- Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 78 +++--- Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h | 60 ++--- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 140 +++++------ .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 108 ++++---- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 64 ++--- Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h | 48 ++-- Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h | 114 ++++----- Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h | 86 +++---- .../src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 124 +++++----- Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h | 40 +-- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 122 +++++----- .../pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 164 ++++++------- .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 178 +++++++------- .../pins/stm32f4/pins_BTT_SKR_V2_0_common.h | 188 +++++++------- Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 78 +++--- .../pins/stm32f4/pins_FYSETC_CHEETAH_V20.h | 110 ++++----- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 126 +++++----- .../pins/stm32f4/pins_MKS_MONSTER8_common.h | 114 ++++----- .../stm32f4/pins_MKS_ROBIN_NANO_V3_common.h | 114 ++++----- .../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 110 ++++----- .../src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h | 68 +++--- Marlin/src/pins/stm32f4/pins_VAKE403D.h | 64 ++--- .../pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h | 78 +++--- .../pins/stm32h7/pins_BTT_SKR_V3_0_common.h | 188 +++++++------- 53 files changed, 2587 insertions(+), 2589 deletions(-) diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index 110c6f83ef..3762f64033 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -119,72 +119,72 @@ /** * ------ ------ - * (BEEPER) 149 |10 9 | 13 (BTN_ENC) (SPI MISO) 19 |10 9 | 18 (SPI SCK) - * (LCD_EN) 21 | 8 7 | 4 (LCD_RS) (BTN_EN1) 14 | 8 7 | 5 (SPI CS) - * (LCD_D4) 0 6 5 | 16 (LCD_D5) (BTN_EN2) 12 6 5 | 23 (SPI MOSI) - * (LCD_D6) 15 | 4 3 | 17 (LCD_D7) (SPI_DET) 34 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V + * (BEEPER) 149 | 1 2 | 13 (BTN_ENC) (SPI MISO) 19 | 1 2 | 18 (SPI SCK) + * (LCD_EN) 21 | 3 4 | 4 (LCD_RS) (BTN_EN1) 14 | 3 4 | 5 (SPI CS) + * (LCD_D4) 0 5 6 | 16 (LCD_D5) (BTN_EN2) 12 5 6 | 23 (SPI MOSI) + * (LCD_D6) 15 | 7 8 | 17 (LCD_D7) (SPI_DET) 34 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 3.3V * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN 17 -#define EXP1_04_PIN 15 -#define EXP1_05_PIN 16 -#define EXP1_06_PIN 0 -#define EXP1_07_PIN 4 -#define EXP1_08_PIN 21 -#define EXP1_09_PIN 13 -#define EXP1_10_PIN 149 +#define EXP1_08_PIN 17 +#define EXP1_07_PIN 15 +#define EXP1_06_PIN 16 +#define EXP1_05_PIN 0 +#define EXP1_04_PIN 4 +#define EXP1_03_PIN 21 +#define EXP1_02_PIN 13 +#define EXP1_01_PIN 149 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN 34 -#define EXP2_05_PIN 23 -#define EXP2_06_PIN 12 -#define EXP2_07_PIN 5 -#define EXP2_08_PIN 14 -#define EXP2_09_PIN 18 -#define EXP2_10_PIN 19 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN 34 +#define EXP2_06_PIN 23 +#define EXP2_05_PIN 12 +#define EXP2_04_PIN 5 +#define EXP2_03_PIN 14 +#define EXP2_02_PIN 18 +#define EXP2_01_PIN 19 // // MicroSD card // -//#define SD_MOSI_PIN EXP2_05_PIN // uses esp32 default 23 -//#define SD_MISO_PIN EXP2_10_PIN // uses esp32 default 19 -//#define SD_SCK_PIN EXP2_09_PIN // uses esp32 default 18 -#define SDSS EXP2_07_PIN -#define SD_DETECT_PIN EXP2_04_PIN // IO34 default is SD_DET signal (Jump to SDDET) +//#define SD_MOSI_PIN EXP2_06_PIN // uses esp32 default 23 +//#define SD_MISO_PIN EXP2_01_PIN // uses esp32 default 19 +//#define SD_SCK_PIN EXP2_02_PIN // uses esp32 default 18 +#define SDSS EXP2_04_PIN +#define SD_DETECT_PIN EXP2_07_PIN // IO34 default is SD_DET signal (Jump to SDDET) #define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_ENC EXP1_09_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BEEPER_PIN EXP1_01_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #define LCD_BACKLIGHT_PIN -1 #if ENABLED(MKS_MINI_12864) // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN #define LCD_RESET_PIN -1 #elif ENABLED(FYSETC_MINI_12864_2_1) // MKS_MINI_12864_V3, BTT_MINI_12864_V1, FYSETC_MINI_12864_2_1 - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define LCD_RESET_PIN EXP1_06_PIN - #define NEOPIXEL_PIN EXP1_05_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define LCD_RESET_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif #else - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #endif #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 diff --git a/Marlin/src/pins/esp32/pins_PANDA_common.h b/Marlin/src/pins/esp32/pins_PANDA_common.h index 7deeca3f62..dfd0525521 100644 --- a/Marlin/src/pins/esp32/pins_PANDA_common.h +++ b/Marlin/src/pins/esp32/pins_PANDA_common.h @@ -82,47 +82,47 @@ #endif /** ------ ------ - * (MISO 19?) |10 9 | (18 SCK?) (BEEPER) 129 |10 9 | 12 (^ENC) - * (EN1) 33 | 8 7 | (5 SDSS?) (EN) 26 | 8 7 | 27 (RS) - * (EN2) 32 6 5 | (23 MOSI?) (D4) 14 | 6 5 -- - * (SDDET 2?) | 4 3 | (RESET) -- | 4 3 | -- - * -- | 2 1 | -- (GND) | 2 1 | (5V) + * (MISO 19?) | 1 2 | (18 SCK?) (BEEPER) 129 | 1 2 | 12 (^ENC) + * (EN1) 33 | 3 4 | (5 SDSS?) (EN) 26 | 3 4 | 27 (RS) + * (EN2) 32 5 6 | (23 MOSI?) (D4) 14 | 5 6 -- + * (SDDET 2?) | 7 8 | (RESET) -- | 7 8 | -- + * -- | 9 10 | -- (GND) | 9 10 | (5V) * ------ ------ * EXP2 EXP1 */ -#define EXP1_06_PIN 14 -#define EXP1_07_PIN 27 -#define EXP1_08_PIN 26 -#define EXP1_09_PIN 12 -#define EXP1_10_PIN 129 +#define EXP1_05_PIN 14 +#define EXP1_04_PIN 27 +#define EXP1_03_PIN 26 +#define EXP1_02_PIN 12 +#define EXP1_01_PIN 129 -#define EXP2_04_PIN 2 // ? -#define EXP2_05_PIN 23 // ? -#define EXP2_06_PIN 32 -#define EXP2_07_PIN 5 // ? -#define EXP2_08_PIN 33 -#define EXP2_09_PIN 18 // ? -#define EXP2_10_PIN 19 // ? +#define EXP2_07_PIN 2 // ? +#define EXP2_06_PIN 23 // ? +#define EXP2_05_PIN 32 +#define EXP2_04_PIN 5 // ? +#define EXP2_03_PIN 33 +#define EXP2_02_PIN 18 // ? +#define EXP2_01_PIN 19 // ? // // SD Card // #if ENABLED(SDSUPPORT) - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SDSS EXP2_07_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN - #define BTN_ENC EXP1_09_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index f0f57c63ee..ba042e3bf5 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -58,31 +58,31 @@ /** ------ ------ - * 1.30 |10 9 | 2.11 0.17 |10 9 | 0.15 - * 0.18 | 8 7 | 0.16 3.26 | 8 7 | 1.23 - * 0.15 6 5 | -- 3.25 6 5 | 0.18 - * -- | 4 3 | -- 1.31 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * 1.30 | 1 2 | 2.11 0.17 | 1 2 | 0.15 + * 0.18 | 3 4 | 0.16 3.26 | 3 4 | 1.23 + * 0.15 5 6 | -- 3.25 5 6 | 0.18 + * -- | 7 8 | -- 1.31 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN -1 // NC -#define EXP1_04_PIN -1 // NC -#define EXP1_05_PIN -1 // NC -#define EXP1_06_PIN P0_15 -#define EXP1_07_PIN P0_16 -#define EXP1_08_PIN P0_18 -#define EXP1_09_PIN P2_11 -#define EXP1_10_PIN P1_30 +#define EXP1_08_PIN -1 // NC +#define EXP1_07_PIN -1 // NC +#define EXP1_06_PIN -1 // NC +#define EXP1_05_PIN P0_15 +#define EXP1_04_PIN P0_16 +#define EXP1_03_PIN P0_18 +#define EXP1_02_PIN P2_11 +#define EXP1_01_PIN P1_30 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN P1_31 -#define EXP2_05_PIN P0_18 -#define EXP2_06_PIN P3_25 -#define EXP2_07_PIN P1_23 -#define EXP2_08_PIN P3_26 -#define EXP2_09_PIN P0_15 -#define EXP2_10_PIN P0_17 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN P1_31 +#define EXP2_06_PIN P0_18 +#define EXP2_05_PIN P3_25 +#define EXP2_04_PIN P1_23 +#define EXP2_03_PIN P3_26 +#define EXP2_02_PIN P0_15 +#define EXP2_01_PIN P0_17 /** * LCD / Controller @@ -100,23 +100,23 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #elif HAS_WIRED_LCD - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN - #define LCD_SDSS EXP2_07_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP2_05_PIN - #define LCD_PINS_D4 EXP2_09_PIN + #define LCD_SDSS EXP2_04_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP2_06_PIN + #define LCD_PINS_D4 EXP2_02_PIN #if ENABLED(MKS_MINI_12864) #define DOGLCD_CS P2_06 - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_A0 EXP1_04_PIN #endif #endif // HAS_WIRED_LCD @@ -165,10 +165,10 @@ // When using any TMC SPI-based drivers, software SPI is used // because pins may be shared with the display or SD card. #define TMC_USE_SW_SPI - #define TMC_SW_MOSI EXP2_05_PIN - #define TMC_SW_MISO EXP2_10_PIN + #define TMC_SW_MOSI EXP2_06_PIN + #define TMC_SW_MISO EXP2_01_PIN // To minimize pin usage use the same clock pin as the display/SD card reader. (May generate LCD noise.) - #define TMC_SW_SCK EXP2_09_PIN + #define TMC_SW_SCK EXP2_02_PIN // If pin 2_06 is unused, it can be used for the clock to avoid the LCD noise. //#define TMC_SW_SCK P2_06 @@ -211,11 +211,11 @@ // SDCARD_CONNECTION must not be 'LCD'. Nothing should be connected to EXP1/EXP2. //#define SKR_USE_LCD_PINS_FOR_CS #if ENABLED(SKR_USE_LCD_PINS_FOR_CS) - #define X_CS_PIN EXP2_07_PIN - #define Y_CS_PIN EXP2_08_PIN - #define Z_CS_PIN EXP1_09_PIN - #define E0_CS_PIN EXP2_06_PIN - #define E1_CS_PIN EXP2_04_PIN + #define X_CS_PIN EXP2_04_PIN + #define Y_CS_PIN EXP2_03_PIN + #define Z_CS_PIN EXP1_02_PIN + #define E0_CS_PIN EXP2_05_PIN + #define E1_CS_PIN EXP2_07_PIN #endif // Example 2: A REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER @@ -228,11 +228,11 @@ #define Z_CS_PIN P2_06 // We use SD_DETECT_PIN for E0 #undef SD_DETECT_PIN - #define E0_CS_PIN EXP2_04_PIN + #define E0_CS_PIN EXP2_07_PIN // We use LCD_SDSS pin for E1 #undef LCD_SDSS #define LCD_SDSS -1 - #define E1_CS_PIN EXP2_07_PIN + #define E1_CS_PIN EXP2_04_PIN #endif // Example 3: Use the driver enable pins for chip-select. 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 4ab5b10937..4ea4687507 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -191,31 +191,31 @@ /** * ------ ------ - * (BEEPER) 1.30 |10 9 | 0.28 (BTN_ENC) (MISO) 0.17 |10 9 | 0.15 (SCK) - * (LCD_EN) 1.18 | 8 7 | 1.19 (LCD_RS) (BTN_EN1) 3.26 | 8 7 | 0.16 (SD_SS) - * (LCD_D4) 1.20 6 5 | 1.21 (LCD_D5) (BTN_EN2) 3.25 6 5 | 0.18 (MOSI) - * (LCD_D6) 1.22 | 4 3 | 1.23 (LCD_D7) (SD_DETECT) 1.31 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) 1.30 | 1 2 | 0.28 (BTN_ENC) (MISO) 0.17 | 1 2 | 0.15 (SCK) + * (LCD_EN) 1.18 | 3 4 | 1.19 (LCD_RS) (BTN_EN1) 3.26 | 3 4 | 0.16 (SD_SS) + * (LCD_D4) 1.20 5 6 | 1.21 (LCD_D5) (BTN_EN2) 3.25 5 6 | 0.18 (MOSI) + * (LCD_D6) 1.22 | 7 8 | 1.23 (LCD_D7) (SD_DETECT) 1.31 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN P1_23 -#define EXP1_04_PIN P1_22 -#define EXP1_05_PIN P1_21 -#define EXP1_06_PIN P1_20 -#define EXP1_07_PIN P1_19 -#define EXP1_08_PIN P1_18 -#define EXP1_09_PIN P0_28 -#define EXP1_10_PIN P1_30 +#define EXP1_08_PIN P1_23 +#define EXP1_07_PIN P1_22 +#define EXP1_06_PIN P1_21 +#define EXP1_05_PIN P1_20 +#define EXP1_04_PIN P1_19 +#define EXP1_03_PIN P1_18 +#define EXP1_02_PIN P0_28 +#define EXP1_01_PIN P1_30 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN P1_31 -#define EXP2_05_PIN P0_18 -#define EXP2_06_PIN P3_25 -#define EXP2_07_PIN P0_16 -#define EXP2_08_PIN P3_26 -#define EXP2_09_PIN P0_15 -#define EXP2_10_PIN P0_17 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN P1_31 +#define EXP2_06_PIN P0_18 +#define EXP2_05_PIN P3_25 +#define EXP2_04_PIN P0_16 +#define EXP2_03_PIN P3_26 +#define EXP2_02_PIN P0_15 +#define EXP2_01_PIN P0_17 #if HAS_WIRED_LCD #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING) @@ -239,23 +239,23 @@ * * BEFORE AFTER * ------ ------ - * (CLK) |10 9 | (BEEPER) (BEEPER) |10 9 | -- - * -- | 8 7 | (BTN_ENC) (BTN_ENC) | 8 7 | (CLK) - * (SID) 6 5 | (BTN_EN1) (BTN_EN1) 6 5 | (SID) - * (CS) | 4 3 | (BTN_EN2) (BTN_EN2) | 4 3 | (CS) - * GND | 2 1 | 5V GND | 2 1 | 5V + * (CLK) | 1 2 | (BEEPER) (BEEPER) | 1 2 | -- + * -- | 3 4 | (BTN_ENC) (BTN_ENC) | 3 4 | (CLK) + * (SID) 5 6 | (BTN_EN1) (BTN_EN1) 5 6 | (SID) + * (CS) | 7 8 | (BTN_EN2) (BTN_EN2) | 7 8 | (CS) + * GND | 9 10 | 5V GND | 9 10 | 5V * ------ ------ * LCD LCD */ - #define LCD_PINS_RS EXP1_03_PIN + #define LCD_PINS_RS EXP1_08_PIN - #define BTN_EN1 EXP1_06_PIN - #define BTN_EN2 EXP1_04_PIN - #define BTN_ENC EXP1_08_PIN + #define BTN_EN1 EXP1_05_PIN + #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_03_PIN - #define LCD_PINS_ENABLE EXP1_05_PIN - #define LCD_PINS_D4 EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_06_PIN + #define LCD_PINS_D4 EXP1_04_PIN #elif ENABLED(WYH_L12864) @@ -274,33 +274,33 @@ * * BEFORE AFTER * ______ ______ - * |10 9 | (MOSI) (MOSI) |10 9 | -- - * (BTN_ENC) | 8 7 | (SCK) (BTN_ENC) | 8 7 | (SCK) - * (BTN_EN1) 6 5 | (SID) (BTN_EN1) 6 5 | (SID) - * (BTN_EN2) | 4 3 | (CS) (BTN_EN2) | 4 3 | (CS) - * 5V | 2 1 | GND GND | 2 1 | 5V + * | 1 2 | (MOSI) (MOSI) | 1 2 | -- + * (BTN_ENC) | 3 4 | (SCK) (BTN_ENC) | 3 4 | (SCK) + * (BTN_EN1) 5 6 | (SID) (BTN_EN1) 5 6 | (SID) + * (BTN_EN2) | 7 8 | (CS) (BTN_EN2) | 7 8 | (CS) + * 5V | 9 10 | GND GND | 9 10 | 5V * ------ ------ * LCD LCD */ - #define BTN_EN1 EXP1_06_PIN - #define BTN_EN2 EXP1_04_PIN - #define BTN_ENC EXP1_08_PIN - #define DOGLCD_CS EXP1_03_PIN - #define DOGLCD_A0 EXP1_05_PIN - #define DOGLCD_SCK EXP1_07_PIN - #define DOGLCD_MOSI EXP1_10_PIN + #define BTN_EN1 EXP1_05_PIN + #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_03_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_04_PIN + #define DOGLCD_MOSI EXP1_01_PIN #define LCD_BACKLIGHT_PIN -1 #elif ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN // (58) open-drain + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN // (58) open-drain - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #elif HAS_ADC_BUTTONS @@ -308,20 +308,20 @@ #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI - #define TFT_A0_PIN EXP1_03_PIN - #define TFT_DC_PIN EXP1_03_PIN - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_RESET_PIN EXP1_07_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_A0_PIN EXP1_08_PIN + #define TFT_DC_PIN EXP1_08_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_RESET_PIN EXP1_04_PIN + #define TFT_BACKLIGHT_PIN EXP1_03_PIN - //#define TFT_RST_PIN EXP2_04_PIN - #define TFT_MOSI_PIN EXP2_05_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN + //#define TFT_RST_PIN EXP2_07_PIN + #define TFT_MOSI_PIN EXP2_06_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_ENC EXP1_02_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 @@ -369,90 +369,90 @@ #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #else // !CR10_STOCKDISPLAY - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN // (31) J3-2 & AUX-4 - #define BTN_EN2 EXP2_06_PIN // (33) J3-4 & AUX-4 - #define BTN_ENC EXP1_09_PIN // (58) open-drain + #define BTN_EN1 EXP2_03_PIN // (31) J3-2 & AUX-4 + #define BTN_EN2 EXP2_05_PIN // (33) J3-4 & AUX-4 + #define BTN_ENC EXP1_02_PIN // (58) open-drain - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN - #define LCD_SDSS EXP2_07_PIN // (16) J3-7 & AUX-4 - #define SD_DETECT_PIN EXP2_04_PIN // (49) (NOT 5V tolerant) + #define LCD_SDSS EXP2_04_PIN // (16) J3-7 & AUX-4 + #define SD_DETECT_PIN EXP2_07_PIN // (49) (NOT 5V tolerant) #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #elif ENABLED(ENDER2_STOCKDISPLAY) /** * Creality Ender-2 display pinout * ------ - * (SCK) P1_30 |10 9 | P0_28 (BTN_ENC) - * (BTN_EN1) P1_18 | 8 7 | P1_19 (RESET) - * (BTN_EN2) P1_20 6 5 | P1_21 (LCD_A0) - * (LCD_CS) P1_22 | 4 3 | P1_23 (MOSI) - * GND | 2 1 | 5V + * (SCK) P1_30 | 1 2 | P0_28 (BTN_ENC) + * (BTN_EN1) P1_18 | 3 4 | P1_19 (RESET) + * (BTN_EN2) P1_20 5 6 | P1_21 (LCD_A0) + * (LCD_CS) P1_22 | 7 8 | P1_23 (MOSI) + * GND | 9 10 | 5V * ------ * EXP1 */ - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN - #define DOGLCD_CS EXP1_04_PIN - #define DOGLCD_A0 EXP1_05_PIN - #define DOGLCD_SCK EXP1_10_PIN - #define DOGLCD_MOSI EXP1_03_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_01_PIN + #define DOGLCD_MOSI EXP1_08_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -467,11 +467,11 @@ #endif // HAS_WIRED_LCD #if NEED_TOUCH_PINS - #define TOUCH_CS_PIN EXP1_06_PIN - #define TOUCH_SCK_PIN EXP2_09_PIN - #define TOUCH_MOSI_PIN EXP2_05_PIN - #define TOUCH_MISO_PIN EXP2_10_PIN - #define TOUCH_INT_PIN EXP1_05_PIN + #define TOUCH_CS_PIN EXP1_05_PIN + #define TOUCH_SCK_PIN EXP2_02_PIN + #define TOUCH_MOSI_PIN EXP2_06_PIN + #define TOUCH_MISO_PIN EXP2_01_PIN + #define TOUCH_INT_PIN EXP1_06_PIN #endif /** diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index b50e8e5780..8f0f46ad85 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -246,41 +246,41 @@ #endif /** ------ ------ - * 1.30 |10 9 | 0.28 0.17 |10 9 | 0.15 - * 1.18 | 8 7 | 1.19 3.26 | 8 7 | 0.16 - * 1.20 6 5 | 1.21 3.25 6 5 | 0.18 - * 1.22 | 4 3 | 1.23 1.31 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * 1.30 | 1 2 | 0.28 0.17 | 1 2 | 0.15 + * 1.18 | 3 4 | 1.19 3.26 | 3 4 | 0.16 + * 1.20 5 6 | 1.21 3.25 5 6 | 0.18 + * 1.22 | 7 8 | 1.23 1.31 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN P1_23 -#define EXP1_04_PIN P1_22 -#define EXP1_05_PIN P1_21 -#define EXP1_06_PIN P1_20 -#define EXP1_07_PIN P1_19 -#define EXP1_08_PIN P1_18 -#define EXP1_09_PIN P0_28 -#define EXP1_10_PIN P1_30 +#define EXP1_08_PIN P1_23 +#define EXP1_07_PIN P1_22 +#define EXP1_06_PIN P1_21 +#define EXP1_05_PIN P1_20 +#define EXP1_04_PIN P1_19 +#define EXP1_03_PIN P1_18 +#define EXP1_02_PIN P0_28 +#define EXP1_01_PIN P1_30 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN P1_31 -#define EXP2_05_PIN P0_18 -#define EXP2_06_PIN P3_25 -#define EXP2_07_PIN P0_16 -#define EXP2_08_PIN P3_26 -#define EXP2_09_PIN P0_15 -#define EXP2_10_PIN P0_17 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN P1_31 +#define EXP2_06_PIN P0_18 +#define EXP2_05_PIN P3_25 +#define EXP2_04_PIN P0_16 +#define EXP2_03_PIN P3_26 +#define EXP2_02_PIN P0_15 +#define EXP2_01_PIN P0_17 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI // RET6 DWIN ENCODER LCD - #define BTN_ENC EXP1_06_PIN - #define BTN_EN1 EXP1_03_PIN - #define BTN_EN2 EXP1_04_PIN + #define BTN_ENC EXP1_05_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_07_PIN #ifndef BEEPER_PIN - #define BEEPER_PIN EXP1_05_PIN + #define BEEPER_PIN EXP1_06_PIN #endif #elif HAS_WIRED_LCD @@ -300,24 +300,24 @@ * * BEFORE AFTER * ------ ------ - * (BEEPER) | 10 9 | (CLK) (BEEPER) | 10 9 | (CLK) - * (BTN_ENC) | 8 7 | -- (BTN_ENC) | 8 7 | -- - * (BTN_EN1) 6 5 | (SID) (BTN_EN1) 6 5 | (SID) - * (BTN_EN2) | 4 3 | (CS) (BTN_EN2) | 4 3 | (CS) - * 5V | 2 1 | GND GND | 2 1 | 5V + * (BEEPER) | 1 2 | (CLK) (BEEPER) | 1 2 | (CLK) + * (BTN_ENC) | 3 4 | -- (BTN_ENC) | 3 4 | -- + * (BTN_EN1) 5 6 | (SID) (BTN_EN1) 5 6 | (SID) + * (BTN_EN2) | 7 8 | (CS) (BTN_EN2) | 7 8 | (CS) + * 5V | 9 10 | GND GND | 9 10 | 5V * ------ ------ * LCD LCD */ - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP1_05_PIN - #define BTN_EN2 EXP1_04_PIN - #define BTN_ENC EXP1_10_PIN + #define BTN_EN1 EXP1_06_PIN + #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_01_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define BEEPER_PIN EXP1_03_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define BEEPER_PIN EXP1_08_PIN #elif ENABLED(ANET_FULL_GRAPHICS_LCD) #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING @@ -336,147 +336,147 @@ * * BEFORE AFTER * ------ ------ - * (BEEPER) |10 9 | (CLK) (BEEPER) |10 9 | -- - * (BTN_ENC) | 8 7 | -- (BTN_ENC) | 8 7 | (CLK) - * (BTN_EN1) 6 5 | (SID) (BTN_EN1) 6 5 | (SID) - * (BTN_EN2) | 4 3 | (CS) (BTN_EN2) | 4 3 | (CS) - * 5V | 2 1 | GND GND | 2 1 | 5V + * (BEEPER) | 1 2 | (CLK) (BEEPER) | 1 2 | -- + * (BTN_ENC) | 3 4 | -- (BTN_ENC) | 3 4 | (CLK) + * (BTN_EN1) 5 6 | (SID) (BTN_EN1) 5 6 | (SID) + * (BTN_EN2) | 7 8 | (CS) (BTN_EN2) | 7 8 | (CS) + * 5V | 9 10 | GND GND | 9 10 | 5V * ------ ------ * LCD LCD */ - #define LCD_PINS_RS EXP1_03_PIN + #define LCD_PINS_RS EXP1_08_PIN - #define BTN_EN1 EXP1_06_PIN - #define BTN_EN2 EXP1_04_PIN - #define BTN_ENC EXP1_08_PIN + #define BTN_EN1 EXP1_05_PIN + #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_03_PIN - #define LCD_PINS_ENABLE EXP1_05_PIN - #define LCD_PINS_D4 EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_06_PIN + #define LCD_PINS_D4 EXP1_04_PIN - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #elif ENABLED(CR10_STOCKDISPLAY) - #define BTN_ENC EXP1_09_PIN // (58) open-drain - #define LCD_PINS_RS EXP1_04_PIN + #define BTN_ENC EXP1_02_PIN // (58) open-drain + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #elif ENABLED(ENDER2_STOCKDISPLAY) /** Creality Ender-2 display pinout * ------ - * (SCK) 1.30 |10 9 | 0.28 (BTN_ENC) - * (BTN_EN1) 1.18 | 8 7 | 1.19 (RESET) - * (BTN_EN2) 1.20 6 5 | 1.21 (LCD_A0) - * (LCD_RS) 1.22 | 4 3 | 1.23 (MOSI) - * GND | 2 1 | 5V + * (SCK) 1.30 | 1 2 | 0.28 (BTN_ENC) + * (BTN_EN1) 1.18 | 3 4 | 1.19 (RESET) + * (BTN_EN2) 1.20 5 6 | 1.21 (LCD_A0) + * (LCD_RS) 1.22 | 7 8 | 1.23 (MOSI) + * GND | 9 10 | 5V * ------ * EXP1 */ - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN - #define DOGLCD_CS EXP1_04_PIN - #define DOGLCD_A0 EXP1_05_PIN - #define DOGLCD_SCK EXP1_10_PIN - #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_01_PIN + #define DOGLCD_MOSI EXP1_08_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_A0_PIN EXP1_03_PIN - #define TFT_DC_PIN EXP1_03_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN - #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_A0_PIN EXP1_08_PIN + #define TFT_DC_PIN EXP1_08_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_BACKLIGHT_PIN EXP1_03_PIN + #define TFT_RESET_PIN EXP1_04_PIN #define LCD_USE_DMA_SPI - #define TOUCH_INT_PIN EXP1_05_PIN - #define TOUCH_CS_PIN EXP1_06_PIN + #define TOUCH_INT_PIN EXP1_06_PIN + #define TOUCH_CS_PIN EXP1_05_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 // SPI 1 - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN #define TFT_BUFFER_SIZE 2400 #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #else - #define BTN_ENC EXP1_09_PIN // (58) open-drain - #define LCD_PINS_RS EXP1_07_PIN + #define BTN_ENC EXP1_02_PIN // (58) open-drain + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN // (31) J3-2 & AUX-4 - #define BTN_EN2 EXP2_06_PIN // (33) J3-4 & AUX-4 + #define BTN_EN1 EXP2_03_PIN // (31) J3-2 & AUX-4 + #define BTN_EN2 EXP2_05_PIN // (33) J3-4 & AUX-4 - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN - #define LCD_SDSS EXP2_07_PIN // (16) J3-7 & AUX-4 + #define LCD_SDSS EXP2_04_PIN // (16) J3-7 & AUX-4 #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #define FORCE_SOFT_SPI #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BTN_ENC_EN EXP1_03_PIN // Detect the presence of the encoder + #define BTN_ENC_EN EXP1_08_PIN // Detect the presence of the encoder #endif #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 37d0cb7fb1..ec74cc640e 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -134,8 +134,8 @@ #define SD_SCK_PIN P0_15 #define SD_MISO_PIN P0_17 #define SD_MOSI_PIN P0_18 - #define SD_SS_PIN EXP2_07_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_SS_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif SD_CONNECTION_IS(ONBOARD) #undef SD_DETECT_PIN @@ -152,11 +152,11 @@ #if ENABLED(BTT_MOTOR_EXPANSION) /** * ------ ------ - * (M3STP) |10 9 | (M3DIR) (M3DIAG) |10 9 | (M3RX) - * (M2STP) | 8 7 | (M2DIR) (M2DIAG) | 8 7 | (M2RX) - * (M1DIR) 6 5 | (M1STP) (M1DIAG) 6 5 | (M1RX) - * (M1EN) | 4 3 | -- (M3EN) | 4 3 | (M2EN) - * GND | 2 1 | -- GND | 2 1 | -- + * (M3STP) | 1 2 | (M3DIR) (M3DIAG) | 1 2 | (M3RX) + * (M2STP) | 3 4 | (M2DIR) (M2DIAG) | 3 4 | (M2RX) + * (M1DIR) 5 6 | (M1STP) (M1DIAG) 5 6 | (M1RX) + * (M1EN) | 7 8 | -- (M3EN) | 7 8 | (M2EN) + * GND | 9 10 | -- GND | 9 10 | -- * ------ ------ * EXP2 EXP1 * @@ -164,46 +164,46 @@ */ // M1 on Driver Expansion Module - #define E2_STEP_PIN EXP2_05_PIN - #define E2_DIR_PIN EXP2_06_PIN - #define E2_ENABLE_PIN EXP2_04_PIN + #define E2_STEP_PIN EXP2_06_PIN + #define E2_DIR_PIN EXP2_05_PIN + #define E2_ENABLE_PIN EXP2_07_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E2_DIAG_PIN EXP1_06_PIN - #define E2_CS_PIN EXP1_05_PIN + #define E2_DIAG_PIN EXP1_05_PIN + #define E2_CS_PIN EXP1_06_PIN #if HAS_TMC_UART - #define E2_SERIAL_TX_PIN EXP1_05_PIN + #define E2_SERIAL_TX_PIN EXP1_06_PIN #define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN #endif #endif // M2 on Driver Expansion Module - #define E3_STEP_PIN EXP2_08_PIN - #define E3_DIR_PIN EXP2_07_PIN + #define E3_STEP_PIN EXP2_03_PIN + #define E3_DIR_PIN EXP2_04_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E3_ENABLE_PIN EXP1_03_PIN - #define E3_DIAG_PIN EXP1_08_PIN - #define E3_CS_PIN EXP1_07_PIN + #define E3_ENABLE_PIN EXP1_08_PIN + #define E3_DIAG_PIN EXP1_03_PIN + #define E3_CS_PIN EXP1_04_PIN #if HAS_TMC_UART - #define E3_SERIAL_TX_PIN EXP1_07_PIN + #define E3_SERIAL_TX_PIN EXP1_04_PIN #define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN #endif #else - #define E3_ENABLE_PIN EXP2_04_PIN + #define E3_ENABLE_PIN EXP2_07_PIN #endif // M3 on Driver Expansion Module - #define E4_STEP_PIN EXP2_10_PIN - #define E4_DIR_PIN EXP2_09_PIN + #define E4_STEP_PIN EXP2_01_PIN + #define E4_DIR_PIN EXP2_02_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E4_ENABLE_PIN EXP1_04_PIN - #define E4_DIAG_PIN EXP1_10_PIN - #define E4_CS_PIN EXP1_09_PIN + #define E4_ENABLE_PIN EXP1_07_PIN + #define E4_DIAG_PIN EXP1_01_PIN + #define E4_CS_PIN EXP1_02_PIN #if HAS_TMC_UART - #define E4_SERIAL_TX_PIN EXP1_09_PIN + #define E4_SERIAL_TX_PIN EXP1_02_PIN #define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN #endif #else - #define E4_ENABLE_PIN EXP2_04_PIN + #define E4_ENABLE_PIN EXP2_07_PIN #endif #endif // BTT_MOTOR_EXPANSION diff --git a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h index 1cda5db669..59b5068eeb 100644 --- a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h +++ b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h @@ -91,27 +91,25 @@ // // Extension ports // -// warning: pins are backward numbered w.r.t. to the -// schematics, e.g. EXP1_01 / EXP1_02 are X1-10 / X1-9. -#define EXP1_01_PIN P0_28 // SCL0 -#define EXP1_02_PIN P0_27 // SDA0 -#define EXP1_03_PIN P0_16 // SSEL0 -#define EXP1_04_PIN P0_15 // SCK0 -#define EXP1_05_PIN P0_18 // MOSI0 -#define EXP1_06_PIN P0_17 // MISO0 -#define EXP1_07_PIN P1_31 -#define EXP1_08_PIN P1_30 -#define EXP1_09_PIN P0_02 // TX0 -#define EXP1_10_PIN P0_03 // RX0 +#define EXP1_10_PIN P0_28 // SCL0 +#define EXP1_09_PIN P0_27 // SDA0 +#define EXP1_08_PIN P0_16 // SSEL0 +#define EXP1_07_PIN P0_15 // SCK0 +#define EXP1_06_PIN P0_18 // MOSI0 +#define EXP1_05_PIN P0_17 // MISO0 +#define EXP1_04_PIN P1_31 +#define EXP1_03_PIN P1_30 +#define EXP1_02_PIN P0_02 // TX0 +#define EXP1_01_PIN P0_03 // RX0 -#define EXP2_03_PIN P1_27 -#define EXP2_04_PIN P1_26 -#define EXP2_05_PIN P1_29 -#define EXP2_06_PIN P1_28 -#define EXP2_07_PIN P0_01 // SCL1 -#define EXP2_08_PIN P0_00 // SDA1 -#define EXP2_09_PIN P0_11 -#define EXP2_10_PIN P0_10 +#define EXP2_08_PIN P1_27 +#define EXP2_07_PIN P1_26 +#define EXP2_06_PIN P1_29 +#define EXP2_05_PIN P1_28 +#define EXP2_04_PIN P0_01 // SCL1 +#define EXP2_03_PIN P0_00 // SDA1 +#define EXP2_02_PIN P0_11 +#define EXP2_01_PIN P0_10 // // SD Support @@ -126,11 +124,11 @@ #define SD_MOSI_PIN P0_09 #define SD_SS_PIN P0_06 #elif SD_CONNECTION_IS(LCD) - #define SD_SCK_PIN EXP1_04_PIN - #define SD_MISO_PIN EXP1_06_PIN - #define SD_MOSI_PIN EXP1_05_PIN - #define SD_SS_PIN EXP1_03_PIN - #define SD_DETECT_PIN EXP1_07_PIN + #define SD_SCK_PIN EXP1_07_PIN + #define SD_MISO_PIN EXP1_05_PIN + #define SD_MOSI_PIN EXP1_06_PIN + #define SD_SS_PIN EXP1_08_PIN + #define SD_DETECT_PIN EXP1_04_PIN #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif @@ -139,13 +137,13 @@ // LCD / Controller // #if ENABLED(EMOTION_TECH_LCD) - #define BEEPER_PIN EXP2_10_PIN - #define DOGLCD_A0 EXP2_05_PIN - #define DOGLCD_CS EXP2_07_PIN - #define DOGLCD_SCK EXP1_04_PIN - #define DOGLCD_MOSI EXP1_05_PIN + #define BEEPER_PIN EXP2_01_PIN + #define DOGLCD_A0 EXP2_06_PIN + #define DOGLCD_CS EXP2_04_PIN + #define DOGLCD_SCK EXP1_07_PIN + #define DOGLCD_MOSI EXP1_06_PIN - #define BTN_EN1 EXP2_04_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP2_09_PIN + #define BTN_EN1 EXP2_07_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP2_02_PIN #endif diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 95bbe17b9b..2ffaef949c 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -231,46 +231,46 @@ #define LED4_PIN P1_21 /** ------ ------ - * (BEEPER) 1.31 |10 9 | 1.30 (BTN_ENC) (MISO) 0.8 |10 9 | 0.7 (SD_SCK) - * (LCD_EN) 0.18 | 8 7 | 0.16 (LCD_RS) (BTN_EN1) 3.25 | 8 7 | 0.28 (SD_CS2) - * (LCD_D4) 0.15 6 5 | 0.17 (LCD_D5) (BTN_EN2) 3.26 6 5 | 0.9 (SD_MOSI) - * (LCD_D6) 1.0 | 4 3 | 1.22 (LCD_D7) (SD_DETECT) 0.27 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) 1.31 | 1 2 | 1.30 (BTN_ENC) (MISO) 0.8 | 1 2 | 0.7 (SD_SCK) + * (LCD_EN) 0.18 | 3 4 | 0.16 (LCD_RS) (BTN_EN1) 3.25 | 3 4 | 0.28 (SD_CS2) + * (LCD_D4) 0.15 5 6 | 0.17 (LCD_D5) (BTN_EN2) 3.26 5 6 | 0.9 (SD_MOSI) + * (LCD_D6) 1.0 | 7 8 | 1.22 (LCD_D7) (SD_DETECT) 0.27 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN P1_22 -#define EXP1_04_PIN P1_00 -#define EXP1_05_PIN P0_17 -#define EXP1_06_PIN P0_15 -#define EXP1_07_PIN P0_16 -#define EXP1_08_PIN P0_18 -#define EXP1_09_PIN P1_30 -#define EXP1_10_PIN P1_31 +#define EXP1_08_PIN P1_22 +#define EXP1_07_PIN P1_00 +#define EXP1_06_PIN P0_17 +#define EXP1_05_PIN P0_15 +#define EXP1_04_PIN P0_16 +#define EXP1_03_PIN P0_18 +#define EXP1_02_PIN P1_30 +#define EXP1_01_PIN P1_31 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN P0_27 -#define EXP2_05_PIN P0_09 -#define EXP2_06_PIN P3_26 -#define EXP2_07_PIN P0_28 -#define EXP2_08_PIN P3_25 -#define EXP2_09_PIN P0_07 -#define EXP2_10_PIN P0_08 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN P0_27 +#define EXP2_06_PIN P0_09 +#define EXP2_05_PIN P3_26 +#define EXP2_04_PIN P0_28 +#define EXP2_03_PIN P3_25 +#define EXP2_02_PIN P0_07 +#define EXP2_01_PIN P0_08 #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif #if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) - #define SD_DETECT_PIN EXP2_04_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN #if SD_CONNECTION_IS(ONBOARD) #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card #define SD_SS_PIN ONBOARD_SD_CS_PIN #else - #define SD_SS_PIN EXP2_07_PIN + #define SD_SS_PIN EXP2_04_PIN #endif #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." @@ -278,30 +278,30 @@ #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_A0_PIN EXP1_03_PIN - #define TFT_DC_PIN EXP1_03_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN - #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_A0_PIN EXP1_08_PIN + #define TFT_DC_PIN EXP1_08_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_BACKLIGHT_PIN EXP1_03_PIN + #define TFT_RESET_PIN EXP1_04_PIN #define LCD_USE_DMA_SPI - #define TOUCH_INT_PIN EXP1_05_PIN - #define TOUCH_CS_PIN EXP1_06_PIN + #define TOUCH_INT_PIN EXP1_06_PIN + #define TOUCH_CS_PIN EXP1_05_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 @@ -316,8 +316,8 @@ #define TFT_QUEUE_SIZE 6144 #endif - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #elif IS_TFTGLCD_PANEL @@ -325,74 +325,74 @@ #undef BTN_ENC #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #else - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_SDSS EXP2_07_PIN + #define LCD_SDSS EXP2_04_PIN #if ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC EXP1_05_PIN - #define DOGLCD_CS EXP1_07_PIN + #define LCD_PINS_DC EXP1_06_PIN + #define DOGLCD_CS EXP1_04_PIN #define DOGLCD_A0 LCD_PINS_DC - #define DOGLCD_SCK EXP1_06_PIN - #define DOGLCD_MOSI EXP1_08_PIN + #define DOGLCD_SCK EXP1_05_PIN + #define DOGLCD_MOSI EXP1_03_PIN - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #define KILL_PIN -1 // NC #else // !MKS_12864OLED_SSD1306 - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index 090a2e4051..d8dae61d94 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -186,22 +186,22 @@ /** * ------ - * (BEEPER) P2_08 |10 9 | P0_16 (BTN_ENC) - * (BTN_EN1) P0_19 | 8 7 | RESET - * (BTN_EN2) P0_20 6 5 | P0_15 (LCD_D4) - * (LCD_RS) P0_17 | 4 3 | P0_18 (LCD_EN) - * GND | 2 1 | 5V + * (BEEPER) P2_08 | 1 2 | P0_16 (BTN_ENC) + * (BTN_EN1) P0_19 | 3 4 | RESET + * (BTN_EN2) P0_20 5 6 | P0_15 (LCD_D4) + * (LCD_RS) P0_17 | 7 8 | P0_18 (LCD_EN) + * GND | 9 10 | 5V * ------ * EXP */ -#define EXP1_03_PIN P0_18 -#define EXP1_04_PIN P0_17 -#define EXP1_05_PIN P0_15 -#define EXP1_06_PIN P0_20 -#define EXP1_07_PIN -1 -#define EXP1_08_PIN P0_19 -#define EXP1_09_PIN P0_16 -#define EXP1_10_PIN P2_08 +#define EXP1_08_PIN P0_18 +#define EXP1_07_PIN P0_17 +#define EXP1_06_PIN P0_15 +#define EXP1_05_PIN P0_20 +#define EXP1_04_PIN -1 +#define EXP1_03_PIN P0_19 +#define EXP1_02_PIN P0_16 +#define EXP1_01_PIN P2_08 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING @@ -211,32 +211,32 @@ /** * Ender 3 V2 display SKR E3 Turbo (EXP1) Ender 3 V2 display --> SKR E3 Turbo * ------ ------ RX 8 --> 5 P0_15 - * -- |10 9 | -- (BEEPER) P2_08 |10 9 | P0_16 (BTN_ENC) TX 7 --> 9 P0_16 - * (SKR_TX1) RX | 8 7 | TX (SKR_RX1) (BTN_EN1) P0_19 | 8 7 | RESET BEEPER 5 --> 10 P2_08 - * (BTN_ENC) ENT 6 5 | BEEPER (BTN_EN2) P0_20 6 5 | P0_15 (LCD_D4) - * (BTN_E2) B | 4 3 | A (BTN_E1) (LCD_RS) P0_17 | 4 3 | P0_18 (LCD_EN) - * GND | 2 1 | 5V GND | 2 1 | 5V + * -- | 1 2 | -- (BEEPER) P2_08 | 1 2 | P0_16 (BTN_ENC) TX 7 --> 9 P0_16 + * (SKR_TX1) RX | 3 4 | TX (SKR_RX1) (BTN_EN1) P0_19 | 3 4 | RESET BEEPER 5 --> 10 P2_08 + * (BTN_ENC) ENT 5 6 | BEEPER (BTN_EN2) P0_20 5 6 | P0_15 (LCD_D4) + * (BTN_E2) B | 7 8 | A (BTN_E1) (LCD_RS) P0_17 | 7 8 | P0_18 (LCD_EN) + * GND | 9 10 | 5V GND | 9 10 | 5V * ------ ------ */ - #define BEEPER_PIN EXP1_10_PIN - #define BTN_EN1 EXP1_03_PIN - #define BTN_EN2 EXP1_04_PIN - #define BTN_ENC EXP1_06_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_05_PIN #elif HAS_WIRED_LCD #if ENABLED(CR10_STOCKDISPLAY) - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! @@ -244,24 +244,24 @@ #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_E3_TURBO.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" #endif - #define LCD_PINS_RS EXP1_05_PIN - #define LCD_PINS_ENABLE EXP1_09_PIN - #define LCD_PINS_D4 EXP1_04_PIN - #define LCD_PINS_D5 EXP1_06_PIN - #define LCD_PINS_D6 EXP1_08_PIN - #define LCD_PINS_D7 EXP1_10_PIN + #define LCD_PINS_RS EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_02_PIN + #define LCD_PINS_D4 EXP1_07_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_03_PIN + #define LCD_PINS_D7 EXP1_01_PIN #define ADC_KEYPAD_PIN P1_23 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD! #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN - #define DOGLCD_CS EXP1_04_PIN - #define DOGLCD_A0 EXP1_05_PIN - #define DOGLCD_SCK EXP1_10_PIN - #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_01_PIN + #define DOGLCD_MOSI EXP1_08_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 4cff5d59e1..d137bdae91 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -270,87 +270,87 @@ #endif /** ------ ------ - * (BEEPER) 1.31 |10 9 | 1.30 (BTN_ENC) (MISO) 0.8 |10 9 | 0.7 (SD_SCK) - * (LCD_EN) 0.18 | 8 7 | 0.16 (LCD_RS) (BTN_EN1) 3.25 | 8 7 | 0.28 (SD_CS2) - * (LCD_D4) 0.15 6 5 | 0.17 (LCD_D5) (BTN_EN2) 3.26 6 5 | 0.9 (SD_MOSI) - * (LCD_D6) 1.0 | 4 3 | 1.22 (LCD_D7) (SD_DETECT) 0.27 | 4 3 | RST - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) 1.31 | 1 2 | 1.30 (BTN_ENC) (MISO) 0.8 | 1 2 | 0.7 (SD_SCK) + * (LCD_EN) 0.18 | 3 4 | 0.16 (LCD_RS) (BTN_EN1) 3.25 | 3 4 | 0.28 (SD_CS2) + * (LCD_D4) 0.15 5 6 | 0.17 (LCD_D5) (BTN_EN2) 3.26 5 6 | 0.9 (SD_MOSI) + * (LCD_D6) 1.0 | 7 8 | 1.22 (LCD_D7) (SD_DETECT) 0.27 | 7 8 | RST + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN P1_22 -#define EXP1_04_PIN P1_00 -#define EXP1_05_PIN P0_17 -#define EXP1_06_PIN P0_15 -#define EXP1_07_PIN P0_16 -#define EXP1_08_PIN P0_18 -#define EXP1_09_PIN P1_30 -#define EXP1_10_PIN P1_31 +#define EXP1_08_PIN P1_22 +#define EXP1_07_PIN P1_00 +#define EXP1_06_PIN P0_17 +#define EXP1_05_PIN P0_15 +#define EXP1_04_PIN P0_16 +#define EXP1_03_PIN P0_18 +#define EXP1_02_PIN P1_30 +#define EXP1_01_PIN P1_31 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN P0_27 -#define EXP2_05_PIN P0_09 -#define EXP2_06_PIN P3_26 -#define EXP2_07_PIN P0_28 -#define EXP2_08_PIN P3_25 -#define EXP2_09_PIN P0_07 -#define EXP2_10_PIN P0_08 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN P0_27 +#define EXP2_06_PIN P0_09 +#define EXP2_05_PIN P3_26 +#define EXP2_04_PIN P0_28 +#define EXP2_03_PIN P3_25 +#define EXP2_02_PIN P0_07 +#define EXP2_01_PIN P0_08 #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #else - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_SDSS EXP2_07_PIN + #define LCD_SDSS EXP2_04_PIN #if ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC EXP1_05_PIN - #define DOGLCD_CS EXP1_07_PIN + #define LCD_PINS_DC EXP1_06_PIN + #define DOGLCD_CS EXP1_04_PIN #define DOGLCD_A0 LCD_PINS_DC - #define DOGLCD_SCK EXP1_06_PIN - #define DOGLCD_MOSI EXP1_08_PIN + #define DOGLCD_SCK EXP1_05_PIN + #define DOGLCD_MOSI EXP1_03_PIN - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #define KILL_PIN -1 // NC #elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_DC_PIN EXP1_03_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_DC_PIN EXP1_08_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_BACKLIGHT_PIN EXP1_08_PIN - #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_BACKLIGHT_PIN EXP1_03_PIN + #define TFT_RESET_PIN EXP1_04_PIN #define LCD_USE_DMA_SPI - #define TOUCH_INT_PIN EXP1_05_PIN - #define TOUCH_CS_PIN EXP1_06_PIN + #define TOUCH_INT_PIN EXP1_06_PIN + #define TOUCH_CS_PIN EXP1_05_PIN #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 2 @@ -367,50 +367,50 @@ #else // !MKS_12864OLED_SSD1306 - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #else // !FYSETC_MINI_12864 #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -431,15 +431,15 @@ #endif #if SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD) - #define SD_DETECT_PIN EXP2_04_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN #if SD_CONNECTION_IS(ONBOARD) #define ONBOARD_SD_CS_PIN P0_06 // Chip select for "System" SD card #define SD_SS_PIN ONBOARD_SD_CS_PIN #else - #define SD_SS_PIN EXP2_07_PIN + #define SD_SS_PIN EXP2_04_PIN #endif #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index 81c7dc9403..f6d8e40844 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -157,11 +157,11 @@ /** * ------ - * P1_31 |10 9 | P1_30 - * P3_26 | 8 7 | P2_11 - * P3_25 6 5 | P0_15 - * P0_16 | 4 3 | P0_18 - * GND | 2 1 | 5V + * P1_31 | 1 2 | P1_30 + * P3_26 | 3 4 | P2_11 + * P3_25 5 6 | P0_15 + * P0_16 | 7 8 | P0_18 + * GND | 9 10 | 5V * ------ * EXP1 * @@ -171,43 +171,43 @@ * A remote SD card is currently not supported because the pins routed to the EXP2 * connector are shared with the onboard SD card. */ -#define EXP1_03_PIN P0_18 -#define EXP1_04_PIN P0_16 -#define EXP1_05_PIN P0_15 -#define EXP1_06_PIN P3_25 -#define EXP1_07_PIN P2_11 -#define EXP1_08_PIN P3_26 -#define EXP1_09_PIN P1_30 -#define EXP1_10_PIN P1_31 +#define EXP1_08_PIN P0_18 +#define EXP1_07_PIN P0_16 +#define EXP1_06_PIN P0_15 +#define EXP1_05_PIN P3_25 +#define EXP1_04_PIN P2_11 +#define EXP1_03_PIN P3_26 +#define EXP1_02_PIN P1_30 +#define EXP1_01_PIN P1_31 #if ENABLED(CR10_STOCKDISPLAY) /** ------ - * BEEPER |10 9 | ENC - * EN1 | 8 7 | KILL - * EN2 6 5 | LCD_D4 - * LCD_RS | 4 3 | LCD_EN - * GND | 2 1 | 5V + * BEEPER | 1 2 | ENC + * EN1 | 3 4 | KILL + * EN2 5 6 | LCD_D4 + * LCD_RS | 7 8 | LCD_EN + * GND | 9 10 | 5V * ------ */ - #define BEEPER_PIN EXP1_10_PIN - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN - #define KILL_PIN EXP1_07_PIN + #define BEEPER_PIN EXP1_01_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define KILL_PIN EXP1_04_PIN #elif ENABLED(MKS_MINI_12864) /** ------ - * SCK |10 9 | ENC - * EN1 | 8 7 | -- - * EN2 6 5 | A0 - * CS | 4 3 | MOSI - * GND | 2 1 | 5V + * SCK | 1 2 | ENC + * EN1 | 3 4 | -- + * EN2 5 6 | A0 + * CS | 7 8 | MOSI + * GND | 9 10 | 5V * ------ */ - #define DOGLCD_CS EXP1_04_PIN - #define DOGLCD_A0 EXP1_05_PIN - #define DOGLCD_SCK EXP1_10_PIN - #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_01_PIN + #define DOGLCD_MOSI EXP1_08_PIN #define LCD_CONTRAST_INIT 160 #define LCD_CONTRAST_MIN 120 #define LCD_CONTRAST_MAX 180 @@ -221,7 +221,7 @@ #endif #if EITHER(CR10_STOCKDISPLAY, MKS_MINI_12864) - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN #endif diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 1ba58629c1..7a8c99e3af 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -54,8 +54,8 @@ #include "pins_RAMPS.h" -#undef EXP2_03_PIN -#define EXP2_03_PIN -1 // RESET +#undef EXP2_08_PIN +#define EXP2_08_PIN -1 // RESET // // LCD / Controller @@ -85,11 +85,11 @@ * This configuration uses the following arrangement: * * ------ ------ - * ENCB |10 9 | ENCA MISO |10 9 | SCK - * BLUE_LED | 8 7 | RED_LED ENCBTN | 8 7 | SDCS - * KILL 6 5 | BEEPER 6 5 | MOSI - * A0 | 4 3 | LCD_CS SDCD | 4 3 | - * GND | 2 1 | 5V GND | 2 1 | -- + * ENCB | 1 2 | ENCA MISO | 1 2 | SCK + * BLUE_LED | 3 4 | RED_LED ENCBTN | 3 4 | SDCS + * KILL 5 6 | BEEPER 5 6 | MOSI + * A0 | 7 8 | LCD_CS SDCD | 7 8 | + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ @@ -107,24 +107,24 @@ // // VIKI2 12-wire lead // - #define SD_DETECT_PIN EXP2_04_PIN // SDCD orange/white - #define BTN_EN1 EXP1_09_PIN // ENCA white - #define BTN_EN2 EXP1_10_PIN // ENCB green - #define BTN_ENC EXP2_08_PIN // ENCBTN purple - #define DOGLCD_A0 EXP1_04_PIN // A0 brown - #define DOGLCD_CS EXP1_03_PIN // LCS green/white + #define SD_DETECT_PIN EXP2_07_PIN // SDCD orange/white + #define BTN_EN1 EXP1_02_PIN // ENCA white + #define BTN_EN2 EXP1_01_PIN // ENCB green + #define BTN_ENC EXP2_03_PIN // ENCBTN purple + #define DOGLCD_A0 EXP1_07_PIN // A0 brown + #define DOGLCD_CS EXP1_08_PIN // LCS green/white - // EXP2_10_PIN gray MISO - // EXP2_05_PIN yellow MOSI - // EXP2_09_PIN orange SCK + // EXP2_01_PIN gray MISO + // EXP2_06_PIN yellow MOSI + // EXP2_02_PIN orange SCK - //#define SDSS EXP2_07_PIN // SDCS blue + //#define SDSS EXP2_04_PIN // SDCS blue // // VIKI2 4-wire lead // - #define KILL_PIN EXP1_06_PIN // BTN blue - #define BEEPER_PIN EXP1_05_PIN // BUZZER green - #define STAT_LED_RED_PIN EXP1_07_PIN // RED-LED yellow - #define STAT_LED_BLUE_PIN EXP1_08_PIN // BLUE-LED white + #define KILL_PIN EXP1_05_PIN // BTN blue + #define BEEPER_PIN EXP1_06_PIN // BUZZER green + #define STAT_LED_RED_PIN EXP1_04_PIN // RED-LED yellow + #define STAT_LED_BLUE_PIN EXP1_03_PIN // BLUE-LED white #endif diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 5672915b7c..a9824fbb8d 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -513,62 +513,62 @@ * LCD adapters come in different variants. The socket keys can be * on either side, and may be backwards on some boards / displays. */ -#ifndef EXP1_03_PIN +#ifndef EXP1_08_PIN - #define EXP1_03_PIN AUX4_13_PIN - #define EXP1_04_PIN AUX4_14_PIN - #define EXP1_05_PIN AUX4_15_PIN - #define EXP1_06_PIN AUX4_16_PIN - #define EXP1_07_PIN AUX4_18_PIN - #define EXP1_08_PIN AUX4_17_PIN + #define EXP1_08_PIN AUX4_13_PIN + #define EXP1_07_PIN AUX4_14_PIN + #define EXP1_06_PIN AUX4_15_PIN + #define EXP1_05_PIN AUX4_16_PIN + #define EXP1_04_PIN AUX4_18_PIN + #define EXP1_03_PIN AUX4_17_PIN - #define EXP2_04_PIN AUX3_02_PIN - #define EXP2_05_PIN AUX3_04_PIN - #define EXP2_07_PIN AUX3_06_PIN - #define EXP2_09_PIN AUX3_05_PIN - #define EXP2_10_PIN AUX3_03_PIN + #define EXP2_07_PIN AUX3_02_PIN + #define EXP2_06_PIN AUX3_04_PIN + #define EXP2_04_PIN AUX3_06_PIN + #define EXP2_02_PIN AUX3_05_PIN + #define EXP2_01_PIN AUX3_03_PIN #if ENABLED(G3D_PANEL) /** Gadgets3D Smart Adapter * ------ ------ - * 4-11 |10 9 | 4-12 (MISO) 3-03 |10 9 | 3-05 (SCK) - * 4-17 | 8 7 | 4-18 4-10 | 8 7 | 3-06 - * 4-16 6 5 | 4-15 4-09 6 5 | 3-04 (MOSI) - * 4-14 | 4 3 | 4-13 3-02 | 4 3 | 4-07 - * (GND) 4-02 | 2 1 | 4-01 (5V) -- | 2 1 | -- + * 4-11 | 1 2 | 4-12 (MISO) 3-03 | 1 2 | 3-05 (SCK) + * 4-17 | 3 4 | 4-18 4-10 | 3 4 | 3-06 + * 4-16 5 6 | 4-15 4-09 5 6 | 3-04 (MOSI) + * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07 + * (GND) 4-02 | 9 10 | 4-01 (5V) -- | 9 10 | -- * ------ ------ * EXP1 EXP2 */ - #define EXP1_09_PIN AUX4_12_PIN - #define EXP1_10_PIN AUX4_11_PIN + #define EXP1_02_PIN AUX4_12_PIN + #define EXP1_01_PIN AUX4_11_PIN - #define EXP2_03_PIN AUX4_07_PIN - #define EXP2_06_PIN AUX4_09_PIN - #define EXP2_08_PIN AUX4_10_PIN + #define EXP2_08_PIN AUX4_07_PIN + #define EXP2_05_PIN AUX4_09_PIN + #define EXP2_03_PIN AUX4_10_PIN #else /** Smart Adapter (c) RRD * ------ ------ - * 4-09 |10 9 | 4-10 (MISO) 3-03 |10 9 | 3-05 (SCK) - * 4-17 | 8 7 | 4-18 4-12 | 8 7 | 3-06 - * 4-16 6 5 | 4-15 4-11 6 5 | 3-04 (MOSI) - * 4-14 | 4 3 | 4-13 3-02 | 4 3 | 4-07 - * (GND) 3-07 | 2 1 | 3-01 (5V) (GND) 3-07 | 2 1 | -- + * 4-09 | 1 2 | 4-10 (MISO) 3-03 | 1 2 | 3-05 (SCK) + * 4-17 | 3 4 | 4-18 4-12 | 3 4 | 3-06 + * 4-16 5 6 | 4-15 4-11 5 6 | 3-04 (MOSI) + * 4-14 | 7 8 | 4-13 3-02 | 7 8 | 4-07 + * (GND) 3-07 | 9 10 | 3-01 (5V) (GND) 3-07 | 9 10 | -- * ------ ------ * EXP1 EXP2 */ - #define EXP1_09_PIN AUX4_10_PIN - #define EXP1_10_PIN AUX4_09_PIN + #define EXP1_02_PIN AUX4_10_PIN + #define EXP1_01_PIN AUX4_09_PIN #if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #define EXP2_03_PIN -1 // RESET - #define EXP2_06_PIN AUX4_12_PIN - #define EXP2_08_PIN AUX4_11_PIN + #define EXP2_08_PIN -1 // RESET + #define EXP2_05_PIN AUX4_12_PIN + #define EXP2_03_PIN AUX4_11_PIN #else - #define EXP2_03_PIN AUX4_07_PIN - #define EXP2_06_PIN AUX4_11_PIN - #define EXP2_08_PIN AUX4_12_PIN + #define EXP2_08_PIN AUX4_07_PIN + #define EXP2_05_PIN AUX4_11_PIN + #define EXP2_03_PIN AUX4_12_PIN #endif #endif @@ -588,9 +588,9 @@ // #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS EXP2_04_PIN // CS chip select /SS chip slave select - #define LCD_PINS_ENABLE EXP2_05_PIN // SID (MOSI) - #define LCD_PINS_D4 EXP2_09_PIN // SCK (CLK) clock + #define LCD_PINS_RS EXP2_07_PIN // CS chip select /SS chip slave select + #define LCD_PINS_ENABLE EXP2_06_PIN // SID (MOSI) + #define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock #elif BOTH(IS_NEWPANEL, PANEL_ONE) @@ -603,18 +603,18 @@ #elif ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_06_PIN + #define TFTGLCD_CS EXP2_05_PIN #else #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #if !IS_NEWPANEL - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #endif #elif ENABLED(ZONESTAR_LCD) @@ -637,25 +637,25 @@ #else #if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306) - #define LCD_PINS_DC EXP1_05_PIN // Set as output on init - #define LCD_PINS_RS EXP1_04_PIN // Pull low for 1s to init + #define LCD_PINS_DC EXP1_06_PIN // Set as output on init + #define LCD_PINS_RS EXP1_07_PIN // Pull low for 1s to init // DOGM SPI LCD Support #define DOGLCD_A0 LCD_PINS_DC - #define DOGLCD_CS EXP1_07_PIN - #define DOGLCD_MOSI EXP1_08_PIN - #define DOGLCD_SCK EXP1_06_PIN + #define DOGLCD_CS EXP1_04_PIN + #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_SCK EXP1_05_PIN #else - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN #endif - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if !IS_NEWPANEL - #define BEEPER_PIN EXP2_06_PIN + #define BEEPER_PIN EXP2_05_PIN #endif #endif @@ -666,7 +666,7 @@ //#define SHIFT_CLK_PIN 38 //#define SHIFT_LD_PIN AUX2_08_PIN //#define SHIFT_OUT_PIN AUX2_06_PIN - //#define SHIFT_EN_PIN EXP1_08_PIN + //#define SHIFT_EN_PIN EXP1_03_PIN #endif #endif @@ -682,22 +682,22 @@ #if IS_RRD_SC - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #else - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #endif - #define BTN_ENC EXP1_09_PIN + #define BTN_ENC EXP1_02_PIN #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif #ifndef KILL_PIN - #define KILL_PIN EXP2_03_PIN + #define KILL_PIN EXP2_08_PIN #endif #if ENABLED(BQ_LCD_SMART_CONTROLLER) @@ -717,7 +717,7 @@ #define BTN_EN2 AUX4_06_PIN #define BTN_ENC AUX4_03_PIN #define LCD_SDSS SDSS - #define KILL_PIN EXP2_03_PIN + #define KILL_PIN EXP2_08_PIN #elif ENABLED(LCD_I2C_VIKI) @@ -726,7 +726,7 @@ #define BTN_ENC -1 #define LCD_SDSS SDSS - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif EITHER(VIKI2, miniVIKI) @@ -734,83 +734,83 @@ #define DOGLCD_A0 AUX2_07_PIN #define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 - #define BEEPER_PIN EXP2_06_PIN + #define BEEPER_PIN EXP2_05_PIN #define STAT_LED_RED_PIN AUX4_03_PIN - #define STAT_LED_BLUE_PIN EXP1_09_PIN + #define STAT_LED_BLUE_PIN EXP1_02_PIN #define BTN_EN1 22 #define BTN_EN2 7 #define BTN_ENC AUX4_08_PIN #define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board - #define KILL_PIN EXP2_08_PIN + #define KILL_PIN EXP2_03_PIN #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define DOGLCD_CS EXP1_03_PIN - #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN - #define BEEPER_PIN EXP1_06_PIN - #define LCD_BACKLIGHT_PIN EXP2_06_PIN + #define BEEPER_PIN EXP1_05_PIN + #define LCD_BACKLIGHT_PIN EXP2_05_PIN - #define BTN_EN1 EXP1_09_PIN - #define BTN_EN2 EXP1_10_PIN - #define BTN_ENC EXP2_08_PIN + #define BTN_EN1 EXP1_02_PIN + #define BTN_EN2 EXP1_01_PIN + #define BTN_ENC EXP2_03_PIN #define LCD_SDSS SDSS - #define SD_DETECT_PIN EXP2_04_PIN - #define KILL_PIN EXP2_03_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define KILL_PIN EXP2_08_PIN #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864) - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif #ifndef KILL_PIN - #define KILL_PIN EXP2_03_PIN + #define KILL_PIN EXP2_08_PIN #endif #if ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN // not connected to a pin #define LCD_BACKLIGHT_PIN -1 // 65 (MKS mini12864 can't adjust backlight by software!) - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #elif ENABLED(FYSETC_MINI_12864) // From https://wiki.fysetc.com/Mini12864_Panel/ - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif @@ -840,31 +840,31 @@ #elif ENABLED(G3D_PANEL) - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN - #define SD_DETECT_PIN EXP2_04_PIN - #define KILL_PIN EXP2_03_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define KILL_PIN EXP2_08_PIN - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN + #define BTN_ENC EXP1_02_PIN #elif IS_TFTGLCD_PANEL - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #else - #define BEEPER_PIN EXP2_06_PIN + #define BEEPER_PIN EXP2_05_PIN #if ENABLED(PANEL_ONE) // Buttons connect directly to AUX-2 #define BTN_EN1 AUX2_03_PIN #define BTN_EN2 AUX2_04_PIN #define BTN_ENC AUX3_02_PIN #else - #define BTN_EN1 EXP1_10_PIN - #define BTN_EN2 EXP1_09_PIN - #define BTN_ENC EXP2_08_PIN + #define BTN_EN1 EXP1_01_PIN + #define BTN_EN2 EXP1_02_PIN + #define BTN_ENC EXP2_03_PIN #endif #endif @@ -898,11 +898,11 @@ * * Board Display * ------ ------ - * (MISO) 50 |10 9 | 52 (SCK) 5V |10 9 | GND - * (BTN_EN2) 33 | 8 7 | 53 (SD_CS) RESET | 8 7 | (SD_DET) - * (BTN_EN1) 31 6 5 | 51 (MOSI) (MOSI) 6 5 | (LCD_CS) - * (SD_DET) 49 | 4 3 | RESET (SD_CS) | 4 3 | (MOD_RESET) - * GND | 2 1 | -- (SCK) | 2 1 | (MISO) + * (MISO) 50 | 1 2 | 52 (SCK) 5V | 1 2 | GND + * (BTN_EN2) 33 | 3 4 | 53 (SD_CS) RESET | 3 4 | (SD_DET) + * (BTN_EN1) 31 5 6 | 51 (MOSI) (MOSI) 5 6 | (LCD_CS) + * (SD_DET) 49 | 7 8 | RESET (SD_CS) | 7 8 | (MOD_RESET) + * GND | 9 10 | -- (SCK) | 9 10 | (MISO) * ------ ------ * EXP2 * @@ -925,11 +925,11 @@ * To fix, insert a 1N4148 diode in the MISO line. */ - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN - #define CLCD_MOD_RESET EXP2_06_PIN - #define CLCD_SPI_CS EXP2_08_PIN + #define CLCD_MOD_RESET EXP2_05_PIN + #define CLCD_SPI_CS EXP2_03_PIN #endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050 diff --git a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h index 0c554c353f..f4e811b8e6 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h @@ -65,30 +65,30 @@ /** 3DYMY Expansion Headers * ------ ------ - * 37 |10 9 | 35 (MISO) 50 |10 9 | 52 (SCK) - * 31 | 8 7 | 41 29 | 8 7 | 53 - * 33 6 5 | 23 25 6 5 | 51 (MOSI) - * 42 | 4 3 | 44 49 | 4 3 | 27 - * GND | 2 1 | 5V GND | 2 1 | -- + * 37 | 1 2 | 35 (MISO) 50 | 1 2 | 52 (SCK) + * 31 | 3 4 | 41 29 | 3 4 | 53 + * 33 5 6 | 23 25 5 6 | 51 (MOSI) + * 42 | 7 8 | 44 49 | 7 8 | 27 + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN 44 -#define EXP1_04_PIN 42 -#define EXP1_05_PIN 23 -#define EXP1_06_PIN 33 -#define EXP1_07_PIN 41 -#define EXP1_08_PIN 31 -#define EXP1_09_PIN 35 -#define EXP1_10_PIN 37 +#define EXP1_08_PIN 44 +#define EXP1_07_PIN 42 +#define EXP1_06_PIN 23 +#define EXP1_05_PIN 33 +#define EXP1_04_PIN 41 +#define EXP1_03_PIN 31 +#define EXP1_02_PIN 35 +#define EXP1_01_PIN 37 -#define EXP2_03_PIN 27 -#define EXP2_04_PIN 49 -#define EXP2_05_PIN 51 -#define EXP2_06_PIN 25 -#define EXP2_07_PIN 53 -#define EXP2_08_PIN 29 -#define EXP2_09_PIN 52 -#define EXP2_10_PIN 50 +#define EXP2_08_PIN 27 +#define EXP2_07_PIN 49 +#define EXP2_06_PIN 51 +#define EXP2_05_PIN 25 +#define EXP2_04_PIN 53 +#define EXP2_03_PIN 29 +#define EXP2_02_PIN 52 +#define EXP2_01_PIN 50 #include "pins_RAMPS.h" diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V53.h b/Marlin/src/pins/ramps/pins_ZRIB_V53.h index 48808d9601..38b8e09b03 100644 --- a/Marlin/src/pins/ramps/pins_ZRIB_V53.h +++ b/Marlin/src/pins/ramps/pins_ZRIB_V53.h @@ -299,33 +299,33 @@ * LCD adapter. NOTE: These come in two variants. The socket keys can be * on either side, and may be backwards on some displays. * ------ ------ - * D37 |10 9 | D35 (MISO) D50 |10 9 | D52 (SCK) - * D17 | 8 7 | D16 D31 | 8 7 | D53 + * D37 | 1 2 | D35 (MISO) D50 | 1 2 | D52 (SCK) + * D17 | 3 4 | D16 D31 | 3 4 | D53 * D23 6 5 D25 D33 6 5 D51 (MOSI) - * D27 | 4 3 | D29 D49 | 4 3 | D41 - * GND | 2 1 | 5V GND | 2 1 | -- + * D27 | 7 8 | D29 D49 | 7 8 | D41 + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#ifndef EXP1_03_PIN - #define EXP1_03_PIN 29 - #define EXP1_04_PIN 27 - #define EXP1_05_PIN 25 - #define EXP1_06_PIN 23 - #define EXP1_07_PIN 16 - #define EXP1_08_PIN 17 - #define EXP1_09_PIN 35 - #define EXP1_10_PIN 37 +#ifndef EXP1_08_PIN + #define EXP1_08_PIN 29 + #define EXP1_07_PIN 27 + #define EXP1_06_PIN 25 + #define EXP1_05_PIN 23 + #define EXP1_04_PIN 16 + #define EXP1_03_PIN 17 + #define EXP1_02_PIN 35 + #define EXP1_01_PIN 37 - #define EXP2_03_PIN 41 - #define EXP2_04_PIN 49 - #define EXP2_05_PIN XS6_05_PIN - #define EXP2_06_PIN 33 - #define EXP2_07_PIN 53 - #define EXP2_08_PIN 31 - #define EXP2_09_PIN XS6_03_PIN - #define EXP2_10_PIN XS6_07_PIN + #define EXP2_08_PIN 41 + #define EXP2_07_PIN 49 + #define EXP2_06_PIN XS6_05_PIN + #define EXP2_05_PIN 33 + #define EXP2_04_PIN 53 + #define EXP2_03_PIN 31 + #define EXP2_02_PIN XS6_03_PIN + #define EXP2_01_PIN XS6_07_PIN #endif ////////////////////////// @@ -386,14 +386,14 @@ #if ENABLED(ZONESTAR_LCD) #define LCDSCREEN_NAME "LCD2004 ADCKEY" - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #define ADC_KEYPAD_PIN 10 // A10 for ADCKEY - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #endif /** diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h index 4cb0f60328..e734a08943 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h +++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h @@ -135,31 +135,31 @@ #define LED_PIN 13 /** ------ ------ - * 37 |10 9 | 35 (MISO) 50 |10 9 | 76 (SCK) - * 29 | 8 7 | 27 (EN2) 31 | 8 7 | 4 (SD_SS) - * 25 6 5 | 23 (EN1) 33 6 5 | 75 (MOSI) - * 16 | 4 3 | 17 (SDD) 49 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * 37 | 1 2 | 35 (MISO) 50 | 1 2 | 76 (SCK) + * 29 | 3 4 | 27 (EN2) 31 | 3 4 | 4 (SD_SS) + * 25 5 6 | 23 (EN1) 33 5 6 | 75 (MOSI) + * 16 | 7 8 | 17 (SDD) 49 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN 17 -#define EXP1_04_PIN 16 -#define EXP1_05_PIN 23 -#define EXP1_06_PIN 25 -#define EXP1_07_PIN 27 -#define EXP1_08_PIN 29 -#define EXP1_09_PIN 35 -#define EXP1_10_PIN 37 +#define EXP1_08_PIN 17 +#define EXP1_07_PIN 16 +#define EXP1_06_PIN 23 +#define EXP1_05_PIN 25 +#define EXP1_04_PIN 27 +#define EXP1_03_PIN 29 +#define EXP1_02_PIN 35 +#define EXP1_01_PIN 37 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN 49 -#define EXP2_05_PIN 75 -#define EXP2_06_PIN 33 -#define EXP2_07_PIN 4 -#define EXP2_08_PIN 31 -#define EXP2_09_PIN 76 -#define EXP2_10_PIN 74 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN 49 +#define EXP2_06_PIN 75 +#define EXP2_05_PIN 33 +#define EXP2_04_PIN 4 +#define EXP2_03_PIN 31 +#define EXP2_02_PIN 76 +#define EXP2_01_PIN 74 // // LCD / Controller @@ -167,65 +167,65 @@ #if HAS_WIRED_LCD // ramps-fd lcd adaptor - #define BEEPER_PIN EXP1_10_PIN - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN - #define BTN_ENC EXP1_09_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN + #define BTN_ENC EXP1_02_PIN + #define SD_DETECT_PIN EXP2_07_PIN #if IS_NEWPANEL - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN #endif #if ENABLED(FYSETC_MINI_12864) #define DOGLCD_CS LCD_PINS_ENABLE #define DOGLCD_A0 LCD_PINS_RS - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_06_PIN // 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 EXP1_06_PIN + #define RGB_LED_R_PIN EXP1_05_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_07_PIN + #define RGB_LED_G_PIN EXP1_04_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_08_PIN + #define RGB_LED_B_PIN EXP1_03_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_06_PIN + #define NEOPIXEL_PIN EXP1_05_PIN #endif #elif IS_NEWPANEL - #define LCD_PINS_D4 EXP1_05_PIN - #define LCD_PINS_D5 EXP1_06_PIN - #define LCD_PINS_D6 EXP1_07_PIN - #define LCD_PINS_D7 EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN #if ENABLED(MINIPANEL) - #define DOGLCD_CS EXP1_06_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_A0 EXP1_04_PIN #endif #endif #if EITHER(VIKI2, miniVIKI) - #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_A0 EXP1_07_PIN #define KILL_PIN 51 - #define STAT_LED_BLUE_PIN EXP1_08_PIN - #define STAT_LED_RED_PIN EXP1_05_PIN - #define DOGLCD_CS EXP1_03_PIN - #define DOGLCD_SCK EXP2_09_PIN // SCK_PIN - Required for DUE Hardware SPI - #define DOGLCD_MOSI EXP2_05_PIN // MOSI_PIN - #define DOGLCD_MISO EXP2_10_PIN // MISO_PIN + #define STAT_LED_BLUE_PIN EXP1_03_PIN + #define STAT_LED_RED_PIN EXP1_06_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_SCK EXP2_02_PIN // SCK_PIN - Required for DUE Hardware SPI + #define DOGLCD_MOSI EXP2_06_PIN // MOSI_PIN + #define DOGLCD_MISO EXP2_01_PIN // MISO_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h index 2b8942c6ad..47bc8bbaa6 100644 --- a/Marlin/src/pins/sam/pins_RAMPS_SMART.h +++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h @@ -110,31 +110,31 @@ #else /** ------ ------ - * 37 |10 9 | 35 (MISO) 50 |10 9 | 52 (SCK) - * 31 | 8 7 | 41 29 | 8 7 | 53 - * 33 6 5 | 23 25 6 5 | 51 (MOSI) - * 42 | 4 3 | 44 49 | 4 3 | 27 - * GND | 2 1 | 5V GND | 2 1 | -- + * 37 | 1 2 | 35 (MISO) 50 | 1 2 | 52 (SCK) + * 31 | 3 4 | 41 29 | 3 4 | 53 + * 33 5 6 | 23 25 5 6 | 51 (MOSI) + * 42 | 7 8 | 44 49 | 7 8 | 27 + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ - #define EXP1_03_PIN 44 - #define EXP1_04_PIN 42 - #define EXP1_05_PIN 23 - #define EXP1_06_PIN 33 - #define EXP1_07_PIN 41 - #define EXP1_08_PIN 31 - #define EXP1_09_PIN 35 - #define EXP1_10_PIN 37 + #define EXP1_08_PIN 44 + #define EXP1_07_PIN 42 + #define EXP1_06_PIN 23 + #define EXP1_05_PIN 33 + #define EXP1_04_PIN 41 + #define EXP1_03_PIN 31 + #define EXP1_02_PIN 35 + #define EXP1_01_PIN 37 - #define EXP2_03_PIN 27 - #define EXP2_04_PIN 49 - #define EXP2_05_PIN 51 - #define EXP2_06_PIN 25 - #define EXP2_07_PIN 53 - #define EXP2_08_PIN 29 - #define EXP2_09_PIN 52 - #define EXP2_10_PIN 50 + #define EXP2_08_PIN 27 + #define EXP2_07_PIN 49 + #define EXP2_06_PIN 51 + #define EXP2_05_PIN 25 + #define EXP2_04_PIN 53 + #define EXP2_03_PIN 29 + #define EXP2_02_PIN 52 + #define EXP2_01_PIN 50 #endif diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 064ce2751a..4f990a0aed 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -146,7 +146,7 @@ // SPI for MAX Thermocouple /* #if DISABLED(SDSUPPORT) - #define TEMP_0_CS_PIN EXP1_03_PIN + #define TEMP_0_CS_PIN EXP1_08_PIN #else #define TEMP_0_CS_PIN 49 #endif @@ -185,31 +185,31 @@ /** * ------ ------ - * (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK) - * (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS) - * (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI) - * (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) 62 | 1 2 | 40 (BTN_ENC) (MISO) 74 | 1 2 | 76 (SCK) + * (LCD_EN) 64 | 3 4 | 63 (LCD_RS) (BTN_EN1) 44 | 3 4 | 10 (SD_SS) + * (LCD_D4) 48 | 5 6 50 (LCD_D5) (BTN_EN2) 42 | 5 6 75 (MOSI) + * (LCD_D6) 52 | 7 8 | 53 (LCD_D7) (SD_DETECT) 51 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN 53 -#define EXP1_04_PIN 52 -#define EXP1_05_PIN 50 -#define EXP1_06_PIN 48 -#define EXP1_07_PIN 63 -#define EXP1_08_PIN 64 -#define EXP1_09_PIN 40 -#define EXP1_10_PIN 62 +#define EXP1_08_PIN 53 +#define EXP1_07_PIN 52 +#define EXP1_06_PIN 50 +#define EXP1_05_PIN 48 +#define EXP1_04_PIN 63 +#define EXP1_03_PIN 64 +#define EXP1_02_PIN 40 +#define EXP1_01_PIN 62 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN 51 -#define EXP2_05_PIN 75 // MOSI -#define EXP2_06_PIN 42 -#define EXP2_07_PIN 10 -#define EXP2_08_PIN 44 -#define EXP2_09_PIN 76 // SCK -#define EXP2_10_PIN 74 // MISO +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN 51 +#define EXP2_06_PIN 75 // MOSI +#define EXP2_05_PIN 42 +#define EXP2_04_PIN 10 +#define EXP2_03_PIN 44 +#define EXP2_02_PIN 76 // SCK +#define EXP2_01_PIN 74 // MISO // // LCD / Controller @@ -217,53 +217,53 @@ #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) - #define BEEPER_PIN EXP1_10_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define BEEPER_PIN EXP1_01_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif #if EITHER(RADDS_DISPLAY, IS_RRD_SC) - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - - #elif IS_RRD_FG_SC - #define LCD_PINS_RS EXP1_04_PIN #define LCD_PINS_ENABLE EXP1_03_PIN + #elif IS_RRD_FG_SC + + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #elif HAS_U8GLIB_I2C_OLED - #define BEEPER_PIN EXP1_10_PIN - #define LCD_SDSS EXP2_07_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define BEEPER_PIN EXP1_01_PIN + #define LCD_SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN EXP1_10_PIN - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define BEEPER_PIN EXP1_01_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN // D5 + #define RGB_LED_R_PIN EXP1_06_PIN // D5 #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN // D6 + #define RGB_LED_G_PIN EXP1_07_PIN // D6 #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN // D7 + #define RGB_LED_B_PIN EXP1_08_PIN // D7 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN // D5 + #define NEOPIXEL_PIN EXP1_06_PIN // D5 #endif #elif ENABLED(SPARK_FULL_GRAPHICS) @@ -280,9 +280,9 @@ #endif // SPARK_FULL_GRAPHICS #if IS_NEWPANEL - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index cc919d0a4f..37e7f20976 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -175,31 +175,31 @@ /** * ------ ------ - * (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK) - * (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS) - * (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI) - * (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) 62 | 1 2 | 40 (BTN_ENC) (MISO) 74 | 1 2 | 76 (SCK) + * (LCD_EN) 64 | 3 4 | 63 (LCD_RS) (BTN_EN1) 44 | 3 4 | 10 (SD_SS) + * (LCD_D4) 48 | 5 6 50 (LCD_D5) (BTN_EN2) 42 | 5 6 75 (MOSI) + * (LCD_D6) 52 | 7 8 | 53 (LCD_D7) (SD_DETECT) 51 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN 53 -#define EXP1_04_PIN 52 -#define EXP1_05_PIN 50 -#define EXP1_06_PIN 48 -#define EXP1_07_PIN 63 -#define EXP1_08_PIN 64 -#define EXP1_09_PIN 40 -#define EXP1_10_PIN 62 +#define EXP1_08_PIN 53 +#define EXP1_07_PIN 52 +#define EXP1_06_PIN 50 +#define EXP1_05_PIN 48 +#define EXP1_04_PIN 63 +#define EXP1_03_PIN 64 +#define EXP1_02_PIN 40 +#define EXP1_01_PIN 62 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN 51 -#define EXP2_05_PIN 75 // MOSI -#define EXP2_06_PIN 42 -#define EXP2_07_PIN 10 -#define EXP2_08_PIN 44 -#define EXP2_09_PIN 76 // SCK -#define EXP2_10_PIN 74 // MISO +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN 51 +#define EXP2_06_PIN 75 // MOSI +#define EXP2_05_PIN 42 +#define EXP2_04_PIN 10 +#define EXP2_03_PIN 44 +#define EXP2_02_PIN 76 // SCK +#define EXP2_01_PIN 74 // MISO // // LCD / Controller @@ -207,67 +207,67 @@ #if HAS_WIRED_LCD #if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC) - #define BEEPER_PIN EXP1_10_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define BEEPER_PIN EXP1_01_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif #if EITHER(RADDS_DISPLAY, IS_RRD_SC) - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - - #elif IS_RRD_FG_SC - #define LCD_PINS_RS EXP1_04_PIN #define LCD_PINS_ENABLE EXP1_03_PIN + #elif IS_RRD_FG_SC + + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #elif HAS_U8GLIB_I2C_OLED - #define BEEPER_PIN EXP1_10_PIN - #define LCD_SDSS EXP2_07_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define BEEPER_PIN EXP1_01_PIN + #define LCD_SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif ENABLED(FYSETC_MINI_12864) - #define BEEPER_PIN EXP1_10_PIN - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define BEEPER_PIN EXP1_01_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN //#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems // results in LCD soft SPI mode 3, SD soft SPI mode 0 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN // D5 + #define RGB_LED_R_PIN EXP1_06_PIN // D5 #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN // D6 + #define RGB_LED_G_PIN EXP1_07_PIN // D6 #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN // D7 + #define RGB_LED_B_PIN EXP1_08_PIN // D7 #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN // D5 + #define NEOPIXEL_PIN EXP1_06_PIN // D5 #endif #elif ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif #if IS_NEWPANEL - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN #endif #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h index 264b2e80c6..a9199ba84c 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -166,33 +166,33 @@ * BTN_ENCODER 40 KILL_PIN 49 */ -#define EXP1_03_PIN 39 -#define EXP1_04_PIN 38 -#define EXP1_05_PIN 37 -#define EXP1_06_PIN 36 -#define EXP1_07_PIN 34 -#define EXP1_08_PIN 35 -#define EXP1_09_PIN 40 -#define EXP1_10_PIN 41 +#define EXP1_08_PIN 39 +#define EXP1_07_PIN 38 +#define EXP1_06_PIN 37 +#define EXP1_05_PIN 36 +#define EXP1_04_PIN 34 +#define EXP1_03_PIN 35 +#define EXP1_02_PIN 40 +#define EXP1_01_PIN 41 -#define EXP2_01_PIN 49 -#define EXP2_04_PIN 44 -#define EXP2_05_PIN 51 -#define EXP2_06_PIN 42 -#define EXP2_07_PIN 53 -#define EXP2_08_PIN 43 -#define EXP2_09_PIN 52 -#define EXP2_10_PIN 50 +#define EXP2_10_PIN 49 +#define EXP2_07_PIN 44 +#define EXP2_06_PIN 51 +#define EXP2_05_PIN 42 +#define EXP2_04_PIN 53 +#define EXP2_03_PIN 43 +#define EXP2_02_PIN 52 +#define EXP2_01_PIN 50 #if ENABLED(CR10_STOCKDISPLAY) - #define EXP3_03_PIN EXP1_03_PIN - #define EXP3_04_PIN EXP1_04_PIN - #define EXP3_05_PIN EXP1_05_PIN - #define EXP3_06_PIN EXP1_06_PIN - #define EXP3_07_PIN EXP1_07_PIN - #define EXP3_08_PIN EXP1_08_PIN - #define EXP3_09_PIN EXP1_09_PIN - #define EXP3_10_PIN EXP1_10_PIN + #define EXP3_03_PIN EXP1_08_PIN + #define EXP3_04_PIN EXP1_07_PIN + #define EXP3_05_PIN EXP1_06_PIN + #define EXP3_06_PIN EXP1_05_PIN + #define EXP3_07_PIN EXP1_04_PIN + #define EXP3_08_PIN EXP1_03_PIN + #define EXP3_09_PIN EXP1_02_PIN + #define EXP3_10_PIN EXP1_01_PIN #endif /************************************/ @@ -222,30 +222,30 @@ #endif // DWIN Encoder - #define BTN_ENC EXP1_09_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_04_PIN #ifndef BEEPER_PIN - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #undef SPEAKER #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) // TO TEST - //#define LCD_PINS_RS EXP2_01_PIN // CS chip select /SS chip slave select - //#define LCD_PINS_ENABLE EXP2_05_PIN // SID (MOSI) - //#define LCD_PINS_D4 EXP2_09_PIN // SCK (CLK) clock + //#define LCD_PINS_RS EXP2_10_PIN // CS chip select /SS chip slave select + //#define LCD_PINS_ENABLE EXP2_06_PIN // SID (MOSI) + //#define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock #elif BOTH(IS_NEWPANEL, PANEL_ONE) // TO TEST - //#define LCD_PINS_RS EXP1_09_PIN - //#define LCD_PINS_ENABLE EXP2_06_PIN + //#define LCD_PINS_RS EXP1_02_PIN + //#define LCD_PINS_ENABLE EXP2_05_PIN //#define LCD_PINS_D4 57 // Mega/Due:65 - AGCM4:57 //#define LCD_PINS_D5 58 // Mega/Due:66 - AGCM4:58 - //#define LCD_PINS_D6 EXP2_04_PIN + //#define LCD_PINS_D6 EXP2_07_PIN //#define LCD_PINS_D7 56 // Mega/Due:64 - AGCM4:56 #else @@ -266,10 +266,10 @@ // TO TEST //#define LCD_PINS_RS 56 // Mega/Due:64 - AGCM4:56 - //#define LCD_PINS_ENABLE EXP2_04_PIN + //#define LCD_PINS_ENABLE EXP2_07_PIN //#define LCD_PINS_D4 55 // Mega/Due:63 - AGCM4:55 - //#define LCD_PINS_D5 EXP1_09_PIN - //#define LCD_PINS_D6 EXP2_06_PIN + //#define LCD_PINS_D5 EXP1_02_PIN + //#define LCD_PINS_D6 EXP2_05_PIN //#define LCD_PINS_D7 57 // Mega/Due:65 - AGCM4:57 #else @@ -287,17 +287,17 @@ #else // Definitions for any standard Display - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN #endif - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if !IS_NEWPANEL - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #endif #endif @@ -305,9 +305,9 @@ #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK_PIN EXP1_04_PIN - //#define SHIFT_LD_PIN EXP2_06_PIN - //#define SHIFT_OUT_PIN EXP1_09_PIN + //#define SHIFT_CLK_PIN EXP1_07_PIN + //#define SHIFT_LD_PIN EXP2_05_PIN + //#define SHIFT_OUT_PIN EXP1_02_PIN //#define SHIFT_EN_PIN 17 #endif @@ -320,7 +320,7 @@ #if IS_RRD_SC - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #if ENABLED(CR10_STOCKDISPLAY) // TO TEST @@ -329,21 +329,21 @@ #else // Definitions for any standard Display - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif #endif - #define BTN_ENC EXP1_09_PIN + #define BTN_ENC EXP1_02_PIN #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif - #define KILL_PIN EXP2_01_PIN + #define KILL_PIN EXP2_10_PIN #if ENABLED(BQ_LCD_SMART_CONTROLLER) - //#define LCD_BACKLIGHT_PIN EXP1_03_PIN // TO TEST + //#define LCD_BACKLIGHT_PIN EXP1_08_PIN // TO TEST #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) @@ -352,41 +352,41 @@ //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 //#define BTN_ENC 55 - //#define SD_DETECT_PIN EXP2_06_PIN + //#define SD_DETECT_PIN EXP2_05_PIN #elif ENABLED(LCD_I2C_PANELOLU2) // TO TEST //#define BTN_EN1 47 - //#define BTN_EN2 EXP2_08_PIN + //#define BTN_EN2 EXP2_03_PIN //#define BTN_ENC 32 //#define LCD_SDSS SDSS - //#define KILL_PIN EXP1_10_PIN + //#define KILL_PIN EXP1_01_PIN #elif ENABLED(LCD_I2C_VIKI) // TO TEST - //#define BTN_EN1 EXP1_09_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - //#define BTN_EN2 EXP2_06_PIN + //#define BTN_EN1 EXP1_02_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + //#define BTN_EN2 EXP2_05_PIN //#define BTN_ENC -1 //#define LCD_SDSS SDSS - //#define SD_DETECT_PIN EXP2_01_PIN + //#define SD_DETECT_PIN EXP2_10_PIN #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 - //#define DOGLCD_A0 EXP2_04_PIN + //#define DOGLCD_A0 EXP2_07_PIN //#define LCD_SCREEN_ROT_180 //#define BEEPER_PIN 33 //#define STAT_LED_RED_PIN 32 - //#define STAT_LED_BLUE_PIN EXP1_08_PIN + //#define STAT_LED_BLUE_PIN EXP1_03_PIN //#define BTN_EN1 22 //#define BTN_EN2 7 - //#define BTN_ENC EXP1_03_PIN + //#define BTN_ENC EXP1_08_PIN //#define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board //#define KILL_PIN 31 @@ -400,23 +400,23 @@ //#define BEEPER_PIN 23 //#define LCD_BACKLIGHT_PIN 33 - //#define BTN_EN1 EXP1_08_PIN - //#define BTN_EN2 EXP1_05_PIN + //#define BTN_EN1 EXP1_03_PIN + //#define BTN_EN2 EXP1_06_PIN //#define BTN_ENC 31 //#define LCD_SDSS SDSS - //#define SD_DETECT_PIN EXP2_01_PIN - //#define KILL_PIN EXP1_10_PIN + //#define SD_DETECT_PIN EXP2_10_PIN + //#define KILL_PIN EXP1_01_PIN #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864) // TO TEST - //#define BEEPER_PIN EXP1_05_PIN - //#define BTN_ENC EXP1_08_PIN - //#define SD_DETECT_PIN EXP2_01_PIN + //#define BEEPER_PIN EXP1_06_PIN + //#define BTN_ENC EXP1_03_PIN + //#define SD_DETECT_PIN EXP2_10_PIN //#ifndef KILL_PIN - // #define KILL_PIN EXP1_10_PIN + // #define KILL_PIN EXP1_01_PIN //#endif #if ENABLED(MKS_MINI_12864) @@ -476,11 +476,11 @@ #elif ENABLED(MINIPANEL) // TO TEST - //#define BEEPER_PIN EXP2_06_PIN + //#define BEEPER_PIN EXP2_05_PIN // not connected to a pin //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) - //#define DOGLCD_A0 EXP2_04_PIN + //#define DOGLCD_A0 EXP2_07_PIN //#define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 // GLCD features @@ -489,11 +489,11 @@ //#define LCD_SCREEN_ROT_180 //#define LCD_SCREEN_ROT_270 - //#define BTN_EN1 EXP1_09_PIN + //#define BTN_EN1 EXP1_02_PIN //#define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 //#define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 - //#define SD_DETECT_PIN EXP2_01_PIN + //#define SD_DETECT_PIN EXP2_10_PIN //#define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 #elif ENABLED(ZONESTAR_LCD) @@ -513,9 +513,9 @@ // Buttons are directly attached to AUX-2 #if IS_RRW_KEYPAD // TO TEST - //#define SHIFT_OUT_PIN EXP1_09_PIN - //#define SHIFT_CLK_PIN EXP2_04_PIN - //#define SHIFT_LD_PIN EXP2_06_PIN + //#define SHIFT_OUT_PIN EXP1_02_PIN + //#define SHIFT_CLK_PIN EXP2_07_PIN + //#define SHIFT_LD_PIN EXP2_05_PIN //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 //#define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 @@ -523,18 +523,18 @@ // TO TEST //#define BTN_EN1 72 // AUX2 PIN 3 (Mega/Due:59 - AGCM4:72) //#define BTN_EN2 55 // AUX2 PIN 4 (Mega/Due:63 - AGCM4:55) - //#define BTN_ENC EXP2_01_PIN // AUX3 PIN 7 + //#define BTN_ENC EXP2_10_PIN // AUX3 PIN 7 #else // TO TEST - //#define BTN_EN1 EXP1_05_PIN - //#define BTN_EN2 EXP1_08_PIN + //#define BTN_EN1 EXP1_06_PIN + //#define BTN_EN2 EXP1_03_PIN //#define BTN_ENC 31 #endif #if ENABLED(G3D_PANEL) // TO TEST - //#define SD_DETECT_PIN EXP2_01_PIN - //#define KILL_PIN EXP1_10_PIN + //#define SD_DETECT_PIN EXP2_10_PIN + //#define KILL_PIN EXP1_01_PIN #endif #endif @@ -565,7 +565,7 @@ #undef SD_DETECT_PIN #define SD_DETECT_PIN 95 #else - #define SDSS EXP2_07_PIN + #define SDSS EXP2_04_PIN #endif #if HAS_TMC_UART diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index e90be4eda1..991b4e1ad8 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -218,33 +218,33 @@ * BTN_ENCODER 40 */ -#define EXP1_03_PIN 39 -#define EXP1_04_PIN 38 -#define EXP1_05_PIN 37 -#define EXP1_06_PIN 36 -#define EXP1_07_PIN 34 -#define EXP1_08_PIN 35 -#define EXP1_09_PIN 40 -#define EXP1_10_PIN 41 +#define EXP1_08_PIN 39 +#define EXP1_07_PIN 38 +#define EXP1_06_PIN 37 +#define EXP1_05_PIN 36 +#define EXP1_04_PIN 34 +#define EXP1_03_PIN 35 +#define EXP1_02_PIN 40 +#define EXP1_01_PIN 41 -#define EXP2_01_PIN 49 -#define EXP2_04_PIN 44 -#define EXP2_05_PIN 51 -#define EXP2_06_PIN 42 -#define EXP2_07_PIN 53 -#define EXP2_08_PIN 43 -#define EXP2_09_PIN 52 -#define EXP2_10_PIN 50 +#define EXP2_10_PIN 49 +#define EXP2_07_PIN 44 +#define EXP2_06_PIN 51 +#define EXP2_05_PIN 42 +#define EXP2_04_PIN 53 +#define EXP2_03_PIN 43 +#define EXP2_02_PIN 52 +#define EXP2_01_PIN 50 #if ENABLED(CR10_STOCKDISPLAY) - #define EXP3_03_PIN EXP1_03_PIN - #define EXP3_04_PIN EXP1_04_PIN - #define EXP3_05_PIN EXP1_05_PIN - #define EXP3_06_PIN EXP1_06_PIN - #define EXP3_07_PIN EXP1_07_PIN - #define EXP3_08_PIN EXP1_08_PIN - #define EXP3_09_PIN EXP1_09_PIN - #define EXP3_10_PIN EXP1_10_PIN + #define EXP3_03_PIN EXP1_08_PIN + #define EXP3_04_PIN EXP1_07_PIN + #define EXP3_05_PIN EXP1_06_PIN + #define EXP3_06_PIN EXP1_05_PIN + #define EXP3_07_PIN EXP1_04_PIN + #define EXP3_08_PIN EXP1_03_PIN + #define EXP3_09_PIN EXP1_02_PIN + #define EXP3_10_PIN EXP1_01_PIN #endif /************************************/ @@ -275,30 +275,30 @@ #endif // DWIN Encoder - #define BTN_ENC EXP1_09_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_04_PIN #ifndef BEEPER_PIN - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #undef SPEAKER #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) // TO TEST - //#define LCD_PINS_RS EXP2_01_PIN // CS chip select /SS chip slave select - //#define LCD_PINS_ENABLE EXP2_05_PIN // SID (MOSI) - //#define LCD_PINS_D4 EXP2_09_PIN // SCK (CLK) clock + //#define LCD_PINS_RS EXP2_10_PIN // CS chip select /SS chip slave select + //#define LCD_PINS_ENABLE EXP2_06_PIN // SID (MOSI) + //#define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock #elif BOTH(IS_NEWPANEL, PANEL_ONE) // TO TEST - //#define LCD_PINS_RS EXP1_09_PIN - //#define LCD_PINS_ENABLE EXP2_06_PIN + //#define LCD_PINS_RS EXP1_02_PIN + //#define LCD_PINS_ENABLE EXP2_05_PIN //#define LCD_PINS_D4 57 // Mega/Due:65 - AGCM4:57 //#define LCD_PINS_D5 58 // Mega/Due:66 - AGCM4:58 - //#define LCD_PINS_D6 EXP2_04_PIN + //#define LCD_PINS_D6 EXP2_07_PIN //#define LCD_PINS_D7 56 // Mega/Due:64 - AGCM4:56 #else @@ -319,10 +319,10 @@ // TO TEST //#define LCD_PINS_RS 56 // Mega/Due:64 - AGCM4:56 - //#define LCD_PINS_ENABLE EXP2_04_PIN + //#define LCD_PINS_ENABLE EXP2_07_PIN //#define LCD_PINS_D4 55 // Mega/Due:63 - AGCM4:55 - //#define LCD_PINS_D5 EXP1_09_PIN - //#define LCD_PINS_D6 EXP2_06_PIN + //#define LCD_PINS_D5 EXP1_02_PIN + //#define LCD_PINS_D6 EXP2_05_PIN //#define LCD_PINS_D7 57 // Mega/Due:65 - AGCM4:57 #else @@ -339,17 +339,17 @@ #else // Definitions for any standard Display - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN #endif - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if !IS_NEWPANEL - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #endif #endif @@ -357,9 +357,9 @@ #if !IS_NEWPANEL // Buttons attached to a shift register // Not wired yet - //#define SHIFT_CLK_PIN EXP1_04_PIN - //#define SHIFT_LD_PIN EXP2_06_PIN - //#define SHIFT_OUT_PIN EXP1_09_PIN + //#define SHIFT_CLK_PIN EXP1_07_PIN + //#define SHIFT_LD_PIN EXP2_05_PIN + //#define SHIFT_OUT_PIN EXP1_02_PIN //#define SHIFT_EN_PIN 17 #endif @@ -372,29 +372,29 @@ #if IS_RRD_SC - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #if ENABLED(CR10_STOCKDISPLAY) // TO TEST - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #else // Definitions fpr any standard Display - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif #endif - #define BTN_ENC EXP1_09_PIN + #define BTN_ENC EXP1_02_PIN #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif - #define KILL_PIN EXP2_01_PIN + #define KILL_PIN EXP2_10_PIN #if ENABLED(BQ_LCD_SMART_CONTROLLER) - //#define LCD_BACKLIGHT_PIN EXP1_03_PIN // TO TEST + //#define LCD_BACKLIGHT_PIN EXP1_08_PIN // TO TEST #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) @@ -403,41 +403,41 @@ //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 //#define BTN_ENC 55 - //#define SD_DETECT_PIN EXP2_06_PIN + //#define SD_DETECT_PIN EXP2_05_PIN #elif ENABLED(LCD_I2C_PANELOLU2) // TO TEST //#define BTN_EN1 47 - //#define BTN_EN2 EXP2_08_PIN + //#define BTN_EN2 EXP2_03_PIN //#define BTN_ENC 32 //#define LCD_SDSS SDSS - //#define KILL_PIN EXP1_10_PIN + //#define KILL_PIN EXP1_01_PIN #elif ENABLED(LCD_I2C_VIKI) // TO TEST - //#define BTN_EN1 EXP1_09_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. - //#define BTN_EN2 EXP2_06_PIN + //#define BTN_EN1 EXP1_02_PIN // https://files.panucatt.com/datasheets/viki_wiring_diagram.pdf explains 40/42. + //#define BTN_EN2 EXP2_05_PIN //#define BTN_ENC -1 //#define LCD_SDSS SDSS - //#define SD_DETECT_PIN EXP2_01_PIN + //#define SD_DETECT_PIN EXP2_10_PIN #elif EITHER(VIKI2, miniVIKI) // TO TEST //#define DOGLCD_CS 45 - //#define DOGLCD_A0 EXP2_04_PIN + //#define DOGLCD_A0 EXP2_07_PIN //#define LCD_SCREEN_ROT_180 //#define BEEPER_PIN 33 //#define STAT_LED_RED_PIN 32 - //#define STAT_LED_BLUE_PIN EXP1_08_PIN + //#define STAT_LED_BLUE_PIN EXP1_03_PIN //#define BTN_EN1 22 //#define BTN_EN2 7 - //#define BTN_ENC EXP1_03_PIN + //#define BTN_ENC EXP1_08_PIN //#define SD_DETECT_PIN -1 // Pin 49 for display SD interface, 72 for easy adapter board //#define KILL_PIN 31 @@ -451,23 +451,23 @@ //#define BEEPER_PIN 23 //#define LCD_BACKLIGHT_PIN 33 - //#define BTN_EN1 EXP1_08_PIN - //#define BTN_EN2 EXP1_05_PIN + //#define BTN_EN1 EXP1_03_PIN + //#define BTN_EN2 EXP1_06_PIN //#define BTN_ENC 31 //#define LCD_SDSS SDSS - //#define SD_DETECT_PIN EXP2_01_PIN - //#define KILL_PIN EXP1_10_PIN + //#define SD_DETECT_PIN EXP2_10_PIN + //#define KILL_PIN EXP1_01_PIN #elif EITHER(MKS_MINI_12864, FYSETC_MINI_12864) // TO TEST - //#define BEEPER_PIN EXP1_05_PIN - //#define BTN_ENC EXP1_08_PIN - //#define SD_DETECT_PIN EXP2_01_PIN + //#define BEEPER_PIN EXP1_06_PIN + //#define BTN_ENC EXP1_03_PIN + //#define SD_DETECT_PIN EXP2_10_PIN //#ifndef KILL_PIN - // #define KILL_PIN EXP1_10_PIN + // #define KILL_PIN EXP1_01_PIN //#endif #if ENABLED(MKS_MINI_12864) @@ -527,11 +527,11 @@ #elif ENABLED(MINIPANEL) // TO TEST - //#define BEEPER_PIN EXP2_06_PIN + //#define BEEPER_PIN EXP2_05_PIN // not connected to a pin //#define LCD_BACKLIGHT_PIN 57 // backlight LED on A11/D? (Mega/Due:65 - AGCM4:57) - //#define DOGLCD_A0 EXP2_04_PIN + //#define DOGLCD_A0 EXP2_07_PIN //#define DOGLCD_CS 58 // Mega/Due:66 - AGCM4:58 // GLCD features @@ -540,11 +540,11 @@ //#define LCD_SCREEN_ROT_180 //#define LCD_SCREEN_ROT_270 - //#define BTN_EN1 EXP1_09_PIN + //#define BTN_EN1 EXP1_02_PIN //#define BTN_EN2 55 // Mega/Due:63 - AGCM4:55 //#define BTN_ENC 72 // Mega/Due:59 - AGCM4:72 - //#define SD_DETECT_PIN EXP2_01_PIN + //#define SD_DETECT_PIN EXP2_10_PIN //#define KILL_PIN 56 // Mega/Due:64 - AGCM4:56 #elif ENABLED(ZONESTAR_LCD) @@ -564,9 +564,9 @@ // Buttons are directly attached to AUX-2 #if IS_RRW_KEYPAD // TO TEST - //#define SHIFT_OUT_PIN EXP1_09_PIN - //#define SHIFT_CLK_PIN EXP2_04_PIN - //#define SHIFT_LD_PIN EXP2_06_PIN + //#define SHIFT_OUT_PIN EXP1_02_PIN + //#define SHIFT_CLK_PIN EXP2_07_PIN + //#define SHIFT_LD_PIN EXP2_05_PIN //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 //#define BTN_ENC 55 // Mega/Due:63 - AGCM4:55 @@ -574,18 +574,18 @@ // TO TEST //#define BTN_EN1 72 // AUX2 PIN 3 (Mega/Due:59 - AGCM4:72) //#define BTN_EN2 55 // AUX2 PIN 4 (Mega/Due:63 - AGCM4:55) - //#define BTN_ENC EXP2_01_PIN // AUX3 PIN 7 + //#define BTN_ENC EXP2_10_PIN // AUX3 PIN 7 #else // TO TEST - //#define BTN_EN1 EXP1_05_PIN - //#define BTN_EN2 EXP1_08_PIN + //#define BTN_EN1 EXP1_06_PIN + //#define BTN_EN2 EXP1_03_PIN //#define BTN_ENC 31 #endif #if ENABLED(G3D_PANEL) // TO TEST - //#define SD_DETECT_PIN EXP2_01_PIN - //#define KILL_PIN EXP1_10_PIN + //#define SD_DETECT_PIN EXP2_10_PIN + //#define KILL_PIN EXP1_01_PIN #endif #endif @@ -616,7 +616,7 @@ #undef SD_DETECT_PIN #define SD_DETECT_PIN 95 #else - #define SDSS EXP2_07_PIN + #define SDSS EXP2_04_PIN #endif #if HAS_TMC_UART diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index a450515a79..83aa5317f9 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -132,10 +132,10 @@ /** * EXP1 Connector EXP1 as CR10 STOCKDISPLAY * ------ ------ - * PA4 |10 9 | PC0 BEEPER_PIN |10 9 | BTN_ENC - * PD3 | 8 7 | RESET BTN_EN1 | 8 7 | RESET - * PD2 6 5 | PA1 BTN_EN2 6 5 | LCD_PINS_D4 (ST9720 CLK) - * PA3 | 4 3 | PC1 (ST9720 CS) LCD_PINS_RS | 4 3 | LCD_PINS_ENABLE (ST9720 DAT) - * GND | 2 1 | 5V GND | 2 1 | 5V + * PA4 | 1 2 | PC0 BEEPER_PIN | 1 2 | BTN_ENC + * PD3 | 3 4 | RESET BTN_EN1 | 3 4 | RESET + * PD2 5 6 | PA1 BTN_EN2 5 6 | LCD_PINS_D4 (ST9720 CLK) + * PA3 | 7 8 | PC1 (ST9720 CS) LCD_PINS_RS | 7 8 | LCD_PINS_ENABLE (ST9720 DAT) + * GND | 9 10 | 5V GND | 9 10 | 5V * ------ ------ */ diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index 0a8143c376..f61f7dc6bb 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -164,25 +164,25 @@ /** EXP1 * ------ - * (MOSI) D5 |10 9 | D7 (SCK) - * (CS) D11 | 8 7 | D10 (DC/D4) - * (EN2) D12 6 5 | D4 or D3 (EN/RS) - * (ENC) D29 | 4 3 | D2 (EN1) - * (GND) | 2 1 | (5V) + * (MOSI) D5 | 1 2 | D7 (SCK) + * (CS) D11 | 3 4 | D10 (DC/D4) + * (EN2) D12 5 6 | D4 or D3 (EN/RS) + * (ENC) D29 | 7 8 | D2 (EN1) + * (GND) | 9 10 | (5V) * ------ */ -#define EXP1_03_PIN 2 -#define EXP1_04_PIN 29 +#define EXP1_08_PIN 2 +#define EXP1_07_PIN 29 #ifndef IS_ZMIB_V2 - #define EXP1_05_PIN 4 // ZMIB V1 + #define EXP1_06_PIN 4 // ZMIB V1 #else - #define EXP1_05_PIN 3 // ZMIB V2 + #define EXP1_06_PIN 3 // ZMIB V2 #endif -#define EXP1_06_PIN 12 -#define EXP1_07_PIN 10 -#define EXP1_08_PIN 11 -#define EXP1_09_PIN 7 -#define EXP1_10_PIN 5 +#define EXP1_05_PIN 12 +#define EXP1_04_PIN 10 +#define EXP1_03_PIN 11 +#define EXP1_02_PIN 7 +#define EXP1_01_PIN 5 #if ENABLED(ZONESTAR_12864LCD) // @@ -190,10 +190,10 @@ // #define LCDSCREEN_NAME "ZONESTAR_12864LCD" #define FORCE_SOFT_SPI - //#define LCD_SDSS EXP1_08_PIN - #define LCD_PINS_RS EXP1_08_PIN // ST7920_CS_PIN (LCD module pin 4) - #define LCD_PINS_ENABLE EXP1_05_PIN // ST7920_DAT_PIN (LCD module pin 5) - #define LCD_PINS_D4 EXP1_07_PIN // ST7920_CLK_PIN (LCD module pin 6) + //#define LCD_SDSS EXP1_03_PIN + #define LCD_PINS_RS EXP1_03_PIN // ST7920_CS_PIN (LCD module pin 4) + #define LCD_PINS_ENABLE EXP1_06_PIN // ST7920_DAT_PIN (LCD module pin 5) + #define LCD_PINS_D4 EXP1_04_PIN // ST7920_CLK_PIN (LCD module pin 6) #define BOARD_ST7920_DELAY_1 DELAY_2_NOP #define BOARD_ST7920_DELAY_2 DELAY_2_NOP @@ -205,9 +205,9 @@ // #define LCDSCREEN_NAME "ZONESTAR 12864OLED" #define FORCE_SOFT_SPI - #define LCD_PINS_RS EXP1_05_PIN - #define LCD_PINS_DC EXP1_07_PIN - #define DOGLCD_CS EXP1_08_PIN + #define LCD_PINS_RS EXP1_06_PIN + #define LCD_PINS_DC EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN #if ENABLED(OLED_HW_IIC) #error "Oops! can't choose HW IIC for ZMIB board!!" @@ -224,9 +224,9 @@ // All the above are also RRDSC with rotary encoder // #if IS_RRD_SC - #define BTN_EN1 EXP1_03_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_04_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_07_PIN #define BEEPER_PIN -1 #define KILL_PIN -1 #endif diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index 06788139f0..4e4efc4f73 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -157,11 +157,11 @@ /** * ------ - * (BEEPER) PA15 |10 9 | PB6 (BTN_ENC) - * (BTN_EN1) PA9 | 8 7 | RESET - * (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) - * (LCD_RS) PB8 | 4 3 | PB7 (LCD_EN) - * GND | 2 1 | 5V + * (BEEPER) PA15 | 1 2 | PB6 (BTN_ENC) + * (BTN_EN1) PA9 | 3 4 | RESET + * (BTN_EN2) PA10 5 6 | PB9 (LCD_D4) + * (LCD_RS) PB8 | 7 8 | PB7 (LCD_EN) + * GND | 9 10 | 5V * ------ * EXP1 */ @@ -198,11 +198,11 @@ /** Creality Ender-2 display pinout * ------ - * (SCK) PA15 |10 9 | PB6 (BTN_ENC) - * (BTN_EN1) PA9 | 8 7 | RESET - * (BTN_EN2) PA10 6 5 | PB9 (LCD_A0) - * (LCD_RS) PB8 | 4 3 | PB7 (MOSI) - * GND | 2 1 | 5V + * (SCK) PA15 | 1 2 | PB6 (BTN_ENC) + * (BTN_EN1) PA9 | 3 4 | RESET + * (BTN_EN2) PA10 5 6 | PB9 (LCD_A0) + * (LCD_RS) PB8 | 7 8 | PB7 (MOSI) + * GND | 9 10 | 5V * ------ * EXP1 */ @@ -234,11 +234,11 @@ * * Board Display * ------ ------ - * (SD_DET) PA15 |10 9 | PB6 (BEEPER) 5V |10 9 | GND - * (MOD_RESET) PA9 | 8 7 | RESET (RESET) | 8 7 | (SD_DET) - * (SD_CS) PA10 6 5 | PB9 (MOSI) 6 5 | (LCD_CS) - * (LCD_CS) PB8 | 4 3 | PB7 (SD_CS) | 4 3 | (MOD_RESET) - * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * (SD_DET) PA15 | 1 2 | PB6 (BEEPER) 5V | 1 2 | GND + * (MOD_RESET) PA9 | 3 4 | RESET (RESET) | 3 4 | (SD_DET) + * (SD_CS) PA10 5 6 | PB9 (MOSI) 5 6 | (LCD_CS) + * (LCD_CS) PB8 | 7 8 | PB7 (SD_CS) | 7 8 | (MOD_RESET) + * GND | 9 10 | 5V (SCK) | 9 10 | (MISO) * ------ ------ * EXP1 EXP1 * diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index fa7eb3dd11..a81f272f26 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -120,11 +120,11 @@ /** * SKR Mini E3 V1.0, V1.2 SKR Mini E3 V2.0 * ------ ------ - * (BEEPER) PB5 |10 9 | PB6 (BTN_ENC) (BEEPER) PB5 |10 9 | PA15 (BTN_ENC) - * (BTN_EN1) PA9 | 8 7 | RESET (BTN_EN1) PA9 | 8 7 | RESET - * (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) - * (LCD_RS) PB8 | 4 3 | PB7 (LCD_EN) (LCD_RS) PB8 | 4 3 | PB15 (LCD_EN) - * GND | 2 1 | 5V GND | 2 1 | 5V + * (BEEPER) PB5 | 1 2 | PB6 (BTN_ENC) (BEEPER) PB5 | 1 2 | PA15 (BTN_ENC) + * (BTN_EN1) PA9 | 3 4 | RESET (BTN_EN1) PA9 | 3 4 | RESET + * (BTN_EN2) PA10 5 6 | PB9 (LCD_D4) (BTN_EN2) PA10 5 6 | PB9 (LCD_D4) + * (LCD_RS) PB8 | 7 8 | PB7 (LCD_EN) (LCD_RS) PB8 | 7 8 | PB15 (LCD_EN) + * GND | 9 10 | 5V GND | 9 10 | 5V * ------ ------ * EXP1 EXP1 */ @@ -139,11 +139,11 @@ #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI /** * ------ ------ ------ - * (ENT) |10 9 | (BEEP) |10 9 | |10 9 | - * (RX) | 8 7 | (RX) | 8 7 | (TX) RX | 8 7 | TX - * (TX) 6 5 | (ENT) 6 5 | (BEEP) ENT | 6 5 | BEEP - * (B) | 4 3 | (A) (B) | 4 3 | (A) B | 4 3 | A - * GND | 2 1 | (VCC) GND | 2 1 | VCC GND | 2 1 | VCC + * (ENT) | 1 2 | (BEEP) | 1 2 | | 1 2 | + * (RX) | 3 4 | (RX) | 3 4 | (TX) RX | 3 4 | TX + * (TX) 5 6 | (ENT) 5 6 | (BEEP) ENT | 5 6 | BEEP + * (B) | 7 8 | (A) (B) | 7 8 | (A) B | 7 8 | A + * GND | 9 10 | (VCC) GND | 9 10 | VCC GND | 9 10 | VCC * ------ ------ ------ * EXP1 DWIN DWIN (plug) * @@ -214,11 +214,11 @@ * * Board Display * ------ ------ - * (SD_DET) PB5 |10 9 | PB6 (BEEPER) 5V |10 9 | GND - * (MOD_RESET) PA9 | 8 7 | RESET -- | 8 7 | (SD_DET) - * (SD_CS) PA10 6 5 | PB9 (MOSI) | 6 5 | -- - * (LCD_CS) PB8 | 4 3 | PB7 (SD_CS) | 4 3 | (LCD_CS) - * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * (SD_DET) PB5 | 1 2 | PB6 (BEEPER) 5V | 1 2 | GND + * (MOD_RESET) PA9 | 3 4 | RESET -- | 3 4 | (SD_DET) + * (SD_CS) PA10 5 6 | PB9 (MOSI) | 5 6 | -- + * (LCD_CS) PB8 | 7 8 | PB7 (SD_CS) | 7 8 | (LCD_CS) + * GND | 9 10 | 5V (SCK) | 9 10 | (MISO) * ------ ------ * EXP1 EXP1 * @@ -253,20 +253,20 @@ * * Board Display * ------ ------ - * PB5 |10 9 | PA15 (BEEP) |10 9 | BTN_ENC - * PA9 | 8 7 | RESET LCD_CS | 8 7 | LCD A0 - * PA10 | 6 5 | PB9 LCD_RST | 6 5 | RED - * PB8 | 4 3 | PB15 (GREEN) | 4 3 | (BLUE) - * GND | 2 1 | 5V GND | 2 1 | 5V + * PB5 | 1 2 | PA15 (BEEP) | 1 2 | BTN_ENC + * PA9 | 3 4 | RESET LCD_CS | 3 4 | LCD A0 + * PA10 | 5 6 | PB9 LCD_RST | 5 6 | RED + * PB8 | 7 8 | PB15 (GREEN) | 7 8 | (BLUE) + * GND | 9 10 | 5V GND | 9 10 | 5V * ------ ------ * EXP1 EXP1 * * --- ------ - * RST | 1 | (MISO) |10 9 | SCK - * (RX2) PA2 | 2 | BTN_EN1 | 8 7 | (SS) - * (TX2) PA3 | 3 | BTN_EN2 | 6 5 | MOSI - * GND | 4 | (CD) | 4 3 | (RST) - * 5V | 5 | (GND) | 2 1 | (KILL) + * RST | 1 | (MISO) | 1 2 | SCK + * (RX2) PA2 | 2 | BTN_EN1 | 3 4 | (SS) + * (TX2) PA3 | 3 | BTN_EN2 | 5 6 | MOSI + * GND | 4 | (CD) | 7 8 | (RST) + * 5V | 5 | (GND) | 9 10 | (KILL) * --- ------ * TFT EXP2 * @@ -325,11 +325,11 @@ * * Board Display * ------ ------ - * (SD_DET) PB5 |10 9 | PB6 (BEEPER) 5V |10 9 | GND - * (MOD_RESET) PA9 | 8 7 | RESET (RESET) | 8 7 | (SD_DET) - * (SD_CS) PA10 6 5 | PB9 (MOSI) | 6 5 | (LCD_CS) - * (LCD_CS) PB8 | 4 3 | PB7 (SD_CS) | 4 3 | (MOD_RESET) - * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * (SD_DET) PB5 | 1 2 | PB6 (BEEPER) 5V | 1 2 | GND + * (MOD_RESET) PA9 | 3 4 | RESET (RESET) | 3 4 | (SD_DET) + * (SD_CS) PA10 5 6 | PB9 (MOSI) | 5 6 | (LCD_CS) + * (LCD_CS) PB8 | 7 8 | PB7 (SD_CS) | 7 8 | (MOD_RESET) + * GND | 9 10 | 5V (SCK) | 9 10 | (MISO) * ------ ------ * EXP1 EXP1 * diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index 1ea947ffdf..16ea8de2f0 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -111,47 +111,47 @@ #define TEMP_0_PIN PA0 // Analog Input /** ------ ------ - * (BEEPER) PC10 |10 9 | PC11 (BTN_ENC) (MISO) PB4 |10 9 | PB3 (SCK) - * (LCD_EN) PB6 | 8 7 | PC12 (LCD_RS) (BTN_EN1) PD2 | 8 7 | PA15 (SD_SS) - * (LCD_D4) PC13 6 5 | PB7 (LCD_D5) (BTN_EN2) PB8 6 5 | PB5 (MOSI) - * (LCD_D6) PC15 | 4 3 | PC14 (LCD_D7) (SD_DETECT) PB9 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) PC10 | 1 2 | PC11 (BTN_ENC) (MISO) PB4 | 1 2 | PB3 (SCK) + * (LCD_EN) PB6 | 3 4 | PC12 (LCD_RS) (BTN_EN1) PD2 | 3 4 | PA15 (SD_SS) + * (LCD_D4) PC13 5 6 | PB7 (LCD_D5) (BTN_EN2) PB8 5 6 | PB5 (MOSI) + * (LCD_D6) PC15 | 7 8 | PC14 (LCD_D7) (SD_DETECT) PB9 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PC14 -#define EXP1_04_PIN PC15 -#define EXP1_05_PIN PB7 -#define EXP1_06_PIN PC13 -#define EXP1_07_PIN PC12 -#define EXP1_08_PIN PB6 -#define EXP1_09_PIN PC11 -#define EXP1_10_PIN PC10 +#define EXP1_08_PIN PC14 +#define EXP1_07_PIN PC15 +#define EXP1_06_PIN PB7 +#define EXP1_05_PIN PC13 +#define EXP1_04_PIN PC12 +#define EXP1_03_PIN PB6 +#define EXP1_02_PIN PC11 +#define EXP1_01_PIN PC10 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PB9 -#define EXP2_05_PIN PB5 -#define EXP2_06_PIN PB8 -#define EXP2_07_PIN PA15 -#define EXP2_08_PIN PD2 -#define EXP2_09_PIN PB3 -#define EXP2_10_PIN PB4 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PB9 +#define EXP2_06_PIN PB5 +#define EXP2_05_PIN PB8 +#define EXP2_04_PIN PA15 +#define EXP2_03_PIN PD2 +#define EXP2_02_PIN PB3 +#define EXP2_01_PIN PB4 // // LCD / Controller // #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #elif IS_TFTGLCD_PANEL @@ -159,56 +159,56 @@ #undef BTN_ENC #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #else - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN #if ENABLED(FYSETC_MINI_12864) #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define LCD_RESET_PIN EXP1_05_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #define FORCE_SOFT_SPI // SPI MODE3 - #define LED_PIN EXP1_05_PIN // red pwm - //#define LED_PIN EXP1_04_PIN // green - //#define LED_PIN EXP1_03_PIN // blue + #define LED_PIN EXP1_06_PIN // red pwm + //#define LED_PIN EXP1_07_PIN // green + //#define LED_PIN EXP1_08_PIN // blue //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) // #ifndef RGB_LED_R_PIN - // #define RGB_LED_R_PIN EXP1_05_PIN + // #define RGB_LED_R_PIN EXP1_06_PIN // #endif // #ifndef RGB_LED_G_PIN - // #define RGB_LED_G_PIN EXP1_04_PIN + // #define RGB_LED_G_PIN EXP1_07_PIN // #endif // #ifndef RGB_LED_B_PIN - // #define RGB_LED_B_PIN EXP1_03_PIN + // #define RGB_LED_B_PIN EXP1_08_PIN // #endif //#elif ENABLED(FYSETC_MINI_12864_2_1) - // #define NEOPIXEL_PIN EXP1_05_PIN + // #define NEOPIXEL_PIN EXP1_06_PIN //#endif #else // !FYSETC_MINI_12864 - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -241,11 +241,11 @@ #if SD_CONNECTION_IS(LCD) #define SPI_DEVICE 3 - #define SD_DETECT_PIN EXP2_04_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_SS_PIN EXP2_07_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_SS_PIN EXP2_04_PIN #elif SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN PA3 #define SD_SCK_PIN PA5 diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index 9dec1e1279..7f63cb1b24 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -123,35 +123,35 @@ /** * ------ - * PB5 |10 9 | PB6 - * PA2 | 8 7 | RESET - * PA3 6 5 | PB8 - * PB7 | 4 3 | PA4 - * GND | 2 1 | VCC5 + * PB5 | 1 2 | PB6 + * PA2 | 3 4 | RESET + * PA3 5 6 | PB8 + * PB7 | 7 8 | PA4 + * GND | 9 10 | VCC5 * ------ * EXP1 */ -#define EXP1_03_PIN PA4 -#define EXP1_04_PIN PB7 -#define EXP1_05_PIN PB8 -#define EXP1_06_PIN PA3 -#define EXP1_07_PIN -1 // RESET -#define EXP1_08_PIN PA2 -#define EXP1_09_PIN PB6 -#define EXP1_10_PIN PB5 +#define EXP1_08_PIN PA4 +#define EXP1_07_PIN PB7 +#define EXP1_06_PIN PB8 +#define EXP1_05_PIN PA3 +#define EXP1_04_PIN -1 // RESET +#define EXP1_03_PIN PA2 +#define EXP1_02_PIN PB6 +#define EXP1_01_PIN PB5 // // LCD / Controller // #if ENABLED(CR10_STOCKDISPLAY) - #define BEEPER_PIN EXP1_10_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN - #define LCD_PINS_RS EXP1_04_PIN // CS -- SOFT SPI for ENDER3 LCD - #define LCD_PINS_D4 EXP1_05_PIN // SCLK - #define LCD_PINS_ENABLE EXP1_03_PIN // DATA MOSI + #define LCD_PINS_RS EXP1_07_PIN // CS -- SOFT SPI for ENDER3 LCD + #define LCD_PINS_D4 EXP1_06_PIN // SCLK + #define LCD_PINS_ENABLE EXP1_08_PIN // DATA MOSI #endif // Alter timing for graphical display diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index 7e3979b87e..3df8ad2a8e 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -168,11 +168,11 @@ /** * RET6 12864 LCD * ------ - * PC6 |10 9 | PB2 - * PB10 | 8 7 | PE8 - * PB14 6 5 | PB13 - * PB12 | 4 3 | PB15 - * GND | 2 1 | 5V + * PC6 | 1 2 | PB2 + * PB10 | 3 4 | PE8 + * PB14 5 6 | PB13 + * PB12 | 7 8 | PB15 + * GND | 9 10 | 5V * ------ * EXP1 */ @@ -194,11 +194,11 @@ /** * VET6 12864 LCD * ------ - * ? |10 9 | PC5 - * PB10 | 8 7 | ? - * PA6 6 5 | PA5 - * PA4 | 4 3 | PA7 - * GND | 2 1 | 5V + * ? | 1 2 | PC5 + * PB10 | 3 4 | ? + * PA6 5 6 | PA5 + * PA4 | 7 8 | PA7 + * GND | 9 10 | 5V * ------ * EXP1 */ diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index 484ff65442..699bfee563 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -150,58 +150,58 @@ /** * RET6 12864 LCD * ------ - * PC6 |10 9 | PB2 - * PB10 | 8 7 | PE8 - * PB14 6 5 | PB13 - * PB12 | 4 3 | PB15 - * GND | 2 1 | 5V + * PC6 | 1 2 | PB2 + * PB10 | 3 4 | PE8 + * PB14 5 6 | PB13 + * PB12 | 7 8 | PB15 + * GND | 9 10 | 5V * ------ * EXP1 */ - #define EXP1_03_PIN PB15 - #define EXP1_04_PIN PB12 - #define EXP1_05_PIN PB13 - #define EXP1_06_PIN PB14 - #define EXP1_07_PIN PE8 - #define EXP1_08_PIN PB10 - #define EXP1_09_PIN PB2 - #define EXP1_10_PIN PC6 + #define EXP1_08_PIN PB15 + #define EXP1_07_PIN PB12 + #define EXP1_06_PIN PB13 + #define EXP1_05_PIN PB14 + #define EXP1_04_PIN PE8 + #define EXP1_03_PIN PB10 + #define EXP1_02_PIN PB2 + #define EXP1_01_PIN PC6 - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #elif ENABLED(VET6_12864_LCD) /** * VET6 12864 LCD * ------ - * ? |10 9 | PC5 - * PB10 | 8 7 | ? - * PA6 6 5 | PA5 - * PA4 | 4 3 | PA7 - * GND | 2 1 | 5V + * ? | 1 2 | PC5 + * PB10 | 3 4 | ? + * PA6 5 6 | PA5 + * PA4 | 7 8 | PA7 + * GND | 9 10 | 5V * ------ * EXP1 */ - #define EXP1_03_PIN PA7 - #define EXP1_04_PIN PA4 - #define EXP1_05_PIN PA5 - #define EXP1_06_PIN PA6 - #define EXP1_07_PIN -1 - #define EXP1_08_PIN PB10 - #define EXP1_09_PIN PC5 - #define EXP1_10_PIN -1 + #define EXP1_08_PIN PA7 + #define EXP1_07_PIN PA4 + #define EXP1_06_PIN PA5 + #define EXP1_05_PIN PA6 + #define EXP1_04_PIN -1 + #define EXP1_03_PIN PB10 + #define EXP1_02_PIN PC5 + #define EXP1_01_PIN -1 #else #error "Define RET6_12864_LCD or VET6_12864_LCD to select pins for CR10_STOCKDISPLAY with the Creality V4 controller." #endif - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #elif HAS_DWIN_E3V2 || IS_DWIN_MARLINUI diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 952b40c1de..5326611672 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -85,13 +85,13 @@ #if ENABLED(TMC_USE_SW_SPI) #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI EXP2_05_PIN + #define TMC_SW_MOSI EXP2_06_PIN #endif #ifndef TMC_SW_MISO - #define TMC_SW_MISO EXP2_10_PIN + #define TMC_SW_MISO EXP2_01_PIN #endif #ifndef TMC_SW_SCK - #define TMC_SW_SCK EXP2_09_PIN + #define TMC_SW_SCK EXP2_02_PIN #endif #endif @@ -123,31 +123,31 @@ #define TEMP_0_PIN PC1 // Analog Input /** ------ ------ - * (BEEPER) PC14 |10 9 | PC13 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SD_SCK) - * (LCD_EN) PB9 | 8 7 | PB8 (LCD_RS) (BTN_EN1) PB3 | 8 7 | PB12 (SD_CS2) - * (LCD_D4) PB7 6 5 | PB6 (LCD_D5) (BTN_EN2) PD2 6 5 | PB15 (SD_MOSI) - * (LCD_D6) PB5 | 4 3 | PB4 (LCD_D7) (SD_DETECT) PB11 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) PC14 | 1 2 | PC13 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) + * (LCD_EN) PB9 | 3 4 | PB8 (LCD_RS) (BTN_EN1) PB3 | 3 4 | PB12 (SD_CS2) + * (LCD_D4) PB7 5 6 | PB6 (LCD_D5) (BTN_EN2) PD2 5 6 | PB15 (SD_MOSI) + * (LCD_D6) PB5 | 7 8 | PB4 (LCD_D7) (SD_DETECT) PB11 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PB4 -#define EXP1_04_PIN PB5 -#define EXP1_05_PIN PB6 -#define EXP1_06_PIN PB7 -#define EXP1_07_PIN PB8 -#define EXP1_08_PIN PB9 -#define EXP1_09_PIN PC13 -#define EXP1_10_PIN PC14 +#define EXP1_08_PIN PB4 +#define EXP1_07_PIN PB5 +#define EXP1_06_PIN PB6 +#define EXP1_05_PIN PB7 +#define EXP1_04_PIN PB8 +#define EXP1_03_PIN PB9 +#define EXP1_02_PIN PC13 +#define EXP1_01_PIN PC14 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PB11 -#define EXP2_05_PIN PB15 -#define EXP2_06_PIN PD2 -#define EXP2_07_PIN PB12 -#define EXP2_08_PIN PB3 -#define EXP2_09_PIN PB13 -#define EXP2_10_PIN PB14 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PB11 +#define EXP2_06_PIN PB15 +#define EXP2_05_PIN PD2 +#define EXP2_04_PIN PB12 +#define EXP2_03_PIN PB3 +#define EXP2_02_PIN PB13 +#define EXP2_01_PIN PB14 // // LCD / Controller @@ -155,26 +155,26 @@ #if HAS_WIRED_LCD #define SPI_DEVICE 2 - #define SD_SS_PIN EXP2_07_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN + #define SD_SS_PIN EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN #define SDSS SD_SS_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h index beda50d29b..7b790ef157 100644 --- a/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h +++ b/Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h @@ -133,11 +133,11 @@ /** * EXP1 pinout for the LCD according to FYSETC's Cheetah board schematic * ------ - * (BEEPER) PC9 |10 9 | PC12 (BTN_ENC) - * (BTN_EN2) PC11 | 8 7 | PB14 (LCD_RS / MISO) - * (BTN_EN1) PC10 6 5 | PB13 (SCK) - * (LCD_EN) PB12 | 4 3 | PB15 (MOSI) - * GND | 2 1 | 5V + * (BEEPER) PC9 | 1 2 | PC12 (BTN_ENC) + * (BTN_EN2) PC11 | 3 4 | PB14 (LCD_RS / MISO) + * (BTN_EN1) PC10 5 6 | PB13 (SCK) + * (LCD_EN) PB12 | 7 8 | PB15 (MOSI) + * GND | 9 10 | 5V * ------ * EXP1 * @@ -146,23 +146,23 @@ * - Functionally the pins are assigned in the same order as on the Ender-3 board. * - Pin 4 on the Cheetah board is assigned to an I/O, it is assigned to RESET on the Ender-3 board. */ -#define EXP1_03_PIN PB15 -#define EXP1_04_PIN PB12 -#define EXP1_05_PIN PB13 -#define EXP1_06_PIN PC10 -#define EXP1_07_PIN PB14 -#define EXP1_08_PIN PC11 -#define EXP1_09_PIN PC12 -#define EXP1_10_PIN PC9 +#define EXP1_08_PIN PB15 +#define EXP1_07_PIN PB12 +#define EXP1_06_PIN PB13 +#define EXP1_05_PIN PC10 +#define EXP1_04_PIN PB14 +#define EXP1_03_PIN PC11 +#define EXP1_02_PIN PC12 +#define EXP1_01_PIN PC9 #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #if HAS_MARLINUI_U8GLIB - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_CS EXP1_04_PIN - #define DOGLCD_SCK EXP1_05_PIN - #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_SCK EXP1_06_PIN + #define DOGLCD_MOSI EXP1_08_PIN #if EITHER(FYSETC_MINI_12864, U8GLIB_ST7920) #define FORCE_SOFT_SPI @@ -170,30 +170,30 @@ //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #endif - #define LCD_PINS_RS EXP1_04_PIN // CS -- SOFT SPI for ENDER3 LCD - #define LCD_PINS_D4 EXP1_05_PIN // SCLK - #define LCD_PINS_ENABLE EXP1_03_PIN // DATA MOSI + #define LCD_PINS_RS EXP1_07_PIN // CS -- SOFT SPI for ENDER3 LCD + #define LCD_PINS_D4 EXP1_06_PIN // SCLK + #define LCD_PINS_ENABLE EXP1_08_PIN // DATA MOSI //#define LCD_CONTRAST_INIT 190 #if IS_NEWPANEL - #define BTN_EN1 EXP1_06_PIN - #define BTN_EN2 EXP1_08_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_05_PIN + #define BTN_EN2 EXP1_03_PIN + #define BTN_ENC EXP1_02_PIN #endif #endif #if ENABLED(TOUCH_UI_FTDI_EVE) - #define BEEPER_PIN EXP1_10_PIN - #define CLCD_MOD_RESET EXP1_08_PIN - #define CLCD_SPI_CS EXP1_04_PIN + #define BEEPER_PIN EXP1_01_PIN + #define CLCD_MOD_RESET EXP1_03_PIN + #define CLCD_SPI_CS EXP1_07_PIN //#define CLCD_USE_SOFT_SPI // the Cheetah can use hardware-SPI so we do not really need this #if ENABLED(CLCD_USE_SOFT_SPI) - #define CLCD_SOFT_SPI_MOSI EXP1_03_PIN - #define CLCD_SOFT_SPI_MISO EXP1_07_PIN - #define CLCD_SOFT_SPI_SCLK EXP1_05_PIN + #define CLCD_SOFT_SPI_MOSI EXP1_08_PIN + #define CLCD_SOFT_SPI_MISO EXP1_04_PIN + #define CLCD_SOFT_SPI_SCLK EXP1_06_PIN #else #define CLCD_SPI_BUS 2 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 38f10f6713..b6f5dfa87e 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -207,31 +207,31 @@ /** * ------ ------ - * PC5 |10 9 | PE13 PA6 |10 9 | PA5 - * PD13 | 8 7 | PC6 PE8 | 8 7 | PE10 - * PE14 | 6 5 PE15 PE11 | 6 5 PA7 - * PD11 | 4 3 | PD10 PE12 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V + * PC5 | 1 2 | PE13 PA6 | 1 2 | PA5 + * PD13 | 3 4 | PC6 PE8 | 3 4 | PE10 + * PE14 | 5 6 PE15 PE11 | 5 6 PA7 + * PD11 | 7 8 | PD10 PE12 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 3.3V * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PD10 -#define EXP1_04_PIN PD11 -#define EXP1_05_PIN PE15 -#define EXP1_06_PIN PE14 -#define EXP1_07_PIN PC6 -#define EXP1_08_PIN PD13 -#define EXP1_09_PIN PE13 -#define EXP1_10_PIN PC5 +#define EXP1_08_PIN PD10 +#define EXP1_07_PIN PD11 +#define EXP1_06_PIN PE15 +#define EXP1_05_PIN PE14 +#define EXP1_04_PIN PC6 +#define EXP1_03_PIN PD13 +#define EXP1_02_PIN PE13 +#define EXP1_01_PIN PC5 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PE12 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PE11 -#define EXP2_07_PIN PE10 -#define EXP2_08_PIN PE8 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PE12 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PE11 +#define EXP2_04_PIN PE10 +#define EXP2_03_PIN PE8 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // // SD Card @@ -247,11 +247,11 @@ #define ONBOARD_SD_CS_PIN PC11 #elif SD_CONNECTION_IS(LCD) #define ENABLE_SPI1 - #define SDSS EXP2_07_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SDSS EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif // @@ -268,25 +268,25 @@ // Shared SPI TFT - #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define LCD_BACKLIGHT_PIN EXP1_03_PIN - #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS - #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK - #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO - #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI + #define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN - #define TFT_DC_PIN EXP1_03_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN + #define TFT_DC_PIN EXP1_08_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_RESET_PIN EXP1_04_PIN #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI @@ -298,22 +298,22 @@ #if ENABLED(TFT_CLASSIC_UI) // Emulated DOGM SPI - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_ENC EXP1_09_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #elif ENABLED(TFT_COLOR_UI) #define TFT_BUFFER_SIZE 14400 #endif #if HAS_WIRED_LCD && !HAS_SPI_TFT - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #define LCD_BACKLIGHT_PIN -1 #if ENABLED(MKS_MINI_12864) @@ -323,18 +323,18 @@ #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN -1 - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #elif IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define PIN_SPI_SCK EXP2_09_PIN - #define PIN_TFT_MISO EXP2_10_PIN - #define PIN_TFT_MOSI EXP2_05_PIN - #define TFTGLCD_CS EXP2_08_PIN + #define PIN_SPI_SCK EXP2_02_PIN + #define PIN_TFT_MISO EXP2_01_PIN + #define PIN_TFT_MOSI EXP2_06_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #ifndef BEEPER_PIN @@ -342,14 +342,14 @@ #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LCD_PINS_DC EXP1_07_PIN - #define DOGLCD_CS EXP1_08_PIN + #define LCD_PINS_DC EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN #define DOGLCD_A0 DOGLCD_A0 #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN - #define NEOPIXEL_PIN EXP1_05_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_SCK EXP2_09_PIN + #define LCD_RESET_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN + #define DOGLCD_MOSI EXP2_06_PIN + #define DOGLCD_SCK EXP2_02_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif @@ -357,11 +357,11 @@ #else // !MKS_MINI_12864 - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -387,7 +387,7 @@ #endif #ifndef BEEPER_PIN - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #endif #if ENABLED(SPEAKER) && BEEPER_PIN == PC5 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index 4af88c1848..a25c8950cb 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -141,82 +141,82 @@ /** * ------ ------ ------ - * (BEEPER) PC1 |10 9 | PC3 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SD_SCK) (BEEPER) PC1 |10 9 | PC3 (BTN_ENC) - * (LCD_EN) PA4 | 8 7 | PA5 (LCD_RS) (BTN_EN1) PB11 | 8 7 | PA15 (SD_SS) (BTN_EN1) PB11 | 8 7 | RESET - * (LCD_D4) PA6 6 5 | PA7 (LCD_D5) (BTN_EN2) PB0 6 5 | PB15 (SD_MOSI) (BTN_EN2) PB0 6 5 | PA6 (LCD_D4) - * (LCD_D6) PC4 | 4 3 | PC5 (LCD_D7) (SD_DETECT) PC10 | 4 3 | RESET (LCD_RS) PA5 | 4 3 | PA4 (LCD_EN) - * GND | 2 1 | 5V GND | 2 1 | -- GND | 2 1 | 5V + * (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) + * (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) (BTN_EN1) PB11 | 3 4 | PA15 (SD_SS) (BTN_EN1) PB11 | 3 4 | RESET + * (LCD_D4) PA6 5 6 | PA7 (LCD_D5) (BTN_EN2) PB0 5 6 | PB15 (SD_MOSI) (BTN_EN2) PB0 5 6 | PA6 (LCD_D4) + * (LCD_D6) PC4 | 7 8 | PC5 (LCD_D7) (SD_DETECT) PC10 | 7 8 | RESET (LCD_RS) PA5 | 7 8 | PA4 (LCD_EN) + * GND | 9 10 | 5V GND | 9 10 | -- GND | 9 10 | 5V * ------ ------ ------ * EXP1 EXP2 "Ender-3 EXP1" */ -#define EXP1_03_PIN PC5 -#define EXP1_04_PIN PC4 -#define EXP1_05_PIN PA7 -#define EXP1_06_PIN PA6 -#define EXP1_07_PIN PA5 -#define EXP1_08_PIN PA4 -#define EXP1_09_PIN PC3 -#define EXP1_10_PIN PC1 +#define EXP1_08_PIN PC5 +#define EXP1_07_PIN PC4 +#define EXP1_06_PIN PA7 +#define EXP1_05_PIN PA6 +#define EXP1_04_PIN PA5 +#define EXP1_03_PIN PA4 +#define EXP1_02_PIN PC3 +#define EXP1_01_PIN PC1 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PC10 -#define EXP2_05_PIN PB15 -#define EXP2_06_PIN PB0 -#define EXP2_07_PIN PA15 -#define EXP2_08_PIN PB11 -#define EXP2_09_PIN PB13 -#define EXP2_10_PIN PB14 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PC10 +#define EXP2_06_PIN PB15 +#define EXP2_05_PIN PB0 +#define EXP2_04_PIN PA15 +#define EXP2_03_PIN PB11 +#define EXP2_02_PIN PB13 +#define EXP2_01_PIN PB14 // "Ender-3 EXP1" -#define E3_EXP1_03_PIN PA4 -#define E3_EXP1_04_PIN PA5 -#define E3_EXP1_05_PIN PA6 -#define E3_EXP1_06_PIN PB0 -#define E3_EXP1_07_PIN -1 // RESET -#define E3_EXP1_08_PIN PB11 -#define E3_EXP1_09_PIN PC3 -#define E3_EXP1_10_PIN PC1 +#define EXP3_08_PIN PA4 +#define EXP3_07_PIN PA5 +#define EXP3_06_PIN PA6 +#define EXP3_05_PIN PB0 +#define EXP3_04_PIN -1 // RESET +#define EXP3_03_PIN PB11 +#define EXP3_02_PIN PC3 +#define EXP3_01_PIN PC1 #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) #if ENABLED(MKS_MINI_12864) #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN -1 - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LCD_PINS_DC EXP1_07_PIN - #define DOGLCD_CS EXP1_08_PIN + #define LCD_PINS_DC EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN #define DOGLCD_A0 LCD_PINS_DC #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN - #define NEOPIXEL_PIN EXP1_05_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_SCK EXP2_09_PIN + #define LCD_RESET_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN + #define DOGLCD_MOSI EXP2_06_PIN + #define DOGLCD_SCK EXP2_02_PIN #define FORCE_SOFT_SPI #define SOFTWARE_SPI //#define LCD_SCREEN_ROTATE 180 // 0, 90, 180, 270 #else - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if !defined(BTN_ENC_EN) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -254,12 +254,12 @@ #define ONBOARD_SPI_DEVICE 2 #define SDSS SD_SS_PIN #define ONBOARD_SD_CS_PIN SD_SS_PIN -#define SD_DETECT_PIN PC10 // EXP2_04_PIN +#define SD_DETECT_PIN PC10 // EXP2_07_PIN #define NO_SD_HOST_DRIVE // TODO: This is the only way to set SPI for SD on STM32 (for now) #define ENABLE_SPI2 -#define SD_SCK_PIN EXP2_09_PIN -#define SD_MISO_PIN EXP2_10_PIN -#define SD_MOSI_PIN EXP2_05_PIN -#define SD_SS_PIN EXP2_07_PIN +#define SD_SCK_PIN EXP2_02_PIN +#define SD_MISO_PIN EXP2_01_PIN +#define SD_MOSI_PIN EXP2_06_PIN +#define SD_SS_PIN EXP2_04_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index bc42bd02eb..227db4b15c 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -80,50 +80,50 @@ #define FIL_RUNOUT_PIN PB8 // MT_DET /** ------ - * (BEEPER) PD2 |10 9 | PB3 (BTN_ENC) - * (BTN_EN1) PB5 | 8 7 | PA11 (RESET?) - * (BTN_EN2) PB4 6 5 | PC1 (LCD_D4) - * (LCD_RS) PC3 | 4 3 | PC2 (LCD_EN) - * GND | 2 1 | 5V + * (BEEPER) PD2 | 1 2 | PB3 (BTN_ENC) + * (BTN_EN1) PB5 | 3 4 | PA11 (RESET?) + * (BTN_EN2) PB4 5 6 | PC1 (LCD_D4) + * (LCD_RS) PC3 | 7 8 | PC2 (LCD_EN) + * GND | 9 10 | 5V * ------ * "E3" EXP1 */ -#define E3_EXP1_01_PIN -1 // 5V -#define E3_EXP1_02_PIN -1 // GND -#define E3_EXP1_03_PIN PC2 -#define E3_EXP1_04_PIN PC3 -#define E3_EXP1_05_PIN PC1 -#define E3_EXP1_06_PIN PB4 -#define E3_EXP1_07_PIN PA11 // RESET? -#define E3_EXP1_08_PIN PB5 -#define E3_EXP1_09_PIN PB3 -#define E3_EXP1_10_PIN PD2 +#define EXP3_10_PIN -1 // 5V +#define EXP3_09_PIN -1 // GND +#define EXP3_08_PIN PC2 +#define EXP3_07_PIN PC3 +#define EXP3_06_PIN PC1 +#define EXP3_05_PIN PB4 +#define EXP3_04_PIN PA11 // RESET? +#define EXP3_03_PIN PB5 +#define EXP3_02_PIN PB3 +#define EXP3_01_PIN PD2 // // LCD Pins // #if HAS_WIRED_LCD - #define BEEPER_PIN E3_EXP1_10_PIN - #define BTN_ENC E3_EXP1_09_PIN - #define LCD_PINS_RS E3_EXP1_04_PIN + #define BEEPER_PIN EXP3_01_PIN + #define BTN_ENC EXP3_02_PIN + #define LCD_PINS_RS EXP3_07_PIN - #define BTN_EN1 E3_EXP1_08_PIN - #define BTN_EN2 E3_EXP1_06_PIN + #define BTN_EN1 EXP3_03_PIN + #define BTN_EN2 EXP3_05_PIN - #define LCD_PINS_ENABLE E3_EXP1_03_PIN + #define LCD_PINS_ENABLE EXP3_08_PIN #if ENABLED(MKS_MINI_12864) #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN -1 - #define DOGLCD_A0 E3_EXP1_05_PIN - #define DOGLCD_CS E3_EXP1_03_PIN + #define DOGLCD_A0 EXP3_06_PIN + #define DOGLCD_CS EXP3_08_PIN #define DOGLCD_SCK PB13 #define DOGLCD_MOSI PB15 #else // !MKS_MINI_12864 - #define LCD_PINS_D4 E3_EXP1_05_PIN + #define LCD_PINS_D4 EXP3_06_PIN #if IS_ULTIPANEL #define LCD_PINS_D5 -1 #define LCD_PINS_D6 -1 @@ -164,12 +164,12 @@ // EXP1 replace LCD with keys for EasyThreeD ET4000+ Mainboard #if ENABLED(EASYTHREED_UI) - #define BTN_HOME E3_EXP1_04_PIN // INPUT_PULLUP (unused) - #define BTN_FEED E3_EXP1_09_PIN // Run E Forward - #define BTN_RETRACT E3_EXP1_08_PIN // Run E Backward - #define BTN_PRINT E3_EXP1_07_PIN // Start File Print - #define BTN_HOME_GND E3_EXP1_03_PIN // OUTPUT (LOW) - #define BTN_FEED_GND E3_EXP1_06_PIN // OUTPUT (LOW) - #define BTN_RETRACT_GND E3_EXP1_05_PIN // OUTPUT (LOW) - #define EASYTHREED_LED_PIN E3_EXP1_10_PIN // Indicator LED + #define BTN_HOME EXP3_07_PIN // INPUT_PULLUP (unused) + #define BTN_FEED EXP3_02_PIN // Run E Forward + #define BTN_RETRACT EXP3_03_PIN // Run E Backward + #define BTN_PRINT EXP3_04_PIN // Start File Print + #define BTN_HOME_GND EXP3_08_PIN // OUTPUT (LOW) + #define BTN_FEED_GND EXP3_05_PIN // OUTPUT (LOW) + #define BTN_RETRACT_GND EXP3_06_PIN // OUTPUT (LOW) + #define EASYTHREED_LED_PIN EXP3_01_PIN // Indicator LED #endif diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h index f1f03a7dd7..ed0f00591f 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E2_V1_0.h @@ -72,14 +72,14 @@ // 2 +5V // 1 GND -#define EXP1_03_PIN PB11 -#define EXP1_04_PIN PB10 -#define EXP1_05_PIN PB2 -#define EXP1_06_PIN PC5 -#define EXP1_07_PIN PA10 -#define EXP1_08_PIN PA9 -#define EXP1_09_PIN PB0 -#define EXP1_10_PIN PB1 +#define EXP1_08_PIN PB11 +#define EXP1_07_PIN PB10 +#define EXP1_06_PIN PB2 +#define EXP1_05_PIN PC5 +#define EXP1_04_PIN PA10 +#define EXP1_03_PIN PA9 +#define EXP1_02_PIN PB0 +#define EXP1_01_PIN PB1 // AUX1 connector // 1 +5V @@ -193,14 +193,14 @@ // 1 GND #define LCDSCREEN_NAME "ZONESTAR LCD12864" - #define LCD_PINS_RS EXP1_08_PIN - #define LCD_PINS_ENABLE EXP1_05_PIN - #define LCD_PINS_D4 EXP1_07_PIN - //#define KILL_PIN EXP1_10_PIN - #define BEEPER_PIN EXP1_09_PIN - #define BTN_EN1 EXP1_03_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_04_PIN + #define LCD_PINS_RS EXP1_03_PIN + #define LCD_PINS_ENABLE EXP1_06_PIN + #define LCD_PINS_D4 EXP1_04_PIN + //#define KILL_PIN EXP1_01_PIN + #define BEEPER_PIN EXP1_02_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_07_PIN #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 200 #define BOARD_ST7920_DELAY_3 125 @@ -221,15 +221,15 @@ #define FORCE_SOFT_SPI #define LCDSCREEN_NAME "ZONESTAR 12864OLED" - #define LCD_PINS_RS EXP1_05_PIN // = LCD_RESET_PIN - #define LCD_PINS_DC EXP1_07_PIN // DC - #define DOGLCD_CS EXP1_08_PIN // CS + #define LCD_PINS_RS EXP1_06_PIN // = LCD_RESET_PIN + #define LCD_PINS_DC EXP1_04_PIN // DC + #define DOGLCD_CS EXP1_03_PIN // CS #define DOGLCD_A0 LCD_PINS_DC - #define DOGLCD_MOSI EXP1_10_PIN // SDA - #define DOGLCD_SCK EXP1_09_PIN // SCK + #define DOGLCD_MOSI EXP1_01_PIN // SDA + #define DOGLCD_SCK EXP1_02_PIN // SCK // Encoder - #define BTN_EN1 EXP1_03_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_04_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_07_PIN #endif diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h index 17e13bdc87..f59d61434e 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h @@ -89,14 +89,14 @@ // 2 +5V +5V // 1 GND GND -#define EXP1_03_PIN PE14 -#define EXP1_04_PIN PE15 -#define EXP1_05_PIN PE9 -#define EXP1_06_PIN PE8 -#define EXP1_07_PIN PE10 -#define EXP1_08_PIN PE12 -#define EXP1_09_PIN PE11 -#define EXP1_10_PIN PE13 +#define EXP1_08_PIN PE14 +#define EXP1_07_PIN PE15 +#define EXP1_06_PIN PE9 +#define EXP1_05_PIN PE8 +#define EXP1_04_PIN PE10 +#define EXP1_03_PIN PE12 +#define EXP1_02_PIN PE11 +#define EXP1_01_PIN PE13 // EXP2 connector // MARK I/O ZONESTAR_LCD12864 REPRAPDISCOUNT_LCD12864 @@ -111,12 +111,12 @@ // 2 +5V +5V // 1 GND GND -#define EXP2_03_PIN PB3 -#define EXP2_04_PIN PB5 -#define EXP2_05_PIN PB4 -#define EXP2_06_PIN PA15 -#define EXP2_07_PIN PA10 -#define EXP2_08_PIN PA9 +#define EXP2_08_PIN PB3 +#define EXP2_07_PIN PB5 +#define EXP2_06_PIN PB4 +#define EXP2_05_PIN PA15 +#define EXP2_04_PIN PA10 +#define EXP2_03_PIN PA9 // AUX1 connector // 1 +5V @@ -279,55 +279,55 @@ // #if ENABLED(ZONESTAR_12864LCD) #define LCDSCREEN_NAME "ZONESTAR LCD12864" - #define LCD_PINS_RS EXP1_08_PIN // 7 CS make sure for zonestar zm3e4! - #define LCD_PINS_ENABLE EXP1_05_PIN // 6 DATA make sure for zonestar zm3e4! - #define LCD_PINS_D4 EXP1_07_PIN // 8 SCK make sure for zonestar zm3e4! - #define BEEPER_PIN EXP1_09_PIN - #define KILL_PIN -1 // EXP1_10_PIN - #define BTN_EN1 EXP1_06_PIN - #define BTN_EN2 EXP1_03_PIN - #define BTN_ENC EXP1_04_PIN + #define LCD_PINS_RS EXP1_03_PIN // 7 CS make sure for zonestar zm3e4! + #define LCD_PINS_ENABLE EXP1_06_PIN // 6 DATA make sure for zonestar zm3e4! + #define LCD_PINS_D4 EXP1_04_PIN // 8 SCK make sure for zonestar zm3e4! + #define BEEPER_PIN EXP1_02_PIN + #define KILL_PIN -1 // EXP1_01_PIN + #define BTN_EN1 EXP1_05_PIN + #define BTN_EN2 EXP1_08_PIN + #define BTN_ENC EXP1_07_PIN #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define LCDSCREEN_NAME "REPRAPDISCOUNT LCD12864" - #define LCD_PINS_RS EXP1_08_PIN // 7 CS make sure for zonestar zm3e4! - #define LCD_PINS_ENABLE EXP1_07_PIN // 6 DATA make sure for zonestar zm3e4! - #define LCD_PINS_D4 EXP1_05_PIN // 8 SCK make sure for zonestar zm3e4! - #define BEEPER_PIN EXP1_09_PIN - #define KILL_PIN EXP2_04_PIN - #define BTN_EN1 EXP2_05_PIN - #define BTN_EN2 EXP2_07_PIN - #define BTN_ENC EXP1_10_PIN + #define LCD_PINS_RS EXP1_03_PIN // 7 CS make sure for zonestar zm3e4! + #define LCD_PINS_ENABLE EXP1_04_PIN // 6 DATA make sure for zonestar zm3e4! + #define LCD_PINS_D4 EXP1_06_PIN // 8 SCK make sure for zonestar zm3e4! + #define BEEPER_PIN EXP1_02_PIN + #define KILL_PIN EXP2_07_PIN + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_04_PIN + #define BTN_ENC EXP1_01_PIN #elif ENABLED(ZONESTAR_DWIN_LCD) // Connect to EXP2 connector #define LCDSCREEN_NAME "ZONESTAR DWIN LCD" - #define BEEPER_PIN EXP2_06_PIN + #define BEEPER_PIN EXP2_05_PIN #define KILL_PIN PC0 - #define BTN_EN1 EXP2_03_PIN - #define BTN_EN2 EXP2_04_PIN - #define BTN_ENC EXP2_05_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_07_PIN + #define BTN_ENC EXP2_06_PIN #endif #if ENABLED(ZONESTAR_LCD2004_KNOB) #define LCDSCREEN_NAME "LCD2004 KNOB" - #define LCD_PINS_RS EXP1_08_PIN - #define LCD_PINS_ENABLE EXP1_07_PIN - #define LCD_PINS_D4 EXP1_05_PIN - #define LCD_PINS_D5 EXP1_06_PIN - #define LCD_PINS_D6 EXP1_03_PIN - #define LCD_PINS_D7 EXP1_04_PIN - #define BTN_EN1 EXP2_07_PIN - #define BTN_EN2 EXP2_05_PIN - #define BTN_ENC EXP1_10_PIN - #define BEEPER_PIN EXP1_09_PIN - #define KILL_PIN EXP2_04_PIN + #define LCD_PINS_RS EXP1_03_PIN + #define LCD_PINS_ENABLE EXP1_04_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_08_PIN + #define LCD_PINS_D7 EXP1_07_PIN + #define BTN_EN1 EXP2_04_PIN + #define BTN_EN2 EXP2_06_PIN + #define BTN_ENC EXP1_01_PIN + #define BEEPER_PIN EXP1_02_PIN + #define KILL_PIN EXP2_07_PIN #elif ENABLED(ZONESTAR_LCD2004_ADCKEY) #define LCDSCREEN_NAME "LCD2004 5KEY" - #define LCD_PINS_RS EXP1_08_PIN - #define LCD_PINS_ENABLE EXP1_07_PIN - #define LCD_PINS_D4 EXP1_05_PIN - #define LCD_PINS_D5 EXP1_06_PIN - #define LCD_PINS_D6 EXP1_03_PIN - #define LCD_PINS_D7 EXP1_04_PIN + #define LCD_PINS_RS EXP1_03_PIN + #define LCD_PINS_ENABLE EXP1_04_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_08_PIN + #define LCD_PINS_D7 EXP1_07_PIN #define ADC_KEYPAD_PIN PC0 // PIN6 of AUX1 #endif @@ -341,16 +341,16 @@ // Remap SERVO0 PIN for BLTouch #if ENABLED(BLTOUCH_ON_EXP1) // BLTouch connected to EXP1 - #define BLTOUCH_PROBE_PIN EXP1_06_PIN - #define BLTOUCH_GND_PIN EXP1_04_PIN + #define BLTOUCH_PROBE_PIN EXP1_05_PIN + #define BLTOUCH_GND_PIN EXP1_07_PIN #undef SERVO0_PIN - #define SERVO0_PIN EXP1_03_PIN + #define SERVO0_PIN EXP1_08_PIN #elif ENABLED(BLTOUCH_ON_EXP2) // BLTouch connected to EXP2 - #define BLTOUCH_PROBE_PIN EXP2_03_PIN - #define BLTOUCH_GND_PIN EXP2_04_PIN + #define BLTOUCH_PROBE_PIN EXP2_08_PIN + #define BLTOUCH_GND_PIN EXP2_07_PIN #undef SERVO0_PIN - #define SERVO0_PIN EXP2_06_PIN + #define SERVO0_PIN EXP2_05_PIN #else #define BLTOUCH_PROBE_PIN PB13 #endif diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h index df0eb9c3d8..f83ce52fe9 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h @@ -90,14 +90,14 @@ // 2 +5V // 1 GND -#define EXP1_03_PIN PE14 -#define EXP1_04_PIN PE15 -#define EXP1_05_PIN PE9 -#define EXP1_06_PIN PE8 -#define EXP1_07_PIN PE10 -#define EXP1_08_PIN PE12 -#define EXP1_09_PIN PE11 -#define EXP1_10_PIN PE13 +#define EXP1_08_PIN PE14 +#define EXP1_07_PIN PE15 +#define EXP1_06_PIN PE9 +#define EXP1_05_PIN PE8 +#define EXP1_04_PIN PE10 +#define EXP1_03_PIN PE12 +#define EXP1_02_PIN PE11 +#define EXP1_01_PIN PE13 // EXP2 connector // MARK I/O ZONESTAR_LCD12864 REPRAPDISCOUNT_LCD12864 @@ -112,14 +112,14 @@ // 2 +5V // 1 GND -#define EXP2_03_PIN PB3 -#define EXP2_04_PIN PB5 -#define EXP2_05_PIN PB4 -#define EXP2_06_PIN PA15 -#define EXP2_07_PIN PA10 -#define EXP2_08_PIN PA9 -#define EXP2_09_PIN PE7 -#define EXP2_10_PIN PC0 +#define EXP2_08_PIN PB3 +#define EXP2_07_PIN PB5 +#define EXP2_06_PIN PB4 +#define EXP2_05_PIN PA15 +#define EXP2_04_PIN PA10 +#define EXP2_03_PIN PA9 +#define EXP2_02_PIN PE7 +#define EXP2_01_PIN PC0 // AUX1 connector // 1 +5V @@ -276,32 +276,32 @@ #if ENABLED(ZONESTAR_12864LCD) #define LCDSCREEN_NAME "ZONESTAR LCD12864" - #define LCD_PINS_RS EXP1_08_PIN // 7 CS make sure for zonestar zm3e4! - #define LCD_PINS_ENABLE EXP1_05_PIN // 6 DATA make sure for zonestar zm3e4! - #define LCD_PINS_D4 EXP1_07_PIN // 8 SCK make sure for zonestar zm3e4! - #define BEEPER_PIN EXP1_09_PIN - #define KILL_PIN -1 // EXP1_10_PIN - #define BTN_EN1 EXP1_06_PIN - #define BTN_EN2 EXP1_03_PIN - #define BTN_ENC EXP1_04_PIN + #define LCD_PINS_RS EXP1_03_PIN // 7 CS make sure for zonestar zm3e4! + #define LCD_PINS_ENABLE EXP1_06_PIN // 6 DATA make sure for zonestar zm3e4! + #define LCD_PINS_D4 EXP1_04_PIN // 8 SCK make sure for zonestar zm3e4! + #define BEEPER_PIN EXP1_02_PIN + #define KILL_PIN -1 // EXP1_01_PIN + #define BTN_EN1 EXP1_05_PIN + #define BTN_EN2 EXP1_08_PIN + #define BTN_ENC EXP1_07_PIN #elif ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define LCDSCREEN_NAME "REPRAPDISCOUNT LCD12864" - #define LCD_PINS_RS EXP2_08_PIN // 7 CS make sure for zonestar zm3e4! - #define LCD_PINS_ENABLE EXP2_05_PIN // 6 DATA make sure for zonestar zm3e4! - #define LCD_PINS_D4 EXP2_07_PIN // 8 SCK make sure for zonestar zm3e4! - #define BEEPER_PIN EXP2_10_PIN - #define KILL_PIN EXP2_09_PIN - #define BTN_EN1 EXP2_03_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP2_04_PIN + #define LCD_PINS_RS EXP2_03_PIN // 7 CS make sure for zonestar zm3e4! + #define LCD_PINS_ENABLE EXP2_06_PIN // 6 DATA make sure for zonestar zm3e4! + #define LCD_PINS_D4 EXP2_04_PIN // 8 SCK make sure for zonestar zm3e4! + #define BEEPER_PIN EXP2_01_PIN + #define KILL_PIN EXP2_02_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP2_07_PIN #elif ENABLED(ZONESTAR_DWIN_LCD) // Connect to EXP2 connector #define LCDSCREEN_NAME "ZONESTAR DWIN LCD" - #define BEEPER_PIN EXP2_06_PIN // PE11 - #define KILL_PIN -1 // EXP1_10_PIN - #define BTN_EN2 EXP2_04_PIN // PE8 - #define BTN_EN1 EXP2_03_PIN // PE14 - #define BTN_ENC EXP2_05_PIN // PE15 + #define BEEPER_PIN EXP2_05_PIN // PE11 + #define KILL_PIN -1 // EXP1_01_PIN + #define BTN_EN2 EXP2_07_PIN // PE8 + #define BTN_EN1 EXP2_08_PIN // PE14 + #define BTN_ENC EXP2_06_PIN // PE15 #endif // Alter timing for graphical display @@ -314,16 +314,16 @@ // Remap SERVO0 PIN for BLTouch #if ENABLED(BLTOUCH_ON_EXP1) // BLTouch connected to EXP1 - #define BLTOUCH_PROBE_PIN EXP1_06_PIN - #define BLTOUCH_GND_PIN EXP1_04_PIN + #define BLTOUCH_PROBE_PIN EXP1_05_PIN + #define BLTOUCH_GND_PIN EXP1_07_PIN #undef SERVO0_PIN - #define SERVO0_PIN EXP1_03_PIN + #define SERVO0_PIN EXP1_08_PIN #elif ENABLED(BLTOUCH_ON_EXP2) // BLTouch connected to EXP2 - #define BLTOUCH_PROBE_PIN EXP2_03_PIN - #define BLTOUCH_GND_PIN EXP2_04_PIN + #define BLTOUCH_PROBE_PIN EXP2_08_PIN + #define BLTOUCH_GND_PIN EXP2_07_PIN #undef SERVO0_PIN - #define SERVO0_PIN EXP2_06_PIN + #define SERVO0_PIN EXP2_05_PIN #else #define BLTOUCH_PROBE_PIN PB13 // Z1_MAX #endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h index 531ab7a958..aadce03c56 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -199,109 +199,109 @@ /** * ---------------------------------BTT002 V1.0--------------------------------- * ------ ------ | - * (BEEPER) PE7 |10 9 | PB1 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) | - * (LCD_EN) PE9 | 8 7 | PE8 (LCD_RS) (BTN_EN1) PC5 | 8 7 | PA4 (SD_SS) | - * (LCD_D4) PE10 6 5 | PE11 (LCD_D5) (BTN_EN2) PB0 6 5 | PA7 (MOSI) | - * (LCD_D6) PE12 | 4 3 | PE13 (LCD_D7) (SD_DET) PC4 | 4 3 | RESET | - * GND | 2 1 | 5V GND | 2 1 | PA3 | + * (BEEPER) PE7 | 1 2 | PB1 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK) | + * (LCD_EN) PE9 | 3 4 | PE8 (LCD_RS) (BTN_EN1) PC5 | 3 4 | PA4 (SD_SS) | + * (LCD_D4) PE10 5 6 | PE11 (LCD_D5) (BTN_EN2) PB0 5 6 | PA7 (MOSI) | + * (LCD_D6) PE12 | 7 8 | PE13 (LCD_D7) (SD_DET) PC4 | 7 8 | RESET | + * GND | 9 10 | 5V GND | 9 10 | PA3 | * ------ ------ | * EXP1 EXP2 | * ------------------------------------------------------------------------------ */ -#define EXP1_03_PIN PE13 -#define EXP1_04_PIN PE12 -#define EXP1_05_PIN PE11 -#define EXP1_06_PIN PE10 -#define EXP1_07_PIN PE8 -#define EXP1_08_PIN PE9 -#define EXP1_09_PIN PB1 -#define EXP1_10_PIN PE7 +#define EXP1_08_PIN PE13 +#define EXP1_07_PIN PE12 +#define EXP1_06_PIN PE11 +#define EXP1_05_PIN PE10 +#define EXP1_04_PIN PE8 +#define EXP1_03_PIN PE9 +#define EXP1_02_PIN PB1 +#define EXP1_01_PIN PE7 -#define EXP2_01_PIN PA3 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PC4 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PB0 -#define EXP2_07_PIN PA4 -#define EXP2_08_PIN PC5 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_10_PIN PA3 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PC4 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PB0 +#define EXP2_04_PIN PA4 +#define EXP2_03_PIN PC5 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // HAL SPI1 pins -#define SD_SCK_PIN EXP2_09_PIN // SPI1 SCLK -#define SD_SS_PIN EXP2_07_PIN // SPI1 SSEL -#define SD_MISO_PIN EXP2_10_PIN // SPI1 MISO -#define SD_MOSI_PIN EXP2_05_PIN // SPI1 MOSI +#define SD_SCK_PIN EXP2_02_PIN // SPI1 SCLK +#define SD_SS_PIN EXP2_04_PIN // SPI1 SSEL +#define SD_MISO_PIN EXP2_01_PIN // SPI1 MISO +#define SD_MOSI_PIN EXP2_06_PIN // SPI1 MOSI -#define SDSS EXP2_07_PIN +#define SDSS EXP2_04_PIN // // LCDs and Controllers // #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN - - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN - - #elif ENABLED(MKS_MINI_12864) - - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - - #else - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #else + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_MISO EXP2_10_PIN - #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_MOSI EXP2_06_PIN + #define DOGLCD_MISO EXP2_01_PIN + #define DOGLCD_SCK EXP2_02_PIN #define LCD_BACKLIGHT_PIN -1 #define FORCE_SOFT_SPI - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index c7cd35c7ad..ca257d257b 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -186,11 +186,11 @@ /** * BTT E3 RRF * ------ - * (BEEPER) PE8 |10 9 | PE9 (BTN_ENC) - * (BTN_EN1) PE7 | 8 7 | RESET - * (BTN_EN2) PB2 6 5 | PE10 (LCD_D4) - * (LCD_RS) PB1 | 4 3 | PE11 (LCD_EN) - * GND | 2 1 | 5V + * (BEEPER) PE8 | 1 2 | PE9 (BTN_ENC) + * (BTN_EN1) PE7 | 3 4 | RESET + * (BTN_EN2) PB2 5 6 | PE10 (LCD_D4) + * (LCD_RS) PB1 | 7 8 | PE11 (LCD_EN) + * GND | 9 10 | 5V * ------ * EXP1 */ @@ -219,11 +219,11 @@ * * BTT E3 RRF Display Ribbon * ------ ------ - * (BEEPER) PE8 |10 9 | PE9 (BTN_ENC) GND |10 9 | 5V - * (BTN_EN1) PE7 | 8 7 | RESET BEEPER | 8 7 | ESTOP (RESET) - * (BTN_EN2) PB2 6 5 | PE10 (LCD_D4) (BTN_ENC) ENC_BTN | 6 5 | LCD_SCLK (LCD_D4) - * (LCD_RS) PB1 | 4 3 | PE11 (LCD_EN) (BTN_EN2) ENC_A | 4 3 | LCD_DATA (LCD_EN) - * GND | 2 1 | 5V (BTN_EN1) ENC_B | 2 1 | LCD_CS (LCD_RS) + * (BEEPER) PE8 | 1 2 | PE9 (BTN_ENC) GND | 1 2 | 5V + * (BTN_EN1) PE7 | 3 4 | RESET BEEPER | 3 4 | ESTOP (RESET) + * (BTN_EN2) PB2 5 6 | PE10 (LCD_D4) (BTN_ENC) ENC_BTN | 5 6 | LCD_SCLK (LCD_D4) + * (LCD_RS) PB1 | 7 8 | PE11 (LCD_EN) (BTN_EN2) ENC_A | 7 8 | LCD_DATA (LCD_EN) + * GND | 9 10 | 5V (BTN_EN1) ENC_B | 9 10 | LCD_CS (LCD_RS) * ------ ------ * EXP1 Ribbon * @@ -286,11 +286,11 @@ * * Board Display * ------ ------ - * (SD_DET) PE8 |10 9 | PE9 (BEEPER) 5V |10 9 | GND - * (MOD_RESET) PE7 | 8 7 | RESET -- | 8 7 | (SD_DET) - * (SD_CS) PB2 6 5 | PE10 (MOSI) 6 5 | -- - * (LCD_CS) PB1 | 4 3 | PE11 (SD_CS) | 4 3 | (LCD_CS) - * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * (SD_DET) PE8 | 1 2 | PE9 (BEEPER) 5V | 1 2 | GND + * (MOD_RESET) PE7 | 3 4 | RESET -- | 3 4 | (SD_DET) + * (SD_CS) PB2 5 6 | PE10 (MOSI) 5 6 | -- + * (LCD_CS) PB1 | 7 8 | PE11 (SD_CS) | 7 8 | (LCD_CS) + * GND | 9 10 | 5V (SCK) | 9 10 | (MISO) * ------ ------ * EXP1 EXP1 * @@ -341,11 +341,11 @@ * * Board Display * ------ ------ - * (SD_DET) PE8 |10 9 | PE9 (BEEPER) 5V |10 9 | GND - * (MOD_RESET) PE7 | 8 7 | RESET RESET | 8 7 | (SD_DET) - * (SD_CS) PB2 6 5 | PE10 (MOSI) | 6 5 | (LCD_CS) - * (LCD_CS) PB1 | 4 3 | PE11 (SD_CS) | 4 3 | (MOD_RESET) - * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * (SD_DET) PE8 | 1 2 | PE9 (BEEPER) 5V | 1 2 | GND + * (MOD_RESET) PE7 | 3 4 | RESET RESET | 3 4 | (SD_DET) + * (SD_CS) PB2 5 6 | PE10 (MOSI) | 5 6 | (LCD_CS) + * (LCD_CS) PB1 | 7 8 | PE11 (SD_CS) | 7 8 | (MOD_RESET) + * GND | 9 10 | 5V (SCK) | 9 10 | (MISO) * ------ ------ * EXP1 EXP1 * diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index b9525a9267..b341f3ae07 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -348,8 +348,8 @@ // #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN EXP2_04_PIN - #define SDSS EXP2_07_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define SDSS EXP2_04_PIN #elif SD_CONNECTION_IS(ONBOARD) @@ -366,112 +366,112 @@ /** * ------ ------ - * (BEEPER) PC11 |10 9 | PA15 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SCK) - * (LCD_EN) PC10 | 8 7 | PA8 (LCD_RS) (BTN_EN1) PD10 | 8 7 | PB12 (SD_SS) - * (LCD_D4) PG8 6 5 | PG7 (LCD_D5) (BTN_EN2) PH10 6 5 | PB15 (MOSI) - * (LCD_D6) PG6 | 4 3 | PG5 (LCD_D7) (SD_DETECT) PB10 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) PC11 | 1 2 | PA15 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SCK) + * (LCD_EN) PC10 | 3 4 | PA8 (LCD_RS) (BTN_EN1) PD10 | 3 4 | PB12 (SD_SS) + * (LCD_D4) PG8 5 6 | PG7 (LCD_D5) (BTN_EN2) PH10 5 6 | PB15 (MOSI) + * (LCD_D6) PG6 | 7 8 | PG5 (LCD_D7) (SD_DETECT) PB10 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PG5 -#define EXP1_04_PIN PG6 -#define EXP1_05_PIN PG7 -#define EXP1_06_PIN PG8 -#define EXP1_07_PIN PA8 -#define EXP1_08_PIN PC10 -#define EXP1_09_PIN PA15 -#define EXP1_10_PIN PC11 +#define EXP1_08_PIN PG5 +#define EXP1_07_PIN PG6 +#define EXP1_06_PIN PG7 +#define EXP1_05_PIN PG8 +#define EXP1_04_PIN PA8 +#define EXP1_03_PIN PC10 +#define EXP1_02_PIN PA15 +#define EXP1_01_PIN PC11 -#define EXP2_04_PIN PB10 -#define EXP2_05_PIN PB15 -#define EXP2_06_PIN PH10 -#define EXP2_07_PIN PB12 -#define EXP2_08_PIN PD10 -#define EXP2_09_PIN PB13 -#define EXP2_10_PIN PB14 +#define EXP2_07_PIN PB10 +#define EXP2_06_PIN PB15 +#define EXP2_05_PIN PH10 +#define EXP2_04_PIN PB12 +#define EXP2_03_PIN PD10 +#define EXP2_02_PIN PB13 +#define EXP2_01_PIN PB14 // // LCDs and Controllers // #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) - #define TFT_CS_PIN EXP2_07_PIN - #define TFT_A0_PIN EXP2_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN + #define TFT_CS_PIN EXP2_04_PIN + #define TFT_A0_PIN EXP2_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN - #define TOUCH_INT_PIN EXP1_04_PIN - #define TOUCH_MISO_PIN EXP1_05_PIN - #define TOUCH_MOSI_PIN EXP1_08_PIN - #define TOUCH_SCK_PIN EXP1_06_PIN - #define TOUCH_CS_PIN EXP1_07_PIN - #define BTN_ENC EXP1_09_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define TOUCH_INT_PIN EXP1_07_PIN + #define TOUCH_MISO_PIN EXP1_06_PIN + #define TOUCH_MOSI_PIN EXP1_03_PIN + #define TOUCH_SCK_PIN EXP1_05_PIN + #define TOUCH_CS_PIN EXP1_04_PIN + #define BTN_ENC EXP1_02_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #elif ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #if SD_CONNECTION_IS(ONBOARD) #define SOFTWARE_SPI #endif #else - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN #if SD_CONNECTION_IS(ONBOARD) #define SOFTWARE_SPI #endif //#define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index 4255881baf..8f04ae1d73 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -322,31 +322,31 @@ #endif /** ------ ------ - * (BEEPER) PE8 |10 9 | PE7 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) - * (LCD_EN) PE9 | 8 7 | PE10 (LCD_RS) (BTN_EN1) PB2 | 8 7 | PA4 (SD_SS) - * (LCD_D4) PE12 6 5 | PE13 (LCD_D5) (BTN_EN2) PB1 6 5 | PA7 (MOSI) - * (LCD_D6) PE14 | 4 3 | PE15 (LCD_D7) (SD_DETECT) PC15 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) PE8 | 1 2 | PE7 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK) + * (LCD_EN) PE9 | 3 4 | PE10 (LCD_RS) (BTN_EN1) PB2 | 3 4 | PA4 (SD_SS) + * (LCD_D4) PE12 5 6 | PE13 (LCD_D5) (BTN_EN2) PB1 5 6 | PA7 (MOSI) + * (LCD_D6) PE14 | 7 8 | PE15 (LCD_D7) (SD_DETECT) PC15 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PE15 -#define EXP1_04_PIN PE14 -#define EXP1_05_PIN PE13 -#define EXP1_06_PIN PE12 -#define EXP1_07_PIN PE10 -#define EXP1_08_PIN PE9 -#define EXP1_09_PIN PE7 -#define EXP1_10_PIN PE8 +#define EXP1_08_PIN PE15 +#define EXP1_07_PIN PE14 +#define EXP1_06_PIN PE13 +#define EXP1_05_PIN PE12 +#define EXP1_04_PIN PE10 +#define EXP1_03_PIN PE9 +#define EXP1_02_PIN PE7 +#define EXP1_01_PIN PE8 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PC15 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PB2 -#define EXP2_07_PIN PA4 -#define EXP2_08_PIN PB1 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PC15 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PB2 +#define EXP2_04_PIN PA4 +#define EXP2_03_PIN PB1 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // // Onboard SD card @@ -376,45 +376,45 @@ #if ENABLED(BTT_MOTOR_EXPANSION) /** * ------ ------ - * M3DIAG |10 9 | M3RX M3STP |10 9 | M3DIR - * M2DIAG | 8 7 | M2RX M2STP | 8 7 | M2DIR - * M1DIAG 6 5 | M1RX M1DIR 6 5 | M1STP - * M3EN | 4 3 | M2EN M1EN | 4 3 | -- - * GND | 2 1 | -- GND | 2 1 | -- + * M3DIAG | 1 2 | M3RX M3STP | 1 2 | M3DIR + * M2DIAG | 3 4 | M2RX M2STP | 3 4 | M2DIR + * M1DIAG 5 6 | M1RX M1DIR 5 6 | M1STP + * M3EN | 7 8 | M2EN M1EN | 7 8 | -- + * GND | 9 10 | -- GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ // M1 on Driver Expansion Module - #define E4_STEP_PIN EXP2_05_PIN - #define E4_DIR_PIN EXP2_06_PIN - #define E4_ENABLE_PIN EXP2_04_PIN - #define E4_DIAG_PIN EXP1_06_PIN - #define E4_CS_PIN EXP1_05_PIN + #define E4_STEP_PIN EXP2_06_PIN + #define E4_DIR_PIN EXP2_05_PIN + #define E4_ENABLE_PIN EXP2_07_PIN + #define E4_DIAG_PIN EXP1_05_PIN + #define E4_CS_PIN EXP1_06_PIN #if HAS_TMC_UART - #define E4_SERIAL_TX_PIN EXP1_05_PIN + #define E4_SERIAL_TX_PIN EXP1_06_PIN #define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN #endif // M2 on Driver Expansion Module - #define E5_STEP_PIN EXP2_08_PIN - #define E5_DIR_PIN EXP2_07_PIN - #define E5_ENABLE_PIN EXP1_03_PIN - #define E5_DIAG_PIN EXP1_08_PIN - #define E5_CS_PIN EXP1_07_PIN + #define E5_STEP_PIN EXP2_03_PIN + #define E5_DIR_PIN EXP2_04_PIN + #define E5_ENABLE_PIN EXP1_08_PIN + #define E5_DIAG_PIN EXP1_03_PIN + #define E5_CS_PIN EXP1_04_PIN #if HAS_TMC_UART - #define E5_SERIAL_TX_PIN EXP1_07_PIN + #define E5_SERIAL_TX_PIN EXP1_04_PIN #define E5_SERIAL_RX_PIN E5_SERIAL_TX_PIN #endif // M3 on Driver Expansion Module - #define E6_STEP_PIN EXP2_10_PIN - #define E6_DIR_PIN EXP2_09_PIN - #define E6_ENABLE_PIN EXP1_04_PIN - #define E6_DIAG_PIN EXP1_10_PIN - #define E6_CS_PIN EXP1_09_PIN + #define E6_STEP_PIN EXP2_01_PIN + #define E6_DIR_PIN EXP2_02_PIN + #define E6_ENABLE_PIN EXP1_07_PIN + #define E6_DIAG_PIN EXP1_01_PIN + #define E6_CS_PIN EXP1_02_PIN #if HAS_TMC_UART - #define E6_SERIAL_TX_PIN EXP1_09_PIN + #define E6_SERIAL_TX_PIN EXP1_02_PIN #define E6_SERIAL_RX_PIN E6_SERIAL_TX_PIN #endif @@ -426,58 +426,58 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN - - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN - - #else - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN + #else + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN //#define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -496,21 +496,21 @@ #endif #if HAS_SPI_TFT - #define TFT_CS_PIN EXP2_07_PIN - #define TFT_A0_PIN EXP2_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN + #define TFT_CS_PIN EXP2_04_PIN + #define TFT_A0_PIN EXP2_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN - #define TOUCH_INT_PIN EXP1_04_PIN - #define TOUCH_MISO_PIN EXP1_05_PIN - #define TOUCH_MOSI_PIN EXP1_08_PIN - #define TOUCH_SCK_PIN EXP1_06_PIN - #define TOUCH_CS_PIN EXP1_07_PIN + #define TOUCH_INT_PIN EXP1_07_PIN + #define TOUCH_MISO_PIN EXP1_06_PIN + #define TOUCH_MOSI_PIN EXP1_03_PIN + #define TOUCH_SCK_PIN EXP1_05_PIN + #define TOUCH_CS_PIN EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN #endif // diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h index 7c902b008c..9b49f27670 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -313,31 +313,31 @@ #endif /** ------ ------ - * (BEEPER) PG4 |10 9 | PA8 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SCK) - * (LCD_EN) PD11 | 8 7 | PD10 (LCD_RS) (BTN_EN1) PG10 | 8 7 | PB12 (SD_SS) - * (LCD_D4) PG2 6 5 | PG3 (LCD_D5) (BTN_EN2) PF11 6 5 | PB15 (MOSI) - * (LCD_D6) PG6 | 4 3 | PG7 (LCD_D7) (SD_DETECT) PF12 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) PG4 | 1 2 | PA8 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SCK) + * (LCD_EN) PD11 | 3 4 | PD10 (LCD_RS) (BTN_EN1) PG10 | 3 4 | PB12 (SD_SS) + * (LCD_D4) PG2 5 6 | PG3 (LCD_D5) (BTN_EN2) PF11 5 6 | PB15 (MOSI) + * (LCD_D6) PG6 | 7 8 | PG7 (LCD_D7) (SD_DETECT) PF12 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PG7 -#define EXP1_04_PIN PG6 -#define EXP1_05_PIN PG3 -#define EXP1_06_PIN PG2 -#define EXP1_07_PIN PD10 -#define EXP1_08_PIN PD11 -#define EXP1_09_PIN PA8 -#define EXP1_10_PIN PG4 +#define EXP1_08_PIN PG7 +#define EXP1_07_PIN PG6 +#define EXP1_06_PIN PG3 +#define EXP1_05_PIN PG2 +#define EXP1_04_PIN PD10 +#define EXP1_03_PIN PD11 +#define EXP1_02_PIN PA8 +#define EXP1_01_PIN PG4 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PF12 -#define EXP2_05_PIN PB15 -#define EXP2_06_PIN PF11 -#define EXP2_07_PIN PB12 -#define EXP2_08_PIN PG10 -#define EXP2_09_PIN PB13 -#define EXP2_10_PIN PB14 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PF12 +#define EXP2_06_PIN PB15 +#define EXP2_05_PIN PF11 +#define EXP2_04_PIN PB12 +#define EXP2_03_PIN PG10 +#define EXP2_02_PIN PB13 +#define EXP2_01_PIN PB14 // // Onboard SD card @@ -345,8 +345,8 @@ // #if SD_CONNECTION_IS(LCD) - #define SD_DETECT_PIN EXP2_04_PIN - #define SDSS EXP2_07_PIN + #define SD_DETECT_PIN EXP2_07_PIN + #define SDSS EXP2_04_PIN #elif SD_CONNECTION_IS(ONBOARD) @@ -379,46 +379,46 @@ */ // M1 on Driver Expansion Module - #define E3_STEP_PIN EXP2_05_PIN - #define E3_DIR_PIN EXP2_06_PIN - #define E3_ENABLE_PIN EXP2_04_PIN + #define E3_STEP_PIN EXP2_06_PIN + #define E3_DIR_PIN EXP2_05_PIN + #define E3_ENABLE_PIN EXP2_07_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E3_DIAG_PIN EXP1_06_PIN - #define E3_CS_PIN EXP1_05_PIN + #define E3_DIAG_PIN EXP1_05_PIN + #define E3_CS_PIN EXP1_06_PIN #if HAS_TMC_UART - #define E3_SERIAL_TX_PIN EXP1_05_PIN - #define E3_SERIAL_RX_PIN EXP1_05_PIN + #define E3_SERIAL_TX_PIN EXP1_06_PIN + #define E3_SERIAL_RX_PIN EXP1_06_PIN #endif #endif // M2 on Driver Expansion Module - #define E4_STEP_PIN EXP2_08_PIN - #define E4_DIR_PIN EXP2_07_PIN + #define E4_STEP_PIN EXP2_03_PIN + #define E4_DIR_PIN EXP2_04_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E4_ENABLE_PIN EXP1_03_PIN - #define E4_DIAG_PIN EXP1_08_PIN - #define E4_CS_PIN EXP1_07_PIN + #define E4_ENABLE_PIN EXP1_08_PIN + #define E4_DIAG_PIN EXP1_03_PIN + #define E4_CS_PIN EXP1_04_PIN #if HAS_TMC_UART - #define E4_SERIAL_TX_PIN EXP1_07_PIN - #define E4_SERIAL_RX_PIN EXP1_07_PIN + #define E4_SERIAL_TX_PIN EXP1_04_PIN + #define E4_SERIAL_RX_PIN EXP1_04_PIN #endif #else - #define E4_ENABLE_PIN EXP2_04_PIN + #define E4_ENABLE_PIN EXP2_07_PIN #endif // M3 on Driver Expansion Module - #define E5_STEP_PIN EXP2_10_PIN - #define E5_DIR_PIN EXP2_09_PIN + #define E5_STEP_PIN EXP2_01_PIN + #define E5_DIR_PIN EXP2_02_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E5_ENABLE_PIN EXP1_04_PIN - #define E5_DIAG_PIN EXP1_10_PIN - #define E5_CS_PIN EXP1_09_PIN + #define E5_ENABLE_PIN EXP1_07_PIN + #define E5_DIAG_PIN EXP1_01_PIN + #define E5_CS_PIN EXP1_02_PIN #if HAS_TMC_UART - #define E5_SERIAL_TX_PIN EXP1_09_PIN - #define E5_SERIAL_RX_PIN EXP1_09_PIN + #define E5_SERIAL_TX_PIN EXP1_02_PIN + #define E5_SERIAL_RX_PIN EXP1_02_PIN #endif #else - #define E5_ENABLE_PIN EXP2_04_PIN + #define E5_ENABLE_PIN EXP2_07_PIN #endif #endif // BTT_MOTOR_EXPANSION @@ -429,30 +429,30 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN #elif ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #elif ENABLED(WYH_L12864) @@ -470,59 +470,59 @@ * * BEFORE AFTER * ------ ------ - * -- |10 9 | MOSI -- |10 9 | MOSI - * BTN_ENC | 8 7 | SCK BTN_ENC | 8 7 | SCK - * BTN_EN1 | 6 5 SID BTN_EN1 | 6 5 SID - * BTN_EN2 | 4 3 | CS BTN_EN2 | 4 3 | CS - * 5V | 2 1 | GND GND | 2 1 | 5V + * -- | 1 2 | MOSI -- | 1 2 | MOSI + * BTN_ENC | 3 4 | SCK BTN_ENC | 3 4 | SCK + * BTN_EN1 | 5 6 SID BTN_EN1 | 5 6 SID + * BTN_EN2 | 7 8 | CS BTN_EN2 | 7 8 | CS + * 5V | 9 10 | GND GND | 9 10 | 5V * ------ ------ * LCD LCD */ #undef BEEPER_PIN #undef BTN_ENC - #define BTN_EN1 EXP1_06_PIN - #define BTN_EN2 EXP1_04_PIN - #define BTN_ENC EXP1_08_PIN - #define DOGLCD_CS EXP1_03_PIN - #define DOGLCD_A0 EXP1_05_PIN - #define DOGLCD_SCK EXP1_07_PIN - #define DOGLCD_MOSI EXP1_09_PIN + #define BTN_EN1 EXP1_05_PIN + #define BTN_EN2 EXP1_07_PIN + #define BTN_ENC EXP1_03_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_04_PIN + #define DOGLCD_MOSI EXP1_02_PIN #define LCD_BACKLIGHT_PIN -1 #else - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN //#define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -553,10 +553,10 @@ /** * ------ - * RX | 8 7 | 3.3V GPIO0 PF14 ... Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) - * GPIO0 | 6 5 | Reset GPIO2 PF15 ... must be high (ESP3D software configures this with a pullup so OK to leave as floating) - * GPIO2 | 4 3 | Enable Reset PG0 ... active low, probably OK to leave floating - * GND | 2 1 | TX Enable PG1 ... Must be high for module to run + * RX | 3 4 | 3.3V GPIO0 PF14 ... Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * GPIO0 | 5 6 | Reset GPIO2 PF15 ... must be high (ESP3D software configures this with a pullup so OK to leave as floating) + * GPIO2 | 7 8 | Enable Reset PG0 ... active low, probably OK to leave floating + * GND | 9 10 | TX Enable PG1 ... Must be high for module to run * ------ * W1 */ diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h index 4e311d4862..9c22ac804d 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h @@ -336,43 +336,43 @@ /** * ------ ------ - * (BEEPER) PC5 |10 9 | PB0 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) - * (LCD_EN) PB1 | 8 7 | PE9 (LCD_RS) (BTN_EN1) PE7 | 8 7 | PA4 (SD_SS) - * (LCD_D4) PE10 | 6 5 PE11 (LCD_D5) (BTN_EN2) PB2 | 6 5 PA7 (MOSI) - * (LCD_D6) PE12 | 4 3 | PE13 (LCD_D7) (SD_DETECT) PC4 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) PC5 | 1 2 | PB0 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK) + * (LCD_EN) PB1 | 3 4 | PE9 (LCD_RS) (BTN_EN1) PE7 | 3 4 | PA4 (SD_SS) + * (LCD_D4) PE10 | 5 6 PE11 (LCD_D5) (BTN_EN2) PB2 | 5 6 PA7 (MOSI) + * (LCD_D6) PE12 | 7 8 | PE13 (LCD_D7) (SD_DETECT) PC4 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PE13 -#define EXP1_04_PIN PE12 -#define EXP1_05_PIN PE11 -#define EXP1_06_PIN PE10 -#define EXP1_07_PIN PE9 -#define EXP1_08_PIN PB1 -#define EXP1_09_PIN PB0 -#define EXP1_10_PIN PC5 +#define EXP1_08_PIN PE13 +#define EXP1_07_PIN PE12 +#define EXP1_06_PIN PE11 +#define EXP1_05_PIN PE10 +#define EXP1_04_PIN PE9 +#define EXP1_03_PIN PB1 +#define EXP1_02_PIN PB0 +#define EXP1_01_PIN PC5 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PC4 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PB2 -#define EXP2_07_PIN PA4 -#define EXP2_08_PIN PE7 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PC4 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PB2 +#define EXP2_04_PIN PA4 +#define EXP2_03_PIN PE7 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // // Onboard SD card // Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 // #if SD_CONNECTION_IS(LCD) - #define SDSS EXP2_07_PIN + #define SDSS EXP2_04_PIN #define SD_SS_PIN SDSS - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD #elif SD_CONNECTION_IS(CUSTOM_CABLE) @@ -393,46 +393,46 @@ */ // M1 on Driver Expansion Module - #define E2_STEP_PIN EXP2_05_PIN - #define E2_DIR_PIN EXP2_06_PIN - #define E2_ENABLE_PIN EXP2_04_PIN + #define E2_STEP_PIN EXP2_06_PIN + #define E2_DIR_PIN EXP2_05_PIN + #define E2_ENABLE_PIN EXP2_07_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E2_DIAG_PIN EXP1_06_PIN - #define E2_CS_PIN EXP1_05_PIN + #define E2_DIAG_PIN EXP1_05_PIN + #define E2_CS_PIN EXP1_06_PIN #if HAS_TMC_UART - #define E2_SERIAL_TX_PIN EXP1_05_PIN - #define E2_SERIAL_RX_PIN EXP1_05_PIN + #define E2_SERIAL_TX_PIN EXP1_06_PIN + #define E2_SERIAL_RX_PIN EXP1_06_PIN #endif #endif // M2 on Driver Expansion Module - #define E3_STEP_PIN EXP2_08_PIN - #define E3_DIR_PIN EXP2_07_PIN + #define E3_STEP_PIN EXP2_03_PIN + #define E3_DIR_PIN EXP2_04_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E3_ENABLE_PIN EXP1_03_PIN - #define E3_DIAG_PIN EXP1_08_PIN - #define E3_CS_PIN EXP1_07_PIN + #define E3_ENABLE_PIN EXP1_08_PIN + #define E3_DIAG_PIN EXP1_03_PIN + #define E3_CS_PIN EXP1_04_PIN #if HAS_TMC_UART - #define E3_SERIAL_TX_PIN EXP1_07_PIN - #define E3_SERIAL_RX_PIN EXP1_07_PIN + #define E3_SERIAL_TX_PIN EXP1_04_PIN + #define E3_SERIAL_RX_PIN EXP1_04_PIN #endif #else - #define E3_ENABLE_PIN EXP2_04_PIN + #define E3_ENABLE_PIN EXP2_07_PIN #endif // M3 on Driver Expansion Module - #define E4_STEP_PIN EXP2_10_PIN - #define E4_DIR_PIN EXP2_09_PIN + #define E4_STEP_PIN EXP2_01_PIN + #define E4_DIR_PIN EXP2_02_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E4_ENABLE_PIN EXP1_04_PIN - #define E4_DIAG_PIN EXP1_10_PIN - #define E4_CS_PIN EXP1_09_PIN + #define E4_ENABLE_PIN EXP1_07_PIN + #define E4_DIAG_PIN EXP1_01_PIN + #define E4_CS_PIN EXP1_02_PIN #if HAS_TMC_UART - #define E4_SERIAL_TX_PIN EXP1_09_PIN - #define E4_SERIAL_RX_PIN EXP1_09_PIN + #define E4_SERIAL_TX_PIN EXP1_02_PIN + #define E4_SERIAL_RX_PIN EXP1_02_PIN #endif #else - #define E4_ENABLE_PIN EXP2_04_PIN + #define E4_ENABLE_PIN EXP2_07_PIN #endif #endif // BTT_MOTOR_EXPANSION @@ -443,65 +443,65 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN - - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN - - #elif ENABLED(MKS_MINI_12864) - - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - - #else - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #else + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN //#define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -528,24 +528,24 @@ #if HAS_SPI_TFT - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN // // e.g., BTT_TFT35_SPI_V1_0 (480x320, 3.5", SPI Stock Display with Rotary Encoder in BIQU B1 SE) // - #define TFT_CS_PIN EXP2_07_PIN - #define TFT_A0_PIN EXP2_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN + #define TFT_CS_PIN EXP2_04_PIN + #define TFT_A0_PIN EXP2_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN - #define TOUCH_INT_PIN EXP1_04_PIN - #define TOUCH_MISO_PIN EXP1_05_PIN - #define TOUCH_MOSI_PIN EXP1_08_PIN - #define TOUCH_SCK_PIN EXP1_06_PIN - #define TOUCH_CS_PIN EXP1_07_PIN + #define TOUCH_INT_PIN EXP1_07_PIN + #define TOUCH_MISO_PIN EXP1_06_PIN + #define TOUCH_MOSI_PIN EXP1_03_PIN + #define TOUCH_SCK_PIN EXP1_05_PIN + #define TOUCH_CS_PIN EXP1_04_PIN #endif diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 11b5dbbb6c..b98dcbf5d7 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -177,31 +177,31 @@ /** * ------ ------ - * PB10 |10 9 | PE15 PB14 |10 9 | PB13 - * PE14 | 8 7 | PE12 PC5 | 8 7 | PF11 - * PE10 6 5 | PE9 PC4 6 5 | PB15 - * PE8 | 4 3 | PE7 PB2 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * PB10 | 1 2 | PE15 PB14 | 1 2 | PB13 + * PE14 | 3 4 | PE12 PC5 | 3 4 | PF11 + * PE10 5 6 | PE9 PC4 5 6 | PB15 + * PE8 | 7 8 | PE7 PB2 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PE7 -#define EXP1_04_PIN PE8 -#define EXP1_05_PIN PE9 -#define EXP1_06_PIN PE10 -#define EXP1_07_PIN PE12 -#define EXP1_08_PIN PE14 -#define EXP1_09_PIN PE15 -#define EXP1_10_PIN PB10 +#define EXP1_08_PIN PE7 +#define EXP1_07_PIN PE8 +#define EXP1_06_PIN PE9 +#define EXP1_05_PIN PE10 +#define EXP1_04_PIN PE12 +#define EXP1_03_PIN PE14 +#define EXP1_02_PIN PE15 +#define EXP1_01_PIN PB10 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PB2 -#define EXP2_05_PIN PB15 -#define EXP2_06_PIN PC4 -#define EXP2_07_PIN PF11 -#define EXP2_08_PIN PC5 -#define EXP2_09_PIN PB13 -#define EXP2_10_PIN PB14 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PB2 +#define EXP2_06_PIN PB15 +#define EXP2_05_PIN PC4 +#define EXP2_04_PIN PF11 +#define EXP2_03_PIN PC5 +#define EXP2_02_PIN PB13 +#define EXP2_01_PIN PB14 // // Onboard SD support @@ -226,11 +226,11 @@ #elif SD_CONNECTION_IS(LCD) - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SDSS EXP2_07_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SDSS EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif @@ -239,13 +239,13 @@ // #if ENABLED(TMC_USE_SW_SPI) #ifndef TMC_SW_SCK - #define TMC_SW_SCK EXP2_09_PIN + #define TMC_SW_SCK EXP2_02_PIN #endif #ifndef TMC_SW_MISO - #define TMC_SW_MISO EXP2_10_PIN + #define TMC_SW_MISO EXP2_01_PIN #endif #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI EXP2_05_PIN + #define TMC_SW_MOSI EXP2_06_PIN #endif #endif @@ -286,16 +286,16 @@ // LCD / Controller // #if IS_RRD_SC - #define BEEPER_PIN EXP1_10_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN + #define BTN_ENC EXP1_02_PIN #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h index 29aff20ffd..f59c6718d5 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h @@ -140,100 +140,100 @@ /** * ------ ------ - * (SD_MISO) PA6 |10 9 | PA5 (SD_SCK) (BEEPER) PC9 |10 9 | PC12 (BTN_ENC) - * (BTN_EN1) PC10 | 8 7 | PA4 (SD_SS) (LCD_EN) PB15 | 8 7 | PB12 (LCD_RS) - * (BTN_EN2) PC11 6 5 | PA7 (SD_MOSI) (LCD_D4) PB13 6 5 | PB14 (LCD_D5) - * (SD_DETECT) PC3 | 4 3 | RESET (LCD_D6) PB6 | 4 3 | PB7 (LCD_D7) - * GND | 2 1 | 5V GND | 2 1 | 5V + * (SD_MISO) PA6 | 1 2 | PA5 (SD_SCK) (BEEPER) PC9 | 1 2 | PC12 (BTN_ENC) + * (BTN_EN1) PC10 | 3 4 | PA4 (SD_SS) (LCD_EN) PB15 | 3 4 | PB12 (LCD_RS) + * (BTN_EN2) PC11 5 6 | PA7 (SD_MOSI) (LCD_D4) PB13 5 6 | PB14 (LCD_D5) + * (SD_DETECT) PC3 | 7 8 | RESET (LCD_D6) PB6 | 7 8 | PB7 (LCD_D7) + * GND | 9 10 | 5V GND | 9 10 | 5V * ------ ------ * EXP2 EXP1 */ /** * ------ - * 5V |10 9 | GND - * (LCD_EN/MOSI) PB15 | 8 7 | PB12 (LCD_RS) - * (LCD_D4/SCK) PB13 6 5 | PC11 (BTN_EN2) - * (LCD_D5/MISO) PB14 | 4 3 | PC10 (BTN_EN1) - * (BTN_ENC) PC12 | 2 1 | PC9 (BEEPER) + * 5V | 1 2 | GND + * (LCD_EN/MOSI) PB15 | 3 4 | PB12 (LCD_RS) + * (LCD_D4/SCK) PB13 5 6 | PC11 (BTN_EN2) + * (LCD_D5/MISO) PB14 | 7 8 | PC10 (BTN_EN1) + * (BTN_ENC) PC12 | 9 10 | PC9 (BEEPER) * ------ * EXP3 */ -#define EXP1_03_PIN PB7 -#define EXP1_04_PIN PB6 -#define EXP1_05_PIN PB14 -#define EXP1_06_PIN PB13 -#define EXP1_07_PIN PB12 -#define EXP1_08_PIN PB15 -#define EXP1_09_PIN PC12 -#define EXP1_10_PIN PC9 +#define EXP1_08_PIN PB7 +#define EXP1_07_PIN PB6 +#define EXP1_06_PIN PB14 +#define EXP1_05_PIN PB13 +#define EXP1_04_PIN PB12 +#define EXP1_03_PIN PB15 +#define EXP1_02_PIN PC12 +#define EXP1_01_PIN PC9 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PC3 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PC11 -#define EXP2_07_PIN PA4 -#define EXP2_08_PIN PC10 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PC3 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PC11 +#define EXP2_04_PIN PA4 +#define EXP2_03_PIN PC10 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 #if HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #elif ENABLED(MKS_MINI_12864) - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #else - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 EXP2_06_PIN - #define BTN_EN2 EXP2_08_PIN + #define BTN_EN1 EXP2_05_PIN + #define BTN_EN2 EXP2_03_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN //#define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -253,7 +253,7 @@ #endif #if ENABLED(TOUCH_UI_FTDI_EVE) - #define BEEPER_PIN EXP1_10_PIN - #define CLCD_MOD_RESET EXP2_08_PIN - #define CLCD_SPI_CS EXP2_06_PIN + #define BEEPER_PIN EXP1_01_PIN + #define CLCD_MOD_RESET EXP2_03_PIN + #define CLCD_SPI_CS EXP2_05_PIN #endif diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 3ed18f9abc..e770140dbb 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -199,117 +199,117 @@ /** * ------ ------ - * PC9 |10 9 | PA8 PA6 |10 9 | PA5 - * PC11 | 8 7 | PD2 PC6 | 8 7 | PA4 - * PC10 6 5 | PC12 PC7 6 5 | PA7 - * PD0 | 4 3 | PD1 PB10 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 5V + * PC9 | 1 2 | PA8 PA6 | 1 2 | PA5 + * PC11 | 3 4 | PD2 PC6 | 3 4 | PA4 + * PC10 5 6 | PC12 PC7 5 6 | PA7 + * PD0 | 7 8 | PD1 PB10 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 5V * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PD1 -#define EXP1_04_PIN PD0 -#define EXP1_05_PIN PC12 -#define EXP1_06_PIN PC10 -#define EXP1_07_PIN PD2 -#define EXP1_08_PIN PC11 -#define EXP1_09_PIN PA8 -#define EXP1_10_PIN PC9 +#define EXP1_08_PIN PD1 +#define EXP1_07_PIN PD0 +#define EXP1_06_PIN PC12 +#define EXP1_05_PIN PC10 +#define EXP1_04_PIN PD2 +#define EXP1_03_PIN PC11 +#define EXP1_02_PIN PA8 +#define EXP1_01_PIN PC9 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PB10 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PC7 -#define EXP2_07_PIN PA4 -#define EXP2_08_PIN PC6 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PB10 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PC7 +#define EXP2_04_PIN PA4 +#define EXP2_03_PIN PC6 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // // SPI / SD Card // -#define SD_SCK_PIN EXP2_09_PIN -#define SD_MISO_PIN EXP2_10_PIN -#define SD_MOSI_PIN EXP2_05_PIN +#define SD_SCK_PIN EXP2_02_PIN +#define SD_MISO_PIN EXP2_01_PIN +#define SD_MOSI_PIN EXP2_06_PIN -#define SDSS EXP2_07_PIN -#define SD_DETECT_PIN EXP2_04_PIN +#define SDSS EXP2_04_PIN +#define SD_DETECT_PIN EXP2_07_PIN // // LCD / Controller // #if ENABLED(FYSETC_242_OLED_12864) - #define BTN_EN1 EXP1_10_PIN - #define BTN_EN2 EXP1_03_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_01_PIN + #define BTN_EN2 EXP1_08_PIN + #define BTN_ENC EXP1_02_PIN - #define BEEPER_PIN EXP2_08_PIN + #define BEEPER_PIN EXP2_03_PIN - #define LCD_PINS_DC EXP1_05_PIN - #define LCD_PINS_RS EXP2_06_PIN // LCD_RST - #define DOGLCD_CS EXP1_07_PIN - #define DOGLCD_MOSI EXP1_06_PIN - #define DOGLCD_SCK EXP1_08_PIN + #define LCD_PINS_DC EXP1_06_PIN + #define LCD_PINS_RS EXP2_05_PIN // LCD_RST + #define DOGLCD_CS EXP1_04_PIN + #define DOGLCD_MOSI EXP1_05_PIN + #define DOGLCD_SCK EXP1_03_PIN #define DOGLCD_A0 LCD_PINS_DC #define FORCE_SOFT_SPI #define KILL_PIN -1 // NC - #define NEOPIXEL_PIN EXP1_04_PIN + #define NEOPIXEL_PIN EXP1_07_PIN #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN - - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN - - #else - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - - #define LCD_SDSS EXP2_07_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN + #else + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #define LCD_SDSS EXP2_04_PIN + + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #if ENABLED(FYSETC_MINI_12864) // See https://wiki.fysetc.com/Mini12864_Panel - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN #if ENABLED(FYSETC_GENERIC_12864_1_1) - #define LCD_BACKLIGHT_PIN EXP1_04_PIN + #define LCD_BACKLIGHT_PIN EXP1_07_PIN #endif - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h index cc02ac3097..676333b89c 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h @@ -213,31 +213,31 @@ /** * ------ ------ - * (BEEPER) PB2 |10 9 | PE10 (BTN_ENC) (SPI1 MISO) PA6 |10 9 | PA5 (SPI1 SCK) - * (LCD_EN) PE11 | 8 7 | PD10 (LCD_RS) (BTN_EN1) PE9 | 8 7 | PA4 (SPI1 CS) - * (LCD_D4) PD9 6 5 | PD8 (LCD_D5) (BTN_EN2) PE8 6 5 | PA7 (SPI1 MOSI) - * (LCD_D6) PE15 | 4 3 | PE7 (LCD_D7) (SPI1_RS) PB11 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V + * (BEEPER) PB2 | 1 2 | PE10 (BTN_ENC) (SPI1 MISO) PA6 | 1 2 | PA5 (SPI1 SCK) + * (LCD_EN) PE11 | 3 4 | PD10 (LCD_RS) (BTN_EN1) PE9 | 3 4 | PA4 (SPI1 CS) + * (LCD_D4) PD9 5 6 | PD8 (LCD_D5) (BTN_EN2) PE8 5 6 | PA7 (SPI1 MOSI) + * (LCD_D6) PE15 | 7 8 | PE7 (LCD_D7) (SPI1_RS) PB11 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 3.3V * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PE7 -#define EXP1_04_PIN PE15 -#define EXP1_05_PIN PD8 -#define EXP1_06_PIN PD9 -#define EXP1_07_PIN PD10 -#define EXP1_08_PIN PE11 -#define EXP1_09_PIN PE10 -#define EXP1_10_PIN PB2 +#define EXP1_08_PIN PE7 +#define EXP1_07_PIN PE15 +#define EXP1_06_PIN PD8 +#define EXP1_05_PIN PD9 +#define EXP1_04_PIN PD10 +#define EXP1_03_PIN PE11 +#define EXP1_02_PIN PE10 +#define EXP1_01_PIN PB2 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PB11 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PE8 -#define EXP2_07_PIN PA4 -#define EXP2_08_PIN PE9 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PB11 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PE8 +#define EXP2_04_PIN PA4 +#define EXP2_03_PIN PE9 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 #if ENABLED(SDSUPPORT) #ifndef SDCARD_CONNECTION @@ -253,25 +253,25 @@ #define SD_DETECT_PIN PC4 // SD_DETECT_PIN doesn't work with NO_SD_HOST_DRIVE disabled #elif SD_CONNECTION_IS(LCD) #define ENABLE_SPI1 - #define SDSS EXP2_07_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SDSS EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif #endif #if EITHER(TFT_COLOR_UI, TFT_CLASSIC_UI) - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN - #define TFT_DC_PIN EXP1_03_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN + #define TFT_DC_PIN EXP1_08_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_RESET_PIN EXP1_04_PIN - #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define LCD_BACKLIGHT_PIN EXP1_03_PIN #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI @@ -284,10 +284,10 @@ #define TFT_HEIGHT 320 #endif - #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS - #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK - #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO - #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI + #define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI #define LCD_READ_ID 0xD3 #define LCD_USE_DMA_SPI @@ -312,8 +312,8 @@ #elif HAS_WIRED_LCD - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN #define LCD_BACKLIGHT_PIN -1 // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) @@ -321,23 +321,23 @@ #define ENABLE_SPI1 #define FORCE_SOFT_SPI - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define DOGLCD_SCK EXP2_09_PIN - #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define DOGLCD_SCK EXP2_02_PIN + #define DOGLCD_MOSI EXP2_06_PIN //#define LCD_BACKLIGHT_PIN -1 //#define LCD_RESET_PIN -1 #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LCD_PINS_DC EXP1_07_PIN - #define DOGLCD_CS EXP1_08_PIN + #define LCD_PINS_DC EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN #define DOGLCD_A0 LCD_PINS_DC #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN - #define NEOPIXEL_PIN EXP1_05_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_SCK EXP2_09_PIN + #define LCD_RESET_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN + #define DOGLCD_MOSI EXP2_06_PIN + #define DOGLCD_SCK EXP2_02_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif @@ -345,11 +345,11 @@ #else - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #endif #define BOARD_ST7920_DELAY_1 96 @@ -361,8 +361,8 @@ #endif // HAS_WIRED_LCD #if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD) - #define BEEPER_PIN EXP1_10_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h index 989010e47f..011d56dfe7 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h @@ -236,58 +236,58 @@ /** * ------ ------ - * (BEEPER) PC5 |10 9 | PE13 (BTN_ENC) (SPI1 MISO) PA6 |10 9 | PA5 (SPI1 SCK) - * (LCD_EN) PD13 | 8 7 | PC6 (LCD_RS) (BTN_EN1) PE8 | 8 7 | PE10 (SPI1 CS) - * (LCD_D4) PE14 6 5 | PE15 (LCD_D5) (BTN_EN2) PE11 6 5 | PA7 (SPI1 MOSI) - * (LCD_D6) PD11 | 4 3 | PD10 (LCD_D7) (SPI1_RS) PE12 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V + * (BEEPER) PC5 | 1 2 | PE13 (BTN_ENC) (SPI1 MISO) PA6 | 1 2 | PA5 (SPI1 SCK) + * (LCD_EN) PD13 | 3 4 | PC6 (LCD_RS) (BTN_EN1) PE8 | 3 4 | PE10 (SPI1 CS) + * (LCD_D4) PE14 5 6 | PE15 (LCD_D5) (BTN_EN2) PE11 5 6 | PA7 (SPI1 MOSI) + * (LCD_D6) PD11 | 7 8 | PD10 (LCD_D7) (SPI1_RS) PE12 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 3.3V * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PD10 -#define EXP1_04_PIN PD11 -#define EXP1_05_PIN PE15 -#define EXP1_06_PIN PE14 -#define EXP1_07_PIN PC6 -#define EXP1_08_PIN PD13 -#define EXP1_09_PIN PE13 -#define EXP1_10_PIN PC5 +#define EXP1_08_PIN PD10 +#define EXP1_07_PIN PD11 +#define EXP1_06_PIN PE15 +#define EXP1_05_PIN PE14 +#define EXP1_04_PIN PC6 +#define EXP1_03_PIN PD13 +#define EXP1_02_PIN PE13 +#define EXP1_01_PIN PC5 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PE12 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PE11 -#define EXP2_07_PIN PE10 -#define EXP2_08_PIN PE8 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PE12 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PE11 +#define EXP2_04_PIN PE10 +#define EXP2_03_PIN PE8 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // // SPI SD Card // #if SD_CONNECTION_IS(LCD) #define ENABLE_SPI1 - #define SDSS EXP2_07_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SDSS EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif // // LCD / Controller // #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN - #define TFT_DC_PIN EXP1_03_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN + #define TFT_DC_PIN EXP1_08_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN EXP1_07_PIN + #define TFT_RESET_PIN EXP1_04_PIN - #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define LCD_BACKLIGHT_PIN EXP1_03_PIN #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI @@ -300,10 +300,10 @@ #define TFT_HEIGHT 320 #endif - #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS - #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK - #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO - #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI + #define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI #define LCD_READ_ID 0xD3 #define LCD_USE_DMA_SPI @@ -328,32 +328,32 @@ #elif HAS_WIRED_LCD - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN #define LCD_BACKLIGHT_PIN -1 // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) #if ENABLED(MKS_MINI_12864) //#define LCD_BACKLIGHT_PIN -1 //#define LCD_RESET_PIN -1 - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - //#define DOGLCD_SCK EXP2_09_PIN - //#define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + //#define DOGLCD_SCK EXP2_02_PIN + //#define DOGLCD_MOSI EXP2_06_PIN // Required for MKS_MINI_12864 with this board //#define MKS_LCD12864B //#undef SHOW_BOOTSCREEN #elif ENABLED(FYSETC_MINI_12864_2_1) - #define LCD_PINS_DC EXP1_07_PIN - #define DOGLCD_CS EXP1_08_PIN + #define LCD_PINS_DC EXP1_04_PIN + #define DOGLCD_CS EXP1_03_PIN #define DOGLCD_A0 LCD_PINS_DC #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN - #define NEOPIXEL_PIN EXP1_05_PIN - #define DOGLCD_MOSI EXP2_05_PIN - #define DOGLCD_SCK EXP2_09_PIN + #define LCD_RESET_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN + #define DOGLCD_MOSI EXP2_06_PIN + #define DOGLCD_SCK EXP2_02_PIN #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif @@ -361,11 +361,11 @@ #else // !MKS_MINI_12864 - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #endif #define BOARD_ST7920_DELAY_1 96 @@ -382,10 +382,10 @@ #endif #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD) - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN #if DISABLED(USE_SPI_DMA_TC) - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h index 1627bb909b..9b50705a90 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h @@ -230,31 +230,31 @@ #endif /** ------ ------ - * (BEEPER) PC5 |10 9 | PE13 (BTN_ENC) (SPI1 MISO) PA6 |10 9 | PA5 (SPI1 SCK) - * (LCD_EN) PD13 | 8 7 | PC6 (LCD_RS) (BTN_EN1) PE8 | 8 7 | PE10 (SPI1 CS) - * (LCD_D4) PE14 6 5 | PE15 (LCD_D5) (BTN_EN2) PE11 6 5 | PA7 (SPI1 MOSI) - * (LCD_D6) PD11 | 4 3 | PD10 (LCD_D7) (SPI DET) PE12 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V + * (BEEPER) PC5 | 1 2 | PE13 (BTN_ENC) (SPI1 MISO) PA6 | 1 2 | PA5 (SPI1 SCK) + * (LCD_EN) PD13 | 3 4 | PC6 (LCD_RS) (BTN_EN1) PE8 | 3 4 | PE10 (SPI1 CS) + * (LCD_D4) PE14 5 6 | PE15 (LCD_D5) (BTN_EN2) PE11 5 6 | PA7 (SPI1 MOSI) + * (LCD_D6) PD11 | 7 8 | PD10 (LCD_D7) (SPI DET) PE12 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 3.3V * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PD10 -#define EXP1_04_PIN PD11 -#define EXP1_05_PIN PE15 -#define EXP1_06_PIN PE14 -#define EXP1_07_PIN PC6 -#define EXP1_08_PIN PD13 -#define EXP1_09_PIN PE13 -#define EXP1_10_PIN PC5 +#define EXP1_08_PIN PD10 +#define EXP1_07_PIN PD11 +#define EXP1_06_PIN PE15 +#define EXP1_05_PIN PE14 +#define EXP1_04_PIN PC6 +#define EXP1_03_PIN PD13 +#define EXP1_02_PIN PE13 +#define EXP1_01_PIN PC5 -#define EXP2_03_PIN -1 // RESET -#define EXP2_04_PIN PE12 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PE11 -#define EXP2_07_PIN PE10 -#define EXP2_08_PIN PE8 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 // RESET +#define EXP2_07_PIN PE12 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PE11 +#define EXP2_04_PIN PE10 +#define EXP2_03_PIN PE8 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // // LCD SD @@ -262,11 +262,11 @@ /* #if SD_CONNECTION_IS(LCD) #define ENABLE_SPI1 - #define SDSS EXP2_07_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SDSS EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN #endif */ @@ -300,15 +300,15 @@ #define TOUCH_ORIENTATION TOUCH_LANDSCAPE #endif - #define TFT_CS_PIN EXP1_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN - #define TFT_DC_PIN EXP1_03_PIN + #define TFT_CS_PIN EXP1_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN + #define TFT_DC_PIN EXP1_08_PIN #define TFT_A0_PIN TFT_DC_PIN - #define TFT_RESET_PIN EXP1_07_PIN - #define LCD_BACKLIGHT_PIN EXP1_08_PIN + #define TFT_RESET_PIN EXP1_04_PIN + #define LCD_BACKLIGHT_PIN EXP1_03_PIN #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN #define TOUCH_BUTTONS_HW_SPI @@ -321,15 +321,15 @@ #define TFT_HEIGHT 320 #endif - #define TOUCH_CS_PIN EXP1_06_PIN // SPI1_NSS - #define TOUCH_SCK_PIN EXP2_09_PIN // SPI1_SCK - #define TOUCH_MISO_PIN EXP2_10_PIN // SPI1_MISO - #define TOUCH_MOSI_PIN EXP2_05_PIN // SPI1_MOSI + #define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS + #define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK + #define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO + #define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #define LCD_READ_ID 0xD3 #define LCD_USE_DMA_SPI @@ -339,22 +339,22 @@ #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN #define LCD_BACKLIGHT_PIN -1 // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) #if ENABLED(MKS_MINI_12864) //#define LCD_BACKLIGHT_PIN -1 //#define LCD_RESET_PIN -1 - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - //#define DOGLCD_SCK EXP2_09_PIN - //#define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + //#define DOGLCD_SCK EXP2_02_PIN + //#define DOGLCD_MOSI EXP2_06_PIN // Required for MKS_MINI_12864 with this board //#define MKS_LCD12864B @@ -362,11 +362,11 @@ #else // !MKS_MINI_12864 - #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D4 EXP1_05_PIN #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #endif #define BOARD_ST7920_DELAY_1 96 diff --git a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h index 1439e6de65..65a396ad3f 100644 --- a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h +++ b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h @@ -199,11 +199,11 @@ /** * ------ - * PA14 |10 9 | PB0 - * PC4 | 8 7 | -- - * PC5 | 6 5 PB13 - * PB12 | 4 3 | PB15 - * GND | 2 1 | 5V + * PA14 | 1 2 | PB0 + * PC4 | 3 4 | -- + * PC5 | 5 6 PB13 + * PB12 | 7 8 | PB15 + * GND | 9 10 | 5V * ------ * EXP1 * @@ -213,30 +213,30 @@ * A remote SD card is currently not supported because the pins routed to the EXP2 * connector are shared with the onboard SD card. */ -#define EXP1_03_PIN PB15 -#define EXP1_04_PIN PB12 -#define EXP1_05_PIN PB13 -#define EXP1_06_PIN PC5 -//#define EXP1_07_PIN -1 -#define EXP1_08_PIN PC4 -#define EXP1_09_PIN PB0 -#define EXP1_10_PIN PA14 +#define EXP1_08_PIN PB15 +#define EXP1_07_PIN PB12 +#define EXP1_06_PIN PB13 +#define EXP1_05_PIN PC5 +//#define EXP1_04_PIN -1 +#define EXP1_03_PIN PC4 +#define EXP1_02_PIN PB0 +#define EXP1_01_PIN PA14 #if ENABLED(CR10_STOCKDISPLAY) /** ------ - * BEEPER |10 9 | ENC - * EN1 | 8 7 | RESET - * EN2 | 6 5 LCD_D4 - * LCD_RS | 4 3 | LCD_EN - * GND | 2 1 | 5V + * BEEPER | 1 2 | ENC + * EN1 | 3 4 | RESET + * EN2 | 5 6 LCD_D4 + * LCD_RS | 7 8 | LCD_EN + * GND | 9 10 | 5V * ------ */ #ifdef DISABLE_JTAGSWD - #define BEEPER_PIN EXP1_10_PIN // Not connected in dev board + #define BEEPER_PIN EXP1_01_PIN // Not connected in dev board #endif - #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN //#define KILL_PIN -1 #define BOARD_ST7920_DELAY_1 600 @@ -245,17 +245,17 @@ #elif ENABLED(MKS_MINI_12864) /** ------ - * SCK |10 9 | ENC - * EN1 | 8 7 | -- - * EN2 | 6 5 A0 - * CS | 4 3 | MOSI - * GND | 2 1 | 5V + * SCK | 1 2 | ENC + * EN1 | 3 4 | -- + * EN2 | 5 6 A0 + * CS | 7 8 | MOSI + * GND | 9 10 | 5V * ------ */ - #define DOGLCD_CS EXP1_04_PIN - #define DOGLCD_A0 EXP1_05_PIN - #define DOGLCD_SCK EXP1_10_PIN - #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_CS EXP1_07_PIN + #define DOGLCD_A0 EXP1_06_PIN + #define DOGLCD_SCK EXP1_01_PIN + #define DOGLCD_MOSI EXP1_08_PIN #define LCD_CONTRAST_INIT 160 #define LCD_CONTRAST_MIN 120 #define LCD_CONTRAST_MAX 180 @@ -269,7 +269,7 @@ #endif #if EITHER(CR10_STOCKDISPLAY, MKS_MINI_12864) - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN + #define BTN_ENC EXP1_02_PIN #endif diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index 66caec588f..e395ee62dd 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -161,37 +161,37 @@ #define POWER_LOSS_PIN PA4 // ?? Power loss / nAC_FAULT #if ENABLED(SDSUPPORT) - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_DETECT_PIN EXP2_07_PIN #define SD_SS_PIN PB15 // USD_CS -> CS for onboard SD #endif /** * ------ ------ - * PC9 |10 9 | PB12 ? |10 9 | ? - * PD7 | 8 7 | PC12 PD6 | 8 7 | ? - * PD1 | 6 5 PD2 PD0 | 6 5 ? - * PD3 | 4 3 | PD4 PB7 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V + * PC9 | 1 2 | PB12 ? | 1 2 | ? + * PD7 | 3 4 | PC12 PD6 | 3 4 | ? + * PD1 | 5 6 PD2 PD0 | 5 6 ? + * PD3 | 7 8 | PD4 PB7 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | 3.3V * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PD4 -#define EXP1_04_PIN PD3 -#define EXP1_05_PIN PD2 -#define EXP1_06_PIN PD1 -#define EXP1_07_PIN PC12 -#define EXP1_08_PIN PD7 -#define EXP1_09_PIN PB12 -#define EXP1_10_PIN PC9 +#define EXP1_08_PIN PD4 +#define EXP1_07_PIN PD3 +#define EXP1_06_PIN PD2 +#define EXP1_05_PIN PD1 +#define EXP1_04_PIN PC12 +#define EXP1_03_PIN PD7 +#define EXP1_02_PIN PB12 +#define EXP1_01_PIN PC9 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PB7 -//#define EXP2_05_PIN ? -#define EXP2_06_PIN PD0 -//#define EXP2_07_PIN ? -#define EXP2_08_PIN PD6 -//#define EXP2_09_PIN ? -//#define EXP2_10_PIN ? +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PB7 +//#define EXP2_06_PIN ? +#define EXP2_05_PIN PD0 +//#define EXP2_04_PIN ? +#define EXP2_03_PIN PD6 +//#define EXP2_02_PIN ? +//#define EXP2_01_PIN ? // // LCD / Controller @@ -202,19 +202,19 @@ #define SDSS PB6 // CS for SD card in LCD #endif - #define BEEPER_PIN EXP1_10_PIN + #define BEEPER_PIN EXP1_01_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN - #define LCD_PINS_ENABLE EXP1_08_PIN - #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_RS EXP1_04_PIN - #define LCD_PINS_D4 EXP1_06_PIN - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #endif diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index 769f10c8a4..f35bdb227f 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -145,25 +145,25 @@ /** * SKR Mini E3 V3.0 * ------ - * (BEEPER) PB5 |10 9 | PA15 (BTN_ENC) - * (BTN_EN1) PA9 | 8 7 | RESET - * (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) - * (LCD_RS) PB8 | 4 3 | PD6 (LCD_EN) - * GND | 2 1 | 5V + * (BEEPER) PB5 | 1 2 | PA15 (BTN_ENC) + * (BTN_EN1) PA9 | 3 4 | RESET + * (BTN_EN2) PA10 5 6 | PB9 (LCD_D4) + * (LCD_RS) PB8 | 7 8 | PD6 (LCD_EN) + * GND | 9 10 | 5V * ------ * EXP1 */ -#define EXP1_09_PIN PA15 -#define EXP1_03_PIN PD6 +#define EXP1_02_PIN PA15 +#define EXP1_08_PIN PD6 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI /** * ------ ------ ------ - * (ENT) |10 9 | (BEEP) |10 9 | |10 9 | - * (RX) | 8 7 | (RX) | 8 7 | (TX) RX | 8 7 | TX - * (TX) 6 5 | (ENT) 6 5 | (BEEP) ENT | 6 5 | BEEP - * (B) | 4 3 | (A) (B) | 4 3 | (A) B | 4 3 | A - * GND | 2 1 | (VCC) GND | 2 1 | VCC GND | 2 1 | VCC + * (ENT) | 1 2 | (BEEP) | 1 2 | | 1 2 | + * (RX) | 3 4 | (RX) | 3 4 | (TX) RX | 3 4 | TX + * (TX) 5 6 | (ENT) 5 6 | (BEEP) ENT | 5 6 | BEEP + * (B) | 7 8 | (A) (B) | 7 8 | (A) B | 7 8 | A + * GND | 9 10 | (VCC) GND | 9 10 | VCC GND | 9 10 | VCC * ------ ------ ------ * EXP1 DWIN DWIN (plug) * @@ -174,8 +174,8 @@ #error "CAUTION! DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" #endif - #define BEEPER_PIN EXP1_09_PIN - #define BTN_EN1 EXP1_03_PIN + #define BEEPER_PIN EXP1_02_PIN + #define BTN_EN1 EXP1_08_PIN #define BTN_EN2 PB8 #define BTN_ENC PB5 @@ -184,13 +184,13 @@ #if ENABLED(CR10_STOCKDISPLAY) #define BEEPER_PIN PB5 - #define BTN_ENC EXP1_09_PIN + #define BTN_ENC EXP1_02_PIN #define BTN_EN1 PA9 #define BTN_EN2 PA10 #define LCD_PINS_RS PB8 - #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 PB9 #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! @@ -200,7 +200,7 @@ #endif #define LCD_PINS_RS PB9 - #define LCD_PINS_ENABLE EXP1_09_PIN + #define LCD_PINS_ENABLE EXP1_02_PIN #define LCD_PINS_D4 PB8 #define LCD_PINS_D5 PA10 #define LCD_PINS_D6 PA9 @@ -209,14 +209,14 @@ #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) - #define BTN_ENC EXP1_09_PIN + #define BTN_ENC EXP1_02_PIN #define BTN_EN1 PA9 #define BTN_EN2 PA10 #define DOGLCD_CS PB8 #define DOGLCD_A0 PB9 #define DOGLCD_SCK PB5 - #define DOGLCD_MOSI EXP1_03_PIN + #define DOGLCD_MOSI EXP1_08_PIN #define FORCE_SOFT_SPI #define LCD_BACKLIGHT_PIN -1 @@ -234,11 +234,11 @@ * * Board Display * ------ ------ - * (BEEPER) PB6 |10 9 | PB5 (SD_DET) 5V |10 9 | GND - * RESET | 8 7 | PA9 (MOD_RESET) -- | 8 7 | (SD_DET) - * PB9 6 5 | PA10 (SD_CS) (MOSI) | 6 5 | -- - * PB7 | 4 3 | PB8 (LCD_CS) (SD_CS) | 4 3 | (LCD_CS) - * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * (BEEPER) PB6 | 1 2 | PB5 (SD_DET) 5V | 1 2 | GND + * RESET | 3 4 | PA9 (MOD_RESET) -- | 3 4 | (SD_DET) + * PB9 5 6 | PA10 (SD_CS) (MOSI) | 5 6 | -- + * PB7 | 7 8 | PB8 (LCD_CS) (SD_CS) | 7 8 | (LCD_CS) + * GND | 9 10 | 5V (SCK) | 9 10 | (MISO) * ------ ------ * EXP1 EXP1 * @@ -272,20 +272,20 @@ * * Board Display * ------ ------ - * (EN2) PB5 |10 9 | PA15(BTN_ENC) 5V |10 9 | GND - * (LCD_CS) PA9 | 8 7 | RST (RESET) -- | 8 7 | -- + * (EN2) PB5 | 1 2 | PA15(BTN_ENC) 5V | 1 2 | GND + * (LCD_CS) PA9 | 3 4 | RST (RESET) -- | 3 4 | -- * (LCD_A0) PA10 |#6 5 | PB9 (EN1) (DIN) | 6 5#| (RESET) - * (LCD_SCK)PB8 | 4 3 | PD6 (MOSI) (LCD_A0) | 4 3 | (LCD_CS) - * GND | 2 1 | 5V (BTN_ENC) | 2 1 | -- + * (LCD_SCK)PB8 | 7 8 | PD6 (MOSI) (LCD_A0) | 7 8 | (LCD_CS) + * GND | 9 10 | 5V (BTN_ENC) | 9 10 | -- * ------ ------ * EXP1 EXP1 * * ------ - * -- |10 9 | -- - * --- (RESET) | 8 7 | -- + * -- | 1 2 | -- + * --- (RESET) | 3 4 | -- * | 3 | (MOSI) | 6 5#| (EN2) - * | 2 | (DIN) -- | 4 3 | (EN1) - * | 1 | (LCD_SCK)| 2 1 | -- + * | 2 | (DIN) -- | 7 8 | (EN1) + * | 1 | (LCD_SCK)| 9 10 | -- * --- ------ * Neopixel EXP2 * @@ -294,7 +294,7 @@ * Check twice index position!!! (marked as # here) * On BTT boards pins from IDC10 connector are numbered in unusual order. */ - #define BTN_ENC EXP1_09_PIN + #define BTN_ENC EXP1_02_PIN #define BTN_EN1 PB9 #define BTN_EN2 PB5 #define BEEPER_PIN -1 @@ -324,11 +324,11 @@ * * Board Display * ------ ------ - * (SD_DET) PB5 |10 9 | PB6 (BEEPER) 5V |10 9 | GND - * (MOD_RESET) PA9 | 8 7 | RESET (RESET) | 8 7 | (SD_DET) - * (SD_CS) PA10 6 5 | PB9 (FREE) (MOSI) | 6 5 | (LCD_CS) - * (LCD_CS) PB8 | 4 3 | PB7 (FREE) (SD_CS) | 4 3 | (MOD_RESET) - * 5V | 2 1 | GND (SCK) | 2 1 | (MISO) + * (SD_DET) PB5 | 1 2 | PB6 (BEEPER) 5V | 1 2 | GND + * (MOD_RESET) PA9 | 3 4 | RESET (RESET) | 3 4 | (SD_DET) + * (SD_CS) PA10 5 6 | PB9 (FREE) (MOSI) | 5 6 | (LCD_CS) + * (LCD_CS) PB8 | 7 8 | PB7 (FREE) (SD_CS) | 7 8 | (MOD_RESET) + * 5V | 9 10 | GND (SCK) | 9 10 | (MISO) * ------ ------ * EXP1 EXP1 * @@ -350,7 +350,7 @@ #define CLCD_SPI_BUS 1 // SPI1 connector - #define BEEPER_PIN EXP1_09_PIN + #define BEEPER_PIN EXP1_02_PIN #define CLCD_MOD_RESET PA9 #define CLCD_SPI_CS PB8 diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h index 02e195a185..f2f1fa255a 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h @@ -326,43 +326,43 @@ /** * ------ ------ - * (BEEPER) PC5 |10 9 | PB0 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) - * (LCD_EN) PB1 | 8 7 | PE8 (LCD_RS) (BTN_EN1) PE7 | 8 7 | PA4 (SD_SS) - * (LCD_D4) PE9 | 6 5 PE10 (LCD_D5) (BTN_EN2) PB2 | 6 5 PA7 (MOSI) - * (LCD_D6) PE11 | 4 3 | PE12 (LCD_D7) (SD_DETECT) PC4 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | -- + * (BEEPER) PC5 | 1 2 | PB0 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK) + * (LCD_EN) PB1 | 3 4 | PE8 (LCD_RS) (BTN_EN1) PE7 | 3 4 | PA4 (SD_SS) + * (LCD_D4) PE9 | 5 6 PE10 (LCD_D5) (BTN_EN2) PB2 | 5 6 PA7 (MOSI) + * (LCD_D6) PE11 | 7 8 | PE12 (LCD_D7) (SD_DETECT) PC4 | 7 8 | RESET + * GND | 9 10 | 5V GND | 9 10 | -- * ------ ------ * EXP1 EXP2 */ -#define EXP1_03_PIN PE12 -#define EXP1_04_PIN PE11 -#define EXP1_05_PIN PE10 -#define EXP1_06_PIN PE9 -#define EXP1_07_PIN PE8 -#define EXP1_08_PIN PB1 -#define EXP1_09_PIN PB0 -#define EXP1_10_PIN PC5 +#define EXP1_08_PIN PE12 +#define EXP1_07_PIN PE11 +#define EXP1_06_PIN PE10 +#define EXP1_05_PIN PE9 +#define EXP1_04_PIN PE8 +#define EXP1_03_PIN PB1 +#define EXP1_02_PIN PB0 +#define EXP1_01_PIN PC5 -#define EXP2_03_PIN -1 -#define EXP2_04_PIN PC4 -#define EXP2_05_PIN PA7 -#define EXP2_06_PIN PB2 -#define EXP2_07_PIN PA4 -#define EXP2_08_PIN PE7 -#define EXP2_09_PIN PA5 -#define EXP2_10_PIN PA6 +#define EXP2_08_PIN -1 +#define EXP2_07_PIN PC4 +#define EXP2_06_PIN PA7 +#define EXP2_05_PIN PB2 +#define EXP2_04_PIN PA4 +#define EXP2_03_PIN PE7 +#define EXP2_02_PIN PA5 +#define EXP2_01_PIN PA6 // // Onboard SD card // Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 // #if SD_CONNECTION_IS(LCD) - #define SDSS EXP2_07_PIN + #define SDSS EXP2_04_PIN #define SD_SS_PIN SDSS - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN + #define SD_SCK_PIN EXP2_02_PIN + #define SD_MISO_PIN EXP2_01_PIN + #define SD_MOSI_PIN EXP2_06_PIN + #define SD_DETECT_PIN EXP2_07_PIN #elif SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT #define SDIO_CLOCK 24000000 // 24MHz @@ -384,46 +384,46 @@ */ // M1 on Driver Expansion Module - #define E2_STEP_PIN EXP2_05_PIN - #define E2_DIR_PIN EXP2_06_PIN - #define E2_ENABLE_PIN EXP2_04_PIN + #define E2_STEP_PIN EXP2_06_PIN + #define E2_DIR_PIN EXP2_05_PIN + #define E2_ENABLE_PIN EXP2_07_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E2_DIAG_PIN EXP1_06_PIN - #define E2_CS_PIN EXP1_05_PIN + #define E2_DIAG_PIN EXP1_05_PIN + #define E2_CS_PIN EXP1_06_PIN #if HAS_TMC_UART - #define E2_SERIAL_TX_PIN EXP1_05_PIN - #define E2_SERIAL_RX_PIN EXP1_05_PIN + #define E2_SERIAL_TX_PIN EXP1_06_PIN + #define E2_SERIAL_RX_PIN EXP1_06_PIN #endif #endif // M2 on Driver Expansion Module - #define E3_STEP_PIN EXP2_08_PIN - #define E3_DIR_PIN EXP2_07_PIN + #define E3_STEP_PIN EXP2_03_PIN + #define E3_DIR_PIN EXP2_04_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E3_ENABLE_PIN EXP1_03_PIN - #define E3_DIAG_PIN EXP1_08_PIN - #define E3_CS_PIN EXP1_07_PIN + #define E3_ENABLE_PIN EXP1_08_PIN + #define E3_DIAG_PIN EXP1_03_PIN + #define E3_CS_PIN EXP1_04_PIN #if HAS_TMC_UART - #define E3_SERIAL_TX_PIN EXP1_07_PIN - #define E3_SERIAL_RX_PIN EXP1_07_PIN + #define E3_SERIAL_TX_PIN EXP1_04_PIN + #define E3_SERIAL_RX_PIN EXP1_04_PIN #endif #else - #define E3_ENABLE_PIN EXP2_04_PIN + #define E3_ENABLE_PIN EXP2_07_PIN #endif // M3 on Driver Expansion Module - #define E4_STEP_PIN EXP2_10_PIN - #define E4_DIR_PIN EXP2_09_PIN + #define E4_STEP_PIN EXP2_01_PIN + #define E4_DIR_PIN EXP2_02_PIN #if !EXP_MOT_USE_EXP2_ONLY - #define E4_ENABLE_PIN EXP1_04_PIN - #define E4_DIAG_PIN EXP1_10_PIN - #define E4_CS_PIN EXP1_09_PIN + #define E4_ENABLE_PIN EXP1_07_PIN + #define E4_DIAG_PIN EXP1_01_PIN + #define E4_CS_PIN EXP1_02_PIN #if HAS_TMC_UART - #define E4_SERIAL_TX_PIN EXP1_09_PIN - #define E4_SERIAL_RX_PIN EXP1_09_PIN + #define E4_SERIAL_TX_PIN EXP1_02_PIN + #define E4_SERIAL_RX_PIN EXP1_02_PIN #endif #else - #define E4_ENABLE_PIN EXP2_04_PIN + #define E4_ENABLE_PIN EXP2_07_PIN #endif #endif // BTT_MOTOR_EXPANSION @@ -434,65 +434,65 @@ #if IS_TFTGLCD_PANEL #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS EXP2_08_PIN + #define TFTGLCD_CS EXP2_03_PIN #endif #elif HAS_WIRED_LCD - #define BEEPER_PIN EXP1_10_PIN - #define BTN_ENC EXP1_09_PIN + #define BEEPER_PIN EXP1_01_PIN + #define BTN_ENC EXP1_02_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS EXP1_04_PIN - - #define BTN_EN1 EXP1_08_PIN - #define BTN_EN2 EXP1_06_PIN - - #define LCD_PINS_ENABLE EXP1_03_PIN - #define LCD_PINS_D4 EXP1_05_PIN - - #elif ENABLED(MKS_MINI_12864) - - #define DOGLCD_A0 EXP1_04_PIN - #define DOGLCD_CS EXP1_05_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - - #else - #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN + #define BTN_EN1 EXP1_03_PIN + #define BTN_EN2 EXP1_05_PIN #define LCD_PINS_ENABLE EXP1_08_PIN #define LCD_PINS_D4 EXP1_06_PIN + #elif ENABLED(MKS_MINI_12864) + + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_06_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #else + + #define LCD_PINS_RS EXP1_04_PIN + + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN + #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS EXP1_08_PIN - #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_04_PIN //#define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally. + #define LCD_RESET_PIN EXP1_05_PIN // 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 EXP1_05_PIN + #define RGB_LED_R_PIN EXP1_06_PIN #endif #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN EXP1_04_PIN + #define RGB_LED_G_PIN EXP1_07_PIN #endif #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN EXP1_03_PIN + #define RGB_LED_B_PIN EXP1_08_PIN #endif #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN EXP1_05_PIN + #define NEOPIXEL_PIN EXP1_06_PIN #endif #endif // !FYSETC_MINI_12864 #if IS_ULTIPANEL - #define LCD_PINS_D5 EXP1_05_PIN - #define LCD_PINS_D6 EXP1_04_PIN - #define LCD_PINS_D7 EXP1_03_PIN + #define LCD_PINS_D5 EXP1_06_PIN + #define LCD_PINS_D6 EXP1_07_PIN + #define LCD_PINS_D7 EXP1_08_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -521,21 +521,21 @@ // // e.g., BTT_TFT35_SPI_V1_0 (480x320, 3.5", SPI Stock Display with Rotary Encoder in BIQU B1 SE) // - #define TFT_CS_PIN EXP2_07_PIN - #define TFT_A0_PIN EXP2_04_PIN - #define TFT_SCK_PIN EXP2_09_PIN - #define TFT_MISO_PIN EXP2_10_PIN - #define TFT_MOSI_PIN EXP2_05_PIN + #define TFT_CS_PIN EXP2_04_PIN + #define TFT_A0_PIN EXP2_07_PIN + #define TFT_SCK_PIN EXP2_02_PIN + #define TFT_MISO_PIN EXP2_01_PIN + #define TFT_MOSI_PIN EXP2_06_PIN - #define TOUCH_INT_PIN EXP1_04_PIN - #define TOUCH_MISO_PIN EXP1_05_PIN - #define TOUCH_MOSI_PIN EXP1_08_PIN - #define TOUCH_SCK_PIN EXP1_06_PIN - #define TOUCH_CS_PIN EXP1_07_PIN + #define TOUCH_INT_PIN EXP1_07_PIN + #define TOUCH_MISO_PIN EXP1_06_PIN + #define TOUCH_MOSI_PIN EXP1_03_PIN + #define TOUCH_SCK_PIN EXP1_05_PIN + #define TOUCH_CS_PIN EXP1_04_PIN - #define BTN_EN1 EXP2_08_PIN - #define BTN_EN2 EXP2_06_PIN - #define BTN_ENC EXP1_09_PIN + #define BTN_EN1 EXP2_03_PIN + #define BTN_EN2 EXP2_05_PIN + #define BTN_ENC EXP1_02_PIN #endif // From 9706cd0d7dc9e09faec2ed2b5ec106dbd22e5c61 Mon Sep 17 00:00:00 2001 From: Arthur Masson Date: Sat, 16 Jul 2022 23:58:18 +0200 Subject: [PATCH 29/31] =?UTF-8?q?=E2=9C=A8=20Polargraph=20M665=20settings?= =?UTF-8?q?=20(#24401)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/G26.cpp | 2 +- Marlin/src/gcode/calibrate/M665.cpp | 39 ++++++++++++----- Marlin/src/gcode/gcode.cpp | 2 +- Marlin/src/gcode/gcode.h | 1 + Marlin/src/module/motion.cpp | 67 +++++++++++++++++++++++++++++ Marlin/src/module/motion.h | 54 +++-------------------- Marlin/src/module/polargraph.cpp | 9 +++- Marlin/src/module/polargraph.h | 3 ++ 8 files changed, 115 insertions(+), 62 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 21fa08fc10..1e436ffd96 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -306,7 +306,7 @@ typedef struct { LIMIT(e.x, X_MIN_POS + 1, X_MAX_POS - 1); #endif - if (position_is_reachable(s.x, s.y) && position_is_reachable(e.x, e.y)) + if (position_is_reachable(s) && position_is_reachable(e)) print_line_from_here_to_there(s, e); } } diff --git a/Marlin/src/gcode/calibrate/M665.cpp b/Marlin/src/gcode/calibrate/M665.cpp index aa21471b60..7dc657a61b 100644 --- a/Marlin/src/gcode/calibrate/M665.cpp +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -86,13 +86,13 @@ * * Parameters: * - * S[segments-per-second] - Segments-per-second + * S[segments] - Segments-per-second * * Without NO_WORKSPACE_OFFSETS: * - * P[theta-psi-offset] - Theta-Psi offset, added to the shoulder (A/X) angle - * T[theta-offset] - Theta offset, added to the elbow (B/Y) angle - * Z[z-offset] - Z offset, added to Z + * P[theta-psi-offset] - Theta-Psi offset, added to the shoulder (A/X) angle + * T[theta-offset] - Theta offset, added to the elbow (B/Y) angle + * Z[z-offset] - Z offset, added to Z * * A, P, and X are all aliases for the shoulder angle * B, T, and Y are all aliases for the elbow angle @@ -152,18 +152,35 @@ * * Parameters: * - * S[segments-per-second] - Segments-per-second + * S[segments] - Segments-per-second + * L[left] - Work area minimum X + * R[right] - Work area maximum X + * T[top] - Work area maximum Y + * B[bottom] - Work area minimum Y + * H[length] - Maximum belt length */ void GcodeSuite::M665() { - if (parser.seenval('S')) - segments_per_second = parser.value_float(); - else - M665_report(); + if (!parser.seen_any()) return M665_report(); + if (parser.seenval('S')) segments_per_second = parser.value_float(); + if (parser.seenval('L')) draw_area_min.x = parser.value_linear_units(); + if (parser.seenval('R')) draw_area_max.x = parser.value_linear_units(); + if (parser.seenval('T')) draw_area_max.y = parser.value_linear_units(); + if (parser.seenval('B')) draw_area_min.y = parser.value_linear_units(); + if (parser.seenval('H')) polargraph_max_belt_len = parser.value_linear_units(); + draw_area_size.x = draw_area_max.x - draw_area_min.x; + draw_area_size.y = draw_area_max.y - draw_area_min.y; } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS " (" STR_S_SEG_PER_SEC ")")); - SERIAL_ECHOLNPGM(" M665 S", segments_per_second); + report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS)); + SERIAL_ECHOLNPGM_P( + PSTR(" M665 S"), LINEAR_UNIT(segments_per_second), + PSTR(" L"), LINEAR_UNIT(draw_area_min.x), + PSTR(" R"), LINEAR_UNIT(draw_area_max.x), + SP_T_STR, LINEAR_UNIT(draw_area_max.y), + SP_B_STR, LINEAR_UNIT(draw_area_min.y), + PSTR(" H"), LINEAR_UNIT(polargraph_max_belt_len) + ); } #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index d0242570eb..1cbd3019c8 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -933,7 +933,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #endif #if IS_KINEMATIC - case 665: M665(); break; // M665: Set Delta/SCARA parameters + case 665: M665(); break; // M665: Set Kinematics parameters #endif #if ENABLED(DELTA) || HAS_EXTRA_ENDSTOPS diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index e754b6dc3d..3657ab2b12 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -262,6 +262,7 @@ * 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) * Set SCARA configurations: "M665 S P T Z (Requires MORGAN_SCARA or MP_SCARA) + * Set Polargraph draw area and belt length: "M665 S L R T B H" * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops. (Requires [XYZ]_DUAL_ENDSTOPS) * M672 - Set/Reset Duet Smart Effector's sensitivity. (Requires DUET_SMART_EFFECTOR and SMART_EFFECTOR_MOD_PIN) * M701 - Load filament (Requires FILAMENT_LOAD_UNLOAD_GCODES) diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index eaf3ab5409..0bf6dfb7d9 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -300,6 +300,73 @@ void report_current_position_projected() { #endif +#if IS_KINEMATIC + + bool position_is_reachable(const_float_t rx, const_float_t ry, const float inset/*=0*/) { + + bool can_reach; + + #if ENABLED(DELTA) + + can_reach = HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + fslop); + + #elif ENABLED(AXEL_TPARA) + + const float R2 = HYPOT2(rx - TPARA_OFFSET_X, ry - TPARA_OFFSET_Y); + can_reach = ( + R2 <= sq(L1 + L2) - inset + #if MIDDLE_DEAD_ZONE_R > 0 + && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) + #endif + ); + + #elif IS_SCARA + + const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); + can_reach = ( + R2 <= sq(L1 + L2) - inset + #if MIDDLE_DEAD_ZONE_R > 0 + && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) + #endif + ); + + #elif ENABLED(POLARGRAPH) + + const float d1 = rx - (draw_area_min.x), + d2 = (draw_area_max.x) - rx, + y = ry - (draw_area_max.y), + a = HYPOT(d1, y), + b = HYPOT(d2, y); + + can_reach = ( + a < polargraph_max_belt_len + 1 + && b < polargraph_max_belt_len + 1 + && (a + b) > _MIN(draw_area_size.x, draw_area_size.y) + ); + + #endif + + return can_reach; + } + +#else // CARTESIAN + + // Return true if the given position is within the machine bounds. + bool position_is_reachable(const_float_t rx, const_float_t ry) { + if (!COORDINATE_OKAY(ry, Y_MIN_POS - fslop, Y_MAX_POS + fslop)) return false; + #if ENABLED(DUAL_X_CARRIAGE) + if (active_extruder) + return COORDINATE_OKAY(rx, X2_MIN_POS - fslop, X2_MAX_POS + fslop); + else + return COORDINATE_OKAY(rx, X1_MIN_POS - fslop, X1_MAX_POS + fslop); + #else + return COORDINATE_OKAY(rx, X_MIN_POS - fslop, X_MAX_POS + fslop); + #endif + } + +#endif // CARTESIAN + + void home_if_needed(const bool keeplev/*=false*/) { if (!all_axes_trusted()) gcode.home_all_axes(keeplev); } diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index ec47818877..ce90947657 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -549,63 +549,21 @@ void home_if_needed(const bool keeplev=false); #endif // Return true if the given point is within the printable area - inline bool position_is_reachable(const_float_t rx, const_float_t ry, const float inset=0) { - #if ENABLED(DELTA) - - return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + fslop); - - #elif ENABLED(POLARGRAPH) - - const float x1 = rx - (X_MIN_POS), x2 = (X_MAX_POS) - rx, y = ry - (Y_MAX_POS), - a = HYPOT(x1, y), b = HYPOT(x2, y); - return a < (POLARGRAPH_MAX_BELT_LEN) + 1 - && b < (POLARGRAPH_MAX_BELT_LEN) + 1 - && (a + b) > _MIN(X_BED_SIZE, Y_BED_SIZE); - - #elif ENABLED(AXEL_TPARA) - - const float R2 = HYPOT2(rx - TPARA_OFFSET_X, ry - TPARA_OFFSET_Y); - return ( - R2 <= sq(L1 + L2) - inset - #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) - #endif - ); - - #elif IS_SCARA - - const float R2 = HYPOT2(rx - SCARA_OFFSET_X, ry - SCARA_OFFSET_Y); - return ( - R2 <= sq(L1 + L2) - inset - #if MIDDLE_DEAD_ZONE_R > 0 - && R2 >= sq(float(MIDDLE_DEAD_ZONE_R)) - #endif - ); - - #endif - } + bool position_is_reachable(const_float_t rx, const_float_t ry, const float inset=0); inline bool position_is_reachable(const xy_pos_t &pos, const float inset=0) { return position_is_reachable(pos.x, pos.y, inset); } -#else // CARTESIAN +#else // Return true if the given position is within the machine bounds. - inline bool position_is_reachable(const_float_t rx, const_float_t ry) { - if (!COORDINATE_OKAY(ry, Y_MIN_POS - fslop, Y_MAX_POS + fslop)) return false; - #if ENABLED(DUAL_X_CARRIAGE) - if (active_extruder) - return COORDINATE_OKAY(rx, X2_MIN_POS - fslop, X2_MAX_POS + fslop); - else - return COORDINATE_OKAY(rx, X1_MIN_POS - fslop, X1_MAX_POS + fslop); - #else - return COORDINATE_OKAY(rx, X_MIN_POS - fslop, X_MAX_POS + fslop); - #endif + bool position_is_reachable(const_float_t rx, const_float_t ry); + inline bool position_is_reachable(const xy_pos_t &pos) { + return position_is_reachable(pos.x, pos.y); } - inline bool position_is_reachable(const xy_pos_t &pos) { return position_is_reachable(pos.x, pos.y); } -#endif // CARTESIAN +#endif /** * Duplication mode diff --git a/Marlin/src/module/polargraph.cpp b/Marlin/src/module/polargraph.cpp index b7eeeee8af..42f99304d7 100644 --- a/Marlin/src/module/polargraph.cpp +++ b/Marlin/src/module/polargraph.cpp @@ -39,8 +39,15 @@ float segments_per_second; // Initialized by settings.load() +xy_pos_t draw_area_min = { X_MIN_POS, Y_MIN_POS }, + draw_area_max = { X_MAX_POS, Y_MAX_POS }; + +xy_float_t draw_area_size = { X_MAX_POS - X_MIN_POS, Y_MAX_POS - Y_MIN_POS }; + +float polargraph_max_belt_len = HYPOT(draw_area_size.x, draw_area_size.y); + void inverse_kinematics(const xyz_pos_t &raw) { - const float x1 = raw.x - (X_MIN_POS), x2 = (X_MAX_POS) - raw.x, y = raw.y - (Y_MAX_POS); + const float x1 = raw.x - (draw_area_min.x), x2 = (draw_area_max.x) - raw.x, y = raw.y - (draw_area_max.y); delta.set(HYPOT(x1, y), HYPOT(x2, y), raw.z); } diff --git a/Marlin/src/module/polargraph.h b/Marlin/src/module/polargraph.h index 0406034253..b465de3287 100644 --- a/Marlin/src/module/polargraph.h +++ b/Marlin/src/module/polargraph.h @@ -29,5 +29,8 @@ #include "../core/macros.h" extern float segments_per_second; +extern xy_pos_t draw_area_min, draw_area_max; +extern xy_float_t draw_area_size; +extern float polargraph_max_belt_len; void inverse_kinematics(const xyz_pos_t &raw); From 8fd6693d533cc95e218cfa84aac710f9ad33b43a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Jul 2022 17:16:37 -0500 Subject: [PATCH 30/31] =?UTF-8?q?=F0=9F=94=A8=20Update=20mfprep=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/git/mfprep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/share/git/mfprep b/buildroot/share/git/mfprep index 0c9e54fe8d..75776cbba3 100755 --- a/buildroot/share/git/mfprep +++ b/buildroot/share/git/mfprep @@ -2,7 +2,7 @@ # # mfprep tag1 [tag2] # -# Find commits in bugfix-2.1.x that are not yet in 2.0.x. +# Find commits in bugfix-2.1.x that are not yet in 2.1.x. # # Specify a version tag to start from, and optional version tag to end at. # For bugfix-2.1.x the tag will be prefixed by dev- to distinguish it from the version tag, From 23926bb4c224a95ea30cdb8eda495b1c623ce324 Mon Sep 17 00:00:00 2001 From: thinkyhead Date: Sun, 17 Jul 2022 00:24:12 +0000 Subject: [PATCH 31/31] [cron] Bump distribution date (2022-07-17) --- Marlin/Version.h | 2 +- Marlin/src/inc/Version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Version.h b/Marlin/Version.h index ab34f3e4bb..c6a04ccaa0 100644 --- a/Marlin/Version.h +++ b/Marlin/Version.h @@ -41,7 +41,7 @@ * here we define this default string as the date where the latest release * version was tagged. */ -//#define STRING_DISTRIBUTION_DATE "2022-07-16" +//#define STRING_DISTRIBUTION_DATE "2022-07-17" /** * Defines a generic printer name to be output to the LCD after booting Marlin. diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 97b750851e..d24953ed6d 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 "2022-07-16" + #define STRING_DISTRIBUTION_DATE "2022-07-17" #endif /**