From 28b101cceff79eaf1401b583a05e0251b1e6e55c Mon Sep 17 00:00:00 2001
From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com>
Date: Fri, 10 Mar 2023 15:56:33 -0800
Subject: [PATCH 001/225] =?UTF-8?q?=E2=9C=A8=20BTT=20Octopus=20Max=20EZ=20?=
=?UTF-8?q?1.0,=20SKR=203.0=20/=203.0=20EZ=20(#25387)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
BTT Octopus Max EZ V1.0 (STM32H723VE/ZE), SKR V3.0 / V3.0 EZ (STM32H723VG)
---
Marlin/src/HAL/STM32/HAL.h | 2 +-
Marlin/src/HAL/STM32/HAL_SPI.cpp | 1 -
Marlin/src/core/boards.h | 1 +
Marlin/src/pins/pins.h | 12 +-
Marlin/src/pins/pins_postprocess.h | 5 +
.../pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 28 +-
Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h | 14 +-
.../pins/stm32g0/pins_BTT_MANTA_M8P_common.h | 9 +-
Marlin/src/pins/stm32h7/env_validate.h | 26 +
.../pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h | 545 ++++++++++++++
.../pins/stm32h7/pins_BTT_SKR_SE_BX_common.h | 4 +-
.../pins/stm32h7/pins_BTT_SKR_V3_0_common.h | 4 +-
.../boards/marlin_BTT_SKR_SE_BX.json | 2 +-
.../PlatformIO/boards/marlin_STM32H723Vx.json | 61 ++
.../PlatformIO/boards/marlin_STM32H723Zx.json | 61 ++
.../variants/MARLIN_H723Vx/PeripheralPins.c | 590 +++++++++++++++
.../variants/MARLIN_H723Vx/PinNamesVar.h | 108 +++
.../variants/MARLIN_H723Vx/ldscript.ld | 174 +++++
.../variant_MARLIN_STM32H723VX.cpp | 273 +++++++
.../variant_MARLIN_STM32H723VX.h | 269 +++++++
.../variants/MARLIN_H723Zx/PeripheralPins.c | 688 ++++++++++++++++++
.../variants/MARLIN_H723Zx/PinNamesVar.h | 117 +++
.../variants/MARLIN_H723Zx/ldscript.ld | 174 +++++
.../variant_MARLIN_STM32H723Zx.cpp | 317 ++++++++
.../variant_MARLIN_STM32H723Zx.h | 308 ++++++++
ini/renamed.ini | 18 +
ini/stm32f1-maple.ini | 1 -
ini/stm32f4.ini | 22 +-
ini/stm32h7.ini | 57 +-
29 files changed, 3834 insertions(+), 57 deletions(-)
create mode 100644 Marlin/src/pins/stm32h7/env_validate.h
create mode 100644 Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
create mode 100644 buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json
create mode 100644 buildroot/share/PlatformIO/boards/marlin_STM32H723Zx.json
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PeripheralPins.c
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PinNamesVar.h
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Vx/ldscript.ld
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Vx/variant_MARLIN_STM32H723VX.cpp
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Vx/variant_MARLIN_STM32H723VX.h
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PeripheralPins.c
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PinNamesVar.h
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Zx/ldscript.ld
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.cpp
create mode 100644 buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.h
diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h
index 3e85aca293..61569c7937 100644
--- a/Marlin/src/HAL/STM32/HAL.h
+++ b/Marlin/src/HAL/STM32/HAL.h
@@ -138,7 +138,7 @@
typedef double isr_float_t; // FPU ops are used for single-precision, so use double for ISRs.
-#ifdef STM32G0B1xx
+#if defined(STM32G0B1xx) || defined(STM32H7xx)
typedef int32_t pin_t;
#else
typedef int16_t pin_t;
diff --git a/Marlin/src/HAL/STM32/HAL_SPI.cpp b/Marlin/src/HAL/STM32/HAL_SPI.cpp
index 40d320d5e8..278d209c47 100644
--- a/Marlin/src/HAL/STM32/HAL_SPI.cpp
+++ b/Marlin/src/HAL/STM32/HAL_SPI.cpp
@@ -78,7 +78,6 @@ static SPISettings spiConfig;
case SPI_SPEED_6: delaySPIFunc = &delaySPI_2000; break; // desired: 250,000 actual: ~210K
default: delaySPIFunc = &delaySPI_4000; break; // desired: 125,000 actual: ~123K
}
- SPI.begin();
}
// Begin SPI transaction, set clock, bit order, data mode
diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h
index bdf86392c9..f861e8864f 100644
--- a/Marlin/src/core/boards.h
+++ b/Marlin/src/core/boards.h
@@ -452,6 +452,7 @@
#define BOARD_BTT_SKR_SE_BX_V3 6005 // BigTreeTech SKR SE BX V3.0 (STM32H743II)
#define BOARD_BTT_SKR_V3_0 6006 // BigTreeTech SKR V3.0 (STM32H743VG)
#define BOARD_BTT_SKR_V3_0_EZ 6007 // BigTreeTech SKR V3.0 EZ (STM32H743VG)
+#define BOARD_BTT_OCTOPUS_MAX_EZ_V1_0 6008 // BigTreeTech Octopus Max EZ V1.0 (STM32H723VE / STM32H723ZE)
//
// Espressif ESP32 WiFi
diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index 1c45b0b155..721e037b8c 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -666,11 +666,11 @@
#elif MB(BTT_SKR_V2_0_REV_B)
#include "stm32f4/pins_BTT_SKR_V2_0_REV_B.h" // STM32F4 env:BIGTREE_SKR_2 env:BIGTREE_SKR_2_USB env:BIGTREE_SKR_2_USB_debug env:BIGTREE_SKR_2_F429 env:BIGTREE_SKR_2_F429_USB env:BIGTREE_SKR_2_F429_USB_debug
#elif MB(BTT_OCTOPUS_V1_0)
- #include "stm32f4/pins_BTT_OCTOPUS_V1_0.h" // STM32F4 env:BIGTREE_OCTOPUS_V1 env:BIGTREE_OCTOPUS_V1_USB
+ #include "stm32f4/pins_BTT_OCTOPUS_V1_0.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_USB
#elif MB(BTT_OCTOPUS_V1_1)
- #include "stm32f4/pins_BTT_OCTOPUS_V1_1.h" // STM32F4 env:BIGTREE_OCTOPUS_V1 env:BIGTREE_OCTOPUS_V1_USB env:BIGTREE_OCTOPUS_V1_F407 env:BIGTREE_OCTOPUS_V1_F407_USB
+ #include "stm32f4/pins_BTT_OCTOPUS_V1_1.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_USB env:STM32F429ZG_btt env:STM32F429ZG_btt_USB env:STM32F407ZE_btt env:STM32F407ZE_btt_USB
#elif MB(BTT_OCTOPUS_PRO_V1_0)
- #include "stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h" // STM32F4 env:BIGTREE_OCTOPUS_V1 env:BIGTREE_OCTOPUS_V1_USB env:BIGTREE_OCTOPUS_PRO_V1_F429 env:BIGTREE_OCTOPUS_PRO_V1_F429_USB
+ #include "stm32f4/pins_BTT_OCTOPUS_PRO_V1_0.h" // STM32F4 env:STM32F446ZE_btt env:STM32F446ZE_btt_USB env:STM32F429ZG_btt env:STM32F429ZG_btt_USB env:STM32H723Zx_btt
#elif MB(LERDGE_K)
#include "stm32f4/pins_LERDGE_K.h" // STM32F4 env:LERDGEK env:LERDGEK_usb_flash_drive
#elif MB(LERDGE_S)
@@ -741,9 +741,11 @@
#elif MB(BTT_SKR_SE_BX_V3)
#include "stm32h7/pins_BTT_SKR_SE_BX_V3.h" // STM32H7 env:BTT_SKR_SE_BX
#elif MB(BTT_SKR_V3_0)
- #include "stm32h7/pins_BTT_SKR_V3_0.h" // STM32H7 env:STM32H743Vx_btt
+ #include "stm32h7/pins_BTT_SKR_V3_0.h" // STM32H7 env:STM32H723Vx_btt env:STM32H743Vx_btt
#elif MB(BTT_SKR_V3_0_EZ)
- #include "stm32h7/pins_BTT_SKR_V3_0_EZ.h" // STM32H7 env:STM32H743Vx_btt
+ #include "stm32h7/pins_BTT_SKR_V3_0_EZ.h" // STM32H7 env:STM32H723Vx_btt env:STM32H743Vx_btt
+#elif MB(BTT_OCTOPUS_MAX_EZ_V1_0)
+ #include "stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h" // STM32H7 env:STM32H723Vx_btt env:STM32H723Zx_btt
#elif MB(TEENSY41)
#include "teensy4/pins_TEENSY41.h" // Teensy-4.x env:teensy41
#elif MB(T41U5XBB)
diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h
index 5b5cbcd214..8906c3cafb 100644
--- a/Marlin/src/pins/pins_postprocess.h
+++ b/Marlin/src/pins/pins_postprocess.h
@@ -487,6 +487,11 @@
#define NUM_SERVO_PLUGS 4
#endif
+// Only used within pins files
+#undef NEEDS_X_MINMAX
+#undef NEEDS_Y_MINMAX
+#undef NEEDS_Z_MINMAX
+
//
// Assign endstop pins for boards with only 3 connectors
//
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 b3d97ae059..a25c2339f2 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h
@@ -27,13 +27,17 @@
#define USES_DIAG_JUMPERS
// Onboard I2C EEPROM
-#define I2C_EEPROM
-#define MARLIN_EEPROM_SIZE 0x1000 // 4K (AT24C32)
-#define I2C_SCL_PIN PB8
-#define I2C_SDA_PIN PB9
+#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM)
+ #undef NO_EEPROM_SELECTED
+ #define I2C_EEPROM
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4K (AT24C32)
+ #define SOFT_I2C_EEPROM // Force the use of Software I2C
+ #define I2C_SCL_PIN PB8
+ #define I2C_SDA_PIN PB9
+#endif
// Avoid conflict with TIMER_TONE
-#define STEP_TIMER 10
+#define STEP_TIMER 8
//
// Servos
@@ -70,13 +74,13 @@
#if HAS_EXTRA_ENDSTOPS
#define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES
#if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_)
- #define NEEDS_X_MINMAX 1
+ #define NEEDS_X_MINMAX
#endif
#if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_)
- #define NEEDS_Y_MINMAX 1
+ #define NEEDS_Y_MINMAX
#endif
#if _ENDSTOP_IS_ANY(_ZMIN_) || _ENDSTOP_IS_ANY(_ZMAX_)
- #define NEEDS_Z_MINMAX 1
+ #define NEEDS_Z_MINMAX
#endif
#undef _ENDSTOP_IS_ANY
#endif
@@ -109,7 +113,7 @@
#else
#define Y_MIN_PIN E1_DIAG_PIN // E1DET
#endif
-#elif NEEDS_Y_MINMAX
+#elif ENABLED(NEEDS_Y_MINMAX)
#ifndef Y_MIN_PIN
#define Y_MIN_PIN Y_DIAG_PIN // Y-STOP
#endif
@@ -127,7 +131,7 @@
#else
#define Z_MIN_PIN E2_DIAG_PIN // PWRDET
#endif
-#elif NEEDS_Z_MINMAX
+#elif ENABLED(NEEDS_Z_MINMAX)
#ifndef Z_MIN_PIN
#define Z_MIN_PIN Z_DIAG_PIN // Z-STOP
#endif
@@ -138,10 +142,6 @@
#define Z_STOP_PIN Z_DIAG_PIN // Z-STOP
#endif
-#undef NEEDS_X_MINMAX
-#undef NEEDS_Y_MINMAX
-#undef NEEDS_Z_MINMAX
-
//
// Filament Runout Sensor
//
diff --git a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
index d00b21c30b..3f0d4e5ee9 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
@@ -59,13 +59,13 @@
#if HAS_EXTRA_ENDSTOPS
#define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES
#if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_)
- #define NEEDS_X_MINMAX 1
+ #define NEEDS_X_MINMAX
#endif
#if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_)
- #define NEEDS_Y_MINMAX 1
+ #define NEEDS_Y_MINMAX
#endif
#if _ENDSTOP_IS_ANY(_ZMIN_) || _ENDSTOP_IS_ANY(_ZMAX_)
- #define NEEDS_Z_MINMAX 1
+ #define NEEDS_Z_MINMAX
#endif
#undef _ENDSTOP_IS_ANY
#endif
@@ -88,7 +88,7 @@
#ifdef Y_STALL_SENSITIVITY
#define Y_STOP_PIN Y_DIAG_PIN // Y-
-#elif NEEDS_Y_MINMAX
+#elif ENABLED(NEEDS_Y_MINMAX)
#ifndef Y_MIN_PIN
#define Y_MIN_PIN Y_DIAG_PIN // Y-
#endif
@@ -101,7 +101,7 @@
#ifdef Z_STALL_SENSITIVITY
#define Z_STOP_PIN Z_DIAG_PIN // Z-
-#elif NEEDS_Z_MINMAX
+#elif ENABLED(NEEDS_Z_MINMAX)
#ifndef Z_MIN_PIN
#define Z_MIN_PIN Z_DIAG_PIN // Z-
#endif
@@ -118,10 +118,6 @@
#endif
#endif
-#undef NEEDS_X_MINMAX
-#undef NEEDS_Y_MINMAX
-#undef NEEDS_Z_MINMAX
-
//
// Steppers
//
diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
index 0d4a74b6f9..6516538c44 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
@@ -81,10 +81,10 @@
#if HAS_EXTRA_ENDSTOPS
#define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES
#if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_)
- #define NEEDS_X_MINMAX 1
+ #define NEEDS_X_MINMAX
#endif
#if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_)
- #define NEEDS_Y_MINMAX 1
+ #define NEEDS_Y_MINMAX
#endif
#undef _ENDSTOP_IS_ANY
#endif
@@ -117,7 +117,7 @@
#else
#define Y_MIN_PIN E1_DIAG_PIN // MIN6
#endif
-#elif NEEDS_Y_MINMAX
+#elif ENABLED(NEEDS_Y_MINMAX)
#ifndef Y_MIN_PIN
#define Y_MIN_PIN Y_DIAG_PIN // MIN2
#endif
@@ -130,9 +130,6 @@
#define Z_STOP_PIN Z_DIAG_PIN // MIN3
-#undef NEEDS_X_MINMAX
-#undef NEEDS_Y_MINMAX
-
//
// Filament Runout Sensors
//
diff --git a/Marlin/src/pins/stm32h7/env_validate.h b/Marlin/src/pins/stm32h7/env_validate.h
new file mode 100644
index 0000000000..0c515e5df6
--- /dev/null
+++ b/Marlin/src/pins/stm32h7/env_validate.h
@@ -0,0 +1,26 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#if NOT_TARGET(STM32H7)
+ #error "Oops! Select an STM32H7 board in 'Tools > Board.'"
+#endif
diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
new file mode 100644
index 0000000000..80ea354982
--- /dev/null
+++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
@@ -0,0 +1,545 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+#include "env_validate.h"
+
+#define BOARD_INFO_NAME "OCTOPUS MAX EZ V1.0"
+
+#define USES_DIAG_JUMPERS
+
+// Onboard I2C EEPROM
+#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM)
+ #undef NO_EEPROM_SELECTED
+ #define I2C_EEPROM
+ #define SOFT_I2C_EEPROM // Force the use of Software I2C
+ #define I2C_SCL_PIN PB10
+ #define I2C_SDA_PIN PB11
+ #define MARLIN_EEPROM_SIZE 0x1000 // 4KB
+#endif
+
+// Avoid conflict with TIMER_TONE
+#define STEP_TIMER 8
+
+//
+// Servos
+//
+#define SERVO0_PIN PB14
+
+//
+// Misc. Functions
+//
+#define LED_PIN PA14
+
+//
+// Trinamic Stallguard pins
+//
+#define X_DIAG_PIN PF0 // M1-STOP
+#define Y_DIAG_PIN PF2 // M2-STOP
+#define Z_DIAG_PIN PF4 // M3-STOP
+#define Z2_DIAG_PIN PF3 // M4-STOP
+#define E0_DIAG_PIN PF1 // M5-STOP
+#define E1_DIAG_PIN PC15 // M6-STOP
+#define E2_DIAG_PIN PF12 // PWRDET
+
+//
+// Z Probe (when not Z_MIN_PIN)
+//
+#ifndef Z_MIN_PROBE_PIN
+ #define Z_MIN_PROBE_PIN PB15
+#endif
+
+//
+// Check for additional used endstop pins
+//
+#if HAS_EXTRA_ENDSTOPS
+ #define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES
+ #if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_)
+ #define NEEDS_X_MINMAX
+ #endif
+ #if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_)
+ #define NEEDS_Y_MINMAX
+ #endif
+ #if _ENDSTOP_IS_ANY(_ZMIN_) || _ENDSTOP_IS_ANY(_ZMAX_)
+ #define NEEDS_Z_MINMAX
+ #endif
+ #undef _ENDSTOP_IS_ANY
+#endif
+
+//
+// Limit Switches
+//
+#ifdef X_STALL_SENSITIVITY
+ #define X_STOP_PIN X_DIAG_PIN
+ #if X_HOME_TO_MIN
+ #define X_MAX_PIN E0_DIAG_PIN // E0DET
+ #else
+ #define X_MIN_PIN E0_DIAG_PIN // E0DET
+ #endif
+#elif EITHER(DUAL_X_CARRIAGE, NEEDS_X_MINMAX)
+ #ifndef X_MIN_PIN
+ #define X_MIN_PIN X_DIAG_PIN // X-STOP
+ #endif
+ #ifndef X_MAX_PIN
+ #define X_MAX_PIN E0_DIAG_PIN // E0DET
+ #endif
+#else
+ #define X_STOP_PIN X_DIAG_PIN // X-STOP
+#endif
+
+#ifdef Y_STALL_SENSITIVITY
+ #define Y_STOP_PIN Y_DIAG_PIN
+ #if Y_HOME_TO_MIN
+ #define Y_MAX_PIN E1_DIAG_PIN // E1DET
+ #else
+ #define Y_MIN_PIN E1_DIAG_PIN // E1DET
+ #endif
+#elif ENABLED(NEEDS_Y_MINMAX)
+ #ifndef Y_MIN_PIN
+ #define Y_MIN_PIN Y_DIAG_PIN // Y-STOP
+ #endif
+ #ifndef Y_MAX_PIN
+ #define Y_MAX_PIN E1_DIAG_PIN // E1DET
+ #endif
+#else
+ #define Y_STOP_PIN Y_DIAG_PIN // Y-STOP
+#endif
+
+#ifdef Z_STALL_SENSITIVITY
+ #define Z_STOP_PIN Z_DIAG_PIN
+ #if Z_HOME_TO_MIN
+ #define Z_MAX_PIN E2_DIAG_PIN // PWRDET
+ #else
+ #define Z_MIN_PIN E2_DIAG_PIN // PWRDET
+ #endif
+#elif ENABLED(NEEDS_Z_MINMAX)
+ #ifndef Z_MIN_PIN
+ #define Z_MIN_PIN Z_DIAG_PIN // Z-STOP
+ #endif
+ #ifndef Z_MAX_PIN
+ #define Z_MAX_PIN E2_DIAG_PIN // PWRDET
+ #endif
+#else
+ #define Z_STOP_PIN Z_DIAG_PIN // Z-STOP
+#endif
+
+//
+// Filament Runout Sensor
+//
+#define FIL_RUNOUT_PIN PF1 // E0DET
+#define FIL_RUNOUT2_PIN PF15 // E1DET
+
+//
+// Power Supply Control
+//
+#ifndef PS_ON_PIN
+ #define PS_ON_PIN PF13 // PS-ON
+#endif
+
+//
+// Power Loss Detection
+//
+#ifndef POWER_LOSS_PIN
+ #define POWER_LOSS_PIN PF12 // PWRDET
+#endif
+
+//
+// Steppers
+//
+#define X_STEP_PIN PC13 // MOTOR 1
+#define X_DIR_PIN PC14
+#define X_ENABLE_PIN PE6
+#ifndef X_CS_PIN
+ #define X_CS_PIN PG14
+#endif
+
+#define Y_STEP_PIN PE4 // MOTOR 2
+#define Y_DIR_PIN PE5
+#define Y_ENABLE_PIN PE3
+#ifndef Y_CS_PIN
+ #define Y_CS_PIN PG13
+#endif
+
+#define Z_STEP_PIN PE1 // MOTOR 3
+#define Z_DIR_PIN PE0
+#define Z_ENABLE_PIN PE2
+#ifndef Z_CS_PIN
+ #define Z_CS_PIN PG12
+#endif
+
+#define Z2_STEP_PIN PB8 // MOTOR 4
+#define Z2_DIR_PIN PB9
+#define Z2_ENABLE_PIN PB7
+#ifndef Z2_CS_PIN
+ #define Z2_CS_PIN PG11
+#endif
+
+#define E0_STEP_PIN PB5 // MOTOR 5
+#define E0_DIR_PIN PB4
+#define E0_ENABLE_PIN PB6
+#ifndef E0_CS_PIN
+ #define E0_CS_PIN PG10
+#endif
+
+#define E1_STEP_PIN PG15 // MOTOR 6
+#define E1_DIR_PIN PB3
+#define E1_ENABLE_PIN PD5
+#ifndef E1_CS_PIN
+ #define E1_CS_PIN PG9
+#endif
+
+#define E2_STEP_PIN PD3 // MOTOR 7
+#define E2_DIR_PIN PD2
+#define E2_ENABLE_PIN PD4
+#ifndef E2_CS_PIN
+ #define E2_CS_PIN PD7
+#endif
+
+#define E3_STEP_PIN PA10 // MOTOR 8
+#define E3_DIR_PIN PA9
+#define E3_ENABLE_PIN PA15
+#ifndef E3_CS_PIN
+ #define E3_CS_PIN PD6
+#endif
+
+#define E4_STEP_PIN PA8 // MOTOR 9
+#define E4_DIR_PIN PC7
+#define E4_ENABLE_PIN PC9
+#ifndef E4_CS_PIN
+ #define E4_CS_PIN PG8
+#endif
+
+#define E5_STEP_PIN PG6 // MOTOR 10
+#define E5_DIR_PIN PC6
+#define E5_ENABLE_PIN PC8
+#ifndef E5_CS_PIN
+ #define E5_CS_PIN PG7
+#endif
+
+//
+// Temperature Sensors
+//
+#define TEMP_BED_PIN PB1 // TB
+#define TEMP_0_PIN PB0 // TH0
+#define TEMP_1_PIN PC5 // TH1
+#define TEMP_2_PIN PC4 // TH2
+#define TEMP_3_PIN PA7 // TH3
+
+//
+// Heaters / Fans
+//
+#define HEATER_BED_PIN PF5 // Hotbed
+#define HEATER_0_PIN PF6 // Heater0
+#define HEATER_1_PIN PA0 // Heater1
+#define HEATER_2_PIN PF9 // Heater2
+#define HEATER_3_PIN PF7 // Heater3
+
+#define FAN_PIN PA6 // Fan0
+#define FAN1_PIN PA5 // Fan1
+#define FAN2_PIN PA4 // Fan2
+#define FAN3_PIN PA3 // Fan3
+#define FAN4_PIN PA1 // 4 wire Fan4
+#define FAN5_PIN PF8 // 4 wire Fan5
+#define FAN6_PIN PA2 // 4 wire Fan6
+
+//
+// SD Support
+//
+#ifndef SDCARD_CONNECTION
+ #if HAS_WIRED_LCD
+ #define SDCARD_CONNECTION LCD
+ #else
+ #define SDCARD_CONNECTION ONBOARD
+ #endif
+#endif
+
+//
+// Software SPI pins for TMC2130 stepper drivers
+//
+#if ENABLED(TMC_USE_SW_SPI)
+ #ifndef TMC_SW_MOSI
+ #define TMC_SW_MOSI PE14
+ #endif
+ #ifndef TMC_SW_MISO
+ #define TMC_SW_MISO PE13
+ #endif
+ #ifndef TMC_SW_SCK
+ #define TMC_SW_SCK PE12
+ #endif
+#endif
+
+#if HAS_TMC_UART
+ /**
+ * TMC2208/TMC2209 stepper drivers
+ *
+ * Hardware serial communication ports.
+ * If undefined software serial is used according to the pins below
+ */
+ //#define X_HARDWARE_SERIAL Serial1
+ //#define X2_HARDWARE_SERIAL Serial1
+ //#define Y_HARDWARE_SERIAL Serial1
+ //#define Y2_HARDWARE_SERIAL Serial1
+ //#define Z_HARDWARE_SERIAL Serial1
+ //#define Z2_HARDWARE_SERIAL Serial1
+ //#define E0_HARDWARE_SERIAL Serial1
+ //#define E1_HARDWARE_SERIAL Serial1
+ //#define E2_HARDWARE_SERIAL Serial1
+ //#define E3_HARDWARE_SERIAL Serial1
+ //#define E4_HARDWARE_SERIAL Serial1
+
+ #define X_SERIAL_TX_PIN PG14
+ #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
+
+ #define Y_SERIAL_TX_PIN PG13
+ #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
+
+ #define Z_SERIAL_TX_PIN PG12
+ #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
+
+ #define Z2_SERIAL_TX_PIN PG11
+ #define Z2_SERIAL_RX_PIN Z2_SERIAL_TX_PIN
+
+ #define E0_SERIAL_TX_PIN PG10
+ #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
+
+ #define E1_SERIAL_TX_PIN PG9
+ #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
+
+ #define E2_SERIAL_TX_PIN PD7
+ #define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
+
+ #define E3_SERIAL_TX_PIN PD6
+ #define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
+
+ #define E4_SERIAL_TX_PIN PG8
+ #define E4_SERIAL_RX_PIN E3_SERIAL_TX_PIN
+
+ #define E5_SERIAL_TX_PIN PG7
+ #define E5_SERIAL_RX_PIN E3_SERIAL_TX_PIN
+
+ // Reduce baud rate to improve software serial reliability
+ #define TMC_BAUD_RATE 19200
+#endif
+
+/**
+ * ----
+ * (MISO) PE13 | 1 |
+ * (SCK) PE12 | 2 |
+ * (BTN_EN1) PG5 | 3 |
+ * (SD_SS) PE11 | 4 |
+ * (BTN_EN2) PG4 | 5 |
+ * (MOSI) PE14 | 6 |
+ * (SD_DETECT) PG3 | 7 |
+ * RESET | 8 |
+ * (BEEPER) PG2 | 9 |
+ * (BTN_ENC) PD15 | 10 |
+ * (LCD_EN) PD14 | 11 |
+ * (LCD_RS) PD13 | 12 |
+ * (LCD_D4) PD12 | 13 |
+ * (LCD_D5) PD11 | 14 |
+ * (LCD_D6) PD10 | 15 |
+ * (LCD_D7) PE15 | 16 |
+ * GND | 17 |
+ * 5V | 18 |
+ * ----
+ * LCD
+ */
+
+#define EXP1_01_PIN PG2
+#define EXP1_02_PIN PD15
+#define EXP1_03_PIN PD14
+#define EXP1_04_PIN PD13
+#define EXP1_05_PIN PD12
+#define EXP1_06_PIN PD11
+#define EXP1_07_PIN PD10
+#define EXP1_08_PIN PE15
+
+#define EXP2_01_PIN PE13
+#define EXP2_02_PIN PE12
+#define EXP2_03_PIN PG5
+#define EXP2_04_PIN PE11
+#define EXP2_05_PIN PG4
+#define EXP2_06_PIN PE14
+#define EXP2_07_PIN PG3
+#define EXP2_08_PIN -1
+
+//
+// Onboard SD card
+// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
+//
+#if SD_CONNECTION_IS(ONBOARD)
+ #ifndef SD_DETECT_STATE
+ #define SD_DETECT_STATE HIGH
+ #elif SD_DETECT_STATE == LOW
+ #error "BOARD_BTT_OCTOPUS_MAX_EZ onboard SD requires SD_DETECT_STATE set to HIGH."
+ #endif
+ #define SDSS PB12
+ #define SD_SS_PIN SDSS
+ #define SD_SCK_PIN PE12
+ #define SD_MISO_PIN PE13
+ #define SD_MOSI_PIN PE14
+ #define SD_DETECT_PIN PB13
+ #define SOFTWARE_SPI
+#elif SD_CONNECTION_IS(LCD)
+ #define SDSS EXP2_04_PIN
+ #define SD_SS_PIN SDSS
+ #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
+ #define SOFTWARE_SPI
+#elif SD_CONNECTION_IS(CUSTOM_CABLE)
+ #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board"
+#endif
+
+//
+// LCDs and Controllers
+//
+#if IS_TFTGLCD_PANEL
+
+ #if ENABLED(TFTGLCD_PANEL_SPI)
+ #define TFTGLCD_CS EXP2_03_PIN
+ #endif
+
+#elif HAS_WIRED_LCD
+
+ #define BEEPER_PIN EXP1_01_PIN
+ #define BTN_ENC EXP1_02_PIN
+
+ #if ENABLED(CR10_STOCKDISPLAY)
+
+ #define LCD_PINS_RS EXP1_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_PINS_ENABLE EXP1_03_PIN
+ #define LCD_PINS_D4 EXP1_05_PIN
+
+ #if ENABLED(FYSETC_MINI_12864)
+ #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 SOFTWARE_SPI
+ #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_BACKLIGHT_PIN -1
+ #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_06_PIN
+ #endif
+ #ifndef RGB_LED_G_PIN
+ #define RGB_LED_G_PIN EXP1_07_PIN
+ #endif
+ #ifndef RGB_LED_B_PIN
+ #define RGB_LED_B_PIN EXP1_08_PIN
+ #endif
+ #elif ENABLED(FYSETC_MINI_12864_2_1)
+ #define NEOPIXEL_PIN EXP1_06_PIN
+ #endif
+ #endif // !FYSETC_MINI_12864
+
+ #if IS_ULTIPANEL
+ #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
+
+ #endif
+
+ #endif
+#endif // HAS_WIRED_LCD
+
+// Alter timing for graphical display
+#if IS_U8GLIB_ST7920
+ #define BOARD_ST7920_DELAY_1 120
+ #define BOARD_ST7920_DELAY_2 80
+ #define BOARD_ST7920_DELAY_3 580
+#endif
+
+#if HAS_SPI_TFT
+ #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_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_03_PIN
+ #define BTN_EN2 EXP2_05_PIN
+ #define BTN_ENC EXP1_02_PIN
+#endif
+
+//
+// NeoPixel LED
+//
+#ifndef NEOPIXEL_PIN
+ #define NEOPIXEL_PIN PE10
+#endif
+
+#ifndef NEOPIXEL2_PIN
+ #define NEOPIXEL2_PIN PE9
+#endif
+
+//
+// WIFI
+//
+
+/**
+ * -------
+ * GND | 9 | | 8 | 3.3V
+ * (ESP-CS) PG1 | 10 | | 7 | PB15 (ESP-MOSI)
+ * 3.3V | 11 | | 6 | PB14 (ESP-MISO)
+ * (ESP-IO0) PG0 | 12 | | 5 | PB13 (ESP-CLK)
+ * (ESP-IO4) PF15 | 13 | | 4 | --
+ * -- | 14 | | 3 | 3.3V (ESP-EN)
+ * (ESP-RX) PE7 | 15 | | 2 | --
+ * (ESP-TX) PE8 | 16 | | 1 | PB2 (ESP-RST)
+ * -------
+ * WIFI
+ */
+#define ESP_WIFI_MODULE_COM 7 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this
+#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2
+#define ESP_WIFI_MODULE_RESET_PIN PB2
+#define ESP_WIFI_MODULE_GPIO0_PIN PG0
+#define ESP_WIFI_MODULE_GPIO4_PIN PF15
diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h
index 1ee7846c93..d06e27d9c0 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h
@@ -21,9 +21,7 @@
*/
#pragma once
-#if NOT_TARGET(STM32H7)
- #error "Oops! Select an STM32H7 board in 'Tools > Board.'"
-#endif
+#include "env_validate.h"
#define DEFAULT_MACHINE_NAME "Biqu BX"
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 eaceafe29e..809a1f3f8c 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
@@ -21,9 +21,7 @@
*/
#pragma once
-#if NOT_TARGET(STM32H7)
- #error "Oops! Select an STM32H7 board in 'Tools > Board.'"
-#endif
+#include "env_validate.h"
// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION
// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
diff --git a/buildroot/share/PlatformIO/boards/marlin_BTT_SKR_SE_BX.json b/buildroot/share/PlatformIO/boards/marlin_BTT_SKR_SE_BX.json
index 65735d433b..3ed21e393b 100644
--- a/buildroot/share/PlatformIO/boards/marlin_BTT_SKR_SE_BX.json
+++ b/buildroot/share/PlatformIO/boards/marlin_BTT_SKR_SE_BX.json
@@ -3,7 +3,7 @@
"core": "stm32",
"cpu": "cortex-m7",
"extra_flags": "-DSTM32H743xx",
- "f_cpu": "400000000L",
+ "f_cpu": "480000000L",
"mcu": "stm32h743iit6",
"variant": "MARLIN_BTT_SKR_SE_BX"
},
diff --git a/buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json b/buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json
new file mode 100644
index 0000000000..73620c162d
--- /dev/null
+++ b/buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json
@@ -0,0 +1,61 @@
+{
+ "build": {
+ "core": "stm32",
+ "cpu": "cortex-m7",
+ "extra_flags": "-DSTM32H7xx -DSTM32H723xx",
+ "f_cpu": "550000000L",
+ "mcu": "stm32h723vet6",
+ "product_line": "STM32H723xx",
+ "variant": "MARLIN_H723vx"
+ },
+ "connectivity": [
+ "can",
+ "ethernet"
+ ],
+ "debug": {
+ "jlink_device": "STM32H723VE",
+ "openocd_target": "stm32h7x",
+ "svd_path": "STM32H7x3.svd",
+ "tools": {
+ "stlink": {
+ "server": {
+ "arguments": [
+ "-f",
+ "scripts/interface/stlink.cfg",
+ "-c",
+ "transport select hla_swd",
+ "-f",
+ "scripts/target/stm32h7x.cfg",
+ "-c",
+ "reset_config none"
+ ],
+ "executable": "bin/openocd",
+ "package": "tool-openocd"
+ }
+ }
+ }
+ },
+ "frameworks": [
+ "arduino",
+ "stm32cube"
+ ],
+ "name": "STM32H723VE (564k RAM. 512k Flash)",
+ "upload": {
+ "disable_flushing": false,
+ "maximum_ram_size": 577536,
+ "maximum_size": 524288,
+ "protocol": "stlink",
+ "protocols": [
+ "stlink",
+ "dfu",
+ "jlink",
+ "cmsis-dap"
+ ],
+ "offset_address": "0x8020000",
+ "require_upload_port": true,
+ "use_1200bps_touch": false,
+ "wait_for_upload_port": false
+ },
+ "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32h723ze.html",
+ "vendor": "ST"
+}
diff --git a/buildroot/share/PlatformIO/boards/marlin_STM32H723Zx.json b/buildroot/share/PlatformIO/boards/marlin_STM32H723Zx.json
new file mode 100644
index 0000000000..8525793c4e
--- /dev/null
+++ b/buildroot/share/PlatformIO/boards/marlin_STM32H723Zx.json
@@ -0,0 +1,61 @@
+{
+ "build": {
+ "core": "stm32",
+ "cpu": "cortex-m7",
+ "extra_flags": "-DSTM32H7xx -DSTM32H723xx",
+ "f_cpu": "550000000L",
+ "mcu": "stm32h723zet6",
+ "product_line": "STM32H723xx",
+ "variant": "MARLIN_H723Zx"
+ },
+ "connectivity": [
+ "can",
+ "ethernet"
+ ],
+ "debug": {
+ "jlink_device": "STM32H723ZE",
+ "openocd_target": "stm32h7x",
+ "svd_path": "STM32H7x3.svd",
+ "tools": {
+ "stlink": {
+ "server": {
+ "arguments": [
+ "-f",
+ "scripts/interface/stlink.cfg",
+ "-c",
+ "transport select hla_swd",
+ "-f",
+ "scripts/target/stm32h7x.cfg",
+ "-c",
+ "reset_config none"
+ ],
+ "executable": "bin/openocd",
+ "package": "tool-openocd"
+ }
+ }
+ }
+ },
+ "frameworks": [
+ "arduino",
+ "stm32cube"
+ ],
+ "name": "STM32H723ZE (564k RAM. 512k Flash)",
+ "upload": {
+ "disable_flushing": false,
+ "maximum_ram_size": 577536,
+ "maximum_size": 524288,
+ "protocol": "stlink",
+ "protocols": [
+ "stlink",
+ "dfu",
+ "jlink",
+ "cmsis-dap"
+ ],
+ "offset_address": "0x8020000",
+ "require_upload_port": true,
+ "use_1200bps_touch": false,
+ "wait_for_upload_port": false
+ },
+ "url": "https://www.st.com/en/microcontrollers-microprocessors/stm32h723ze.html",
+ "vendor": "ST"
+}
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PeripheralPins.c
new file mode 100644
index 0000000000..e484edd1ad
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PeripheralPins.c
@@ -0,0 +1,590 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2020, 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 STM32H723VEHx.xml, STM32H723VETx.xml
+ * STM32H723VGHx.xml, STM32H723VGTx.xml
+ * STM32H730VBHx.xml, STM32H730VBTx.xml
+ * STM32H733VGHx.xml, STM32H733VGTx.xml
+ * CubeMX DB release 6.0.60
+ */
+#if !defined(CUSTOM_PERIPHERAL_PINS)
+#include "Arduino.h"
+#include "PeripheralPins.h"
+
+/* =====
+ * Notes:
+ * - The pins mentioned Px_y_ALTz are alternative possibilities which use other
+ * HW peripheral instances. You can use them the same way as any other "normal"
+ * pin (i.e. analogWrite(PA7_ALT1, 128);).
+ *
+ * - 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, 16, 0)}, // ADC1_INP16
+ {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // ADC1_INP17
+ {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_INP14
+ {PA_2_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_INP14
+ {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_INP15
+ {PA_3_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_INP15
+ {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC1_INP18
+ {PA_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC2_INP18
+ {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC1_INP19
+ {PA_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC2_INP19
+ {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_INP3
+ {PA_6_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_INP3
+ {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_INP7
+ {PA_7_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_INP7
+ {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_INP9
+ {PB_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_INP9
+ {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_INP5
+ {PB_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_INP5
+ {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_INP10
+ {PC_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_INP10
+ {PC_0_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_INP10
+ {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_INP11
+ {PC_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_INP11
+ {PC_1_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_INP11
+ {PC_2_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_INP0
+ {PC_3_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_INP1
+ {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_INP4
+ {PC_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_INP4
+ {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_INP8
+ {PC_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_INP8
+ {NC, NP, 0}
+};
+#endif
+
+//*** DAC ***
+
+#ifdef HAL_DAC_MODULE_ENABLED
+WEAK const PinMap PinMap_DAC[] = {
+ {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC1_OUT1
+ {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC1_OUT2
+ {NC, NP, 0}
+};
+#endif
+
+//*** I2C ***
+
+#ifdef HAL_I2C_MODULE_ENABLED
+WEAK const PinMap PinMap_I2C_SDA[] = {
+ {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_7_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_9_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
+ {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
+ {PC_9_ALT1, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C5)},
+ {PC_10, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C5)},
+ {PD_13, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_I2C_MODULE_ENABLED
+WEAK const PinMap PinMap_I2C_SCL[] = {
+ {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
+ {PA_8_ALT1, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C5)},
+ {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_6_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_8_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
+ {PC_11, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C5)},
+ {PD_12, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
+ {NC, NP, 0}
+};
+#endif
+
+//*** TIM ***
+
+#ifdef HAL_TIM_MODULE_ENABLED
+WEAK const PinMap PinMap_TIM[] = {
+ {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
+ {PA_0_ALT1, 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_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2
+ {PA_1_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N
+ {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
+ {PA_2_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3
+ {PA_2_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1
+ {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
+ {PA_3_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4
+ {PA_3_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_CH2
+ {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
+ {PA_5_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
+ {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
+ {PA_6_ALT1, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
+ {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
+ {PA_7_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
+ {PA_7_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
+ {PA_7_ALT3, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1
+ {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_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
+ {PB_0_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
+ {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
+ {PB_1_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
+ {PB_1_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
+ {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_6_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N
+ {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
+ {PB_7_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N
+ {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
+ {PB_8_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1
+ {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
+ {PB_9_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1
+ {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
+ {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
+ {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
+ {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
+ {PB_14_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
+ {PB_14_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM12, 1, 0)}, // TIM12_CH1
+ {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
+ {PB_15_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
+ {PB_15_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM12, 2, 0)}, // TIM12_CH2
+ {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
+ {PC_6_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1
+ {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
+ {PC_7_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2
+ {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
+ {PC_8_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3
+ {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
+ {PC_9_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4
+ {PC_12, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM15, 1, 0)}, // TIM15_CH1
+ {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_4, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N
+ {PE_5, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1
+ {PE_6, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_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
+
+//*** UART ***
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_TX[] = {
+ {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_9, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_9_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PA_12, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)},
+ {PA_15, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PB_4, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PB_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)},
+ {PB_6_ALT1, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_6_ALT2, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PB_9, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PB_13, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_14, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
+ {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PC_10_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_15, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PE_1, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_3, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_USART10)},
+ {PE_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_RX[] = {
+ {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PA_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_10_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PA_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)},
+ {PB_3, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PB_5, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_7, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)},
+ {PB_7_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PB_8, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PB_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_15, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
+ {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PC_11_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_14, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PE_0, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_2, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART10)},
+ {PE_7, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_RTS[] = {
+ {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_12_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PA_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_14, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_14_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PC_8, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_13, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PD_15, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_9, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_CTS[] = {
+ {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_11_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PB_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PB_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PC_9, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_0, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_14, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_10, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {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)},
+ {PA_7_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_2, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
+ {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PB_5_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
+ {PB_5_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PC_1, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PC_3_C, 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_SPI3)},
+ {PD_7, SPI1, 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}
+};
+#endif
+
+#ifdef HAL_SPI_MODULE_ENABLED
+WEAK const PinMap PinMap_SPI_MISO[] = {
+ {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_6_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PB_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PB_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PC_2_C, 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}
+};
+#endif
+
+#ifdef HAL_SPI_MODULE_ENABLED
+WEAK const PinMap PinMap_SPI_SCLK[] = {
+ {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_5_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PA_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PB_3_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PB_3_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {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)},
+ {PC_12, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {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}
+};
+#endif
+
+#ifdef HAL_SPI_MODULE_ENABLED
+WEAK const PinMap PinMap_SPI_SSEL[] = {
+ {PA_0, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PA_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PA_11, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_15_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PA_15_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI6)},
+ {PB_4, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)},
+ {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
+
+//*** FDCAN ***
+
+#ifdef HAL_FDCAN_MODULE_ENABLED
+WEAK const PinMap PinMap_CAN_RD[] = {
+ {PA_11, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_5, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PB_8, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_12, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PD_0, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PD_12, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_FDCAN3)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_FDCAN_MODULE_ENABLED
+WEAK const PinMap PinMap_CAN_TD[] = {
+ {PA_12, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_6, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PB_9, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_13, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PD_1, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PD_13, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_FDCAN3)},
+ {NC, NP, 0}
+};
+#endif
+
+//*** ETHERNET ***
+
+#if defined(HAL_ETH_MODULE_ENABLED) || defined(HAL_ETH_LEGACY_MODULE_ENABLED)
+WEAK const PinMap PinMap_Ethernet[] = {
+ {PA_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS
+ {PA_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_REF_CLK
+ {PA_1_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_CLK
+ {PA_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDIO
+ {PA_3, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_COL
+ {PA_7, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS_DV
+ {PA_7_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_DV
+ {PA_9, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_ER
+ {PB_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD2
+ {PB_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD3
+ {PB_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_ER
+ {PB_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT
+ {PB_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3
+ {PB_10, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_ER
+ {PB_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN
+ {PB_12, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0
+ {PB_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1
+ {PC_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDC
+ {PC_2_C, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD2
+ {PC_3_C, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_CLK
+ {PC_4, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD0
+ {PC_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD1
+ {PE_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3
+ {NC, NP, 0}
+};
+#endif
+
+//*** OCTOSPI ***
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA0[] = {
+ {PA_2, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PB_1, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PB_12, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PC_3_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PC_9, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PD_11, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA1[] = {
+ {PB_0, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO1
+ {PC_10, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO1
+ {PD_12, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO1
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA2[] = {
+ {PA_3, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PA_7, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PB_13, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PC_2_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PE_2, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA3[] = {
+ {PA_1, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO3
+ {PA_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO3
+ {PD_13, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO3
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA4[] = {
+ {PC_1, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO4
+ {PD_4, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO4
+ {PE_7, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO4
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA5[] = {
+ {PC_2_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO5
+ {PD_5, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO5
+ {PE_8, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO5
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA6[] = {
+ {PC_3_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO6
+ {PD_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO6
+ {PE_9, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO6
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA7[] = {
+ {PD_7, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO7
+ {PE_10, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO7
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_SCLK[] = {
+ {PA_3, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OCTOSPIM_P1)}, // OCTOSPIM_P1_CLK
+ {PB_2, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_CLK
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_SSEL[] = {
+ {PB_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PB_10, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PC_11, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PE_11, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {NC, NP, 0}
+};
+#endif
+
+//*** USB ***
+
+#if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED)
+WEAK const PinMap PinMap_USB_OTG_HS[] = {
+#ifdef USE_USB_HS_IN_FS
+ {PA_8, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_SOF
+ {PA_9, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS
+ {PA_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ID
+ {PA_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF_NONE)}, // USB_OTG_HS_DM
+ {PA_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF_NONE)}, // USB_OTG_HS_DP
+#else
+ {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D0
+ {PA_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_CK
+ {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D1
+ {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D2
+ {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D7
+ {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D3
+ {PB_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D4
+ {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D5
+ {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D6
+ {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_STP
+ {PC_2_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_DIR
+ {PC_3_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_NXT
+#endif /* USE_USB_HS_IN_FS */
+ {NC, NP, 0}
+};
+#endif
+
+//*** SD ***
+
+#ifdef HAL_SD_MODULE_ENABLED
+WEAK const PinMap PinMap_SD[] = {
+ {PA_0, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDMMC2)}, // SDMMC2_CMD
+ {PB_3, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D2
+ {PB_4, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D3
+ {PB_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDMMC1)}, // SDMMC1_CKIN
+ {PB_8_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D4
+ {PB_8_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D4
+ {PB_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDMMC1)}, // SDMMC1_CDIR
+ {PB_9_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D5
+ {PB_9_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D5
+ {PB_13, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D0
+ {PB_14, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D0
+ {PB_15, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D1
+ {PC_1, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDMMC2)}, // SDMMC2_CK
+ {PC_4, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_SDMMC2)}, // SDMMC2_CKIN
+ {PC_6, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDMMC1)}, // SDMMC1_D0DIR
+ {PC_6_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D6
+ {PC_6_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D6
+ {PC_7, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDMMC1)}, // SDMMC1_D123DIR
+ {PC_7_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D7
+ {PC_7_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D7
+ {PC_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D0
+ {PC_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D1
+ {PC_10, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D2
+ {PC_11, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D3
+ {PC_12, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDMMC1)}, // SDMMC1_CK
+ {PD_2, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDMMC1)}, // SDMMC1_CMD
+ {PD_6, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDMMC2)}, // SDMMC2_CK
+ {PD_7, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDMMC2)}, // SDMMC2_CMD
+ {NC, NP, 0}
+};
+#endif
+
+#endif /* !CUSTOM_PERIPHERAL_PINS */
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PinNamesVar.h
new file mode 100644
index 0000000000..3bd0ed8fcd
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/PinNamesVar.h
@@ -0,0 +1,108 @@
+/* Dual pad pin name */
+PC_2_C = PC_2 | PDUAL,
+PC_3_C = PC_3 | PDUAL,
+
+/* Alternate pin name */
+PA_0_ALT1 = PA_0 | ALT1,
+PA_1_ALT1 = PA_1 | ALT1,
+PA_1_ALT2 = PA_1 | ALT2,
+PA_2_ALT1 = PA_2 | ALT1,
+PA_2_ALT2 = PA_2 | ALT2,
+PA_3_ALT1 = PA_3 | ALT1,
+PA_3_ALT2 = PA_3 | ALT2,
+PA_4_ALT1 = PA_4 | ALT1,
+PA_4_ALT2 = PA_4 | ALT2,
+PA_5_ALT1 = PA_5 | ALT1,
+PA_6_ALT1 = PA_6 | ALT1,
+PA_7_ALT1 = PA_7 | ALT1,
+PA_7_ALT2 = PA_7 | ALT2,
+PA_7_ALT3 = PA_7 | ALT3,
+PA_8_ALT1 = PA_8 | ALT1,
+PA_9_ALT1 = PA_9 | ALT1,
+PA_10_ALT1 = PA_10 | ALT1,
+PA_11_ALT1 = PA_11 | ALT1,
+PA_12_ALT1 = PA_12 | ALT1,
+PA_15_ALT1 = PA_15 | ALT1,
+PA_15_ALT2 = PA_15 | ALT2,
+PB_0_ALT1 = PB_0 | ALT1,
+PB_0_ALT2 = PB_0 | ALT2,
+PB_1_ALT1 = PB_1 | ALT1,
+PB_1_ALT2 = PB_1 | ALT2,
+PB_3_ALT1 = PB_3 | ALT1,
+PB_3_ALT2 = PB_3 | ALT2,
+PB_4_ALT1 = PB_4 | ALT1,
+PB_4_ALT2 = PB_4 | ALT2,
+PB_5_ALT1 = PB_5 | ALT1,
+PB_5_ALT2 = PB_5 | ALT2,
+PB_6_ALT1 = PB_6 | ALT1,
+PB_6_ALT2 = PB_6 | ALT2,
+PB_7_ALT1 = PB_7 | ALT1,
+PB_8_ALT1 = PB_8 | ALT1,
+PB_8_ALT2 = PB_8 | ALT2,
+PB_9_ALT1 = PB_9 | ALT1,
+PB_9_ALT2 = PB_9 | ALT2,
+PB_14_ALT1 = PB_14 | ALT1,
+PB_14_ALT2 = PB_14 | ALT2,
+PB_15_ALT1 = PB_15 | ALT1,
+PB_15_ALT2 = PB_15 | ALT2,
+PC_0_ALT1 = PC_0 | ALT1,
+PC_0_ALT2 = PC_0 | ALT2,
+PC_1_ALT1 = PC_1 | ALT1,
+PC_1_ALT2 = PC_1 | ALT2,
+PC_4_ALT1 = PC_4 | ALT1,
+PC_5_ALT1 = PC_5 | ALT1,
+PC_6_ALT1 = PC_6 | ALT1,
+PC_6_ALT2 = PC_6 | ALT2,
+PC_7_ALT1 = PC_7 | ALT1,
+PC_7_ALT2 = PC_7 | ALT2,
+PC_8_ALT1 = PC_8 | ALT1,
+PC_9_ALT1 = PC_9 | ALT1,
+PC_10_ALT1 = PC_10 | ALT1,
+PC_11_ALT1 = PC_11 | ALT1,
+
+/* SYS_WKUP */
+#ifdef PWR_WAKEUP_PIN1
+ SYS_WKUP1 = PA_0,
+#endif
+#ifdef PWR_WAKEUP_PIN2
+ SYS_WKUP2 = PA_2,
+#endif
+#ifdef PWR_WAKEUP_PIN3
+ SYS_WKUP3 = NC,
+#endif
+#ifdef PWR_WAKEUP_PIN4
+ SYS_WKUP4 = PC_13,
+#endif
+#ifdef PWR_WAKEUP_PIN5
+ SYS_WKUP5 = NC,
+#endif
+#ifdef PWR_WAKEUP_PIN6
+ SYS_WKUP6 = PC_1,
+#endif
+#ifdef PWR_WAKEUP_PIN7
+ SYS_WKUP7 = NC,
+#endif
+#ifdef PWR_WAKEUP_PIN8
+ SYS_WKUP8 = NC,
+#endif
+
+/* USB */
+#ifdef USBCON
+ USB_OTG_HS_DM = PA_11,
+ USB_OTG_HS_DP = PA_12,
+ USB_OTG_HS_ID = PA_10,
+ USB_OTG_HS_SOF = PA_8,
+ USB_OTG_HS_ULPI_CK = PA_5,
+ USB_OTG_HS_ULPI_D0 = PA_3,
+ USB_OTG_HS_ULPI_D1 = PB_0,
+ USB_OTG_HS_ULPI_D2 = PB_1,
+ USB_OTG_HS_ULPI_D3 = PB_10,
+ USB_OTG_HS_ULPI_D4 = PB_11,
+ USB_OTG_HS_ULPI_D5 = PB_12,
+ USB_OTG_HS_ULPI_D6 = PB_13,
+ USB_OTG_HS_ULPI_D7 = PB_5,
+ USB_OTG_HS_ULPI_DIR = PC_2_C,
+ USB_OTG_HS_ULPI_NXT = PC_3_C,
+ USB_OTG_HS_ULPI_STP = PC_0,
+ USB_OTG_HS_VBUS = PA_9,
+#endif
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/ldscript.ld
new file mode 100644
index 0000000000..6322861033
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/ldscript.ld
@@ -0,0 +1,174 @@
+/*
+******************************************************************************
+**
+** File : LinkerScript.ld
+**
+** Author : STM32CubeIDE
+**
+** Abstract : Linker script for STM32H7 series
+** 512Kbytes FLASH and 560Kbytes 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) 2022 STMicroelectronics.
+** All rights reserved.
+**
+** This software is licensed under terms that can be found in the LICENSE file
+** in the root directory of this software component.
+** If no LICENSE file comes with this software, it is provided AS-IS.
+**
+****************************************************************************
+*/
+
+/* Entry Point */
+ENTRY(Reset_Handler)
+
+/* Highest address of the user mode stack */
+_estack = ORIGIN(RAM_D1) + LENGTH(RAM_D1); /* 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
+{
+ ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
+ DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
+ FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
+ RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
+ RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
+ RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
+}
+
+/* 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 */
+ *(.RamFunc) /* .RamFunc sections */
+ *(.RamFunc*) /* .RamFunc* sections */
+
+ . = ALIGN(4);
+ _edata = .; /* define a global symbol at data end */
+ } >RAM_D1 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_D1
+
+ /* User_heap_stack section, used to check that there is enough RAM left */
+ ._user_heap_stack :
+ {
+ . = ALIGN(8);
+ PROVIDE ( end = . );
+ PROVIDE ( _end = . );
+ . = . + _Min_Heap_Size;
+ . = . + _Min_Stack_Size;
+ . = ALIGN(8);
+ } >RAM_D1
+
+ /* 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_H723Vx/variant_MARLIN_STM32H723VX.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/variant_MARLIN_STM32H723VX.cpp
new file mode 100644
index 0000000000..bfeb0f9abc
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/variant_MARLIN_STM32H723VX.cpp
@@ -0,0 +1,273 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2020-2021, 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
+ *
+ *******************************************************************************
+ */
+#ifdef STM32H723xx
+#include "pins_arduino.h"
+
+// Digital PinName array
+const PinName digitalPin[] = {
+ PA_0, // D0/A0
+ PA_1, // D1/A1
+ PA_2, // D2/A2
+ PA_3, // D3/A3
+ PA_4, // D4/A4
+ PA_5, // D5/A5
+ PA_6, // D6/A6
+ PA_7, // D7/A7
+ PA_8, // D8
+ PA_9, // D9
+ PA_10, // D10
+ PA_11, // D11
+ PA_12, // D12
+ PA_13, // D13
+ PA_14, // D14
+ PA_15, // D15
+ PB_0, // D16/A8
+ PB_1, // D17/A9
+ PB_2, // D18
+ PB_3, // D19
+ PB_4, // D20
+ PB_5, // D21
+ PB_6, // D22
+ PB_7, // D23
+ PB_8, // D24
+ PB_9, // D25
+ PB_10, // D26
+ PB_11, // D27
+ PB_12, // D28
+ PB_13, // D29
+ PB_14, // D30
+ PB_15, // D31
+ PC_0, // D32/A10
+ PC_1, // D33/A11
+ PC_4, // D34/A12
+ PC_5, // D35/A13
+ PC_6, // D36
+ PC_7, // D37
+ PC_8, // D38
+ PC_9, // D39
+ PC_10, // D40
+ PC_11, // D41
+ PC_12, // D42
+ PC_13, // D43
+ PC_14, // D44
+ PC_15, // D45
+ PD_0, // D46
+ PD_1, // D47
+ PD_2, // D48
+ PD_3, // D49
+ PD_4, // D50
+ PD_5, // D51
+ PD_6, // D52
+ PD_7, // D53
+ PD_8, // D54
+ PD_9, // D55
+ PD_10, // D56
+ PD_11, // D57
+ PD_12, // D58
+ PD_13, // D59
+ PD_14, // D60
+ PD_15, // D61
+ PE_0, // D62
+ PE_1, // D63
+ PE_2, // D64
+ PE_3, // D65
+ PE_4, // D66
+ PE_5, // D67
+ PE_6, // D68
+ PE_7, // D69
+ PE_8, // D70
+ PE_9, // D71
+ PE_10, // D72
+ PE_11, // D73
+ PE_12, // D74
+ PE_13, // D75
+ PE_14, // D76
+ PE_15, // D77
+ PH_0, // D78
+ PH_1, // D79
+ PC_2_C, // D80/A14
+ PC_3_C // D81/A15
+};
+
+// Analog (Ax) pin number array
+const uint32_t analogInputPin[] = {
+ 0, // A0, PA0
+ 1, // A1, PA1
+ 2, // A2, PA2
+ 3, // A3, PA3
+ 4, // A4, PA4
+ 5, // A5, PA5
+ 6, // A6, PA6
+ 7, // A7, PA7
+ 16, // A8, PB0
+ 17, // A9, PB1
+ 32, // A10, PC0
+ 33, // A11, PC1
+ 34, // A12, PC4
+ 35, // A13, PC5
+ 80, // A14, PC2_C
+ 81 // A15, PC3_C
+};
+
+void MPU_Config(void)
+{
+ MPU_Region_InitTypeDef MPU_InitStruct = {0};
+
+ /* Disables the MPU */
+ HAL_MPU_Disable();
+
+ /** Initializes and configures the Region and the memory to be protected
+ */
+ MPU_InitStruct.Enable = MPU_REGION_ENABLE;
+ MPU_InitStruct.Number = MPU_REGION_NUMBER0;
+ MPU_InitStruct.BaseAddress = 0x0;
+ MPU_InitStruct.Size = MPU_REGION_SIZE_4GB;
+ MPU_InitStruct.SubRegionDisable = 0x87;
+ MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
+ MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;
+ MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
+ MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
+ MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
+ MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
+
+ HAL_MPU_ConfigRegion(&MPU_InitStruct);
+ /* Enables the MPU */
+ HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
+
+}
+
+/*
+ * @brief System Clock Configuration
+ * @param None
+ * @retval None
+ */
+WEAK void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
+
+ MPU_Config();
+
+ /** Supply configuration update enable
+ */
+ HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
+
+ while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; // 48Mhz for USB
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
+ RCC_OscInitStruct.PLL.PLLM = 5; // 25Mhz / 5 = 5Mhz
+ RCC_OscInitStruct.PLL.PLLN = 110; // 25Mhz / 5 * 110 = 550Mhz
+ RCC_OscInitStruct.PLL.PLLP = 1; // 550Mhz / 1 = 550Mhz
+ RCC_OscInitStruct.PLL.PLLQ = 10; // 550Mhz / 10 = 55Mhz
+ RCC_OscInitStruct.PLL.PLLR = 10; // unused
+ RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
+ RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
+ RCC_OscInitStruct.PLL.PLLFRACN = 0;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
+ |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
+ RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
+ RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB
+ | RCC_PERIPHCLK_SDMMC | RCC_PERIPHCLK_ADC
+ | RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_USART16
+ | RCC_PERIPHCLK_USART234578 | RCC_PERIPHCLK_I2C123
+ | RCC_PERIPHCLK_I2C4 | RCC_PERIPHCLK_SPI123
+ | RCC_PERIPHCLK_SPI45 | RCC_PERIPHCLK_SPI6;
+
+ /* HSI48 used for USB 48 Mhz */
+ /* PLL1 qclk also used for FMC, SDMMC, RNG, SAI */
+ /* PLL2 pclk is needed for adc max 80 Mhz (p,q,r same) */
+ /* PLL2 pclk also used for LP timers 2,3,4,5, SPI 1,2,3 */
+ /* PLL2 qclk is needed for uart, can, spi4,5,6 80 Mhz */
+ /* PLL3 r clk is needed for i2c 80 Mhz (p,q,r same) */
+ PeriphClkInitStruct.PLL2.PLL2M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz
+ PeriphClkInitStruct.PLL2.PLL2N = 96; // N MUL 96
+ PeriphClkInitStruct.PLL2.PLL2P = 2; // P div 2
+ PeriphClkInitStruct.PLL2.PLL2Q = 2; // Q div 2
+ PeriphClkInitStruct.PLL2.PLL2R = 2; // R div 2
+ // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz
+ PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_0;
+ PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM;
+ PeriphClkInitStruct.PLL2.PLL2FRACN = 0;
+ PeriphClkInitStruct.PLL3.PLL3M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz
+ PeriphClkInitStruct.PLL3.PLL3N = 96; // N MUL 96
+ PeriphClkInitStruct.PLL3.PLL3P = 2; // P div 2
+ PeriphClkInitStruct.PLL3.PLL3Q = 2; // Q div 2
+ PeriphClkInitStruct.PLL3.PLL3R = 2; // R div 2
+ // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz
+ PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_0;
+ PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOMEDIUM;
+ PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
+ // ADC from PLL2 pclk
+ PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2;
+ // USB from HSI48
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ // SDMMC from PLL1 qclk
+ PeriphClkInitStruct.SdmmcClockSelection = 0;
+ //PeriphClkInitStruct.SdmmcClockSelection = RCC_SDMMCCLKSOURCE_PLL;
+ // LPUART from PLL2 qclk
+ PeriphClkInitStruct.Lpuart1ClockSelection = 0;
+ //PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PLL2;
+ // USART from PLL2 qclk
+ PeriphClkInitStruct.Usart16ClockSelection = RCC_USART16CLKSOURCE_PLL2;
+ // USART from PLL2 qclk
+ PeriphClkInitStruct.Usart234578ClockSelection = 0;
+ //PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_PLL2;
+ // I2C123 from PLL3 rclk
+ PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_PLL3;
+ // I2C4 from PLL3 rclk
+ PeriphClkInitStruct.I2c4ClockSelection = 0;
+ //PeriphClkInitStruct.I2c4ClockSelection = RCC_I2C4CLKSOURCE_PLL3;
+ // SPI123 from PLL2 pclk
+ PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL2;
+ // SPI45 from PLL2 qclk
+ PeriphClkInitStruct.Spi45ClockSelection = 0;
+ //PeriphClkInitStruct.Spi45ClockSelection = RCC_SPI45CLKSOURCE_PLL2;
+ // SPI6 from PLL2 qclk
+ PeriphClkInitStruct.Spi6ClockSelection = 0;
+ //PeriphClkInitStruct.Spi6ClockSelection = RCC_SPI6CLKSOURCE_PLL2;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
+ Error_Handler();
+ }
+}
+
+#endif /* ARDUINO_GENERIC_* */
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/variant_MARLIN_STM32H723VX.h b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/variant_MARLIN_STM32H723VX.h
new file mode 100644
index 0000000000..8b67905680
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Vx/variant_MARLIN_STM32H723VX.h
@@ -0,0 +1,269 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2020, 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
+ *
+ *******************************************************************************
+ */
+#pragma once
+
+/*----------------------------------------------------------------------------
+ * STM32 pins number
+ *----------------------------------------------------------------------------*/
+#define PA0 PIN_A0
+#define PA1 PIN_A1
+#define PA2 PIN_A2
+#define PA3 PIN_A3
+#define PA4 PIN_A4
+#define PA5 PIN_A5
+#define PA6 PIN_A6
+#define PA7 PIN_A7
+#define PA8 8
+#define PA9 9
+#define PA10 10
+#define PA11 11
+#define PA12 12
+#define PA13 13
+#define PA14 14
+#define PA15 15
+#define PB0 PIN_A8
+#define PB1 PIN_A9
+#define PB2 18
+#define PB3 19
+#define PB4 20
+#define PB5 21
+#define PB6 22
+#define PB7 23
+#define PB8 24
+#define PB9 25
+#define PB10 26
+#define PB11 27
+#define PB12 28
+#define PB13 29
+#define PB14 30
+#define PB15 31
+#define PC0 PIN_A10
+#define PC1 PIN_A11
+#define PC4 PIN_A12
+#define PC5 PIN_A13
+#define PC6 36
+#define PC7 37
+#define PC8 38
+#define PC9 39
+#define PC10 40
+#define PC11 41
+#define PC12 42
+#define PC13 43
+#define PC14 44
+#define PC15 45
+#define PD0 46
+#define PD1 47
+#define PD2 48
+#define PD3 49
+#define PD4 50
+#define PD5 51
+#define PD6 52
+#define PD7 53
+#define PD8 54
+#define PD9 55
+#define PD10 56
+#define PD11 57
+#define PD12 58
+#define PD13 59
+#define PD14 60
+#define PD15 61
+#define PE0 62
+#define PE1 63
+#define PE2 64
+#define PE3 65
+#define PE4 66
+#define PE5 67
+#define PE6 68
+#define PE7 69
+#define PE8 70
+#define PE9 71
+#define PE10 72
+#define PE11 73
+#define PE12 74
+#define PE13 75
+#define PE14 76
+#define PE15 77
+#define PH0 78
+#define PH1 79
+#define PC2_C PIN_A14
+#define PC3_C PIN_A15
+#define PC2 PC2_C
+#define PC3 PC3_C
+
+// Alternate pins number
+#define PA0_ALT1 (PA0 | ALT1)
+#define PA1_ALT1 (PA1 | ALT1)
+#define PA1_ALT2 (PA1 | ALT2)
+#define PA2_ALT1 (PA2 | ALT1)
+#define PA2_ALT2 (PA2 | ALT2)
+#define PA3_ALT1 (PA3 | ALT1)
+#define PA3_ALT2 (PA3 | ALT2)
+#define PA4_ALT1 (PA4 | ALT1)
+#define PA4_ALT2 (PA4 | ALT2)
+#define PA5_ALT1 (PA5 | ALT1)
+#define PA6_ALT1 (PA6 | ALT1)
+#define PA7_ALT1 (PA7 | ALT1)
+#define PA7_ALT2 (PA7 | ALT2)
+#define PA7_ALT3 (PA7 | ALT3)
+#define PA8_ALT1 (PA8 | ALT1)
+#define PA9_ALT1 (PA9 | ALT1)
+#define PA10_ALT1 (PA10 | ALT1)
+#define PA11_ALT1 (PA11 | ALT1)
+#define PA12_ALT1 (PA12 | ALT1)
+#define PA15_ALT1 (PA15 | ALT1)
+#define PA15_ALT2 (PA15 | ALT2)
+#define PB0_ALT1 (PB0 | ALT1)
+#define PB0_ALT2 (PB0 | ALT2)
+#define PB1_ALT1 (PB1 | ALT1)
+#define PB1_ALT2 (PB1 | ALT2)
+#define PB3_ALT1 (PB3 | ALT1)
+#define PB3_ALT2 (PB3 | ALT2)
+#define PB4_ALT1 (PB4 | ALT1)
+#define PB4_ALT2 (PB4 | ALT2)
+#define PB5_ALT1 (PB5 | ALT1)
+#define PB5_ALT2 (PB5 | ALT2)
+#define PB6_ALT1 (PB6 | ALT1)
+#define PB6_ALT2 (PB6 | ALT2)
+#define PB7_ALT1 (PB7 | ALT1)
+#define PB8_ALT1 (PB8 | ALT1)
+#define PB8_ALT2 (PB8 | ALT2)
+#define PB9_ALT1 (PB9 | ALT1)
+#define PB9_ALT2 (PB9 | ALT2)
+#define PB14_ALT1 (PB14 | ALT1)
+#define PB14_ALT2 (PB14 | ALT2)
+#define PB15_ALT1 (PB15 | ALT1)
+#define PB15_ALT2 (PB15 | ALT2)
+#define PC0_ALT1 (PC0 | ALT1)
+#define PC0_ALT2 (PC0 | ALT2)
+#define PC1_ALT1 (PC1 | ALT1)
+#define PC1_ALT2 (PC1 | ALT2)
+#define PC4_ALT1 (PC4 | ALT1)
+#define PC5_ALT1 (PC5 | ALT1)
+#define PC6_ALT1 (PC6 | ALT1)
+#define PC6_ALT2 (PC6 | ALT2)
+#define PC7_ALT1 (PC7 | ALT1)
+#define PC7_ALT2 (PC7 | ALT2)
+#define PC8_ALT1 (PC8 | ALT1)
+#define PC9_ALT1 (PC9 | ALT1)
+#define PC10_ALT1 (PC10 | ALT1)
+#define PC11_ALT1 (PC11 | ALT1)
+
+#define NUM_DIGITAL_PINS 82
+#define NUM_DUALPAD_PINS 2
+#define NUM_ANALOG_INPUTS 16
+
+// On-board LED pin number
+#ifndef LED_BUILTIN
+ #define LED_BUILTIN PNUM_NOT_DEFINED
+#endif
+
+// On-board user button
+#ifndef USER_BTN
+ #define USER_BTN PNUM_NOT_DEFINED
+#endif
+
+// SPI definitions
+#ifndef PIN_SPI_SS
+ #define PIN_SPI_SS PA4
+#endif
+#ifndef PIN_SPI_SS1
+ #define PIN_SPI_SS1 PA15
+#endif
+#ifndef PIN_SPI_SS2
+ #define PIN_SPI_SS2 PNUM_NOT_DEFINED
+#endif
+#ifndef PIN_SPI_SS3
+ #define PIN_SPI_SS3 PNUM_NOT_DEFINED
+#endif
+#ifndef PIN_SPI_MOSI
+ #define PIN_SPI_MOSI PA7
+#endif
+#ifndef PIN_SPI_MISO
+ #define PIN_SPI_MISO PA6
+#endif
+#ifndef PIN_SPI_SCK
+ #define PIN_SPI_SCK PA5
+#endif
+
+// I2C definitions
+#ifndef PIN_WIRE_SDA
+ #define PIN_WIRE_SDA PB7
+#endif
+#ifndef PIN_WIRE_SCL
+ #define PIN_WIRE_SCL PB6
+#endif
+
+// Timer Definitions
+// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
+#ifndef TIMER_TONE
+ #define TIMER_TONE TIM6
+#endif
+#ifndef TIMER_SERVO
+ #define TIMER_SERVO TIM7
+#endif
+
+// UART Definitions
+#ifndef SERIAL_UART_INSTANCE
+ #define SERIAL_UART_INSTANCE 4
+#endif
+
+// Default pin used for generic 'Serial' instance
+// Mandatory for Firmata
+#ifndef PIN_SERIAL_RX
+ #define PIN_SERIAL_RX PA1
+#endif
+#ifndef PIN_SERIAL_TX
+ #define PIN_SERIAL_TX PA0
+#endif
+
+// Extra HAL modules
+#if !defined(HAL_DAC_MODULE_DISABLED)
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#if !defined(HAL_ETH_MODULE_DISABLED)
+ #define HAL_ETH_MODULE_ENABLED
+#endif
+#if !defined(HAL_OSPI_MODULE_DISABLED)
+ #define HAL_OSPI_MODULE_ENABLED
+#endif
+#if !defined(HAL_SD_MODULE_DISABLED)
+ #define HAL_SD_MODULE_ENABLED
+#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.
+ #ifndef SERIAL_PORT_MONITOR
+ #define SERIAL_PORT_MONITOR Serial
+ #endif
+ #ifndef SERIAL_PORT_HARDWARE
+ #define SERIAL_PORT_HARDWARE Serial
+ #endif
+#endif
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PeripheralPins.c b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PeripheralPins.c
new file mode 100644
index 0000000000..70048173e7
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PeripheralPins.c
@@ -0,0 +1,688 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2020-2021, 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 STM32H723ZETx.xml, STM32H723ZGTx.xml
+ * STM32H733ZGTx.xml
+ * CubeMX DB release 6.0.30
+ */
+#if !defined(CUSTOM_PERIPHERAL_PINS)
+#include "Arduino.h"
+#include "PeripheralPins.h"
+
+/* =====
+ * Notes:
+ * - The pins mentioned Px_y_ALTz are alternative possibilities which use other
+ * HW peripheral instances. You can use them the same way as any other "normal"
+ * pin (i.e. analogWrite(PA7_ALT1, 128);).
+ *
+ * - 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, 16, 0)}, // ADC1_INP16
+ {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // ADC1_INP17
+ {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_INP14
+ {PA_2_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_INP14
+ {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_INP15
+ {PA_3_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_INP15
+ {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC1_INP18
+ {PA_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC2_INP18
+ {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC1_INP19
+ {PA_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC2_INP19
+ {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_INP3
+ {PA_6_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_INP3
+ {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_INP7
+ {PA_7_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_INP7
+ {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_INP9
+ {PB_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_INP9
+ {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_INP5
+ {PB_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_INP5
+ {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_INP10
+ {PC_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_INP10
+ {PC_0_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_INP10
+ {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_INP11
+ {PC_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_INP11
+ {PC_1_ALT2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_INP11
+ {PC_2_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_INP0
+ {PC_3_C, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_INP1
+ {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_INP4
+ {PC_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_INP4
+ {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_INP8
+ {PC_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_INP8
+ {PF_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC3_INP5
+ {PF_4, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC3_INP9
+ {PF_5, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC3_INP4
+ {PF_6, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC3_INP8
+ {PF_7, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_INP3
+ {PF_8, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC3_INP7
+ {PF_9, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_INP2
+ {PF_10, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC3_INP6
+ {PF_11, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_INP2
+ {PF_12, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_INP6
+ {PF_13, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_INP2
+ {PF_14, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_INP6
+ {NC, NP, 0}
+};
+#endif
+
+//*** DAC ***
+
+#ifdef HAL_DAC_MODULE_ENABLED
+WEAK const PinMap PinMap_DAC[] = {
+ {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC1_OUT1
+ {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC1_OUT2
+ {NC, NP, 0}
+};
+#endif
+
+//*** I2C ***
+
+#ifdef HAL_I2C_MODULE_ENABLED
+WEAK const PinMap PinMap_I2C_SDA[] = {
+ {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_7_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_9_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
+ {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
+ {PC_9_ALT1, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C5)},
+ {PC_10, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C5)},
+ {PD_13, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
+ {PF_0, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
+ {PF_0_ALT1, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C5)},
+ {PF_15, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_I2C_MODULE_ENABLED
+WEAK const PinMap PinMap_I2C_SCL[] = {
+ {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
+ {PA_8_ALT1, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C5)},
+ {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_6_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
+ {PB_8_ALT1, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C4)},
+ {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
+ {PC_11, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C5)},
+ {PD_12, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
+ {PF_1, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
+ {PF_1_ALT1, I2C5, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C5)},
+ {PF_14, I2C4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)},
+ {NC, NP, 0}
+};
+#endif
+
+//*** TIM ***
+
+#ifdef HAL_TIM_MODULE_ENABLED
+WEAK const PinMap PinMap_TIM[] = {
+ {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
+ {PA_0_ALT1, 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_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2
+ {PA_1_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N
+ {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
+ {PA_2_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3
+ {PA_2_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1
+ {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
+ {PA_3_ALT1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4
+ {PA_3_ALT2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_CH2
+ {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
+ {PA_5_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
+ {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
+ {PA_6_ALT1, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
+ {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
+ {PA_7_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
+ {PA_7_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
+ {PA_7_ALT3, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1
+ {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_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
+ {PB_0_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
+ {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
+ {PB_1_ALT1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
+ {PB_1_ALT2, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
+ {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_6_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N
+ {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
+ {PB_7_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N
+ {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
+ {PB_8_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1
+ {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
+ {PB_9_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1
+ {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
+ {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
+ {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
+ {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
+ {PB_14_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
+ {PB_14_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM12, 1, 0)}, // TIM12_CH1
+ {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
+ {PB_15_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
+ {PB_15_ALT2, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM12, 2, 0)}, // TIM12_CH2
+ {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
+ {PC_6_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1
+ {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
+ {PC_7_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2
+ {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
+ {PC_8_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3
+ {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
+ {PC_9_ALT1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4
+ {PC_12, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM15, 1, 0)}, // TIM15_CH1
+ {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_4, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N
+ {PE_5, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1
+ {PE_6, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_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
+ {PF_0, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 1, 0)}, // TIM23_CH1
+ {PF_1, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 2, 0)}, // TIM23_CH2
+ {PF_2, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 3, 0)}, // TIM23_CH3
+ {PF_3, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 4, 0)}, // TIM23_CH4
+ {PF_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 0)}, // TIM16_CH1
+ {PF_6_ALT1, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 1, 0)}, // TIM23_CH1
+ {PF_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 0)}, // TIM17_CH1
+ {PF_7_ALT1, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 2, 0)}, // TIM23_CH2
+ {PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
+ {PF_8_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM16, 1, 1)}, // TIM16_CH1N
+ {PF_8_ALT2, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 3, 0)}, // TIM23_CH3
+ {PF_9, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1
+ {PF_9_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM17, 1, 1)}, // TIM17_CH1N
+ {PF_9_ALT2, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 4, 0)}, // TIM23_CH4
+ {PF_11, TIM24, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM24, 1, 0)}, // TIM24_CH1
+ {PF_12, TIM24, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM24, 2, 0)}, // TIM24_CH2
+ {PF_13, TIM24, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM24, 3, 0)}, // TIM24_CH3
+ {PF_14, TIM24, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM24, 4, 0)}, // TIM24_CH4
+ {PG_12, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 1, 0)}, // TIM23_CH1
+ {PG_13, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 2, 0)}, // TIM23_CH2
+ {PG_14, TIM23, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF13_TIM23, 3, 0)}, // TIM23_CH3
+ {NC, NP, 0}
+};
+#endif
+
+//*** UART ***
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_TX[] = {
+ {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_9, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_9_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PA_12, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)},
+ {PA_15, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PB_4, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PB_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)},
+ {PB_6_ALT1, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_6_ALT2, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PB_9, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PB_13, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_14, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
+ {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PC_10_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_15, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PE_1, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_3, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_USART10)},
+ {PE_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PF_7, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PG_1, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PG_12, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART10)},
+ {PG_14, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_RX[] = {
+ {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PA_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_10_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PA_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)},
+ {PB_3, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
+ {PB_5, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_7, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)},
+ {PB_7_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PB_8, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PB_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
+ {PB_15, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
+ {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PC_11_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_14, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PE_0, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_2, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART10)},
+ {PE_7, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PF_6, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PG_0, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PG_9, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PG_11, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART10)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_RTS[] = {
+ {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_12_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PA_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_14, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_14_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PC_8, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_12, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_13, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PD_15, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_9, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PF_8, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PG_8, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PG_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PG_14, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART10)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_UART_MODULE_ENABLED
+WEAK const PinMap PinMap_UART_CTS[] = {
+ {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PA_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},
+ {PA_11_ALT1, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
+ {PB_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PB_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
+ {PC_9, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
+ {PD_0, UART9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
+ {PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
+ {PD_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
+ {PD_14, UART8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
+ {PE_10, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PF_9, UART7, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
+ {PG_13, USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART10)},
+ {PG_13_ALT1, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {PG_15, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
+ {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)},
+ {PA_7_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_2, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
+ {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PB_5_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
+ {PB_5_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PC_1, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PC_3_C, 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_SPI3)},
+ {PD_7, SPI1, 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)},
+ {PF_9, SPI5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)},
+ {PF_11, SPI5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)},
+ {PG_14, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_SPI_MODULE_ENABLED
+WEAK const PinMap PinMap_SPI_MISO[] = {
+ {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_6_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PB_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PB_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PC_2_C, 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)},
+ {PF_8, SPI5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)},
+ {PG_9, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PG_12, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_SPI_MODULE_ENABLED
+WEAK const PinMap PinMap_SPI_SCLK[] = {
+ {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_5_ALT1, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PA_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PB_3_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PB_3_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {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)},
+ {PC_12, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {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)},
+ {PF_7, SPI5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)},
+ {PG_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PG_13, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_SPI_MODULE_ENABLED
+WEAK const PinMap PinMap_SPI_SSEL[] = {
+ {PA_0, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_4_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PA_4_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_SPI6)},
+ {PA_11, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
+ {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {PA_15_ALT1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
+ {PA_15_ALT2, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI6)},
+ {PB_4, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)},
+ {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)},
+ {PF_6, SPI5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI5)},
+ {PG_8, SPI6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI6)},
+ {PG_10, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
+ {NC, NP, 0}
+};
+#endif
+
+//*** FDCAN ***
+
+#ifdef HAL_FDCAN_MODULE_ENABLED
+WEAK const PinMap PinMap_CAN_RD[] = {
+ {PA_11, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_5, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PB_8, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_12, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PD_0, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PD_12, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_FDCAN3)},
+ {PF_6, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF2_FDCAN3)},
+ {PG_10, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF2_FDCAN3)},
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_FDCAN_MODULE_ENABLED
+WEAK const PinMap PinMap_CAN_TD[] = {
+ {PA_12, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_6, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PB_9, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PB_13, FDCAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN2)},
+ {PD_1, FDCAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_FDCAN1)},
+ {PD_13, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_FDCAN3)},
+ {PF_7, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF2_FDCAN3)},
+ {PG_9, FDCAN3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF2_FDCAN3)},
+ {NC, NP, 0}
+};
+#endif
+
+//*** ETHERNET ***
+
+#ifdef HAL_ETH_MODULE_ENABLED
+WEAK const PinMap PinMap_Ethernet[] = {
+ {PA_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS
+ {PA_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_REF_CLK
+ {PA_1_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_CLK
+ {PA_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDIO
+ {PA_3, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_COL
+ {PA_7, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_CRS_DV
+ {PA_7_ALT1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_DV
+ {PA_9, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_ER
+ {PB_0, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD2
+ {PB_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD3
+ {PB_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_ER
+ {PB_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT
+ {PB_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3
+ {PB_10, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RX_ER
+ {PB_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN
+ {PB_12, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0
+ {PB_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1
+ {PC_1, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_MDC
+ {PC_2_C, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD2
+ {PC_3_C, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_CLK
+ {PC_4, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD0
+ {PC_5, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_RXD1
+ {PE_2, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD3
+ {PG_8, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_PPS_OUT
+ {PG_11, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TX_EN
+ {PG_12, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1
+ {PG_13, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD0
+ {PG_14, ETH, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_ETH)}, // ETH_TXD1
+ {NC, NP, 0}
+};
+#endif
+
+//*** OCTOSPI ***
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA0[] = {
+ {PA_2, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PB_1, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PB_12, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PC_3_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PC_9, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PD_11, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {PF_0, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO0
+ {PF_8, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO0
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA1[] = {
+ {PB_0, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO1
+ {PC_10, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO1
+ {PD_12, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO1
+ {PF_1, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO1
+ {PF_9, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO1
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA2[] = {
+ {PA_3, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PA_7, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PB_13, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PC_2_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PE_2, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {PF_2, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO2
+ {PF_7, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO2
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA3[] = {
+ {PA_1, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO3
+ {PA_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO3
+ {PD_13, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO3
+ {PF_3, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO3
+ {PF_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO3
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA4[] = {
+ {PC_1, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO4
+ {PD_4, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO4
+ {PE_7, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO4
+ {PG_0, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO4
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA5[] = {
+ {PC_2_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO5
+ {PD_5, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO5
+ {PE_8, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO5
+ {PG_1, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO5
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA6[] = {
+ {PC_3_C, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO6
+ {PD_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO6
+ {PE_9, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO6
+ {PG_9, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO6
+ {PG_10, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO6
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_DATA7[] = {
+ {PD_7, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO7
+ {PE_10, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO7
+ {PG_11, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_IO7
+ {PG_14, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_IO7
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_SCLK[] = {
+ {PA_3, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_OCTOSPIM_P1)}, // OCTOSPIM_P1_CLK
+ {PB_2, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_CLK
+ {PF_4, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P2)}, // OCTOSPIM_P2_CLK
+ {PF_10, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_CLK
+ {NC, NP, 0}
+};
+#endif
+
+#ifdef HAL_OSPI_MODULE_ENABLED
+WEAK const PinMap PinMap_OCTOSPI_SSEL[] = {
+ {PB_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PB_10, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PC_11, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PE_11, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PG_6, OCTOSPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OCTOSPIM_P1)}, // OCTOSPIM_P1_NCS
+ {PG_12, OCTOSPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_OCTOSPIM_P2)}, // OCTOSPIM_P2_NCS
+ {NC, NP, 0}
+};
+#endif
+
+//*** USB ***
+
+#if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED)
+WEAK const PinMap PinMap_USB_OTG_HS[] = {
+#ifdef USE_USB_HS_IN_FS
+ {PA_8, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_SOF
+ {PA_9, USB_OTG_HS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_HS_VBUS
+ {PA_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ID
+ {PA_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF_NONE)}, // USB_OTG_HS_DM
+ {PA_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF_NONE)}, // USB_OTG_HS_DP
+#else
+ {PA_3, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D0
+ {PA_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_CK
+ {PB_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D1
+ {PB_1, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D2
+ {PB_5, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D7
+ {PB_10, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D3
+ {PB_11, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D4
+ {PB_12, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D5
+ {PB_13, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_D6
+ {PC_0, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_STP
+ {PC_2_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_DIR
+ {PC_3_C, USB_OTG_HS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG1_HS)}, // USB_OTG_HS_ULPI_NXT
+#endif /* USE_USB_HS_IN_FS */
+ {NC, NP, 0}
+};
+#endif
+
+//*** SD ***
+
+#ifdef HAL_SD_MODULE_ENABLED
+WEAK const PinMap PinMap_SD[] = {
+ {PA_0, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDMMC2)}, // SDMMC2_CMD
+ {PB_3, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D2
+ {PB_4, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D3
+ {PB_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDMMC1)}, // SDMMC1_CKIN
+ {PB_8_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D4
+ {PB_8_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D4
+ {PB_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF7_SDMMC1)}, // SDMMC1_CDIR
+ {PB_9_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D5
+ {PB_9_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D5
+ {PB_13, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D0
+ {PB_14, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D0
+ {PB_15, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_SDMMC2)}, // SDMMC2_D1
+ {PC_1, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_SDMMC2)}, // SDMMC2_CK
+ {PC_4, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_SDMMC2)}, // SDMMC2_CKIN
+ {PC_6, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDMMC1)}, // SDMMC1_D0DIR
+ {PC_6_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D6
+ {PC_6_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D6
+ {PC_7, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_SDMMC1)}, // SDMMC1_D123DIR
+ {PC_7_ALT1, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D7
+ {PC_7_ALT2, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D7
+ {PC_8, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D0
+ {PC_9, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D1
+ {PC_10, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D2
+ {PC_11, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_SDMMC1)}, // SDMMC1_D3
+ {PC_12, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDMMC1)}, // SDMMC1_CK
+ {PD_2, SDMMC1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF12_SDMMC1)}, // SDMMC1_CMD
+ {PD_6, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDMMC2)}, // SDMMC2_CK
+ {PD_7, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF11_SDMMC2)}, // SDMMC2_CMD
+ {PG_9, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_SDMMC2)}, // SDMMC2_D0
+ {PG_10, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_SDMMC2)}, // SDMMC2_D1
+ {PG_11, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D2
+ {PG_12, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D3
+ {PG_13, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D6
+ {PG_14, SDMMC2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_SDMMC2)}, // SDMMC2_D7
+ {NC, NP, 0}
+};
+#endif
+
+#endif /* !CUSTOM_PERIPHERAL_PINS */
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PinNamesVar.h b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PinNamesVar.h
new file mode 100644
index 0000000000..ad9d80a625
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/PinNamesVar.h
@@ -0,0 +1,117 @@
+/* Dual pad pin name */
+PC_2_C = PC_2 | PDUAL,
+PC_3_C = PC_3 | PDUAL,
+
+/* Alternate pin name */
+PA_0_ALT1 = PA_0 | ALT1,
+PA_1_ALT1 = PA_1 | ALT1,
+PA_1_ALT2 = PA_1 | ALT2,
+PA_2_ALT1 = PA_2 | ALT1,
+PA_2_ALT2 = PA_2 | ALT2,
+PA_3_ALT1 = PA_3 | ALT1,
+PA_3_ALT2 = PA_3 | ALT2,
+PA_4_ALT1 = PA_4 | ALT1,
+PA_4_ALT2 = PA_4 | ALT2,
+PA_5_ALT1 = PA_5 | ALT1,
+PA_6_ALT1 = PA_6 | ALT1,
+PA_7_ALT1 = PA_7 | ALT1,
+PA_7_ALT2 = PA_7 | ALT2,
+PA_7_ALT3 = PA_7 | ALT3,
+PA_8_ALT1 = PA_8 | ALT1,
+PA_9_ALT1 = PA_9 | ALT1,
+PA_10_ALT1 = PA_10 | ALT1,
+PA_11_ALT1 = PA_11 | ALT1,
+PA_12_ALT1 = PA_12 | ALT1,
+PA_15_ALT1 = PA_15 | ALT1,
+PA_15_ALT2 = PA_15 | ALT2,
+PB_0_ALT1 = PB_0 | ALT1,
+PB_0_ALT2 = PB_0 | ALT2,
+PB_1_ALT1 = PB_1 | ALT1,
+PB_1_ALT2 = PB_1 | ALT2,
+PB_3_ALT1 = PB_3 | ALT1,
+PB_3_ALT2 = PB_3 | ALT2,
+PB_4_ALT1 = PB_4 | ALT1,
+PB_4_ALT2 = PB_4 | ALT2,
+PB_5_ALT1 = PB_5 | ALT1,
+PB_5_ALT2 = PB_5 | ALT2,
+PB_6_ALT1 = PB_6 | ALT1,
+PB_6_ALT2 = PB_6 | ALT2,
+PB_7_ALT1 = PB_7 | ALT1,
+PB_8_ALT1 = PB_8 | ALT1,
+PB_8_ALT2 = PB_8 | ALT2,
+PB_9_ALT1 = PB_9 | ALT1,
+PB_9_ALT2 = PB_9 | ALT2,
+PB_14_ALT1 = PB_14 | ALT1,
+PB_14_ALT2 = PB_14 | ALT2,
+PB_15_ALT1 = PB_15 | ALT1,
+PB_15_ALT2 = PB_15 | ALT2,
+PC_0_ALT1 = PC_0 | ALT1,
+PC_0_ALT2 = PC_0 | ALT2,
+PC_1_ALT1 = PC_1 | ALT1,
+PC_1_ALT2 = PC_1 | ALT2,
+PC_4_ALT1 = PC_4 | ALT1,
+PC_5_ALT1 = PC_5 | ALT1,
+PC_6_ALT1 = PC_6 | ALT1,
+PC_6_ALT2 = PC_6 | ALT2,
+PC_7_ALT1 = PC_7 | ALT1,
+PC_7_ALT2 = PC_7 | ALT2,
+PC_8_ALT1 = PC_8 | ALT1,
+PC_9_ALT1 = PC_9 | ALT1,
+PC_10_ALT1 = PC_10 | ALT1,
+PC_11_ALT1 = PC_11 | ALT1,
+PF_0_ALT1 = PF_0 | ALT1,
+PF_1_ALT1 = PF_1 | ALT1,
+PF_6_ALT1 = PF_6 | ALT1,
+PF_7_ALT1 = PF_7 | ALT1,
+PF_8_ALT1 = PF_8 | ALT1,
+PF_8_ALT2 = PF_8 | ALT2,
+PF_9_ALT1 = PF_9 | ALT1,
+PF_9_ALT2 = PF_9 | ALT2,
+PG_13_ALT1 = PG_13 | ALT1,
+
+/* SYS_WKUP */
+#ifdef PWR_WAKEUP_PIN1
+ SYS_WKUP1 = PA_0,
+#endif
+#ifdef PWR_WAKEUP_PIN2
+ SYS_WKUP2 = PA_2,
+#endif
+#ifdef PWR_WAKEUP_PIN3
+ SYS_WKUP3 = NC,
+#endif
+#ifdef PWR_WAKEUP_PIN4
+ SYS_WKUP4 = PC_13,
+#endif
+#ifdef PWR_WAKEUP_PIN5
+ SYS_WKUP5 = NC,
+#endif
+#ifdef PWR_WAKEUP_PIN6
+ SYS_WKUP6 = PC_1,
+#endif
+#ifdef PWR_WAKEUP_PIN7
+ SYS_WKUP7 = NC,
+#endif
+#ifdef PWR_WAKEUP_PIN8
+ SYS_WKUP8 = NC,
+#endif
+
+/* USB */
+#ifdef USBCON
+ USB_OTG_HS_DM = PA_11,
+ USB_OTG_HS_DP = PA_12,
+ USB_OTG_HS_ID = PA_10,
+ USB_OTG_HS_SOF = PA_8,
+ USB_OTG_HS_ULPI_CK = PA_5,
+ USB_OTG_HS_ULPI_D0 = PA_3,
+ USB_OTG_HS_ULPI_D1 = PB_0,
+ USB_OTG_HS_ULPI_D2 = PB_1,
+ USB_OTG_HS_ULPI_D3 = PB_10,
+ USB_OTG_HS_ULPI_D4 = PB_11,
+ USB_OTG_HS_ULPI_D5 = PB_12,
+ USB_OTG_HS_ULPI_D6 = PB_13,
+ USB_OTG_HS_ULPI_D7 = PB_5,
+ USB_OTG_HS_ULPI_DIR = PC_2_C,
+ USB_OTG_HS_ULPI_NXT = PC_3_C,
+ USB_OTG_HS_ULPI_STP = PC_0,
+ USB_OTG_HS_VBUS = PA_9,
+#endif
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/ldscript.ld b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/ldscript.ld
new file mode 100644
index 0000000000..6322861033
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/ldscript.ld
@@ -0,0 +1,174 @@
+/*
+******************************************************************************
+**
+** File : LinkerScript.ld
+**
+** Author : STM32CubeIDE
+**
+** Abstract : Linker script for STM32H7 series
+** 512Kbytes FLASH and 560Kbytes 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) 2022 STMicroelectronics.
+** All rights reserved.
+**
+** This software is licensed under terms that can be found in the LICENSE file
+** in the root directory of this software component.
+** If no LICENSE file comes with this software, it is provided AS-IS.
+**
+****************************************************************************
+*/
+
+/* Entry Point */
+ENTRY(Reset_Handler)
+
+/* Highest address of the user mode stack */
+_estack = ORIGIN(RAM_D1) + LENGTH(RAM_D1); /* 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
+{
+ ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
+ DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
+ FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
+ RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
+ RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
+ RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
+}
+
+/* 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 */
+ *(.RamFunc) /* .RamFunc sections */
+ *(.RamFunc*) /* .RamFunc* sections */
+
+ . = ALIGN(4);
+ _edata = .; /* define a global symbol at data end */
+ } >RAM_D1 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_D1
+
+ /* User_heap_stack section, used to check that there is enough RAM left */
+ ._user_heap_stack :
+ {
+ . = ALIGN(8);
+ PROVIDE ( end = . );
+ PROVIDE ( _end = . );
+ . = . + _Min_Heap_Size;
+ . = . + _Min_Stack_Size;
+ . = ALIGN(8);
+ } >RAM_D1
+
+ /* 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_H723Zx/variant_MARLIN_STM32H723Zx.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.cpp
new file mode 100644
index 0000000000..4506cf5ce6
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.cpp
@@ -0,0 +1,317 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2020-2021, 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
+ *
+ *******************************************************************************
+ */
+#if defined(STM32H723xx)
+#include "pins_arduino.h"
+
+// Digital PinName array
+const PinName digitalPin[] = {
+ PA_0, // D0/A0
+ PA_1, // D1/A1
+ PA_2, // D2/A2
+ PA_3, // D3/A3
+ PA_4, // D4/A4
+ PA_5, // D5/A5
+ PA_6, // D6/A6
+ PA_7, // D7/A7
+ PA_8, // D8
+ PA_9, // D9
+ PA_10, // D10
+ PA_11, // D11
+ PA_12, // D12
+ PA_13, // D13
+ PA_14, // D14
+ PA_15, // D15
+ PB_0, // D16/A8
+ PB_1, // D17/A9
+ PB_2, // D18
+ PB_3, // D19
+ PB_4, // D20
+ PB_5, // D21
+ PB_6, // D22
+ PB_7, // D23
+ PB_8, // D24
+ PB_9, // D25
+ PB_10, // D26
+ PB_11, // D27
+ PB_12, // D28
+ PB_13, // D29
+ PB_14, // D30
+ PB_15, // D31
+ PC_0, // D32/A10
+ PC_1, // D33/A11
+ PC_4, // D34/A12
+ PC_5, // D35/A13
+ PC_6, // D36
+ PC_7, // D37
+ PC_8, // D38
+ PC_9, // D39
+ PC_10, // D40
+ PC_11, // D41
+ PC_12, // D42
+ PC_13, // D43
+ PC_14, // D44
+ PC_15, // D45
+ PD_0, // D46
+ PD_1, // D47
+ PD_2, // D48
+ PD_3, // D49
+ PD_4, // D50
+ PD_5, // D51
+ PD_6, // D52
+ PD_7, // D53
+ PD_8, // D54
+ PD_9, // D55
+ PD_10, // D56
+ PD_11, // D57
+ PD_12, // D58
+ PD_13, // D59
+ PD_14, // D60
+ PD_15, // D61
+ PE_0, // D62
+ PE_1, // D63
+ PE_2, // D64
+ PE_3, // D65
+ PE_4, // D66
+ PE_5, // D67
+ PE_6, // D68
+ PE_7, // D69
+ PE_8, // D70
+ PE_9, // D71
+ PE_10, // D72
+ PE_11, // D73
+ PE_12, // D74
+ PE_13, // D75
+ PE_14, // D76
+ PE_15, // D77
+ PF_0, // D78
+ PF_1, // D79
+ PF_2, // D80
+ PF_3, // D81/A14
+ PF_4, // D82/A15
+ PF_5, // D83/A16
+ PF_6, // D84/A17
+ PF_7, // D85/A18
+ PF_8, // D86/A19
+ PF_9, // D87/A20
+ PF_10, // D88/A21
+ PF_11, // D89/A22
+ PF_12, // D90/A23
+ PF_13, // D91/A24
+ PF_14, // D92/A25
+ PF_15, // D93
+ PG_0, // D94
+ PG_1, // D95
+ PG_2, // D96
+ PG_3, // D97
+ PG_4, // D98
+ PG_5, // D99
+ PG_6, // D100
+ PG_7, // D101
+ PG_8, // D102
+ PG_9, // D103
+ PG_10, // D104
+ PG_11, // D105
+ PG_12, // D106
+ PG_13, // D107
+ PG_14, // D108
+ PG_15, // D109
+ PH_0, // D110
+ PH_1, // D111
+ PC_2_C, // D112/A26
+ PC_3_C // D113/A27
+};
+
+// Analog (Ax) pin number array
+const uint32_t analogInputPin[] = {
+ 0, // A0, PA0
+ 1, // A1, PA1
+ 2, // A2, PA2
+ 3, // A3, PA3
+ 4, // A4, PA4
+ 5, // A5, PA5
+ 6, // A6, PA6
+ 7, // A7, PA7
+ 16, // A8, PB0
+ 17, // A9, PB1
+ 32, // A10, PC0
+ 33, // A11, PC1
+ 34, // A12, PC4
+ 35, // A13, PC5
+ 81, // A14, PF3
+ 82, // A15, PF4
+ 83, // A16, PF5
+ 84, // A17, PF6
+ 85, // A18, PF7
+ 86, // A19, PF8
+ 87, // A20, PF9
+ 88, // A21, PF10
+ 89, // A22, PF11
+ 90, // A23, PF12
+ 91, // A24, PF13
+ 92, // A25, PF14
+ 112, // A26, PC2_C
+ 113 // A27, PC3_C
+};
+
+void MPU_Config(void)
+{
+ MPU_Region_InitTypeDef MPU_InitStruct = {0};
+
+ /* Disables the MPU */
+ HAL_MPU_Disable();
+
+ /** Initializes and configures the Region and the memory to be protected
+ */
+ MPU_InitStruct.Enable = MPU_REGION_ENABLE;
+ MPU_InitStruct.Number = MPU_REGION_NUMBER0;
+ MPU_InitStruct.BaseAddress = 0x0;
+ MPU_InitStruct.Size = MPU_REGION_SIZE_4GB;
+ MPU_InitStruct.SubRegionDisable = 0x87;
+ MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
+ MPU_InitStruct.AccessPermission = MPU_REGION_NO_ACCESS;
+ MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
+ MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
+ MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
+ MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
+
+ HAL_MPU_ConfigRegion(&MPU_InitStruct);
+ /* Enables the MPU */
+ HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
+
+}
+
+/*
+ * @brief System Clock Configuration
+ * @param None
+ * @retval None
+ */
+WEAK void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
+
+ MPU_Config();
+
+ /** Supply configuration update enable
+ */
+ HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
+ /** Configure the main internal regulator output voltage
+ */
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
+
+ while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;
+ RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; // 48Mhz for USB
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
+ RCC_OscInitStruct.PLL.PLLM = 5; // 25Mhz / 5 = 5Mhz
+ RCC_OscInitStruct.PLL.PLLN = 110; // 25Mhz / 5 * 110 = 550Mhz
+ RCC_OscInitStruct.PLL.PLLP = 1; // 550Mhz / 1 = 550Mhz
+ RCC_OscInitStruct.PLL.PLLQ = 10; // 550Mhz / 10 = 55Mhz
+ RCC_OscInitStruct.PLL.PLLR = 10; // unused
+ RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
+ RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
+ RCC_OscInitStruct.PLL.PLLFRACN = 0;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
+ |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
+ RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
+ RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
+ RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB
+ | RCC_PERIPHCLK_SDMMC | RCC_PERIPHCLK_ADC
+ | RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_USART16
+ | RCC_PERIPHCLK_USART234578 | RCC_PERIPHCLK_I2C123
+ | RCC_PERIPHCLK_I2C4 | RCC_PERIPHCLK_SPI123
+ | RCC_PERIPHCLK_SPI45 | RCC_PERIPHCLK_SPI6;
+
+ /* HSI48 used for USB 48 Mhz */
+ /* PLL1 qclk also used for FMC, SDMMC, RNG, SAI */
+ /* PLL2 pclk is needed for adc max 80 Mhz (p,q,r same) */
+ /* PLL2 pclk also used for LP timers 2,3,4,5, SPI 1,2,3 */
+ /* PLL2 qclk is needed for uart, can, spi4,5,6 80 Mhz */
+ /* PLL3 r clk is needed for i2c 80 Mhz (p,q,r same) */
+ PeriphClkInitStruct.PLL2.PLL2M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz
+ PeriphClkInitStruct.PLL2.PLL2N = 96; // N MUL 96
+ PeriphClkInitStruct.PLL2.PLL2P = 2; // P div 2
+ PeriphClkInitStruct.PLL2.PLL2Q = 2; // Q div 2
+ PeriphClkInitStruct.PLL2.PLL2R = 2; // R div 2
+ // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz
+ PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_0;
+ PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM;
+ PeriphClkInitStruct.PLL2.PLL2FRACN = 0;
+ PeriphClkInitStruct.PLL3.PLL3M = 15; // M DIV 15 vco 25 / 15 ~ 1.667 Mhz
+ PeriphClkInitStruct.PLL3.PLL3N = 96; // N MUL 96
+ PeriphClkInitStruct.PLL3.PLL3P = 2; // P div 2
+ PeriphClkInitStruct.PLL3.PLL3Q = 2; // Q div 2
+ PeriphClkInitStruct.PLL3.PLL3R = 2; // R div 2
+ // RCC_PLL1VCIRANGE_0 Clock range frequency between 1 and 2 MHz
+ PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_0;
+ PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOMEDIUM;
+ PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
+ // ADC from PLL2 pclk
+ PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2;
+ // USB from HSI48
+ PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
+ // SDMMC from PLL1 qclk
+ PeriphClkInitStruct.SdmmcClockSelection = 0;
+ //PeriphClkInitStruct.SdmmcClockSelection = RCC_SDMMCCLKSOURCE_PLL;
+ // LPUART from PLL2 qclk
+ PeriphClkInitStruct.Lpuart1ClockSelection = 0;
+ //PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PLL2;
+ // USART from PLL2 qclk
+ PeriphClkInitStruct.Usart16ClockSelection = RCC_USART16CLKSOURCE_PLL2;
+ // USART from PLL2 qclk
+ PeriphClkInitStruct.Usart234578ClockSelection = 0;
+ //PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_PLL2;
+ // I2C123 from PLL3 rclk
+ PeriphClkInitStruct.I2c123ClockSelection = RCC_I2C123CLKSOURCE_PLL3;
+ // I2C4 from PLL3 rclk
+ PeriphClkInitStruct.I2c4ClockSelection = 0;
+ //PeriphClkInitStruct.I2c4ClockSelection = RCC_I2C4CLKSOURCE_PLL3;
+ // SPI123 from PLL2 pclk
+ PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL2;
+ // SPI45 from PLL2 qclk
+ PeriphClkInitStruct.Spi45ClockSelection = 0;
+ //PeriphClkInitStruct.Spi45ClockSelection = RCC_SPI45CLKSOURCE_PLL2;
+ // SPI6 from PLL2 qclk
+ PeriphClkInitStruct.Spi6ClockSelection = 0;
+ //PeriphClkInitStruct.Spi6ClockSelection = RCC_SPI6CLKSOURCE_PLL2;
+
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
+ Error_Handler();
+ }
+}
+
+#endif /* ARDUINO_GENERIC_* */
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.h b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.h
new file mode 100644
index 0000000000..d443f5c1fd
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.h
@@ -0,0 +1,308 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2020-2021, 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
+ *
+ *******************************************************************************
+ */
+#pragma once
+
+/*----------------------------------------------------------------------------
+ * STM32 pins number
+ *----------------------------------------------------------------------------*/
+#define PA0 PIN_A0
+#define PA1 PIN_A1
+#define PA2 PIN_A2
+#define PA3 PIN_A3
+#define PA4 PIN_A4
+#define PA5 PIN_A5
+#define PA6 PIN_A6
+#define PA7 PIN_A7
+#define PA8 8
+#define PA9 9
+#define PA10 10
+#define PA11 11
+#define PA12 12
+#define PA13 13
+#define PA14 14
+#define PA15 15
+#define PB0 PIN_A8
+#define PB1 PIN_A9
+#define PB2 18
+#define PB3 19
+#define PB4 20
+#define PB5 21
+#define PB6 22
+#define PB7 23
+#define PB8 24
+#define PB9 25
+#define PB10 26
+#define PB11 27
+#define PB12 28
+#define PB13 29
+#define PB14 30
+#define PB15 31
+#define PC0 PIN_A10
+#define PC1 PIN_A11
+#define PC4 PIN_A12
+#define PC5 PIN_A13
+#define PC6 36
+#define PC7 37
+#define PC8 38
+#define PC9 39
+#define PC10 40
+#define PC11 41
+#define PC12 42
+#define PC13 43
+#define PC14 44
+#define PC15 45
+#define PD0 46
+#define PD1 47
+#define PD2 48
+#define PD3 49
+#define PD4 50
+#define PD5 51
+#define PD6 52
+#define PD7 53
+#define PD8 54
+#define PD9 55
+#define PD10 56
+#define PD11 57
+#define PD12 58
+#define PD13 59
+#define PD14 60
+#define PD15 61
+#define PE0 62
+#define PE1 63
+#define PE2 64
+#define PE3 65
+#define PE4 66
+#define PE5 67
+#define PE6 68
+#define PE7 69
+#define PE8 70
+#define PE9 71
+#define PE10 72
+#define PE11 73
+#define PE12 74
+#define PE13 75
+#define PE14 76
+#define PE15 77
+#define PF0 78
+#define PF1 79
+#define PF2 80
+#define PF3 PIN_A14
+#define PF4 PIN_A15
+#define PF5 PIN_A16
+#define PF6 PIN_A17
+#define PF7 PIN_A18
+#define PF8 PIN_A19
+#define PF9 PIN_A20
+#define PF10 PIN_A21
+#define PF11 PIN_A22
+#define PF12 PIN_A23
+#define PF13 PIN_A24
+#define PF14 PIN_A25
+#define PF15 93
+#define PG0 94
+#define PG1 95
+#define PG2 96
+#define PG3 97
+#define PG4 98
+#define PG5 99
+#define PG6 100
+#define PG7 101
+#define PG8 102
+#define PG9 103
+#define PG10 104
+#define PG11 105
+#define PG12 106
+#define PG13 107
+#define PG14 108
+#define PG15 109
+#define PH0 110
+#define PH1 111
+#define PC2_C PIN_A26
+#define PC3_C PIN_A27
+
+// Alternate pins number
+#define PA0_ALT1 (PA0 | ALT1)
+#define PA1_ALT1 (PA1 | ALT1)
+#define PA1_ALT2 (PA1 | ALT2)
+#define PA2_ALT1 (PA2 | ALT1)
+#define PA2_ALT2 (PA2 | ALT2)
+#define PA3_ALT1 (PA3 | ALT1)
+#define PA3_ALT2 (PA3 | ALT2)
+#define PA4_ALT1 (PA4 | ALT1)
+#define PA4_ALT2 (PA4 | ALT2)
+#define PA5_ALT1 (PA5 | ALT1)
+#define PA6_ALT1 (PA6 | ALT1)
+#define PA7_ALT1 (PA7 | ALT1)
+#define PA7_ALT2 (PA7 | ALT2)
+#define PA7_ALT3 (PA7 | ALT3)
+#define PA8_ALT1 (PA8 | ALT1)
+#define PA9_ALT1 (PA9 | ALT1)
+#define PA10_ALT1 (PA10 | ALT1)
+#define PA11_ALT1 (PA11 | ALT1)
+#define PA12_ALT1 (PA12 | ALT1)
+#define PA15_ALT1 (PA15 | ALT1)
+#define PA15_ALT2 (PA15 | ALT2)
+#define PB0_ALT1 (PB0 | ALT1)
+#define PB0_ALT2 (PB0 | ALT2)
+#define PB1_ALT1 (PB1 | ALT1)
+#define PB1_ALT2 (PB1 | ALT2)
+#define PB3_ALT1 (PB3 | ALT1)
+#define PB3_ALT2 (PB3 | ALT2)
+#define PB4_ALT1 (PB4 | ALT1)
+#define PB4_ALT2 (PB4 | ALT2)
+#define PB5_ALT1 (PB5 | ALT1)
+#define PB5_ALT2 (PB5 | ALT2)
+#define PB6_ALT1 (PB6 | ALT1)
+#define PB6_ALT2 (PB6 | ALT2)
+#define PB7_ALT1 (PB7 | ALT1)
+#define PB8_ALT1 (PB8 | ALT1)
+#define PB8_ALT2 (PB8 | ALT2)
+#define PB9_ALT1 (PB9 | ALT1)
+#define PB9_ALT2 (PB9 | ALT2)
+#define PB14_ALT1 (PB14 | ALT1)
+#define PB14_ALT2 (PB14 | ALT2)
+#define PB15_ALT1 (PB15 | ALT1)
+#define PB15_ALT2 (PB15 | ALT2)
+#define PC0_ALT1 (PC0 | ALT1)
+#define PC0_ALT2 (PC0 | ALT2)
+#define PC1_ALT1 (PC1 | ALT1)
+#define PC1_ALT2 (PC1 | ALT2)
+#define PC4_ALT1 (PC4 | ALT1)
+#define PC5_ALT1 (PC5 | ALT1)
+#define PC6_ALT1 (PC6 | ALT1)
+#define PC6_ALT2 (PC6 | ALT2)
+#define PC7_ALT1 (PC7 | ALT1)
+#define PC7_ALT2 (PC7 | ALT2)
+#define PC8_ALT1 (PC8 | ALT1)
+#define PC9_ALT1 (PC9 | ALT1)
+#define PC10_ALT1 (PC10 | ALT1)
+#define PC11_ALT1 (PC11 | ALT1)
+#define PF0_ALT1 (PF0 | ALT1)
+#define PF1_ALT1 (PF1 | ALT1)
+#define PF6_ALT1 (PF6 | ALT1)
+#define PF7_ALT1 (PF7 | ALT1)
+#define PF8_ALT1 (PF8 | ALT1)
+#define PF8_ALT2 (PF8 | ALT2)
+#define PF9_ALT1 (PF9 | ALT1)
+#define PF9_ALT2 (PF9 | ALT2)
+#define PG13_ALT1 (PG13 | ALT1)
+
+#define NUM_DIGITAL_PINS 114
+#define NUM_DUALPAD_PINS 2
+#define NUM_ANALOG_INPUTS 28
+
+// On-board LED pin number
+#ifndef LED_BUILTIN
+ #define LED_BUILTIN PNUM_NOT_DEFINED
+#endif
+
+// On-board user button
+#ifndef USER_BTN
+ #define USER_BTN PNUM_NOT_DEFINED
+#endif
+
+// SPI definitions
+#ifndef PIN_SPI_SS
+ #define PIN_SPI_SS PA4
+#endif
+#ifndef PIN_SPI_SS1
+ #define PIN_SPI_SS1 PA15
+#endif
+#ifndef PIN_SPI_SS2
+ #define PIN_SPI_SS2 PG10
+#endif
+#ifndef PIN_SPI_SS3
+ #define PIN_SPI_SS3 PNUM_NOT_DEFINED
+#endif
+#ifndef PIN_SPI_MOSI
+ #define PIN_SPI_MOSI PA7
+#endif
+#ifndef PIN_SPI_MISO
+ #define PIN_SPI_MISO PA6
+#endif
+#ifndef PIN_SPI_SCK
+ #define PIN_SPI_SCK PA5
+#endif
+
+// I2C definitions
+#ifndef PIN_WIRE_SDA
+ #define PIN_WIRE_SDA PB7
+#endif
+#ifndef PIN_WIRE_SCL
+ #define PIN_WIRE_SCL PB6
+#endif
+
+// Timer Definitions
+// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
+#ifndef TIMER_TONE
+ #define TIMER_TONE TIM6
+#endif
+#ifndef TIMER_SERVO
+ #define TIMER_SERVO TIM7
+#endif
+
+// UART Definitions
+#ifndef SERIAL_UART_INSTANCE
+ #define SERIAL_UART_INSTANCE 4
+#endif
+
+// Default pin used for generic 'Serial' instance
+// Mandatory for Firmata
+#ifndef PIN_SERIAL_RX
+ #define PIN_SERIAL_RX PA1
+#endif
+#ifndef PIN_SERIAL_TX
+ #define PIN_SERIAL_TX PA0
+#endif
+
+// Extra HAL modules
+#if !defined(HAL_DAC_MODULE_DISABLED)
+ #define HAL_DAC_MODULE_ENABLED
+#endif
+#if !defined(HAL_ETH_MODULE_DISABLED)
+ #define HAL_ETH_MODULE_ENABLED
+#endif
+#if !defined(HAL_OSPI_MODULE_DISABLED)
+ #define HAL_OSPI_MODULE_ENABLED
+#endif
+#if !defined(HAL_SD_MODULE_DISABLED)
+ #define HAL_SD_MODULE_ENABLED
+#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.
+ #ifndef SERIAL_PORT_MONITOR
+ #define SERIAL_PORT_MONITOR Serial
+ #endif
+ #ifndef SERIAL_PORT_HARDWARE
+ #define SERIAL_PORT_HARDWARE Serial
+ #endif
+#endif
diff --git a/ini/renamed.ini b/ini/renamed.ini
index cd890b593c..ae1b5742b5 100644
--- a/ini/renamed.ini
+++ b/ini/renamed.ini
@@ -53,3 +53,21 @@ extends = renamed
[env:mks_robin_nano35_maple] ;=> mks_robin_nano_v1v2_maple
extends = renamed
+
+[env:BIGTREE_OCTOPUS_V1] ;=> STM32F446ZE_btt
+extends = renamed
+
+[env:BIGTREE_OCTOPUS_V1_USB] ;=> STM32F446ZE_btt_USB
+extends = renamed
+
+[env:BIGTREE_OCTOPUS_PRO_V1_F429] ;=> STM32F429ZG_btt
+extends = renamed
+
+[env:BIGTREE_OCTOPUS_PRO_V1_F429_USB] ;=> STM32F429ZG_btt_USB
+extends = renamed
+
+[env:BIGTREE_OCTOPUS_V1_F407] ;=> STM32F407ZE_btt
+extends = renamed
+
+[env:BIGTREE_OCTOPUS_V1_F407_USB] ;=> STM32F407ZE_btt_USB
+extends = renamed
diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini
index d06e95750a..be7966be9d 100644
--- a/ini/stm32f1-maple.ini
+++ b/ini/stm32f1-maple.ini
@@ -352,7 +352,6 @@ build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
extends = STM32F1_maple
platform_packages = tool-stm32duino
board_build.address = 0x08005000
-board_build.offset = 0x5000
board_upload.maximum_size = 237568
build_flags = ${STM32F1_maple.build_flags}
-D__STM32F1__=1 -DDEBUG_LEVEL=0 -DSS_TIMER=4 -DSERIAL_USB
diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini
index 05a549bec7..aa3b1dfc7c 100644
--- a/ini/stm32f4.ini
+++ b/ini/stm32f4.ini
@@ -269,7 +269,7 @@ build_unflags = ${env:BIGTREE_SKR_2_F429_USB.build_unflags} -Os -NDEBUG
#
# BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4)
#
-[env:BIGTREE_OCTOPUS_V1]
+[env:STM32F446ZE_btt]
extends = stm32_variant
board = marlin_BigTree_Octopus_v1
board_build.offset = 0x8000
@@ -282,8 +282,8 @@ build_flags = ${stm32_variant.build_flags}
#
# BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support
#
-[env:BIGTREE_OCTOPUS_V1_USB]
-extends = env:BIGTREE_OCTOPUS_V1
+[env:STM32F446ZE_btt_USB]
+extends = env:STM32F446ZE_btt
platform_packages = ${stm_flash_drive.platform_packages}
build_unflags = -DUSBD_USE_CDC
build_flags = ${stm_flash_drive.build_flags}
@@ -293,9 +293,9 @@ build_flags = ${stm_flash_drive.build_flags}
-DUSBD_USE_CDC_MSC
#
-# BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4)
+# BigTreeTech Octopus V1.1 / Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4)
#
-[env:BIGTREE_OCTOPUS_PRO_V1_F429]
+[env:STM32F429ZG_btt]
extends = stm32_variant
board = marlin_BigTree_Octopus_Pro_v1_F429
board_build.offset = 0x8000
@@ -306,10 +306,10 @@ build_flags = ${stm32_variant.build_flags}
-DUSE_USB_HS_IN_FS
#
-# BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) with USB Flash Drive Support
+# BigTreeTech Octopus V1.1 / Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) with USB Flash Drive Support
#
-[env:BIGTREE_OCTOPUS_PRO_V1_F429_USB]
-extends = env:BIGTREE_OCTOPUS_PRO_V1_F429
+[env:STM32F429ZG_btt_USB]
+extends = env:STM32F429ZG_btt
platform_packages = ${stm_flash_drive.platform_packages}
build_unflags = -DUSBD_USE_CDC
build_flags = ${stm_flash_drive.build_flags}
@@ -320,7 +320,7 @@ build_flags = ${stm_flash_drive.build_flags}
#
# BigTreeTech Octopus / Octopus Pro (STM32F407ZET6 ARM Cortex-M4)
#
-[env:BIGTREE_OCTOPUS_V1_F407]
+[env:STM32F407ZE_btt]
extends = stm32_variant
board = marlin_STM32F407ZE
board_build.offset = 0x8000
@@ -330,8 +330,8 @@ build_flags = ${stm32_variant.build_flags}
#
# BigTreeTech Octopus / Octopus Pro (STM32F407ZET6 ARM Cortex-M4) with USB Flash Drive Support
#
-[env:BIGTREE_OCTOPUS_V1_F407_USB]
-extends = env:BIGTREE_OCTOPUS_V1_F407
+[env:STM32F407ZE_btt_USB]
+extends = env:STM32F407ZE_btt
platform_packages = ${stm_flash_drive.platform_packages}
build_unflags = -DUSBD_USE_CDC
build_flags = ${stm_flash_drive.build_flags}
diff --git a/ini/stm32h7.ini b/ini/stm32h7.ini
index d00d374c61..ff4a5b4c0b 100644
--- a/ini/stm32h7.ini
+++ b/ini/stm32h7.ini
@@ -44,8 +44,8 @@ debug_tool = cmsis-dap
#
[env:STM32H743Vx_btt]
extends = stm32_variant
-platform = ststm32@~15.4.1
-platform_packages = framework-arduinoststm32@~4.20200.220530
+platform = ststm32@15.4.1
+platform_packages = framework-arduinoststm32@4.20200.220530
board = marlin_STM32H743Vx
board_build.offset = 0x20000
board_upload.offset_address = 0x08020000
@@ -59,3 +59,56 @@ build_flags = ${stm32_variant.build_flags}
-DD_CACHE_DISABLED
upload_protocol = cmsis-dap
debug_tool = cmsis-dap
+
+#
+# BigTreeTech SKR V3.0 / SKR V3.0 EZ (STM32H723VGT6 ARM Cortex-M7)
+# BigTreeTech Octopus Max EZ V1.0 (STM32H723VET6 ARM Cortex-M7)
+#
+[env:STM32H723Vx_btt]
+extends = stm32_variant
+platform = ststm32@15.4.1
+platform_packages = framework-arduinoststm32@4.20200.220530
+board = marlin_STM32H723Vx
+board_build.offset = 0x20000
+board_upload.offset_address = 0x08020000
+build_flags = ${stm32_variant.build_flags}
+ -DPIN_SERIAL1_RX=PA_10 -DPIN_SERIAL1_TX=PA_9
+ -DPIN_SERIAL2_RX=PD_6 -DPIN_SERIAL2_TX=PD_5
+ -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8
+ -DPIN_SERIAL4_RX=PA_1 -DPIN_SERIAL4_TX=PA_0
+ -DPIN_SERIAL7_RX=PE_7 -DPIN_SERIAL7_TX=PE_8
+ -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024
+ -DTIMER_SERVO=TIM5 -DTIMER_TONE=TIM2
+ -DSTEP_TIMER_IRQ_PRIO=0
+ -DRCC_PERIPHCLK_I2C35=RCC_PERIPHCLK_I2C5
+ -DUSE_USB_HS -DUSE_USB_HS_IN_FS
+ -DD_CACHE_DISABLED
+ -UI2C5_BASE
+upload_protocol = cmsis-dap
+debug_tool = cmsis-dap
+
+#
+# BigTreeTech Octopus Pro V1.0 / Octopus Max EZ V1.0 (STM32H723ZET6 ARM Cortex-M7)
+#
+[env:STM32H723Zx_btt]
+extends = stm32_variant
+platform = ststm32@15.4.1
+platform_packages = framework-arduinoststm32@4.20200.220530
+board = marlin_STM32H723Zx
+board_build.offset = 0x20000
+board_upload.offset_address = 0x08020000
+build_flags = ${stm32_variant.build_flags}
+ -DPIN_SERIAL1_RX=PA_10 -DPIN_SERIAL1_TX=PA_9
+ -DPIN_SERIAL2_RX=PD_6 -DPIN_SERIAL2_TX=PD_5
+ -DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8
+ -DPIN_SERIAL4_RX=PA_1 -DPIN_SERIAL4_TX=PA_0
+ -DPIN_SERIAL7_RX=PE_7 -DPIN_SERIAL7_TX=PE_8
+ -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024
+ -DTIMER_SERVO=TIM5 -DTIMER_TONE=TIM2
+ -DSTEP_TIMER_IRQ_PRIO=0
+ -DRCC_PERIPHCLK_I2C35=RCC_PERIPHCLK_I2C5
+ -DUSE_USB_HS -DUSE_USB_HS_IN_FS
+ -DD_CACHE_DISABLED
+ -UI2C5_BASE
+upload_protocol = cmsis-dap
+debug_tool = cmsis-dap
From 987923ecb4bddb0a5813cc7c5563eb69722b33d5 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Sat, 11 Mar 2023 00:20:20 +0000
Subject: [PATCH 002/225] [cron] Bump distribution date (2023-03-11)
---
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 154e1f9c4e..96b70234ed 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 "2023-03-10"
+//#define STRING_DISTRIBUTION_DATE "2023-03-11"
/**
* 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 f1b0861dad..735f89a1fb 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 "2023-03-10"
+ #define STRING_DISTRIBUTION_DATE "2023-03-11"
#endif
/**
From 3e12934ea0878c311b55c00766493f1b7cda0044 Mon Sep 17 00:00:00 2001
From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com>
Date: Sat, 11 Mar 2023 00:08:07 -0800
Subject: [PATCH 003/225] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Anet=20ET4=20SD=5F?=
=?UTF-8?q?SS=5FPIN=20(#25492)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/pins/stm32f4/pins_ANET_ET4.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h
index 01ca4560fe..7c6eaca812 100644
--- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h
+++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h
@@ -206,6 +206,7 @@
#if DISABLED(SDIO_SUPPORT)
#define SOFTWARE_SPI
#define SDSS PC11
+ #define SD_SS_PIN SDSS
#define SD_SCK_PIN PC12
#define SD_MISO_PIN PC8
#define SD_MOSI_PIN PD2
From fe32582262a22d5e4111d14e47e087902fe3e9fd Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Sun, 12 Mar 2023 00:24:43 +0000
Subject: [PATCH 004/225] [cron] Bump distribution date (2023-03-12)
---
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 96b70234ed..614ee400b7 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 "2023-03-11"
+//#define STRING_DISTRIBUTION_DATE "2023-03-12"
/**
* 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 735f89a1fb..ca975adb4e 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 "2023-03-11"
+ #define STRING_DISTRIBUTION_DATE "2023-03-12"
#endif
/**
From 4527908c11be0f7a5f512f7235c0123b1e3f3e2a Mon Sep 17 00:00:00 2001
From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com>
Date: Sat, 11 Mar 2023 17:44:56 -0800
Subject: [PATCH 005/225] =?UTF-8?q?BTT=20Octopus=20=E2=80=A6=20followup=20?=
=?UTF-8?q?(#25495)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Followup to #25387
---
...ARLIN_STM32H723Zx.cpp => variant_MARLIN_STM32H723ZX.cpp} | 0
...nt_MARLIN_STM32H723Zx.h => variant_MARLIN_STM32H723ZX.h} | 0
ini/stm32h7.ini | 6 +++---
3 files changed, 3 insertions(+), 3 deletions(-)
rename buildroot/share/PlatformIO/variants/MARLIN_H723Zx/{variant_MARLIN_STM32H723Zx.cpp => variant_MARLIN_STM32H723ZX.cpp} (100%)
rename buildroot/share/PlatformIO/variants/MARLIN_H723Zx/{variant_MARLIN_STM32H723Zx.h => variant_MARLIN_STM32H723ZX.h} (100%)
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.cpp b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723ZX.cpp
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.cpp
rename to buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723ZX.cpp
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.h b/buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723ZX.h
similarity index 100%
rename from buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723Zx.h
rename to buildroot/share/PlatformIO/variants/MARLIN_H723Zx/variant_MARLIN_STM32H723ZX.h
diff --git a/ini/stm32h7.ini b/ini/stm32h7.ini
index ff4a5b4c0b..5733d35bf0 100644
--- a/ini/stm32h7.ini
+++ b/ini/stm32h7.ini
@@ -45,7 +45,7 @@ debug_tool = cmsis-dap
[env:STM32H743Vx_btt]
extends = stm32_variant
platform = ststm32@15.4.1
-platform_packages = framework-arduinoststm32@4.20200.220530
+platform_packages = framework-arduinoststm32@~4.20200.220530
board = marlin_STM32H743Vx
board_build.offset = 0x20000
board_upload.offset_address = 0x08020000
@@ -67,7 +67,7 @@ debug_tool = cmsis-dap
[env:STM32H723Vx_btt]
extends = stm32_variant
platform = ststm32@15.4.1
-platform_packages = framework-arduinoststm32@4.20200.220530
+platform_packages = framework-arduinoststm32@~4.20200.220530
board = marlin_STM32H723Vx
board_build.offset = 0x20000
board_upload.offset_address = 0x08020000
@@ -93,7 +93,7 @@ debug_tool = cmsis-dap
[env:STM32H723Zx_btt]
extends = stm32_variant
platform = ststm32@15.4.1
-platform_packages = framework-arduinoststm32@4.20200.220530
+platform_packages = framework-arduinoststm32@~4.20200.220530
board = marlin_STM32H723Zx
board_build.offset = 0x20000
board_upload.offset_address = 0x08020000
From cb66bff9246534c11acea192deae4ab6281b64c6 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:17:25 -0600
Subject: [PATCH 006/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Exit=20from=20ISR?=
=?UTF-8?q?=20on=20AVR=20already=20does=20sei?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/module/stepper.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index d0398b404c..b54b9668ea 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -1600,8 +1600,11 @@ void Stepper::isr() {
// Set the next ISR to fire at the proper time
HAL_timer_set_compare(MF_TIMER_STEP, hal_timer_t(next_isr_ticks));
- // Don't forget to finally reenable interrupts
- hal.isr_on();
+ // Don't forget to finally reenable interrupts on non-AVR.
+ // AVR automatically calls sei() for us on Return-from-Interrupt.
+ #ifndef __AVR__
+ hal.isr_on();
+ #endif
}
#if MINIMUM_STEPPER_PULSE || MAXIMUM_STEPPER_RATE
From f9d3939d2331b785c59924538f1d248d5ad23a58 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 18:51:37 -0600
Subject: [PATCH 007/225] =?UTF-8?q?=F0=9F=8E=A8=20Cosmetic=20stepper=20upd?=
=?UTF-8?q?ates?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/Configuration_adv.h | 18 +-
Marlin/src/core/types.h | 65 ++---
Marlin/src/module/stepper.cpp | 60 ++--
Marlin/src/module/stepper.h | 28 +-
Marlin/src/module/stepper/speed_lookuptable.h | 256 +++++++++---------
5 files changed, 218 insertions(+), 209 deletions(-)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index abb238e33e..f3f7a4c255 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -4042,16 +4042,16 @@
* Sample debug features
* If you add more debug displays, be careful to avoid conflicts!
*/
- #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning
- #define MAX7219_DEBUG_PLANNER_HEAD 2 // Show the planner queue head position on this and the next LED matrix row
- #define MAX7219_DEBUG_PLANNER_TAIL 4 // Show the planner queue tail position on this and the next LED matrix row
+ #define MAX7219_DEBUG_PRINTER_ALIVE // Blink corner LED of 8x8 matrix to show that the firmware is functioning
+ #define MAX7219_DEBUG_PLANNER_HEAD 2 // Show the planner queue head position on this and the next LED matrix row
+ #define MAX7219_DEBUG_PLANNER_TAIL 4 // Show the planner queue tail position on this and the next LED matrix row
- #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row
- // If you experience stuttering, reboots, etc. this option can reveal how
- // tweaks made to the configuration are affecting the printer in real-time.
- #define MAX7219_DEBUG_PROFILE 6 // Display the fraction of CPU time spent in profiled code on this LED matrix
- // row. By default idle() is profiled so this shows how "idle" the processor is.
- // See class CodeProfiler.
+ #define MAX7219_DEBUG_PLANNER_QUEUE 0 // Show the current planner queue depth on this and the next LED matrix row
+ // If you experience stuttering, reboots, etc. this option can reveal how
+ // tweaks made to the configuration are affecting the printer in real-time.
+ #define MAX7219_DEBUG_PROFILE 6 // Display the fraction of CPU time spent in profiled code on this LED matrix
+ // row. By default idle() is profiled so this shows how "idle" the processor is.
+ // See class CodeProfiler.
#endif
/**
diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h
index 4e3d7f0782..15d572af60 100644
--- a/Marlin/src/core/types.h
+++ b/Marlin/src/core/types.h
@@ -84,6 +84,13 @@ template struct IF { typedef L type; };
#define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L || AXIS7_NAME == L || AXIS8_NAME == L || AXIS9_NAME == L)
+// Helpers
+#define _RECIP(N) ((N) ? 1.0f / static_cast(N) : 0.0f)
+#define _ABS(N) ((N) < 0 ? -(N) : (N))
+#define _LS(N) (N = (T)(uint32_t(N) << p))
+#define _RS(N) (N = (T)(uint32_t(N) >> p))
+#define FI FORCE_INLINE
+
// Define types based on largest bit width stored value required
#define bits_t(W) typename IF<((W)> 16), uint32_t, typename IF<((W)> 8), uint16_t, uint8_t>::type>::type
#define uvalue_t(V) typename IF<((V)>65535), uint32_t, typename IF<((V)>255), uint16_t, uint8_t>::type>::type
@@ -101,28 +108,30 @@ struct Flags {
flagbits_t b;
typename IF<(N>16), N32, typename IF<(N>8), N16, N8>::type>::type flag;
};
- void reset() { b = 0; }
- void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
- void set(const int n) { b |= (flagbits_t)_BV(n); }
- void clear(const int n) { b &= ~(flagbits_t)_BV(n); }
- bool test(const int n) const { return TEST(b, n); }
- bool operator[](const int n) { return test(n); }
- bool operator[](const int n) const { return test(n); }
- int size() const { return sizeof(b); }
+ FI void reset() { b = 0; }
+ FI void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
+ FI void set(const int n) { b |= (flagbits_t)_BV(n); }
+ FI void clear(const int n) { b &= ~(flagbits_t)_BV(n); }
+ FI bool test(const int n) const { return TEST(b, n); }
+ FI bool operator[](const int n) { return test(n); }
+ FI bool operator[](const int n) const { return test(n); }
+ FI int size() const { return sizeof(b); }
+ FI operator bool() const { return b; }
};
// Specialization for a single bool flag
template<>
struct Flags<1> {
bool b;
- void reset() { b = false; }
- void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
- void set(const int) { b = true; }
- void clear(const int) { b = false; }
- bool test(const int) const { return b; }
- bool& operator[](const int) { return b; }
- bool operator[](const int) const { return b; }
- int size() const { return sizeof(b); }
+ FI void reset() { b = false; }
+ FI void set(const int n, const bool onoff) { onoff ? set(n) : clear(n); }
+ FI void set(const int) { b = true; }
+ FI void clear(const int) { b = false; }
+ FI bool test(const int) const { return b; }
+ FI bool& operator[](const int) { return b; }
+ FI bool operator[](const int) const { return b; }
+ FI int size() const { return sizeof(b); }
+ FI operator bool() const { return b; }
};
typedef Flags<8> flags_8_t;
@@ -134,14 +143,15 @@ typedef struct AxisFlags {
struct Flags flags;
struct { bool LOGICAL_AXIS_LIST(e:1, x:1, y:1, z:1, i:1, j:1, k:1, u:1, v:1, w:1); };
};
- void reset() { flags.reset(); }
- void set(const int n) { flags.set(n); }
- void set(const int n, const bool onoff) { flags.set(n, onoff); }
- void clear(const int n) { flags.clear(n); }
- bool test(const int n) const { return flags.test(n); }
- bool operator[](const int n) { return flags[n]; }
- bool operator[](const int n) const { return flags[n]; }
- int size() const { return sizeof(flags); }
+ FI void reset() { flags.reset(); }
+ FI void set(const int n) { flags.set(n); }
+ FI void set(const int n, const bool onoff) { flags.set(n, onoff); }
+ FI void clear(const int n) { flags.clear(n); }
+ FI bool test(const int n) const { return flags.test(n); }
+ FI bool operator[](const int n) { return flags[n]; }
+ FI bool operator[](const int n) const { return flags[n]; }
+ FI int size() const { return sizeof(flags); }
+ FI operator bool() const { return flags; }
} axis_flags_t;
//
@@ -230,13 +240,6 @@ typedef const_float_t const_celsius_float_t;
// Coordinates structures for XY, XYZ, XYZE...
//
-// Helpers
-#define _RECIP(N) ((N) ? 1.0f / static_cast(N) : 0.0f)
-#define _ABS(N) ((N) < 0 ? -(N) : (N))
-#define _LS(N) (N = (T)(uint32_t(N) << p))
-#define _RS(N) (N = (T)(uint32_t(N) >> p))
-#define FI FORCE_INLINE
-
// Forward declarations
template struct XYval;
template struct XYZval;
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index b54b9668ea..700cdd377b 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -189,7 +189,7 @@ bool Stepper::abort_current_block;
#endif
uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
-uint8_t Stepper::steps_per_isr;
+uint8_t Stepper::steps_per_isr; // Count of steps to perform per Stepper ISR call
#if ENABLED(FREEZE_FEATURE)
bool Stepper::frozen; // = false
@@ -1996,7 +1996,7 @@ void Stepper::pulse_phase_isr() {
void Stepper::shaping_isr() {
xy_bool_t step_needed{0};
- // Clear the echoes that are ready to process. If the buffers are too full and risk overflo, also apply echoes early.
+ // Clear the echoes that are ready to process. If the buffers are too full and risk overflow, also apply echoes early.
TERN_(INPUT_SHAPING_X, step_needed[X_AXIS] = !ShapingQueue::peek_x() || ShapingQueue::free_count_x() < steps_per_isr);
TERN_(INPUT_SHAPING_Y, step_needed[Y_AXIS] = !ShapingQueue::peek_y() || ShapingQueue::free_count_y() < steps_per_isr);
@@ -2047,39 +2047,45 @@ void Stepper::pulse_phase_isr() {
// Calculate timer interval, with all limits applied.
uint32_t Stepper::calc_timer_interval(uint32_t step_rate) {
+
#ifdef CPU_32_BIT
- // In case of high-performance processor, it is able to calculate in real-time
- return uint32_t(STEPPER_TIMER_RATE) / step_rate;
+
+ return uint32_t(STEPPER_TIMER_RATE) / step_rate; // A fast processor can just do integer division
+
#else
+
// AVR is able to keep up at 30khz Stepping ISR rate.
- constexpr uint32_t min_step_rate = (F_CPU) / 500000U;
- if (step_rate <= min_step_rate) {
+ constexpr uint32_t min_step_rate = (F_CPU) / 500000U; // i.e., 32 or 40
+ if (step_rate <= min_step_rate) { // lower step rates
step_rate = 0;
- uintptr_t table_address = (uintptr_t)&speed_lookuptable_slow[0][0];
- return uint16_t(pgm_read_word(table_address));
+ return uint16_t(pgm_read_word(uintptr_t(speed_lookuptable_slow)));
}
else {
step_rate -= min_step_rate; // Correct for minimal speed
if (step_rate >= 0x0800) { // higher step rate
- const uint8_t rate_mod_256 = (step_rate & 0x00FF);
- const uintptr_t table_address = uintptr_t(&speed_lookuptable_fast[uint8_t(step_rate >> 8)][0]),
- gain = uint16_t(pgm_read_word(table_address + 2));
- return uint16_t(pgm_read_word(table_address)) - MultiU8X16toH16(rate_mod_256, gain);
+ const uintptr_t table_address = uintptr_t(&speed_lookuptable_fast[uint8_t(step_rate >> 8)]);
+ const uint16_t gain = uint16_t(pgm_read_word(table_address + 2));
+ return uint16_t(pgm_read_word(table_address)) - MultiU8X16toH16(uint8_t(step_rate & 0x00FF), gain);
}
else { // lower step rates
- uintptr_t table_address = uintptr_t(&speed_lookuptable_slow[0][0]);
- table_address += (step_rate >> 1) & 0xFFFC;
+ const uintptr_t table_address = uintptr_t(&speed_lookuptable_slow[uint8_t(step_rate >> 3)]);
return uint16_t(pgm_read_word(table_address))
- ((uint16_t(pgm_read_word(table_address + 2)) * uint8_t(step_rate & 0x0007)) >> 3);
}
}
- #endif
+
+ #endif // !CPU_32_BIT
}
// Get the timer interval and the number of loops to perform per tick
uint32_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t &loops) {
uint8_t multistep = 1;
- #if DISABLED(DISABLE_MULTI_STEPPING)
+ #if ENABLED(DISABLE_MULTI_STEPPING)
+
+ // Just make sure the step rate is doable
+ NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X));
+
+ #else
// The stepping frequency limits for each multistepping rate
static const uint32_t limit[] PROGMEM = {
@@ -2100,18 +2106,18 @@ uint32_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t &loops) {
multistep <<= 1;
++idx;
};
- #else
- NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X));
+
#endif
loops = multistep;
return calc_timer_interval(step_rate);
}
-// This is the last half of the stepper interrupt: This one processes and
-// properly schedules blocks from the planner. This is executed after creating
-// the step pulses, so it is not time critical, as pulses are already done.
-
+/**
+ * This last phase of the stepper interrupt processes and properly
+ * schedules planner blocks. This is executed after the step pulses
+ * have been done, so it is less time critical.
+ */
uint32_t Stepper::block_phase_isr() {
// If no queued movements, just wait 1ms for the next block
@@ -2555,7 +2561,7 @@ uint32_t Stepper::block_phase_isr() {
if (stepper_extruder != last_moved_extruder) la_advance_steps = 0;
#endif
if (current_block->la_advance_rate) {
- // apply LA scaling and discount the effect of frequency scaling
+ // Apply LA scaling and discount the effect of frequency scaling
la_dividend = (advance_dividend.e << current_block->la_scaling) << oversampling_factor;
}
#endif
@@ -2597,7 +2603,7 @@ uint32_t Stepper::block_phase_isr() {
if (current_block->steps.z) enable_axis(Z_AXIS);
#endif
- // Mark the time_nominal as not calculated yet
+ // Mark ticks_nominal as not-yet-calculated
ticks_nominal = -1;
#if ENABLED(S_CURVE_ACCELERATION)
@@ -2635,8 +2641,8 @@ uint32_t Stepper::block_phase_isr() {
// the acceleration and speed values calculated in block_phase_isr().
// This helps keep LA in sync with, for example, S_CURVE_ACCELERATION.
la_delta_error += la_dividend;
- const bool step_needed = la_delta_error >= 0;
- if (step_needed) {
+ const bool e_step_needed = la_delta_error >= 0;
+ if (e_step_needed) {
count_position.e += count_direction.e;
la_advance_steps += count_direction.e;
la_delta_error -= advance_divisor;
@@ -2647,7 +2653,7 @@ uint32_t Stepper::block_phase_isr() {
TERN_(I2S_STEPPER_STREAM, i2s_push_sample());
- if (step_needed) {
+ if (e_step_needed) {
// Enforce a minimum duration for STEP pulse ON
#if ISR_PULSE_CONTROL
USING_TIMED_PULSE();
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 05f609c9f3..3a3e45dccc 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -217,10 +217,10 @@
// The loop takes the base time plus the time for all the bresenham logic for R pulses plus the time
// between pulses for (R-1) pulses. But the user could be enforcing a minimum time so the loop time is:
-#define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * (R - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES))
+#define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * ((1UL << R) - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES))
// Model input shaping as an extra loop call
-#define ISR_SHAPING_LOOP_CYCLES(R) TERN0(HAS_SHAPING, (R) * ((ISR_LOOP_BASE_CYCLES) + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)))
+#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_SHAPING, ((ISR_LOOP_BASE_CYCLES) + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R))
// If linear advance is enabled, then it is handled separately
#if ENABLED(LIN_ADVANCE)
@@ -245,17 +245,17 @@
#endif
// Now estimate the total ISR execution time in cycles given a step per ISR multiplier
-#define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + ISR_SHAPING_BASE_CYCLES + ISR_LOOP_CYCLES(R) + ISR_SHAPING_LOOP_CYCLES(R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) / (R))
+#define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + ISR_SHAPING_BASE_CYCLES + ISR_LOOP_CYCLES(R) + ISR_SHAPING_LOOP_CYCLES(R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) >> R)
// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz)
-#define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(128))
-#define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(64))
-#define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(32))
-#define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(16))
-#define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(8))
-#define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(4))
-#define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(2))
-#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(1))
+#define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(7))
+#define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(6))
+#define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(5))
+#define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(4))
+#define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(3))
+#define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(2))
+#define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(1))
+#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(0))
// The minimum step ISR rate used by ADAPTIVE_STEP_SMOOTHING to target 50% CPU usage
// This does not account for the possibility of multi-stepping.
@@ -459,8 +459,6 @@ constexpr ena_mask_t enable_overlap[] = {
// Stepper class definition
//
class Stepper {
- friend class KinematicSystem;
- friend class DeltaKinematicSystem;
friend void stepperTask(void *);
public:
@@ -810,8 +808,10 @@ class Stepper {
// Set the current position in steps
static void _set_position(const abce_long_t &spos);
- // Calculate timing interval for the given step rate
+ // Calculate the timing interval for the given step rate
static uint32_t calc_timer_interval(uint32_t step_rate);
+
+ // Calculate timing interval and steps-per-ISR for the given step rate
static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t &loops);
#if ENABLED(S_CURVE_ACCELERATION)
diff --git a/Marlin/src/module/stepper/speed_lookuptable.h b/Marlin/src/module/stepper/speed_lookuptable.h
index b173ebec08..0b4205ea57 100644
--- a/Marlin/src/module/stepper/speed_lookuptable.h
+++ b/Marlin/src/module/stepper/speed_lookuptable.h
@@ -24,145 +24,145 @@
#if F_CPU == 16000000
const uint16_t speed_lookuptable_fast[256][2] PROGMEM = {
- { 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135},
- { 961, 105}, { 856, 85}, { 771, 69}, { 702, 58}, { 644, 49}, { 595, 42}, { 553, 37}, { 516, 32},
- { 484, 28}, { 456, 25}, { 431, 23}, { 408, 20}, { 388, 19}, { 369, 16}, { 353, 16}, { 337, 14},
- { 323, 13}, { 310, 11}, { 299, 11}, { 288, 11}, { 277, 9}, { 268, 9}, { 259, 8}, { 251, 8},
- { 243, 8}, { 235, 7}, { 228, 6}, { 222, 6}, { 216, 6}, { 210, 6}, { 204, 5}, { 199, 5},
- { 194, 5}, { 189, 4}, { 185, 4}, { 181, 4}, { 177, 4}, { 173, 4}, { 169, 4}, { 165, 3},
- { 162, 3}, { 159, 4}, { 155, 3}, { 152, 3}, { 149, 2}, { 147, 3}, { 144, 3}, { 141, 2},
- { 139, 3}, { 136, 2}, { 134, 2}, { 132, 3}, { 129, 2}, { 127, 2}, { 125, 2}, { 123, 2},
- { 121, 2}, { 119, 1}, { 118, 2}, { 116, 2}, { 114, 1}, { 113, 2}, { 111, 2}, { 109, 1},
- { 108, 2}, { 106, 1}, { 105, 2}, { 103, 1}, { 102, 1}, { 101, 1}, { 100, 2}, { 98, 1},
- { 97, 1}, { 96, 1}, { 95, 2}, { 93, 1}, { 92, 1}, { 91, 1}, { 90, 1}, { 89, 1},
- { 88, 1}, { 87, 1}, { 86, 1}, { 85, 1}, { 84, 1}, { 83, 0}, { 83, 1}, { 82, 1},
- { 81, 1}, { 80, 1}, { 79, 1}, { 78, 0}, { 78, 1}, { 77, 1}, { 76, 1}, { 75, 0},
- { 75, 1}, { 74, 1}, { 73, 1}, { 72, 0}, { 72, 1}, { 71, 1}, { 70, 0}, { 70, 1},
- { 69, 0}, { 69, 1}, { 68, 1}, { 67, 0}, { 67, 1}, { 66, 0}, { 66, 1}, { 65, 0},
- { 65, 1}, { 64, 1}, { 63, 0}, { 63, 1}, { 62, 0}, { 62, 1}, { 61, 0}, { 61, 1},
- { 60, 0}, { 60, 0}, { 60, 1}, { 59, 0}, { 59, 1}, { 58, 0}, { 58, 1}, { 57, 0},
- { 57, 1}, { 56, 0}, { 56, 0}, { 56, 1}, { 55, 0}, { 55, 1}, { 54, 0}, { 54, 0},
- { 54, 1}, { 53, 0}, { 53, 0}, { 53, 1}, { 52, 0}, { 52, 0}, { 52, 1}, { 51, 0},
- { 51, 0}, { 51, 1}, { 50, 0}, { 50, 0}, { 50, 1}, { 49, 0}, { 49, 0}, { 49, 1},
- { 48, 0}, { 48, 0}, { 48, 1}, { 47, 0}, { 47, 0}, { 47, 0}, { 47, 1}, { 46, 0},
- { 46, 0}, { 46, 1}, { 45, 0}, { 45, 0}, { 45, 0}, { 45, 1}, { 44, 0}, { 44, 0},
- { 44, 0}, { 44, 1}, { 43, 0}, { 43, 0}, { 43, 0}, { 43, 1}, { 42, 0}, { 42, 0},
- { 42, 0}, { 42, 1}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 0}, { 41, 1}, { 40, 0},
- { 40, 0}, { 40, 0}, { 40, 0}, { 40, 1}, { 39, 0}, { 39, 0}, { 39, 0}, { 39, 0},
- { 39, 1}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 0}, { 38, 1}, { 37, 0}, { 37, 0},
- { 37, 0}, { 37, 0}, { 37, 0}, { 37, 1}, { 36, 0}, { 36, 0}, { 36, 0}, { 36, 0},
- { 36, 1}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 0}, { 35, 1},
- { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 0}, { 34, 1}, { 33, 0}, { 33, 0},
- { 33, 0}, { 33, 0}, { 33, 0}, { 33, 0}, { 33, 1}, { 32, 0}, { 32, 0}, { 32, 0},
- { 32, 0}, { 32, 0}, { 32, 0}, { 32, 0}, { 32, 1}, { 31, 0}, { 31, 0}, { 31, 0},
- { 31, 0}, { 31, 0}, { 31, 0}, { 31, 1}, { 30, 0}, { 30, 0}, { 30, 0}, { 30, 0}
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // dummy first row
+ { 961, 105 }, { 856, 85 }, { 771, 69 }, { 702, 58 }, { 644, 49 }, { 595, 42 }, { 553, 37 }, { 516, 32 },
+ { 484, 28 }, { 456, 25 }, { 431, 23 }, { 408, 20 }, { 388, 19 }, { 369, 16 }, { 353, 16 }, { 337, 14 },
+ { 323, 13 }, { 310, 11 }, { 299, 11 }, { 288, 11 }, { 277, 9 }, { 268, 9 }, { 259, 8 }, { 251, 8 },
+ { 243, 8 }, { 235, 7 }, { 228, 6 }, { 222, 6 }, { 216, 6 }, { 210, 6 }, { 204, 5 }, { 199, 5 },
+ { 194, 5 }, { 189, 4 }, { 185, 4 }, { 181, 4 }, { 177, 4 }, { 173, 4 }, { 169, 4 }, { 165, 3 },
+ { 162, 3 }, { 159, 4 }, { 155, 3 }, { 152, 3 }, { 149, 2 }, { 147, 3 }, { 144, 3 }, { 141, 2 },
+ { 139, 3 }, { 136, 2 }, { 134, 2 }, { 132, 3 }, { 129, 2 }, { 127, 2 }, { 125, 2 }, { 123, 2 },
+ { 121, 2 }, { 119, 1 }, { 118, 2 }, { 116, 2 }, { 114, 1 }, { 113, 2 }, { 111, 2 }, { 109, 1 },
+ { 108, 2 }, { 106, 1 }, { 105, 2 }, { 103, 1 }, { 102, 1 }, { 101, 1 }, { 100, 2 }, { 98, 1 },
+ { 97, 1 }, { 96, 1 }, { 95, 2 }, { 93, 1 }, { 92, 1 }, { 91, 1 }, { 90, 1 }, { 89, 1 },
+ { 88, 1 }, { 87, 1 }, { 86, 1 }, { 85, 1 }, { 84, 1 }, { 83, 0 }, { 83, 1 }, { 82, 1 },
+ { 81, 1 }, { 80, 1 }, { 79, 1 }, { 78, 0 }, { 78, 1 }, { 77, 1 }, { 76, 1 }, { 75, 0 },
+ { 75, 1 }, { 74, 1 }, { 73, 1 }, { 72, 0 }, { 72, 1 }, { 71, 1 }, { 70, 0 }, { 70, 1 },
+ { 69, 0 }, { 69, 1 }, { 68, 1 }, { 67, 0 }, { 67, 1 }, { 66, 0 }, { 66, 1 }, { 65, 0 },
+ { 65, 1 }, { 64, 1 }, { 63, 0 }, { 63, 1 }, { 62, 0 }, { 62, 1 }, { 61, 0 }, { 61, 1 },
+ { 60, 0 }, { 60, 0 }, { 60, 1 }, { 59, 0 }, { 59, 1 }, { 58, 0 }, { 58, 1 }, { 57, 0 },
+ { 57, 1 }, { 56, 0 }, { 56, 0 }, { 56, 1 }, { 55, 0 }, { 55, 1 }, { 54, 0 }, { 54, 0 },
+ { 54, 1 }, { 53, 0 }, { 53, 0 }, { 53, 1 }, { 52, 0 }, { 52, 0 }, { 52, 1 }, { 51, 0 },
+ { 51, 0 }, { 51, 1 }, { 50, 0 }, { 50, 0 }, { 50, 1 }, { 49, 0 }, { 49, 0 }, { 49, 1 },
+ { 48, 0 }, { 48, 0 }, { 48, 1 }, { 47, 0 }, { 47, 0 }, { 47, 0 }, { 47, 1 }, { 46, 0 },
+ { 46, 0 }, { 46, 1 }, { 45, 0 }, { 45, 0 }, { 45, 0 }, { 45, 1 }, { 44, 0 }, { 44, 0 },
+ { 44, 0 }, { 44, 1 }, { 43, 0 }, { 43, 0 }, { 43, 0 }, { 43, 1 }, { 42, 0 }, { 42, 0 },
+ { 42, 0 }, { 42, 1 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 1 }, { 40, 0 },
+ { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 1 }, { 39, 0 }, { 39, 0 }, { 39, 0 }, { 39, 0 },
+ { 39, 1 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 1 }, { 37, 0 }, { 37, 0 },
+ { 37, 0 }, { 37, 0 }, { 37, 0 }, { 37, 1 }, { 36, 0 }, { 36, 0 }, { 36, 0 }, { 36, 0 },
+ { 36, 1 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 1 },
+ { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 1 }, { 33, 0 }, { 33, 0 },
+ { 33, 0 }, { 33, 0 }, { 33, 0 }, { 33, 0 }, { 33, 1 }, { 32, 0 }, { 32, 0 }, { 32, 0 },
+ { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 1 }, { 31, 0 }, { 31, 0 }, { 31, 0 },
+ { 31, 0 }, { 31, 0 }, { 31, 0 }, { 31, 1 }, { 30, 0 }, { 30, 0 }, { 30, 0 }, { 30, 0 }
};
const uint16_t speed_lookuptable_slow[256][2] PROGMEM = {
- { 62500, 12500}, { 50000, 8334}, { 41666, 5952}, { 35714, 4464}, { 31250, 3473}, { 27777, 2777}, { 25000, 2273}, { 22727, 1894},
- { 20833, 1603}, { 19230, 1373}, { 17857, 1191}, { 16666, 1041}, { 15625, 920}, { 14705, 817}, { 13888, 731}, { 13157, 657},
- { 12500, 596}, { 11904, 541}, { 11363, 494}, { 10869, 453}, { 10416, 416}, { 10000, 385}, { 9615, 356}, { 9259, 331},
- { 8928, 308}, { 8620, 287}, { 8333, 269}, { 8064, 252}, { 7812, 237}, { 7575, 223}, { 7352, 210}, { 7142, 198},
- { 6944, 188}, { 6756, 178}, { 6578, 168}, { 6410, 160}, { 6250, 153}, { 6097, 145}, { 5952, 139}, { 5813, 132},
- { 5681, 126}, { 5555, 121}, { 5434, 115}, { 5319, 111}, { 5208, 106}, { 5102, 102}, { 5000, 99}, { 4901, 94},
- { 4807, 91}, { 4716, 87}, { 4629, 84}, { 4545, 81}, { 4464, 79}, { 4385, 75}, { 4310, 73}, { 4237, 71},
- { 4166, 68}, { 4098, 66}, { 4032, 64}, { 3968, 62}, { 3906, 60}, { 3846, 59}, { 3787, 56}, { 3731, 55},
- { 3676, 53}, { 3623, 52}, { 3571, 50}, { 3521, 49}, { 3472, 48}, { 3424, 46}, { 3378, 45}, { 3333, 44},
- { 3289, 43}, { 3246, 41}, { 3205, 41}, { 3164, 39}, { 3125, 39}, { 3086, 38}, { 3048, 36}, { 3012, 36},
- { 2976, 35}, { 2941, 35}, { 2906, 33}, { 2873, 33}, { 2840, 32}, { 2808, 31}, { 2777, 30}, { 2747, 30},
- { 2717, 29}, { 2688, 29}, { 2659, 28}, { 2631, 27}, { 2604, 27}, { 2577, 26}, { 2551, 26}, { 2525, 25},
- { 2500, 25}, { 2475, 25}, { 2450, 23}, { 2427, 24}, { 2403, 23}, { 2380, 22}, { 2358, 22}, { 2336, 22},
- { 2314, 21}, { 2293, 21}, { 2272, 20}, { 2252, 20}, { 2232, 20}, { 2212, 20}, { 2192, 19}, { 2173, 18},
- { 2155, 19}, { 2136, 18}, { 2118, 18}, { 2100, 17}, { 2083, 17}, { 2066, 17}, { 2049, 17}, { 2032, 16},
- { 2016, 16}, { 2000, 16}, { 1984, 16}, { 1968, 15}, { 1953, 16}, { 1937, 14}, { 1923, 15}, { 1908, 15},
- { 1893, 14}, { 1879, 14}, { 1865, 14}, { 1851, 13}, { 1838, 14}, { 1824, 13}, { 1811, 13}, { 1798, 13},
- { 1785, 12}, { 1773, 13}, { 1760, 12}, { 1748, 12}, { 1736, 12}, { 1724, 12}, { 1712, 12}, { 1700, 11},
- { 1689, 12}, { 1677, 11}, { 1666, 11}, { 1655, 11}, { 1644, 11}, { 1633, 10}, { 1623, 11}, { 1612, 10},
- { 1602, 10}, { 1592, 10}, { 1582, 10}, { 1572, 10}, { 1562, 10}, { 1552, 9}, { 1543, 10}, { 1533, 9},
- { 1524, 9}, { 1515, 9}, { 1506, 9}, { 1497, 9}, { 1488, 9}, { 1479, 9}, { 1470, 9}, { 1461, 8},
- { 1453, 8}, { 1445, 9}, { 1436, 8}, { 1428, 8}, { 1420, 8}, { 1412, 8}, { 1404, 8}, { 1396, 8},
- { 1388, 7}, { 1381, 8}, { 1373, 7}, { 1366, 8}, { 1358, 7}, { 1351, 7}, { 1344, 8}, { 1336, 7},
- { 1329, 7}, { 1322, 7}, { 1315, 7}, { 1308, 6}, { 1302, 7}, { 1295, 7}, { 1288, 6}, { 1282, 7},
- { 1275, 6}, { 1269, 7}, { 1262, 6}, { 1256, 6}, { 1250, 7}, { 1243, 6}, { 1237, 6}, { 1231, 6},
- { 1225, 6}, { 1219, 6}, { 1213, 6}, { 1207, 6}, { 1201, 5}, { 1196, 6}, { 1190, 6}, { 1184, 5},
- { 1179, 6}, { 1173, 5}, { 1168, 6}, { 1162, 5}, { 1157, 5}, { 1152, 6}, { 1146, 5}, { 1141, 5},
- { 1136, 5}, { 1131, 5}, { 1126, 5}, { 1121, 5}, { 1116, 5}, { 1111, 5}, { 1106, 5}, { 1101, 5},
- { 1096, 5}, { 1091, 5}, { 1086, 4}, { 1082, 5}, { 1077, 5}, { 1072, 4}, { 1068, 5}, { 1063, 4},
- { 1059, 5}, { 1054, 4}, { 1050, 4}, { 1046, 5}, { 1041, 4}, { 1037, 4}, { 1033, 5}, { 1028, 4},
- { 1024, 4}, { 1020, 4}, { 1016, 4}, { 1012, 4}, { 1008, 4}, { 1004, 4}, { 1000, 4}, { 996, 4},
- { 992, 4}, { 988, 4}, { 984, 4}, { 980, 4}, { 976, 4}, { 972, 4}, { 968, 3}, { 965, 3}
+ { 62500, 12500 }, { 50000, 8334 }, { 41666, 5952 }, { 35714, 4464 }, { 31250, 3473 }, { 27777, 2777 }, { 25000, 2273 }, { 22727, 1894 },
+ { 20833, 1603 }, { 19230, 1373 }, { 17857, 1191 }, { 16666, 1041 }, { 15625, 920 }, { 14705, 817 }, { 13888, 731 }, { 13157, 657 },
+ { 12500, 596 }, { 11904, 541 }, { 11363, 494 }, { 10869, 453 }, { 10416, 416 }, { 10000, 385 }, { 9615, 356 }, { 9259, 331 },
+ { 8928, 308 }, { 8620, 287 }, { 8333, 269 }, { 8064, 252 }, { 7812, 237 }, { 7575, 223 }, { 7352, 210 }, { 7142, 198 },
+ { 6944, 188 }, { 6756, 178 }, { 6578, 168 }, { 6410, 160 }, { 6250, 153 }, { 6097, 145 }, { 5952, 139 }, { 5813, 132 },
+ { 5681, 126 }, { 5555, 121 }, { 5434, 115 }, { 5319, 111 }, { 5208, 106 }, { 5102, 102 }, { 5000, 99 }, { 4901, 94 },
+ { 4807, 91 }, { 4716, 87 }, { 4629, 84 }, { 4545, 81 }, { 4464, 79 }, { 4385, 75 }, { 4310, 73 }, { 4237, 71 },
+ { 4166, 68 }, { 4098, 66 }, { 4032, 64 }, { 3968, 62 }, { 3906, 60 }, { 3846, 59 }, { 3787, 56 }, { 3731, 55 },
+ { 3676, 53 }, { 3623, 52 }, { 3571, 50 }, { 3521, 49 }, { 3472, 48 }, { 3424, 46 }, { 3378, 45 }, { 3333, 44 },
+ { 3289, 43 }, { 3246, 41 }, { 3205, 41 }, { 3164, 39 }, { 3125, 39 }, { 3086, 38 }, { 3048, 36 }, { 3012, 36 },
+ { 2976, 35 }, { 2941, 35 }, { 2906, 33 }, { 2873, 33 }, { 2840, 32 }, { 2808, 31 }, { 2777, 30 }, { 2747, 30 },
+ { 2717, 29 }, { 2688, 29 }, { 2659, 28 }, { 2631, 27 }, { 2604, 27 }, { 2577, 26 }, { 2551, 26 }, { 2525, 25 },
+ { 2500, 25 }, { 2475, 25 }, { 2450, 23 }, { 2427, 24 }, { 2403, 23 }, { 2380, 22 }, { 2358, 22 }, { 2336, 22 },
+ { 2314, 21 }, { 2293, 21 }, { 2272, 20 }, { 2252, 20 }, { 2232, 20 }, { 2212, 20 }, { 2192, 19 }, { 2173, 18 },
+ { 2155, 19 }, { 2136, 18 }, { 2118, 18 }, { 2100, 17 }, { 2083, 17 }, { 2066, 17 }, { 2049, 17 }, { 2032, 16 },
+ { 2016, 16 }, { 2000, 16 }, { 1984, 16 }, { 1968, 15 }, { 1953, 16 }, { 1937, 14 }, { 1923, 15 }, { 1908, 15 },
+ { 1893, 14 }, { 1879, 14 }, { 1865, 14 }, { 1851, 13 }, { 1838, 14 }, { 1824, 13 }, { 1811, 13 }, { 1798, 13 },
+ { 1785, 12 }, { 1773, 13 }, { 1760, 12 }, { 1748, 12 }, { 1736, 12 }, { 1724, 12 }, { 1712, 12 }, { 1700, 11 },
+ { 1689, 12 }, { 1677, 11 }, { 1666, 11 }, { 1655, 11 }, { 1644, 11 }, { 1633, 10 }, { 1623, 11 }, { 1612, 10 },
+ { 1602, 10 }, { 1592, 10 }, { 1582, 10 }, { 1572, 10 }, { 1562, 10 }, { 1552, 9 }, { 1543, 10 }, { 1533, 9 },
+ { 1524, 9 }, { 1515, 9 }, { 1506, 9 }, { 1497, 9 }, { 1488, 9 }, { 1479, 9 }, { 1470, 9 }, { 1461, 8 },
+ { 1453, 8 }, { 1445, 9 }, { 1436, 8 }, { 1428, 8 }, { 1420, 8 }, { 1412, 8 }, { 1404, 8 }, { 1396, 8 },
+ { 1388, 7 }, { 1381, 8 }, { 1373, 7 }, { 1366, 8 }, { 1358, 7 }, { 1351, 7 }, { 1344, 8 }, { 1336, 7 },
+ { 1329, 7 }, { 1322, 7 }, { 1315, 7 }, { 1308, 6 }, { 1302, 7 }, { 1295, 7 }, { 1288, 6 }, { 1282, 7 },
+ { 1275, 6 }, { 1269, 7 }, { 1262, 6 }, { 1256, 6 }, { 1250, 7 }, { 1243, 6 }, { 1237, 6 }, { 1231, 6 },
+ { 1225, 6 }, { 1219, 6 }, { 1213, 6 }, { 1207, 6 }, { 1201, 5 }, { 1196, 6 }, { 1190, 6 }, { 1184, 5 },
+ { 1179, 6 }, { 1173, 5 }, { 1168, 6 }, { 1162, 5 }, { 1157, 5 }, { 1152, 6 }, { 1146, 5 }, { 1141, 5 },
+ { 1136, 5 }, { 1131, 5 }, { 1126, 5 }, { 1121, 5 }, { 1116, 5 }, { 1111, 5 }, { 1106, 5 }, { 1101, 5 },
+ { 1096, 5 }, { 1091, 5 }, { 1086, 4 }, { 1082, 5 }, { 1077, 5 }, { 1072, 4 }, { 1068, 5 }, { 1063, 4 },
+ { 1059, 5 }, { 1054, 4 }, { 1050, 4 }, { 1046, 5 }, { 1041, 4 }, { 1037, 4 }, { 1033, 5 }, { 1028, 4 },
+ { 1024, 4 }, { 1020, 4 }, { 1016, 4 }, { 1012, 4 }, { 1008, 4 }, { 1004, 4 }, { 1000, 4 }, { 996, 4 },
+ { 992, 4 }, { 988, 4 }, { 984, 4 }, { 980, 4 }, { 976, 4 }, { 972, 4 }, { 968, 3 }, { 965, 3 }
};
#elif F_CPU == 20000000
const uint16_t speed_lookuptable_fast[256][2] PROGMEM = {
- {62500, 54055}, {8445, 3917}, {4528, 1434}, {3094, 745}, {2349, 456}, {1893, 307}, {1586, 222}, {1364, 167},
- {1197, 131}, {1066, 105}, {961, 86}, {875, 72}, {803, 61}, {742, 53}, {689, 45}, {644, 40},
- {604, 35}, {569, 32}, {537, 28}, {509, 25}, {484, 23}, {461, 21}, {440, 19}, {421, 17},
- {404, 16}, {388, 15}, {373, 14}, {359, 13}, {346, 12}, {334, 11}, {323, 10}, {313, 10},
- {303, 9}, {294, 9}, {285, 8}, {277, 7}, {270, 8}, {262, 7}, {255, 6}, {249, 6},
- {243, 6}, {237, 6}, {231, 5}, {226, 5}, {221, 5}, {216, 5}, {211, 4}, {207, 5},
- {202, 4}, {198, 4}, {194, 4}, {190, 3}, {187, 4}, {183, 3}, {180, 3}, {177, 4},
- {173, 3}, {170, 3}, {167, 2}, {165, 3}, {162, 3}, {159, 2}, {157, 3}, {154, 2},
- {152, 3}, {149, 2}, {147, 2}, {145, 2}, {143, 2}, {141, 2}, {139, 2}, {137, 2},
- {135, 2}, {133, 2}, {131, 2}, {129, 1}, {128, 2}, {126, 2}, {124, 1}, {123, 2},
- {121, 1}, {120, 2}, {118, 1}, {117, 1}, {116, 2}, {114, 1}, {113, 1}, {112, 2},
- {110, 1}, {109, 1}, {108, 1}, {107, 2}, {105, 1}, {104, 1}, {103, 1}, {102, 1},
- {101, 1}, {100, 1}, {99, 1}, {98, 1}, {97, 1}, {96, 1}, {95, 1}, {94, 1},
- {93, 1}, {92, 1}, {91, 0}, {91, 1}, {90, 1}, {89, 1}, {88, 1}, {87, 0},
- {87, 1}, {86, 1}, {85, 1}, {84, 0}, {84, 1}, {83, 1}, {82, 1}, {81, 0},
- {81, 1}, {80, 1}, {79, 0}, {79, 1}, {78, 0}, {78, 1}, {77, 1}, {76, 0},
- {76, 1}, {75, 0}, {75, 1}, {74, 1}, {73, 0}, {73, 1}, {72, 0}, {72, 1},
- {71, 0}, {71, 1}, {70, 0}, {70, 1}, {69, 0}, {69, 1}, {68, 0}, {68, 1},
- {67, 0}, {67, 1}, {66, 0}, {66, 1}, {65, 0}, {65, 0}, {65, 1}, {64, 0},
- {64, 1}, {63, 0}, {63, 1}, {62, 0}, {62, 0}, {62, 1}, {61, 0}, {61, 1},
- {60, 0}, {60, 0}, {60, 1}, {59, 0}, {59, 0}, {59, 1}, {58, 0}, {58, 0},
- {58, 1}, {57, 0}, {57, 0}, {57, 1}, {56, 0}, {56, 0}, {56, 1}, {55, 0},
- {55, 0}, {55, 1}, {54, 0}, {54, 0}, {54, 1}, {53, 0}, {53, 0}, {53, 0},
- {53, 1}, {52, 0}, {52, 0}, {52, 1}, {51, 0}, {51, 0}, {51, 0}, {51, 1},
- {50, 0}, {50, 0}, {50, 0}, {50, 1}, {49, 0}, {49, 0}, {49, 0}, {49, 1},
- {48, 0}, {48, 0}, {48, 0}, {48, 1}, {47, 0}, {47, 0}, {47, 0}, {47, 1},
- {46, 0}, {46, 0}, {46, 0}, {46, 0}, {46, 1}, {45, 0}, {45, 0}, {45, 0},
- {45, 1}, {44, 0}, {44, 0}, {44, 0}, {44, 0}, {44, 1}, {43, 0}, {43, 0},
- {43, 0}, {43, 0}, {43, 1}, {42, 0}, {42, 0}, {42, 0}, {42, 0}, {42, 0},
- {42, 1}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 0}, {41, 1}, {40, 0},
- {40, 0}, {40, 0}, {40, 0}, {40, 1}, {39, 0}, {39, 0}, {39, 0}, {39, 0},
- {39, 0}, {39, 0}, {39, 1}, {38, 0}, {38, 0}, {38, 0}, {38, 0}, {38, 0},
+ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // dummy first row
+ { 1197, 131 }, { 1066, 105 }, { 961, 86 }, { 875, 72 }, { 803, 61 }, { 742, 53 }, { 689, 45 }, { 644, 40 },
+ { 604, 35 }, { 569, 32 }, { 537, 28 }, { 509, 25 }, { 484, 23 }, { 461, 21 }, { 440, 19 }, { 421, 17 },
+ { 404, 16 }, { 388, 15 }, { 373, 14 }, { 359, 13 }, { 346, 12 }, { 334, 11 }, { 323, 10 }, { 313, 10 },
+ { 303, 9 }, { 294, 9 }, { 285, 8 }, { 277, 7 }, { 270, 8 }, { 262, 7 }, { 255, 6 }, { 249, 6 },
+ { 243, 6 }, { 237, 6 }, { 231, 5 }, { 226, 5 }, { 221, 5 }, { 216, 5 }, { 211, 4 }, { 207, 5 },
+ { 202, 4 }, { 198, 4 }, { 194, 4 }, { 190, 3 }, { 187, 4 }, { 183, 3 }, { 180, 3 }, { 177, 4 },
+ { 173, 3 }, { 170, 3 }, { 167, 2 }, { 165, 3 }, { 162, 3 }, { 159, 2 }, { 157, 3 }, { 154, 2 },
+ { 152, 3 }, { 149, 2 }, { 147, 2 }, { 145, 2 }, { 143, 2 }, { 141, 2 }, { 139, 2 }, { 137, 2 },
+ { 135, 2 }, { 133, 2 }, { 131, 2 }, { 129, 1 }, { 128, 2 }, { 126, 2 }, { 124, 1 }, { 123, 2 },
+ { 121, 1 }, { 120, 2 }, { 118, 1 }, { 117, 1 }, { 116, 2 }, { 114, 1 }, { 113, 1 }, { 112, 2 },
+ { 110, 1 }, { 109, 1 }, { 108, 1 }, { 107, 2 }, { 105, 1 }, { 104, 1 }, { 103, 1 }, { 102, 1 },
+ { 101, 1 }, { 100, 1 }, { 99, 1 }, { 98, 1 }, { 97, 1 }, { 96, 1 }, { 95, 1 }, { 94, 1 },
+ { 93, 1 }, { 92, 1 }, { 91, 0 }, { 91, 1 }, { 90, 1 }, { 89, 1 }, { 88, 1 }, { 87, 0 },
+ { 87, 1 }, { 86, 1 }, { 85, 1 }, { 84, 0 }, { 84, 1 }, { 83, 1 }, { 82, 1 }, { 81, 0 },
+ { 81, 1 }, { 80, 1 }, { 79, 0 }, { 79, 1 }, { 78, 0 }, { 78, 1 }, { 77, 1 }, { 76, 0 },
+ { 76, 1 }, { 75, 0 }, { 75, 1 }, { 74, 1 }, { 73, 0 }, { 73, 1 }, { 72, 0 }, { 72, 1 },
+ { 71, 0 }, { 71, 1 }, { 70, 0 }, { 70, 1 }, { 69, 0 }, { 69, 1 }, { 68, 0 }, { 68, 1 },
+ { 67, 0 }, { 67, 1 }, { 66, 0 }, { 66, 1 }, { 65, 0 }, { 65, 0 }, { 65, 1 }, { 64, 0 },
+ { 64, 1 }, { 63, 0 }, { 63, 1 }, { 62, 0 }, { 62, 0 }, { 62, 1 }, { 61, 0 }, { 61, 1 },
+ { 60, 0 }, { 60, 0 }, { 60, 1 }, { 59, 0 }, { 59, 0 }, { 59, 1 }, { 58, 0 }, { 58, 0 },
+ { 58, 1 }, { 57, 0 }, { 57, 0 }, { 57, 1 }, { 56, 0 }, { 56, 0 }, { 56, 1 }, { 55, 0 },
+ { 55, 0 }, { 55, 1 }, { 54, 0 }, { 54, 0 }, { 54, 1 }, { 53, 0 }, { 53, 0 }, { 53, 0 },
+ { 53, 1 }, { 52, 0 }, { 52, 0 }, { 52, 1 }, { 51, 0 }, { 51, 0 }, { 51, 0 }, { 51, 1 },
+ { 50, 0 }, { 50, 0 }, { 50, 0 }, { 50, 1 }, { 49, 0 }, { 49, 0 }, { 49, 0 }, { 49, 1 },
+ { 48, 0 }, { 48, 0 }, { 48, 0 }, { 48, 1 }, { 47, 0 }, { 47, 0 }, { 47, 0 }, { 47, 1 },
+ { 46, 0 }, { 46, 0 }, { 46, 0 }, { 46, 0 }, { 46, 1 }, { 45, 0 }, { 45, 0 }, { 45, 0 },
+ { 45, 1 }, { 44, 0 }, { 44, 0 }, { 44, 0 }, { 44, 0 }, { 44, 1 }, { 43, 0 }, { 43, 0 },
+ { 43, 0 }, { 43, 0 }, { 43, 1 }, { 42, 0 }, { 42, 0 }, { 42, 0 }, { 42, 0 }, { 42, 0 },
+ { 42, 1 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 1 }, { 40, 0 },
+ { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 1 }, { 39, 0 }, { 39, 0 }, { 39, 0 }, { 39, 0 },
+ { 39, 0 }, { 39, 0 }, { 39, 1 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 },
};
const uint16_t speed_lookuptable_slow[256][2] PROGMEM = {
- {62500, 10417}, {52083, 7441}, {44642, 5580}, {39062, 4340}, {34722, 3472}, {31250, 2841}, {28409, 2368}, {26041, 2003},
- {24038, 1717}, {22321, 1488}, {20833, 1302}, {19531, 1149}, {18382, 1021}, {17361, 914}, {16447, 822}, {15625, 745},
- {14880, 676}, {14204, 618}, {13586, 566}, {13020, 520}, {12500, 481}, {12019, 445}, {11574, 414}, {11160, 385},
- {10775, 359}, {10416, 336}, {10080, 315}, {9765, 296}, {9469, 278}, {9191, 263}, {8928, 248}, {8680, 235},
- {8445, 222}, {8223, 211}, {8012, 200}, {7812, 191}, {7621, 181}, {7440, 173}, {7267, 165}, {7102, 158},
- {6944, 151}, {6793, 145}, {6648, 138}, {6510, 133}, {6377, 127}, {6250, 123}, {6127, 118}, {6009, 113},
- {5896, 109}, {5787, 106}, {5681, 101}, {5580, 98}, {5482, 95}, {5387, 91}, {5296, 88}, {5208, 86},
- {5122, 82}, {5040, 80}, {4960, 78}, {4882, 75}, {4807, 73}, {4734, 70}, {4664, 69}, {4595, 67},
- {4528, 64}, {4464, 63}, {4401, 61}, {4340, 60}, {4280, 58}, {4222, 56}, {4166, 55}, {4111, 53},
- {4058, 52}, {4006, 51}, {3955, 49}, {3906, 48}, {3858, 48}, {3810, 45}, {3765, 45}, {3720, 44},
- {3676, 43}, {3633, 42}, {3591, 40}, {3551, 40}, {3511, 39}, {3472, 38}, {3434, 38}, {3396, 36},
- {3360, 36}, {3324, 35}, {3289, 34}, {3255, 34}, {3221, 33}, {3188, 32}, {3156, 31}, {3125, 31},
- {3094, 31}, {3063, 30}, {3033, 29}, {3004, 28}, {2976, 28}, {2948, 28}, {2920, 27}, {2893, 27},
- {2866, 26}, {2840, 25}, {2815, 25}, {2790, 25}, {2765, 24}, {2741, 24}, {2717, 24}, {2693, 23},
- {2670, 22}, {2648, 22}, {2626, 22}, {2604, 22}, {2582, 21}, {2561, 21}, {2540, 20}, {2520, 20},
- {2500, 20}, {2480, 20}, {2460, 19}, {2441, 19}, {2422, 19}, {2403, 18}, {2385, 18}, {2367, 18},
- {2349, 17}, {2332, 18}, {2314, 17}, {2297, 16}, {2281, 17}, {2264, 16}, {2248, 16}, {2232, 16},
- {2216, 16}, {2200, 15}, {2185, 15}, {2170, 15}, {2155, 15}, {2140, 15}, {2125, 14}, {2111, 14},
- {2097, 14}, {2083, 14}, {2069, 14}, {2055, 13}, {2042, 13}, {2029, 13}, {2016, 13}, {2003, 13},
- {1990, 13}, {1977, 12}, {1965, 12}, {1953, 13}, {1940, 11}, {1929, 12}, {1917, 12}, {1905, 12},
- {1893, 11}, {1882, 11}, {1871, 11}, {1860, 11}, {1849, 11}, {1838, 11}, {1827, 11}, {1816, 10},
- {1806, 11}, {1795, 10}, {1785, 10}, {1775, 10}, {1765, 10}, {1755, 10}, {1745, 9}, {1736, 10},
- {1726, 9}, {1717, 10}, {1707, 9}, {1698, 9}, {1689, 9}, {1680, 9}, {1671, 9}, {1662, 9},
- {1653, 9}, {1644, 8}, {1636, 9}, {1627, 8}, {1619, 9}, {1610, 8}, {1602, 8}, {1594, 8},
- {1586, 8}, {1578, 8}, {1570, 8}, {1562, 8}, {1554, 7}, {1547, 8}, {1539, 8}, {1531, 7},
- {1524, 8}, {1516, 7}, {1509, 7}, {1502, 7}, {1495, 7}, {1488, 7}, {1481, 7}, {1474, 7},
- {1467, 7}, {1460, 7}, {1453, 7}, {1446, 6}, {1440, 7}, {1433, 7}, {1426, 6}, {1420, 6},
- {1414, 7}, {1407, 6}, {1401, 6}, {1395, 7}, {1388, 6}, {1382, 6}, {1376, 6}, {1370, 6},
- {1364, 6}, {1358, 6}, {1352, 6}, {1346, 5}, {1341, 6}, {1335, 6}, {1329, 5}, {1324, 6},
- {1318, 5}, {1313, 6}, {1307, 5}, {1302, 6}, {1296, 5}, {1291, 5}, {1286, 6}, {1280, 5},
- {1275, 5}, {1270, 5}, {1265, 5}, {1260, 5}, {1255, 5}, {1250, 5}, {1245, 5}, {1240, 5},
- {1235, 5}, {1230, 5}, {1225, 5}, {1220, 5}, {1215, 4}, {1211, 5}, {1206, 5}, {1201, 5},
+ { 62500, 10417 }, { 52083, 7441 }, { 44642, 5580 }, { 39062, 4340 }, { 34722, 3472 }, { 31250, 2841 }, { 28409, 2368 }, { 26041, 2003 },
+ { 24038, 1717 }, { 22321, 1488 }, { 20833, 1302 }, { 19531, 1149 }, { 18382, 1021 }, { 17361, 914 }, { 16447, 822 }, { 15625, 745 },
+ { 14880, 676 }, { 14204, 618 }, { 13586, 566 }, { 13020, 520 }, { 12500, 481 }, { 12019, 445 }, { 11574, 414 }, { 11160, 385 },
+ { 10775, 359 }, { 10416, 336 }, { 10080, 315 }, { 9765, 296 }, { 9469, 278 }, { 9191, 263 }, { 8928, 248 }, { 8680, 235 },
+ { 8445, 222 }, { 8223, 211 }, { 8012, 200 }, { 7812, 191 }, { 7621, 181 }, { 7440, 173 }, { 7267, 165 }, { 7102, 158 },
+ { 6944, 151 }, { 6793, 145 }, { 6648, 138 }, { 6510, 133 }, { 6377, 127 }, { 6250, 123 }, { 6127, 118 }, { 6009, 113 },
+ { 5896, 109 }, { 5787, 106 }, { 5681, 101 }, { 5580, 98 }, { 5482, 95 }, { 5387, 91 }, { 5296, 88 }, { 5208, 86 },
+ { 5122, 82 }, { 5040, 80 }, { 4960, 78 }, { 4882, 75 }, { 4807, 73 }, { 4734, 70 }, { 4664, 69 }, { 4595, 67 },
+ { 4528, 64 }, { 4464, 63 }, { 4401, 61 }, { 4340, 60 }, { 4280, 58 }, { 4222, 56 }, { 4166, 55 }, { 4111, 53 },
+ { 4058, 52 }, { 4006, 51 }, { 3955, 49 }, { 3906, 48 }, { 3858, 48 }, { 3810, 45 }, { 3765, 45 }, { 3720, 44 },
+ { 3676, 43 }, { 3633, 42 }, { 3591, 40 }, { 3551, 40 }, { 3511, 39 }, { 3472, 38 }, { 3434, 38 }, { 3396, 36 },
+ { 3360, 36 }, { 3324, 35 }, { 3289, 34 }, { 3255, 34 }, { 3221, 33 }, { 3188, 32 }, { 3156, 31 }, { 3125, 31 },
+ { 3094, 31 }, { 3063, 30 }, { 3033, 29 }, { 3004, 28 }, { 2976, 28 }, { 2948, 28 }, { 2920, 27 }, { 2893, 27 },
+ { 2866, 26 }, { 2840, 25 }, { 2815, 25 }, { 2790, 25 }, { 2765, 24 }, { 2741, 24 }, { 2717, 24 }, { 2693, 23 },
+ { 2670, 22 }, { 2648, 22 }, { 2626, 22 }, { 2604, 22 }, { 2582, 21 }, { 2561, 21 }, { 2540, 20 }, { 2520, 20 },
+ { 2500, 20 }, { 2480, 20 }, { 2460, 19 }, { 2441, 19 }, { 2422, 19 }, { 2403, 18 }, { 2385, 18 }, { 2367, 18 },
+ { 2349, 17 }, { 2332, 18 }, { 2314, 17 }, { 2297, 16 }, { 2281, 17 }, { 2264, 16 }, { 2248, 16 }, { 2232, 16 },
+ { 2216, 16 }, { 2200, 15 }, { 2185, 15 }, { 2170, 15 }, { 2155, 15 }, { 2140, 15 }, { 2125, 14 }, { 2111, 14 },
+ { 2097, 14 }, { 2083, 14 }, { 2069, 14 }, { 2055, 13 }, { 2042, 13 }, { 2029, 13 }, { 2016, 13 }, { 2003, 13 },
+ { 1990, 13 }, { 1977, 12 }, { 1965, 12 }, { 1953, 13 }, { 1940, 11 }, { 1929, 12 }, { 1917, 12 }, { 1905, 12 },
+ { 1893, 11 }, { 1882, 11 }, { 1871, 11 }, { 1860, 11 }, { 1849, 11 }, { 1838, 11 }, { 1827, 11 }, { 1816, 10 },
+ { 1806, 11 }, { 1795, 10 }, { 1785, 10 }, { 1775, 10 }, { 1765, 10 }, { 1755, 10 }, { 1745, 9 }, { 1736, 10 },
+ { 1726, 9 }, { 1717, 10 }, { 1707, 9 }, { 1698, 9 }, { 1689, 9 }, { 1680, 9 }, { 1671, 9 }, { 1662, 9 },
+ { 1653, 9 }, { 1644, 8 }, { 1636, 9 }, { 1627, 8 }, { 1619, 9 }, { 1610, 8 }, { 1602, 8 }, { 1594, 8 },
+ { 1586, 8 }, { 1578, 8 }, { 1570, 8 }, { 1562, 8 }, { 1554, 7 }, { 1547, 8 }, { 1539, 8 }, { 1531, 7 },
+ { 1524, 8 }, { 1516, 7 }, { 1509, 7 }, { 1502, 7 }, { 1495, 7 }, { 1488, 7 }, { 1481, 7 }, { 1474, 7 },
+ { 1467, 7 }, { 1460, 7 }, { 1453, 7 }, { 1446, 6 }, { 1440, 7 }, { 1433, 7 }, { 1426, 6 }, { 1420, 6 },
+ { 1414, 7 }, { 1407, 6 }, { 1401, 6 }, { 1395, 7 }, { 1388, 6 }, { 1382, 6 }, { 1376, 6 }, { 1370, 6 },
+ { 1364, 6 }, { 1358, 6 }, { 1352, 6 }, { 1346, 5 }, { 1341, 6 }, { 1335, 6 }, { 1329, 5 }, { 1324, 6 },
+ { 1318, 5 }, { 1313, 6 }, { 1307, 5 }, { 1302, 6 }, { 1296, 5 }, { 1291, 5 }, { 1286, 6 }, { 1280, 5 },
+ { 1275, 5 }, { 1270, 5 }, { 1265, 5 }, { 1260, 5 }, { 1255, 5 }, { 1250, 5 }, { 1245, 5 }, { 1240, 5 },
+ { 1235, 5 }, { 1230, 5 }, { 1225, 5 }, { 1220, 5 }, { 1215, 4 }, { 1211, 5 }, { 1206, 5 }, { 1201, 5 },
};
#endif
From 4fdb0fbe8e8e8187d05bf56e8ee8e2a138120a4c Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:53:32 -0600
Subject: [PATCH 008/225] =?UTF-8?q?=E2=9C=A8=20MAX7219=5FDEBUG=5FMULTISTEP?=
=?UTF-8?q?PING?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/Configuration_adv.h | 1 +
Marlin/src/feature/max7219.cpp | 14 ++++++++++++++
Marlin/src/module/stepper.h | 1 +
3 files changed, 16 insertions(+)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index f3f7a4c255..35e7363423 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -4052,6 +4052,7 @@
#define MAX7219_DEBUG_PROFILE 6 // Display the fraction of CPU time spent in profiled code on this LED matrix
// row. By default idle() is profiled so this shows how "idle" the processor is.
// See class CodeProfiler.
+ //#define MAX7219_DEBUG_MULTISTEPPING 6 // Show multistepping 1 to 128 on this LED matrix row.
#endif
/**
diff --git a/Marlin/src/feature/max7219.cpp b/Marlin/src/feature/max7219.cpp
index 83d161d1fe..efc992f80f 100644
--- a/Marlin/src/feature/max7219.cpp
+++ b/Marlin/src/feature/max7219.cpp
@@ -44,6 +44,7 @@
#include "max7219.h"
#include "../module/planner.h"
+#include "../module/stepper.h"
#include "../MarlinCore.h"
#include "../HAL/shared/Delay.h"
@@ -723,6 +724,19 @@ void Max7219::idle_tasks() {
}
#endif
+ #ifdef MAX7219_DEBUG_MULTISTEPPING
+ static uint8_t last_multistepping = 0;
+ const uint8_t multistepping = Stepper::steps_per_isr;
+ if (multistepping != last_multistepping) {
+ static uint8_t log2_old = 0;
+ uint8_t log2_new = 0;
+ for (uint8_t val = multistepping; val > 1; val >>= 1) log2_new++;
+ mark16(MAX7219_DEBUG_MULTISTEPPING, log2_old, log2_new, &row_change_mask);
+ last_multistepping = multistepping;
+ log2_old = log2_new;
+ }
+ #endif
+
// batch line updates
suspended--;
if (!suspended)
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 3a3e45dccc..33f45b9ae1 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -459,6 +459,7 @@ constexpr ena_mask_t enable_overlap[] = {
// Stepper class definition
//
class Stepper {
+ friend class Max7219;
friend void stepperTask(void *);
public:
From 194f58740a34c8aa8daebf21baf614c6f1eec518 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:08:13 -0600
Subject: [PATCH 009/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Use=20hal=5Ftimer?=
=?UTF-8?q?=5Ft=20for=20timing=20vars?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/module/stepper.cpp | 36 +++++++++++++++++------------------
Marlin/src/module/stepper.h | 26 ++++++++++++-------------
2 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index 700cdd377b..a3183c1b12 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -225,11 +225,11 @@ uint32_t Stepper::advance_divisor = 0,
#endif
#if ENABLED(LIN_ADVANCE)
- uint32_t Stepper::nextAdvanceISR = LA_ADV_NEVER,
- Stepper::la_interval = LA_ADV_NEVER;
- int32_t Stepper::la_delta_error = 0,
- Stepper::la_dividend = 0,
- Stepper::la_advance_steps = 0;
+ hal_timer_t Stepper::nextAdvanceISR = LA_ADV_NEVER,
+ Stepper::la_interval = LA_ADV_NEVER;
+ int32_t Stepper::la_delta_error = 0,
+ Stepper::la_dividend = 0,
+ Stepper::la_advance_steps = 0;
#endif
#if HAS_SHAPING
@@ -255,14 +255,14 @@ uint32_t Stepper::advance_divisor = 0,
#endif
#if ENABLED(INTEGRATED_BABYSTEPPING)
- uint32_t Stepper::nextBabystepISR = BABYSTEP_NEVER;
+ hal_timer_t Stepper::nextBabystepISR = BABYSTEP_NEVER;
#endif
#if ENABLED(DIRECT_STEPPING)
page_step_state_t Stepper::page_step_state;
#endif
-int32_t Stepper::ticks_nominal = -1;
+hal_timer_t Stepper::ticks_nominal = 0;
#if DISABLED(S_CURVE_ACCELERATION)
uint32_t Stepper::acc_step_rate; // needed for deceleration start point
#endif
@@ -1462,7 +1462,7 @@ HAL_STEP_TIMER_ISR() {
void Stepper::isr() {
- static uint32_t nextMainISR = 0; // Interval until the next main Stepper Pulse phase (0 = Now)
+ static hal_timer_t nextMainISR = 0; // Interval until the next main Stepper Pulse phase (0 = Now)
#ifndef __AVR__
// Disable interrupts, to avoid ISR preemption while we reprogram the period
@@ -1518,8 +1518,8 @@ void Stepper::isr() {
#endif
// Get the interval to the next ISR call
- const uint32_t interval = _MIN(
- uint32_t(HAL_TIMER_TYPE_MAX), // Come back in a very long time
+ const hal_timer_t interval = _MIN(
+ hal_timer_t(HAL_TIMER_TYPE_MAX), // Come back in a very long time
nextMainISR // Time until the next Pulse / Block phase
OPTARG(INPUT_SHAPING_X, ShapingQueue::peek_x()) // Time until next input shaping echo for X
OPTARG(INPUT_SHAPING_Y, ShapingQueue::peek_y()) // Time until next input shaping echo for Y
@@ -1598,7 +1598,7 @@ void Stepper::isr() {
// sure that the time has not arrived yet - Warrantied by the scheduler
// Set the next ISR to fire at the proper time
- HAL_timer_set_compare(MF_TIMER_STEP, hal_timer_t(next_isr_ticks));
+ HAL_timer_set_compare(MF_TIMER_STEP, next_isr_ticks);
// Don't forget to finally reenable interrupts on non-AVR.
// AVR automatically calls sei() for us on Return-from-Interrupt.
@@ -2046,7 +2046,7 @@ void Stepper::pulse_phase_isr() {
#endif // HAS_SHAPING
// Calculate timer interval, with all limits applied.
-uint32_t Stepper::calc_timer_interval(uint32_t step_rate) {
+hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
#ifdef CPU_32_BIT
@@ -2078,7 +2078,7 @@ uint32_t Stepper::calc_timer_interval(uint32_t step_rate) {
}
// Get the timer interval and the number of loops to perform per tick
-uint32_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t &loops) {
+hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t &loops) {
uint8_t multistep = 1;
#if ENABLED(DISABLE_MULTI_STEPPING)
@@ -2118,10 +2118,10 @@ uint32_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t &loops) {
* schedules planner blocks. This is executed after the step pulses
* have been done, so it is less time critical.
*/
-uint32_t Stepper::block_phase_isr() {
+hal_timer_t Stepper::block_phase_isr() {
// If no queued movements, just wait 1ms for the next block
- uint32_t interval = (STEPPER_TIMER_RATE) / 1000UL;
+ hal_timer_t interval = (STEPPER_TIMER_RATE) / 1000UL;
// If there is a current block
if (current_block) {
@@ -2296,7 +2296,7 @@ uint32_t Stepper::block_phase_isr() {
else { // Must be in cruise phase otherwise
// Calculate the ticks_nominal for this nominal speed, if not done yet
- if (ticks_nominal < 0) {
+ if (ticks_nominal == 0) {
// step_rate to timer interval and loops for the nominal speed
ticks_nominal = calc_timer_interval(current_block->nominal_rate << oversampling_factor, steps_per_isr);
@@ -2604,7 +2604,7 @@ uint32_t Stepper::block_phase_isr() {
#endif
// Mark ticks_nominal as not-yet-calculated
- ticks_nominal = -1;
+ ticks_nominal = 0;
#if ENABLED(S_CURVE_ACCELERATION)
// Initialize the Bézier speed curve
@@ -2671,7 +2671,7 @@ uint32_t Stepper::block_phase_isr() {
#if ENABLED(INTEGRATED_BABYSTEPPING)
// Timer interrupt for baby-stepping
- uint32_t Stepper::babystepping_isr() {
+ hal_timer_t Stepper::babystepping_isr() {
babystep.task();
return babystep.has_steps() ? BABYSTEP_TICKS : BABYSTEP_NEVER;
}
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 33f45b9ae1..2336bfb405 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -568,24 +568,24 @@ class Stepper {
#endif
#if ENABLED(LIN_ADVANCE)
- static constexpr uint32_t LA_ADV_NEVER = 0xFFFFFFFF;
- static uint32_t nextAdvanceISR,
- la_interval; // Interval between ISR calls for LA
- static int32_t la_delta_error, // Analogue of delta_error.e for E steps in LA ISR
- la_dividend, // Analogue of advance_dividend.e for E steps in LA ISR
- la_advance_steps; // Count of steps added to increase nozzle pressure
+ static constexpr hal_timer_t LA_ADV_NEVER = HAL_TIMER_TYPE_MAX;
+ static hal_timer_t nextAdvanceISR,
+ la_interval; // Interval between ISR calls for LA
+ static int32_t la_delta_error, // Analogue of delta_error.e for E steps in LA ISR
+ la_dividend, // Analogue of advance_dividend.e for E steps in LA ISR
+ la_advance_steps; // Count of steps added to increase nozzle pressure
#endif
#if ENABLED(INTEGRATED_BABYSTEPPING)
- static constexpr uint32_t BABYSTEP_NEVER = 0xFFFFFFFF;
- static uint32_t nextBabystepISR;
+ static constexpr hal_timer_t BABYSTEP_NEVER = HAL_TIMER_TYPE_MAX;
+ static hal_timer_t nextBabystepISR;
#endif
#if ENABLED(DIRECT_STEPPING)
static page_step_state_t page_step_state;
#endif
- static int32_t ticks_nominal;
+ static hal_timer_t ticks_nominal;
#if DISABLED(S_CURVE_ACCELERATION)
static uint32_t acc_step_rate; // needed for deceleration start point
#endif
@@ -624,7 +624,7 @@ class Stepper {
static void pulse_phase_isr();
// The stepper block processing ISR phase
- static uint32_t block_phase_isr();
+ static hal_timer_t block_phase_isr();
#if HAS_SHAPING
static void shaping_isr();
@@ -637,7 +637,7 @@ class Stepper {
#if ENABLED(INTEGRATED_BABYSTEPPING)
// The Babystepping ISR phase
- static uint32_t babystepping_isr();
+ static hal_timer_t babystepping_isr();
FORCE_INLINE static void initiateBabystepping() {
if (nextBabystepISR == BABYSTEP_NEVER) {
nextBabystepISR = 0;
@@ -810,10 +810,10 @@ class Stepper {
static void _set_position(const abce_long_t &spos);
// Calculate the timing interval for the given step rate
- static uint32_t calc_timer_interval(uint32_t step_rate);
+ static hal_timer_t calc_timer_interval(uint32_t step_rate);
// Calculate timing interval and steps-per-ISR for the given step rate
- static uint32_t calc_timer_interval(uint32_t step_rate, uint8_t &loops);
+ static hal_timer_t calc_timer_interval(uint32_t step_rate, uint8_t &loops);
#if ENABLED(S_CURVE_ACCELERATION)
static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av);
From d554844a51691c4e88d0fab8e7893b62e090f235 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:19:36 -0600
Subject: [PATCH 010/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Use=20cached=20la?=
=?UTF-8?q?=5Factive=20state?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/module/stepper.cpp | 14 ++++++++------
Marlin/src/module/stepper.h | 1 +
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index a3183c1b12..acb394f281 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -230,6 +230,7 @@ uint32_t Stepper::advance_divisor = 0,
int32_t Stepper::la_delta_error = 0,
Stepper::la_dividend = 0,
Stepper::la_advance_steps = 0;
+ bool Stepper::la_active = false;
#endif
#if HAS_SHAPING
@@ -1868,7 +1869,7 @@ void Stepper::pulse_phase_isr() {
PULSE_PREP(E);
#if ENABLED(LIN_ADVANCE)
- if (step_needed.e && current_block->la_advance_rate) {
+ if (la_active && step_needed.e) {
// don't actually step here, but do subtract movements steps
// from the linear advance step count
step_needed.e = false;
@@ -2170,7 +2171,7 @@ hal_timer_t Stepper::block_phase_isr() {
acceleration_time += interval;
#if ENABLED(LIN_ADVANCE)
- if (current_block->la_advance_rate) {
+ if (la_active) {
const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0;
la_interval = calc_timer_interval(acc_step_rate + la_step_rate) << current_block->la_scaling;
}
@@ -2240,7 +2241,7 @@ hal_timer_t Stepper::block_phase_isr() {
deceleration_time += interval;
#if ENABLED(LIN_ADVANCE)
- if (current_block->la_advance_rate) {
+ if (la_active) {
const uint32_t la_step_rate = la_advance_steps > current_block->final_adv_steps ? current_block->la_advance_rate : 0;
if (la_step_rate != step_rate) {
bool reverse_e = la_step_rate > step_rate;
@@ -2301,7 +2302,7 @@ hal_timer_t Stepper::block_phase_isr() {
ticks_nominal = calc_timer_interval(current_block->nominal_rate << oversampling_factor, steps_per_isr);
#if ENABLED(LIN_ADVANCE)
- if (current_block->la_advance_rate)
+ if (la_active)
la_interval = calc_timer_interval(current_block->nominal_rate) << current_block->la_scaling;
#endif
}
@@ -2556,11 +2557,12 @@ hal_timer_t Stepper::block_phase_isr() {
// Initialize the trapezoid generator from the current block.
#if ENABLED(LIN_ADVANCE)
+ la_active = (current_block->la_advance_rate != 0);
#if DISABLED(MIXING_EXTRUDER) && E_STEPPERS > 1
// If the now active extruder wasn't in use during the last move, its pressure is most likely gone.
if (stepper_extruder != last_moved_extruder) la_advance_steps = 0;
#endif
- if (current_block->la_advance_rate) {
+ if (la_active) {
// Apply LA scaling and discount the effect of frequency scaling
la_dividend = (advance_dividend.e << current_block->la_scaling) << oversampling_factor;
}
@@ -2621,7 +2623,7 @@ hal_timer_t Stepper::block_phase_isr() {
acceleration_time += interval;
#if ENABLED(LIN_ADVANCE)
- if (current_block->la_advance_rate) {
+ if (la_active) {
const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0;
la_interval = calc_timer_interval(current_block->initial_rate + la_step_rate) << current_block->la_scaling;
}
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 2336bfb405..61dcb3804c 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -574,6 +574,7 @@ class Stepper {
static int32_t la_delta_error, // Analogue of delta_error.e for E steps in LA ISR
la_dividend, // Analogue of advance_dividend.e for E steps in LA ISR
la_advance_steps; // Count of steps added to increase nozzle pressure
+ static bool la_active; // Whether linear advance is used on the present segment.
#endif
#if ENABLED(INTEGRATED_BABYSTEPPING)
From 4a0cb4fb4ac27ab20b1f97a016b85bac6ad15470 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:21:31 -0600
Subject: [PATCH 011/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Use=20AxisFlags=20?=
=?UTF-8?q?for=20step=5Fneeded?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/module/stepper.cpp | 57 ++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index acb394f281..400dab5893 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -1661,21 +1661,24 @@ void Stepper::pulse_phase_isr() {
bool firstStep = true;
USING_TIMED_PULSE();
#endif
- xyze_bool_t step_needed{0};
// Direct Stepping page?
const bool is_page = current_block->is_page();
do {
+ AxisFlags step_needed{0};
+
#define _APPLY_STEP(AXIS, INV, ALWAYS) AXIS ##_APPLY_STEP(INV, ALWAYS)
#define _STEP_STATE(AXIS) STEP_STATE_## AXIS
// Determine if a pulse is needed using Bresenham
#define PULSE_PREP(AXIS) do{ \
- delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \
- step_needed[_AXIS(AXIS)] = (delta_error[_AXIS(AXIS)] >= 0); \
- if (step_needed[_AXIS(AXIS)]) \
- delta_error[_AXIS(AXIS)] -= advance_divisor; \
+ int32_t de = delta_error[_AXIS(AXIS)] + advance_dividend[_AXIS(AXIS)]; \
+ if (de >= 0) { \
+ step_needed.set(_AXIS(AXIS)); \
+ de -= advance_divisor; \
+ } \
+ delta_error[_AXIS(AXIS)] = de; \
}while(0)
// With input shaping, direction changes can happen with almost only
@@ -1699,7 +1702,7 @@ void Stepper::pulse_phase_isr() {
#define HYSTERESIS(AXIS) _HYSTERESIS(AXIS)
#define PULSE_PREP_SHAPING(AXIS, DELTA_ERROR, DIVIDEND) do{ \
- if (step_needed[_AXIS(AXIS)]) { \
+ if (step_needed.test(_AXIS(AXIS))) { \
DELTA_ERROR += (DIVIDEND); \
if ((MAXDIR(AXIS) && DELTA_ERROR <= -(64 + HYSTERESIS(AXIS))) || (MINDIR(AXIS) && DELTA_ERROR >= (64 + HYSTERESIS(AXIS)))) { \
{ USING_TIMED_PULSE(); START_TIMED_PULSE(); AWAIT_LOW_PULSE(); } \
@@ -1708,15 +1711,15 @@ void Stepper::pulse_phase_isr() {
SET_STEP_DIR(AXIS); \
DIR_WAIT_AFTER(); \
} \
- step_needed[_AXIS(AXIS)] = DELTA_ERROR <= -(64 + HYSTERESIS(AXIS)) || DELTA_ERROR >= (64 + HYSTERESIS(AXIS)); \
- if (step_needed[_AXIS(AXIS)]) \
+ step_needed.set(_AXIS(AXIS), DELTA_ERROR <= -(64 + HYSTERESIS(AXIS)) || DELTA_ERROR >= (64 + HYSTERESIS(AXIS))); \
+ if (step_needed.test(_AXIS(AXIS))) \
DELTA_ERROR += MAXDIR(AXIS) ? -128 : 128; \
} \
}while(0)
// Start an active pulse if needed
#define PULSE_START(AXIS) do{ \
- if (step_needed[_AXIS(AXIS)]) { \
+ if (step_needed.test(_AXIS(AXIS))) { \
count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
_APPLY_STEP(AXIS, _STEP_STATE(AXIS), 0); \
} \
@@ -1724,7 +1727,7 @@ void Stepper::pulse_phase_isr() {
// Stop an active pulse if needed
#define PULSE_STOP(AXIS) do { \
- if (step_needed[_AXIS(AXIS)]) { \
+ if (step_needed.test(_AXIS(AXIS))) { \
_APPLY_STEP(AXIS, !_STEP_STATE(AXIS), 0); \
} \
}while(0)
@@ -1743,8 +1746,8 @@ void Stepper::pulse_phase_isr() {
}while(0)
#define PAGE_PULSE_PREP(AXIS) do{ \
- step_needed[_AXIS(AXIS)] = \
- pgm_read_byte(&segment_table[page_step_state.sd[_AXIS(AXIS)]][page_step_state.segment_steps & 0x7]); \
+ step_needed.set(_AXIS(AXIS), \
+ pgm_read_byte(&segment_table[page_step_state.sd[_AXIS(AXIS)]][page_step_state.segment_steps & 0x7])); \
}while(0)
switch (page_step_state.segment_steps) {
@@ -1784,8 +1787,8 @@ void Stepper::pulse_phase_isr() {
page_step_state.bd[_AXIS(AXIS)] += VALUE;
#define PAGE_PULSE_PREP(AXIS) do{ \
- step_needed[_AXIS(AXIS)] = \
- pgm_read_byte(&segment_table[page_step_state.sd[_AXIS(AXIS)]][page_step_state.segment_steps & 0x3]); \
+ step_needed.set(_AXIS(AXIS), \
+ pgm_read_byte(&segment_table[page_step_state.sd[_AXIS(AXIS)]][page_step_state.segment_steps & 0x3])); \
}while(0)
switch (page_step_state.segment_steps) {
@@ -1812,10 +1815,10 @@ void Stepper::pulse_phase_isr() {
#elif STEPPER_PAGE_FORMAT == SP_4x1_512
- #define PAGE_PULSE_PREP(AXIS, BITS) do{ \
- step_needed[_AXIS(AXIS)] = (steps >> BITS) & 0x1; \
- if (step_needed[_AXIS(AXIS)]) \
- page_step_state.bd[_AXIS(AXIS)]++; \
+ #define PAGE_PULSE_PREP(AXIS, NBIT) do{ \
+ step_needed.set(_AXIS(AXIS), TEST(steps, NBIT)); \
+ if (step_needed.test(_AXIS(AXIS))) \
+ page_step_state.bd[_AXIS(AXIS)]++; \
}while(0)
uint8_t steps = page_step_state.page[page_step_state.segment_idx >> 1];
@@ -1880,8 +1883,8 @@ void Stepper::pulse_phase_isr() {
#if HAS_SHAPING
// record an echo if a step is needed in the primary bresenham
- const bool x_step = TERN0(INPUT_SHAPING_X, shaping_x.enabled && step_needed[X_AXIS]),
- y_step = TERN0(INPUT_SHAPING_Y, shaping_y.enabled && step_needed[Y_AXIS]);
+ const bool x_step = TERN0(INPUT_SHAPING_X, shaping_x.enabled && step_needed.x),
+ y_step = TERN0(INPUT_SHAPING_Y, shaping_y.enabled && step_needed.y);
if (x_step || y_step)
ShapingQueue::enqueue(x_step, TERN0(INPUT_SHAPING_X, shaping_x.forward), y_step, TERN0(INPUT_SHAPING_Y, shaping_y.forward));
@@ -1995,15 +1998,15 @@ void Stepper::pulse_phase_isr() {
#if HAS_SHAPING
void Stepper::shaping_isr() {
- xy_bool_t step_needed{0};
+ AxisFlags step_needed{0};
// Clear the echoes that are ready to process. If the buffers are too full and risk overflow, also apply echoes early.
- TERN_(INPUT_SHAPING_X, step_needed[X_AXIS] = !ShapingQueue::peek_x() || ShapingQueue::free_count_x() < steps_per_isr);
- TERN_(INPUT_SHAPING_Y, step_needed[Y_AXIS] = !ShapingQueue::peek_y() || ShapingQueue::free_count_y() < steps_per_isr);
+ TERN_(INPUT_SHAPING_X, step_needed.x = !ShapingQueue::peek_x() || ShapingQueue::free_count_x() < steps_per_isr);
+ TERN_(INPUT_SHAPING_Y, step_needed.y = !ShapingQueue::peek_y() || ShapingQueue::free_count_y() < steps_per_isr);
if (bool(step_needed)) while (true) {
#if ENABLED(INPUT_SHAPING_X)
- if (step_needed[X_AXIS]) {
+ if (step_needed.x) {
const bool forward = ShapingQueue::dequeue_x();
PULSE_PREP_SHAPING(X, shaping_x.delta_error, shaping_x.factor2 * (forward ? 1 : -1));
PULSE_START(X);
@@ -2011,7 +2014,7 @@ void Stepper::pulse_phase_isr() {
#endif
#if ENABLED(INPUT_SHAPING_Y)
- if (step_needed[Y_AXIS]) {
+ if (step_needed.y) {
const bool forward = ShapingQueue::dequeue_y();
PULSE_PREP_SHAPING(Y, shaping_y.delta_error, shaping_y.factor2 * (forward ? 1 : -1));
PULSE_START(Y);
@@ -2034,8 +2037,8 @@ void Stepper::pulse_phase_isr() {
#endif
}
- TERN_(INPUT_SHAPING_X, step_needed[X_AXIS] = !ShapingQueue::peek_x() || ShapingQueue::free_count_x() < steps_per_isr);
- TERN_(INPUT_SHAPING_Y, step_needed[Y_AXIS] = !ShapingQueue::peek_y() || ShapingQueue::free_count_y() < steps_per_isr);
+ TERN_(INPUT_SHAPING_X, step_needed.x = !ShapingQueue::peek_x() || ShapingQueue::free_count_x() < steps_per_isr);
+ TERN_(INPUT_SHAPING_Y, step_needed.y = !ShapingQueue::peek_y() || ShapingQueue::free_count_y() < steps_per_isr);
if (!bool(step_needed)) break;
From e1a209d0ce5cacf60a13b75f06ffb7ae67ee3bee Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Mon, 13 Mar 2023 00:22:40 +0000
Subject: [PATCH 012/225] [cron] Bump distribution date (2023-03-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 614ee400b7..c76ff2632a 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 "2023-03-12"
+//#define STRING_DISTRIBUTION_DATE "2023-03-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 ca975adb4e..3b57bf0d03 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 "2023-03-12"
+ #define STRING_DISTRIBUTION_DATE "2023-03-13"
#endif
/**
From e4b83ad5f58772f73d9b2dcc9dcccbbc2a3e893d Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:22:18 -0600
Subject: [PATCH 013/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Major=20shaper=20o?=
=?UTF-8?q?ptimization?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/module/stepper.cpp | 36 ++++++++++++++++++-------------
Marlin/src/module/stepper.h | 40 ++++++++++++++++++++++++++---------
2 files changed, 51 insertions(+), 25 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index 400dab5893..0ae2a52f9d 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -1676,7 +1676,7 @@ void Stepper::pulse_phase_isr() {
int32_t de = delta_error[_AXIS(AXIS)] + advance_dividend[_AXIS(AXIS)]; \
if (de >= 0) { \
step_needed.set(_AXIS(AXIS)); \
- de -= advance_divisor; \
+ de -= advance_divisor_cached; \
} \
delta_error[_AXIS(AXIS)] = de; \
}while(0)
@@ -1702,19 +1702,22 @@ void Stepper::pulse_phase_isr() {
#define HYSTERESIS(AXIS) _HYSTERESIS(AXIS)
#define PULSE_PREP_SHAPING(AXIS, DELTA_ERROR, DIVIDEND) do{ \
- if (step_needed.test(_AXIS(AXIS))) { \
- DELTA_ERROR += (DIVIDEND); \
- if ((MAXDIR(AXIS) && DELTA_ERROR <= -(64 + HYSTERESIS(AXIS))) || (MINDIR(AXIS) && DELTA_ERROR >= (64 + HYSTERESIS(AXIS)))) { \
+ int16_t de = DELTA_ERROR + (DIVIDEND); \
+ const bool step_fwd = de >= (64 + HYSTERESIS(AXIS)), \
+ step_bak = de <= -(64 + HYSTERESIS(AXIS)); \
+ if (step_fwd || step_bak) { \
+ de += step_fwd ? -128 : 128; \
+ if ((MAXDIR(AXIS) && step_bak) || (MINDIR(AXIS) && step_fwd)) { \
{ USING_TIMED_PULSE(); START_TIMED_PULSE(); AWAIT_LOW_PULSE(); } \
TBI(last_direction_bits, _AXIS(AXIS)); \
DIR_WAIT_BEFORE(); \
SET_STEP_DIR(AXIS); \
DIR_WAIT_AFTER(); \
} \
- step_needed.set(_AXIS(AXIS), DELTA_ERROR <= -(64 + HYSTERESIS(AXIS)) || DELTA_ERROR >= (64 + HYSTERESIS(AXIS))); \
- if (step_needed.test(_AXIS(AXIS))) \
- DELTA_ERROR += MAXDIR(AXIS) ? -128 : 128; \
} \
+ else \
+ step_needed.clear(_AXIS(AXIS)); \
+ DELTA_ERROR = de; \
}while(0)
// Start an active pulse if needed
@@ -1839,6 +1842,9 @@ void Stepper::pulse_phase_isr() {
#endif // DIRECT_STEPPING
if (!is_page) {
+ // Give the compiler a clue to store advance_divisor in registers for what follows
+ const uint32_t advance_divisor_cached = advance_divisor;
+
// Determine if pulses are needed
#if HAS_X_STEP
PULSE_PREP(X);
@@ -1883,19 +1889,19 @@ void Stepper::pulse_phase_isr() {
#if HAS_SHAPING
// record an echo if a step is needed in the primary bresenham
- const bool x_step = TERN0(INPUT_SHAPING_X, shaping_x.enabled && step_needed.x),
- y_step = TERN0(INPUT_SHAPING_Y, shaping_y.enabled && step_needed.y);
+ const bool x_step = TERN0(INPUT_SHAPING_X, step_needed.x && shaping_x.enabled),
+ y_step = TERN0(INPUT_SHAPING_Y, step_needed.y && shaping_y.enabled);
if (x_step || y_step)
ShapingQueue::enqueue(x_step, TERN0(INPUT_SHAPING_X, shaping_x.forward), y_step, TERN0(INPUT_SHAPING_Y, shaping_y.forward));
// do the first part of the secondary bresenham
#if ENABLED(INPUT_SHAPING_X)
- if (shaping_x.enabled)
- PULSE_PREP_SHAPING(X, shaping_x.delta_error, shaping_x.factor1 * (shaping_x.forward ? 1 : -1));
+ if (x_step)
+ PULSE_PREP_SHAPING(X, shaping_x.delta_error, shaping_x.forward ? shaping_x.factor1 : -shaping_x.factor1);
#endif
#if ENABLED(INPUT_SHAPING_Y)
- if (shaping_y.enabled)
- PULSE_PREP_SHAPING(Y, shaping_y.delta_error, shaping_y.factor1 * (shaping_y.forward ? 1 : -1));
+ if (y_step)
+ PULSE_PREP_SHAPING(Y, shaping_y.delta_error, shaping_y.forward ? shaping_y.factor1 : -shaping_y.factor1);
#endif
#endif
}
@@ -2008,7 +2014,7 @@ void Stepper::pulse_phase_isr() {
#if ENABLED(INPUT_SHAPING_X)
if (step_needed.x) {
const bool forward = ShapingQueue::dequeue_x();
- PULSE_PREP_SHAPING(X, shaping_x.delta_error, shaping_x.factor2 * (forward ? 1 : -1));
+ PULSE_PREP_SHAPING(X, shaping_x.delta_error, (forward ? shaping_x.factor2 : -shaping_x.factor2));
PULSE_START(X);
}
#endif
@@ -2016,7 +2022,7 @@ void Stepper::pulse_phase_isr() {
#if ENABLED(INPUT_SHAPING_Y)
if (step_needed.y) {
const bool forward = ShapingQueue::dequeue_y();
- PULSE_PREP_SHAPING(Y, shaping_y.delta_error, shaping_y.factor2 * (forward ? 1 : -1));
+ PULSE_PREP_SHAPING(Y, shaping_y.delta_error, (forward ? shaping_y.factor2 : -shaping_y.factor2));
PULSE_START(Y);
}
#endif
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 61dcb3804c..731d7e6ee8 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -392,16 +392,36 @@ constexpr ena_mask_t enable_overlap[] = {
TERN_(INPUT_SHAPING_Y, if (axis == Y_AXIS) delay_y = delay);
}
static void enqueue(const bool x_step, const bool x_forward, const bool y_step, const bool y_forward) {
- TERN_(INPUT_SHAPING_X, if (head_x == tail && x_step) peek_x_val = delay_x);
- TERN_(INPUT_SHAPING_Y, if (head_y == tail && y_step) peek_y_val = delay_y);
+ #if ENABLED(INPUT_SHAPING_X)
+ if (x_step) {
+ if (head_x == tail) peek_x_val = delay_x;
+ echo_axes[tail].x = x_forward ? ECHO_FWD : ECHO_BWD;
+ _free_count_x--;
+ }
+ else {
+ echo_axes[tail].x = ECHO_NONE;
+ if (head_x != tail)
+ _free_count_x--;
+ else if (++head_x == shaping_echoes)
+ head_x = 0;
+ }
+ #endif
+ #if ENABLED(INPUT_SHAPING_Y)
+ if (y_step) {
+ if (head_y == tail) peek_y_val = delay_y;
+ echo_axes[tail].y = y_forward ? ECHO_FWD : ECHO_BWD;
+ _free_count_y--;
+ }
+ else {
+ echo_axes[tail].y = ECHO_NONE;
+ if (head_y != tail)
+ _free_count_y--;
+ else if (++head_y == shaping_echoes)
+ head_y = 0;
+ }
+ #endif
times[tail] = now;
- TERN_(INPUT_SHAPING_X, echo_axes[tail].x = x_step ? (x_forward ? ECHO_FWD : ECHO_BWD) : ECHO_NONE);
- TERN_(INPUT_SHAPING_Y, echo_axes[tail].y = y_step ? (y_forward ? ECHO_FWD : ECHO_BWD) : ECHO_NONE);
if (++tail == shaping_echoes) tail = 0;
- TERN_(INPUT_SHAPING_X, _free_count_x--);
- TERN_(INPUT_SHAPING_Y, _free_count_y--);
- TERN_(INPUT_SHAPING_X, if (echo_axes[head_x].x == ECHO_NONE) dequeue_x());
- TERN_(INPUT_SHAPING_Y, if (echo_axes[head_y].y == ECHO_NONE) dequeue_y());
}
#if ENABLED(INPUT_SHAPING_X)
static shaping_time_t peek_x() { return peek_x_val; }
@@ -445,11 +465,11 @@ constexpr ena_mask_t enable_overlap[] = {
struct ShapeParams {
float frequency;
float zeta;
- bool enabled;
+ bool enabled : 1;
+ bool forward : 1;
int16_t delta_error = 0; // delta_error for seconday bresenham mod 128
uint8_t factor1;
uint8_t factor2;
- bool forward;
int32_t last_block_end_pos = 0;
};
From 549419e08482873422675173cd9d241362b88f00 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:25:42 -0600
Subject: [PATCH 014/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Set=20steps=5Fper?=
=?UTF-8?q?=5Fisr=20in=20calc=5Fmultistep=5Ftimer=5Finterval?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/module/stepper.cpp | 24 +++++++++++-------------
Marlin/src/module/stepper.h | 2 +-
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index 0ae2a52f9d..738862666f 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -189,7 +189,7 @@ bool Stepper::abort_current_block;
#endif
uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
-uint8_t Stepper::steps_per_isr; // Count of steps to perform per Stepper ISR call
+uint8_t Stepper::steps_per_isr = 1; // Count of steps to perform per Stepper ISR call
#if ENABLED(FREEZE_FEATURE)
bool Stepper::frozen; // = false
@@ -2088,8 +2088,7 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
}
// Get the timer interval and the number of loops to perform per tick
-hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t &loops) {
- uint8_t multistep = 1;
+hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) {
#if ENABLED(DISABLE_MULTI_STEPPING)
// Just make sure the step rate is doable
@@ -2109,16 +2108,15 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate, uint8_t &loops) {
(MAX_STEP_ISR_FREQUENCY_128X >> 7)
};
- // Select the proper multistepping
- uint8_t idx = 0;
- while (idx < 7 && step_rate > (uint32_t)pgm_read_dword(&limit[idx])) {
+ // Find a doable step rate using multistepping
+ uint8_t multistep = 1;
+ for (uint8_t i = 0; i < 7 && step_rate > uint32_t(pgm_read_dword(&limit[i])); ++i) {
step_rate >>= 1;
multistep <<= 1;
- ++idx;
- };
+ }
+ steps_per_isr = multistep;
#endif
- loops = multistep;
return calc_timer_interval(step_rate);
}
@@ -2176,7 +2174,7 @@ hal_timer_t Stepper::block_phase_isr() {
// acc_step_rate is in steps/second
// step_rate to timer interval and steps per stepper isr
- interval = calc_timer_interval(acc_step_rate << oversampling_factor, steps_per_isr);
+ interval = calc_multistep_timer_interval(acc_step_rate << oversampling_factor);
acceleration_time += interval;
#if ENABLED(LIN_ADVANCE)
@@ -2246,7 +2244,7 @@ hal_timer_t Stepper::block_phase_isr() {
#endif
// step_rate to timer interval and steps per stepper isr
- interval = calc_timer_interval(step_rate << oversampling_factor, steps_per_isr);
+ interval = calc_multistep_timer_interval(step_rate << oversampling_factor);
deceleration_time += interval;
#if ENABLED(LIN_ADVANCE)
@@ -2308,7 +2306,7 @@ hal_timer_t Stepper::block_phase_isr() {
// Calculate the ticks_nominal for this nominal speed, if not done yet
if (ticks_nominal == 0) {
// step_rate to timer interval and loops for the nominal speed
- ticks_nominal = calc_timer_interval(current_block->nominal_rate << oversampling_factor, steps_per_isr);
+ ticks_nominal = calc_multistep_timer_interval(current_block->nominal_rate << oversampling_factor);
#if ENABLED(LIN_ADVANCE)
if (la_active)
@@ -2628,7 +2626,7 @@ hal_timer_t Stepper::block_phase_isr() {
#endif
// Calculate the initial timer interval
- interval = calc_timer_interval(current_block->initial_rate << oversampling_factor, steps_per_isr);
+ interval = calc_multistep_timer_interval(current_block->initial_rate << oversampling_factor);
acceleration_time += interval;
#if ENABLED(LIN_ADVANCE)
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 731d7e6ee8..ebd7e98aeb 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -834,7 +834,7 @@ class Stepper {
static hal_timer_t calc_timer_interval(uint32_t step_rate);
// Calculate timing interval and steps-per-ISR for the given step rate
- static hal_timer_t calc_timer_interval(uint32_t step_rate, uint8_t &loops);
+ static hal_timer_t calc_multistep_timer_interval(uint32_t step_rate);
#if ENABLED(S_CURVE_ACCELERATION)
static void _calc_bezier_curve_coeffs(const int32_t v0, const int32_t v1, const uint32_t av);
From 3365172e7c7b577d12912a7d942d3a2fa5c75f74 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 11 Mar 2023 19:54:48 -0600
Subject: [PATCH 015/225] =?UTF-8?q?=F0=9F=94=A7=20Expose=20MULTISTEPPING?=
=?UTF-8?q?=5FLIMIT=20option?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/Configuration_adv.h | 6 +++++
Marlin/src/inc/Conditionals_adv.h | 6 +++++
Marlin/src/inc/SanityCheck.h | 3 +++
Marlin/src/inc/Warnings.cpp | 4 ++++
Marlin/src/module/stepper.cpp | 37 ++++++++++++++++++++++---------
Marlin/src/module/stepper.h | 12 +++++-----
6 files changed, 52 insertions(+), 16 deletions(-)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 35e7363423..6ef72d9f04 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -1267,6 +1267,12 @@
#endif
#endif
+/**
+ * Multi-stepping sends steps in bursts to reduce MCU usage for high step-rates.
+ * This allows higher feedrates than the MCU could otherwise support.
+ */
+#define MULTISTEPPING_LIMIT 16 //: [1, 2, 4, 8, 16, 32, 64, 128]
+
/**
* Adaptive Step Smoothing increases the resolution of multi-axis moves, particularly at step frequencies
* below 1kHz (for AVR) or 10kHz (for ARM), where aliasing between axes in multi-axis moves causes audible
diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h
index 5b303e919f..5079a93c1d 100644
--- a/Marlin/src/inc/Conditionals_adv.h
+++ b/Marlin/src/inc/Conditionals_adv.h
@@ -1219,3 +1219,9 @@
#undef TC_GCODE_USE_GLOBAL_Y
#undef TC_GCODE_USE_GLOBAL_Z
#endif
+
+// Multi-Stepping Limit
+#ifndef MULTISTEPPING_LIMIT
+ #define MULTISTEPPING_LIMIT 128
+ #define MULTISTEPPING_LIMIT_WARNING 1
+#endif
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index 7d8f404591..5f20b205a0 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -4500,6 +4500,9 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
#endif
#endif
+// Multi-Stepping Limit
+static_assert(WITHIN(MULTISTEPPING_LIMIT, 1, 128) && IS_POWER_OF_2(MULTISTEPPING_LIMIT), "MULTISTEPPING_LIMIT must be 1, 2, 4, 8, 16, 32, 64, or 128.");
+
// Misc. Cleanup
#undef _TEST_PWM
#undef _NUM_AXES_STR
diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp
index 1d1426936f..184d1a08da 100644
--- a/Marlin/src/inc/Warnings.cpp
+++ b/Marlin/src/inc/Warnings.cpp
@@ -797,3 +797,7 @@
#if HAS_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
#endif
+
+#if MULTISTEPPING_LIMIT_WARNING
+ #warning "MULTISTEPPING_LIMIT has been automatically set to 128. Use a lower value if the machine is slow to respond."
+#endif
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index 738862666f..b4c66d1fba 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -189,7 +189,10 @@ bool Stepper::abort_current_block;
#endif
uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
-uint8_t Stepper::steps_per_isr = 1; // Count of steps to perform per Stepper ISR call
+
+#if MULTISTEPPING_LIMIT > 1
+ uint8_t Stepper::steps_per_isr = 1; // Count of steps to perform per Stepper ISR call
+#endif
#if ENABLED(FREEZE_FEATURE)
bool Stepper::frozen; // = false
@@ -2089,7 +2092,7 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
// Get the timer interval and the number of loops to perform per tick
hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) {
- #if ENABLED(DISABLE_MULTI_STEPPING)
+ #if MULTISTEPPING_LIMIT == 1
// Just make sure the step rate is doable
NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X));
@@ -2098,19 +2101,31 @@ hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) {
// The stepping frequency limits for each multistepping rate
static const uint32_t limit[] PROGMEM = {
- ( MAX_STEP_ISR_FREQUENCY_1X ),
- ( MAX_STEP_ISR_FREQUENCY_2X >> 1),
- ( MAX_STEP_ISR_FREQUENCY_4X >> 2),
- ( MAX_STEP_ISR_FREQUENCY_8X >> 3),
- ( MAX_STEP_ISR_FREQUENCY_16X >> 4),
- ( MAX_STEP_ISR_FREQUENCY_32X >> 5),
- ( MAX_STEP_ISR_FREQUENCY_64X >> 6),
- (MAX_STEP_ISR_FREQUENCY_128X >> 7)
+ ( MAX_STEP_ISR_FREQUENCY_1X )
+ , ( MAX_STEP_ISR_FREQUENCY_2X >> 1)
+ #if MULTISTEPPING_LIMIT >= 4
+ , ( MAX_STEP_ISR_FREQUENCY_4X >> 2)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 8
+ , ( MAX_STEP_ISR_FREQUENCY_8X >> 3)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 16
+ , ( MAX_STEP_ISR_FREQUENCY_16X >> 4)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 32
+ , ( MAX_STEP_ISR_FREQUENCY_32X >> 5)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 64
+ , ( MAX_STEP_ISR_FREQUENCY_64X >> 6)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 128
+ , (MAX_STEP_ISR_FREQUENCY_128X >> 7)
+ #endif
};
// Find a doable step rate using multistepping
uint8_t multistep = 1;
- for (uint8_t i = 0; i < 7 && step_rate > uint32_t(pgm_read_dword(&limit[i])); ++i) {
+ for (uint8_t i = 0; i < COUNT(limit) && step_rate > uint32_t(pgm_read_dword(&limit[i])); ++i) {
step_rate >>= 1;
multistep <<= 1;
}
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index ebd7e98aeb..820d1d9a73 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -49,9 +49,6 @@
#include "stepper/speed_lookuptable.h"
#endif
-// Disable multiple steps per ISR
-//#define DISABLE_MULTI_STEPPING
-
//
// Estimate the amount of time the Stepper ISR will take to execute
//
@@ -259,7 +256,7 @@
// The minimum step ISR rate used by ADAPTIVE_STEP_SMOOTHING to target 50% CPU usage
// This does not account for the possibility of multi-stepping.
-// Perhaps DISABLE_MULTI_STEPPING should be required with ADAPTIVE_STEP_SMOOTHING.
+// Should a MULTISTEPPING_LIMIT of 1 should be required with ADAPTIVE_STEP_SMOOTHING?
#define MIN_STEP_ISR_FREQUENCY (MAX_STEP_ISR_FREQUENCY_1X / 2)
#define ENABLE_COUNT (NUM_AXES + E_STEPPERS)
@@ -543,7 +540,12 @@ class Stepper {
#endif
static uint32_t acceleration_time, deceleration_time; // time measured in Stepper Timer ticks
- static uint8_t steps_per_isr; // Count of steps to perform per Stepper ISR call
+
+ #if MULTISTEPPING_LIMIT == 1
+ static constexpr uint8_t steps_per_isr = 1; // Count of steps to perform per Stepper ISR call
+ #else
+ static uint8_t steps_per_isr;
+ #endif
#if ENABLED(ADAPTIVE_STEP_SMOOTHING)
static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis
From 143a8701d5b11925440d643b47e5c5812a69352f Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sun, 12 Mar 2023 16:29:21 -0500
Subject: [PATCH 016/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Optimize=20speed?=
=?UTF-8?q?=20lookup=20for=20AVR?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/HAL/AVR/math.h | 34 +--
Marlin/src/module/stepper.cpp | 27 +-
Marlin/src/module/stepper/speed_lookuptable.h | 254 +++++++++---------
.../share/scripts/createSpeedLookupTable.py | 42 +--
4 files changed, 176 insertions(+), 181 deletions(-)
diff --git a/Marlin/src/HAL/AVR/math.h b/Marlin/src/HAL/AVR/math.h
index 34f859fbbb..16848524fa 100644
--- a/Marlin/src/HAL/AVR/math.h
+++ b/Marlin/src/HAL/AVR/math.h
@@ -84,32 +84,26 @@ FORCE_INLINE static uint16_t MultiU24X32toH16(uint32_t longIn1, uint32_t longIn2
return intRes;
}
-// intRes = intIn1 * intIn2 >> 8
+// charRes = charIn1 * charIn2 >> 8
// uses:
-// r1, r0 for the result of mul. After the second mul, r0 holds bits 0-7 of the 24 bit result and
-// the top bit of r0 is used for rounding.
-// [tmp] to store 0.
-// [intRes] (A B) is bits 8-15 and is the returned value.
+// r1, r0 for the result of mul. After the mul, r0 holds bits 0-7 of the 16 bit result,
+// and the top bit of r0 is used for rounding.
+// [charRes] is bits 8-15 and is the returned value.
// [charIn1] is an 8 bit parameter.
-// [intIn2] (B A) is a 16 bit parameter.
+// [charIn2] is an 8 bit parameter.
//
-FORCE_INLINE static uint16_t MultiU8X16toH16(uint8_t charIn1, uint16_t intIn2) {
- uint8_t tmp;
- uint16_t intRes;
+FORCE_INLINE static uint8_t MultiU8X8toH8(uint8_t charIn1, uint8_t charIn2) {
+ uint8_t charRes;
__asm__ __volatile__ (
- A("clr %[tmp]")
- A("mul %[charIn1], %B[intIn2]")
- A("movw %A[intRes], r0")
- A("mul %[charIn1], %A[intIn2]")
- A("lsl r0")
- A("adc %A[intRes], r1")
- A("adc %B[intRes], %[tmp]")
+ A("mul %[charIn1], %[charIn2]")
+ A("mov %[charRes], r1")
A("clr r1")
- : [intRes] "=&r" (intRes),
- [tmp] "=&r" (tmp)
+ A("lsl r0")
+ A("adc %[charRes], r1")
+ : [charRes] "=&r" (charRes)
: [charIn1] "d" (charIn1),
- [intIn2] "d" (intIn2)
+ [charIn2] "d" (charIn2)
: "cc"
);
- return intRes;
+ return charRes;
}
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index b4c66d1fba..ae12f0b7f4 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -2069,22 +2069,21 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
// AVR is able to keep up at 30khz Stepping ISR rate.
constexpr uint32_t min_step_rate = (F_CPU) / 500000U; // i.e., 32 or 40
- if (step_rate <= min_step_rate) { // lower step rates
- step_rate = 0;
- return uint16_t(pgm_read_word(uintptr_t(speed_lookuptable_slow)));
+ if (step_rate >= 0x0800) { // higher step rate
+ const uintptr_t table_address = uintptr_t(&speed_lookuptable_fast[uint8_t(step_rate >> 8)]);
+ const uint16_t base = uint16_t(pgm_read_word(table_address));
+ const uint8_t gain = uint8_t(pgm_read_byte(table_address + 2));
+ return base - MultiU8X8toH8(uint8_t(step_rate & 0x00FF), gain);
+ }
+ else if (step_rate > min_step_rate) { // lower step rates
+ step_rate -= min_step_rate; // Correct for minimal speed
+ const uintptr_t table_address = uintptr_t(&speed_lookuptable_slow[uint8_t(step_rate >> 3)]);
+ return uint16_t(pgm_read_word(table_address))
+ - ((uint16_t(pgm_read_word(table_address + 2)) * uint8_t(step_rate & 0x0007)) >> 3);
}
else {
- step_rate -= min_step_rate; // Correct for minimal speed
- if (step_rate >= 0x0800) { // higher step rate
- const uintptr_t table_address = uintptr_t(&speed_lookuptable_fast[uint8_t(step_rate >> 8)]);
- const uint16_t gain = uint16_t(pgm_read_word(table_address + 2));
- return uint16_t(pgm_read_word(table_address)) - MultiU8X16toH16(uint8_t(step_rate & 0x00FF), gain);
- }
- else { // lower step rates
- const uintptr_t table_address = uintptr_t(&speed_lookuptable_slow[uint8_t(step_rate >> 3)]);
- return uint16_t(pgm_read_word(table_address))
- - ((uint16_t(pgm_read_word(table_address + 2)) * uint8_t(step_rate & 0x0007)) >> 3);
- }
+ step_rate = 0;
+ return uint16_t(pgm_read_word(uintptr_t(speed_lookuptable_slow)));
}
#endif // !CPU_32_BIT
diff --git a/Marlin/src/module/stepper/speed_lookuptable.h b/Marlin/src/module/stepper/speed_lookuptable.h
index 0b4205ea57..ae30bdbf3b 100644
--- a/Marlin/src/module/stepper/speed_lookuptable.h
+++ b/Marlin/src/module/stepper/speed_lookuptable.h
@@ -23,146 +23,146 @@
#if F_CPU == 16000000
- const uint16_t speed_lookuptable_fast[256][2] PROGMEM = {
+ const struct { uint16_t base; uint8_t gain; } speed_lookuptable_fast[256] PROGMEM = {
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // dummy first row
- { 961, 105 }, { 856, 85 }, { 771, 69 }, { 702, 58 }, { 644, 49 }, { 595, 42 }, { 553, 37 }, { 516, 32 },
- { 484, 28 }, { 456, 25 }, { 431, 23 }, { 408, 20 }, { 388, 19 }, { 369, 16 }, { 353, 16 }, { 337, 14 },
- { 323, 13 }, { 310, 11 }, { 299, 11 }, { 288, 11 }, { 277, 9 }, { 268, 9 }, { 259, 8 }, { 251, 8 },
- { 243, 8 }, { 235, 7 }, { 228, 6 }, { 222, 6 }, { 216, 6 }, { 210, 6 }, { 204, 5 }, { 199, 5 },
- { 194, 5 }, { 189, 4 }, { 185, 4 }, { 181, 4 }, { 177, 4 }, { 173, 4 }, { 169, 4 }, { 165, 3 },
- { 162, 3 }, { 159, 4 }, { 155, 3 }, { 152, 3 }, { 149, 2 }, { 147, 3 }, { 144, 3 }, { 141, 2 },
- { 139, 3 }, { 136, 2 }, { 134, 2 }, { 132, 3 }, { 129, 2 }, { 127, 2 }, { 125, 2 }, { 123, 2 },
- { 121, 2 }, { 119, 1 }, { 118, 2 }, { 116, 2 }, { 114, 1 }, { 113, 2 }, { 111, 2 }, { 109, 1 },
- { 108, 2 }, { 106, 1 }, { 105, 2 }, { 103, 1 }, { 102, 1 }, { 101, 1 }, { 100, 2 }, { 98, 1 },
- { 97, 1 }, { 96, 1 }, { 95, 2 }, { 93, 1 }, { 92, 1 }, { 91, 1 }, { 90, 1 }, { 89, 1 },
- { 88, 1 }, { 87, 1 }, { 86, 1 }, { 85, 1 }, { 84, 1 }, { 83, 0 }, { 83, 1 }, { 82, 1 },
- { 81, 1 }, { 80, 1 }, { 79, 1 }, { 78, 0 }, { 78, 1 }, { 77, 1 }, { 76, 1 }, { 75, 0 },
- { 75, 1 }, { 74, 1 }, { 73, 1 }, { 72, 0 }, { 72, 1 }, { 71, 1 }, { 70, 0 }, { 70, 1 },
- { 69, 0 }, { 69, 1 }, { 68, 1 }, { 67, 0 }, { 67, 1 }, { 66, 0 }, { 66, 1 }, { 65, 0 },
- { 65, 1 }, { 64, 1 }, { 63, 0 }, { 63, 1 }, { 62, 0 }, { 62, 1 }, { 61, 0 }, { 61, 1 },
- { 60, 0 }, { 60, 0 }, { 60, 1 }, { 59, 0 }, { 59, 1 }, { 58, 0 }, { 58, 1 }, { 57, 0 },
- { 57, 1 }, { 56, 0 }, { 56, 0 }, { 56, 1 }, { 55, 0 }, { 55, 1 }, { 54, 0 }, { 54, 0 },
- { 54, 1 }, { 53, 0 }, { 53, 0 }, { 53, 1 }, { 52, 0 }, { 52, 0 }, { 52, 1 }, { 51, 0 },
- { 51, 0 }, { 51, 1 }, { 50, 0 }, { 50, 0 }, { 50, 1 }, { 49, 0 }, { 49, 0 }, { 49, 1 },
- { 48, 0 }, { 48, 0 }, { 48, 1 }, { 47, 0 }, { 47, 0 }, { 47, 0 }, { 47, 1 }, { 46, 0 },
- { 46, 0 }, { 46, 1 }, { 45, 0 }, { 45, 0 }, { 45, 0 }, { 45, 1 }, { 44, 0 }, { 44, 0 },
- { 44, 0 }, { 44, 1 }, { 43, 0 }, { 43, 0 }, { 43, 0 }, { 43, 1 }, { 42, 0 }, { 42, 0 },
- { 42, 0 }, { 42, 1 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 1 }, { 40, 0 },
- { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 1 }, { 39, 0 }, { 39, 0 }, { 39, 0 }, { 39, 0 },
- { 39, 1 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 1 }, { 37, 0 }, { 37, 0 },
- { 37, 0 }, { 37, 0 }, { 37, 0 }, { 37, 1 }, { 36, 0 }, { 36, 0 }, { 36, 0 }, { 36, 0 },
- { 36, 1 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 0 }, { 35, 1 },
- { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 1 }, { 33, 0 }, { 33, 0 },
- { 33, 0 }, { 33, 0 }, { 33, 0 }, { 33, 0 }, { 33, 1 }, { 32, 0 }, { 32, 0 }, { 32, 0 },
- { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 1 }, { 31, 0 }, { 31, 0 }, { 31, 0 },
- { 31, 0 }, { 31, 0 }, { 31, 0 }, { 31, 1 }, { 30, 0 }, { 30, 0 }, { 30, 0 }, { 30, 0 }
+ { 977, 109 }, { 868, 87 }, { 781, 71 }, { 710, 59 }, { 651, 50 }, { 601, 43 }, { 558, 37 }, { 521, 33 },
+ { 488, 28 }, { 460, 26 }, { 434, 23 }, { 411, 20 }, { 391, 19 }, { 372, 17 }, { 355, 15 }, { 340, 14 },
+ { 326, 13 }, { 313, 13 }, { 300, 11 }, { 289, 10 }, { 279, 10 }, { 269, 9 }, { 260, 8 }, { 252, 8 },
+ { 244, 7 }, { 237, 7 }, { 230, 7 }, { 223, 6 }, { 217, 6 }, { 211, 5 }, { 206, 6 }, { 200, 5 },
+ { 195, 4 }, { 191, 5 }, { 186, 4 }, { 182, 4 }, { 178, 4 }, { 174, 4 }, { 170, 4 }, { 166, 3 },
+ { 163, 4 }, { 159, 3 }, { 156, 3 }, { 153, 3 }, { 150, 3 }, { 147, 2 }, { 145, 3 }, { 142, 2 },
+ { 140, 3 }, { 137, 2 }, { 135, 3 }, { 132, 2 }, { 130, 2 }, { 128, 2 }, { 126, 2 }, { 124, 2 },
+ { 122, 2 }, { 120, 2 }, { 118, 1 }, { 117, 2 }, { 115, 2 }, { 113, 1 }, { 112, 2 }, { 110, 1 },
+ { 109, 2 }, { 107, 1 }, { 106, 2 }, { 104, 1 }, { 103, 2 }, { 101, 1 }, { 100, 1 }, { 99, 1 },
+ { 98, 2 }, { 96, 1 }, { 95, 1 }, { 94, 1 }, { 93, 1 }, { 92, 1 }, { 91, 1 }, { 90, 1 },
+ { 89, 1 }, { 88, 1 }, { 87, 1 }, { 86, 1 }, { 85, 1 }, { 84, 1 }, { 83, 1 }, { 82, 1 },
+ { 81, 0 }, { 81, 1 }, { 80, 1 }, { 79, 1 }, { 78, 1 }, { 77, 0 }, { 77, 1 }, { 76, 1 },
+ { 75, 1 }, { 74, 0 }, { 74, 1 }, { 73, 1 }, { 72, 0 }, { 72, 1 }, { 71, 1 }, { 70, 0 },
+ { 70, 1 }, { 69, 0 }, { 69, 1 }, { 68, 1 }, { 67, 0 }, { 67, 1 }, { 66, 0 }, { 66, 1 },
+ { 65, 0 }, { 65, 1 }, { 64, 0 }, { 64, 1 }, { 63, 0 }, { 63, 1 }, { 62, 0 }, { 62, 1 },
+ { 61, 0 }, { 61, 1 }, { 60, 0 }, { 60, 1 }, { 59, 0 }, { 59, 1 }, { 58, 0 }, { 58, 1 },
+ { 57, 0 }, { 57, 0 }, { 57, 1 }, { 56, 0 }, { 56, 1 }, { 55, 0 }, { 55, 0 }, { 55, 1 },
+ { 54, 0 }, { 54, 0 }, { 54, 1 }, { 53, 0 }, { 53, 1 }, { 52, 0 }, { 52, 0 }, { 52, 1 },
+ { 51, 0 }, { 51, 0 }, { 51, 1 }, { 50, 0 }, { 50, 0 }, { 50, 1 }, { 49, 0 }, { 49, 0 },
+ { 49, 0 }, { 49, 1 }, { 48, 0 }, { 48, 0 }, { 48, 1 }, { 47, 0 }, { 47, 0 }, { 47, 0 },
+ { 47, 1 }, { 46, 0 }, { 46, 0 }, { 46, 1 }, { 45, 0 }, { 45, 0 }, { 45, 0 }, { 45, 1 },
+ { 44, 0 }, { 44, 0 }, { 44, 0 }, { 44, 1 }, { 43, 0 }, { 43, 0 }, { 43, 0 }, { 43, 1 },
+ { 42, 0 }, { 42, 0 }, { 42, 0 }, { 42, 0 }, { 42, 1 }, { 41, 0 }, { 41, 0 }, { 41, 0 },
+ { 41, 1 }, { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 1 }, { 39, 0 }, { 39, 0 },
+ { 39, 0 }, { 39, 0 }, { 39, 1 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 },
+ { 38, 1 }, { 37, 0 }, { 37, 0 }, { 37, 0 }, { 37, 0 }, { 37, 0 }, { 37, 1 }, { 36, 0 },
+ { 36, 0 }, { 36, 0 }, { 36, 0 }, { 36, 0 }, { 36, 1 }, { 35, 0 }, { 35, 0 }, { 35, 0 },
+ { 35, 0 }, { 35, 0 }, { 35, 1 }, { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 0 }, { 34, 0 },
+ { 34, 0 }, { 34, 1 }, { 33, 0 }, { 33, 0 }, { 33, 0 }, { 33, 0 }, { 33, 0 }, { 33, 0 },
+ { 33, 1 }, { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 0 }, { 32, 0 },
+ { 32, 1 }, { 31, 0 }, { 31, 0 }, { 31, 0 }, { 31, 0 }, { 31, 0 }, { 31, 0 }, { 31, 0 },
};
const uint16_t speed_lookuptable_slow[256][2] PROGMEM = {
- { 62500, 12500 }, { 50000, 8334 }, { 41666, 5952 }, { 35714, 4464 }, { 31250, 3473 }, { 27777, 2777 }, { 25000, 2273 }, { 22727, 1894 },
- { 20833, 1603 }, { 19230, 1373 }, { 17857, 1191 }, { 16666, 1041 }, { 15625, 920 }, { 14705, 817 }, { 13888, 731 }, { 13157, 657 },
- { 12500, 596 }, { 11904, 541 }, { 11363, 494 }, { 10869, 453 }, { 10416, 416 }, { 10000, 385 }, { 9615, 356 }, { 9259, 331 },
- { 8928, 308 }, { 8620, 287 }, { 8333, 269 }, { 8064, 252 }, { 7812, 237 }, { 7575, 223 }, { 7352, 210 }, { 7142, 198 },
- { 6944, 188 }, { 6756, 178 }, { 6578, 168 }, { 6410, 160 }, { 6250, 153 }, { 6097, 145 }, { 5952, 139 }, { 5813, 132 },
- { 5681, 126 }, { 5555, 121 }, { 5434, 115 }, { 5319, 111 }, { 5208, 106 }, { 5102, 102 }, { 5000, 99 }, { 4901, 94 },
- { 4807, 91 }, { 4716, 87 }, { 4629, 84 }, { 4545, 81 }, { 4464, 79 }, { 4385, 75 }, { 4310, 73 }, { 4237, 71 },
- { 4166, 68 }, { 4098, 66 }, { 4032, 64 }, { 3968, 62 }, { 3906, 60 }, { 3846, 59 }, { 3787, 56 }, { 3731, 55 },
- { 3676, 53 }, { 3623, 52 }, { 3571, 50 }, { 3521, 49 }, { 3472, 48 }, { 3424, 46 }, { 3378, 45 }, { 3333, 44 },
- { 3289, 43 }, { 3246, 41 }, { 3205, 41 }, { 3164, 39 }, { 3125, 39 }, { 3086, 38 }, { 3048, 36 }, { 3012, 36 },
- { 2976, 35 }, { 2941, 35 }, { 2906, 33 }, { 2873, 33 }, { 2840, 32 }, { 2808, 31 }, { 2777, 30 }, { 2747, 30 },
- { 2717, 29 }, { 2688, 29 }, { 2659, 28 }, { 2631, 27 }, { 2604, 27 }, { 2577, 26 }, { 2551, 26 }, { 2525, 25 },
- { 2500, 25 }, { 2475, 25 }, { 2450, 23 }, { 2427, 24 }, { 2403, 23 }, { 2380, 22 }, { 2358, 22 }, { 2336, 22 },
- { 2314, 21 }, { 2293, 21 }, { 2272, 20 }, { 2252, 20 }, { 2232, 20 }, { 2212, 20 }, { 2192, 19 }, { 2173, 18 },
- { 2155, 19 }, { 2136, 18 }, { 2118, 18 }, { 2100, 17 }, { 2083, 17 }, { 2066, 17 }, { 2049, 17 }, { 2032, 16 },
- { 2016, 16 }, { 2000, 16 }, { 1984, 16 }, { 1968, 15 }, { 1953, 16 }, { 1937, 14 }, { 1923, 15 }, { 1908, 15 },
- { 1893, 14 }, { 1879, 14 }, { 1865, 14 }, { 1851, 13 }, { 1838, 14 }, { 1824, 13 }, { 1811, 13 }, { 1798, 13 },
- { 1785, 12 }, { 1773, 13 }, { 1760, 12 }, { 1748, 12 }, { 1736, 12 }, { 1724, 12 }, { 1712, 12 }, { 1700, 11 },
- { 1689, 12 }, { 1677, 11 }, { 1666, 11 }, { 1655, 11 }, { 1644, 11 }, { 1633, 10 }, { 1623, 11 }, { 1612, 10 },
- { 1602, 10 }, { 1592, 10 }, { 1582, 10 }, { 1572, 10 }, { 1562, 10 }, { 1552, 9 }, { 1543, 10 }, { 1533, 9 },
- { 1524, 9 }, { 1515, 9 }, { 1506, 9 }, { 1497, 9 }, { 1488, 9 }, { 1479, 9 }, { 1470, 9 }, { 1461, 8 },
- { 1453, 8 }, { 1445, 9 }, { 1436, 8 }, { 1428, 8 }, { 1420, 8 }, { 1412, 8 }, { 1404, 8 }, { 1396, 8 },
- { 1388, 7 }, { 1381, 8 }, { 1373, 7 }, { 1366, 8 }, { 1358, 7 }, { 1351, 7 }, { 1344, 8 }, { 1336, 7 },
- { 1329, 7 }, { 1322, 7 }, { 1315, 7 }, { 1308, 6 }, { 1302, 7 }, { 1295, 7 }, { 1288, 6 }, { 1282, 7 },
- { 1275, 6 }, { 1269, 7 }, { 1262, 6 }, { 1256, 6 }, { 1250, 7 }, { 1243, 6 }, { 1237, 6 }, { 1231, 6 },
- { 1225, 6 }, { 1219, 6 }, { 1213, 6 }, { 1207, 6 }, { 1201, 5 }, { 1196, 6 }, { 1190, 6 }, { 1184, 5 },
- { 1179, 6 }, { 1173, 5 }, { 1168, 6 }, { 1162, 5 }, { 1157, 5 }, { 1152, 6 }, { 1146, 5 }, { 1141, 5 },
+ { 62500, 12500 }, { 50000, 8333 }, { 41667, 5953 }, { 35714, 4464 }, { 31250, 3472 }, { 27778, 2778 }, { 25000, 2273 }, { 22727, 1894 },
+ { 20833, 1602 }, { 19231, 1374 }, { 17857, 1190 }, { 16667, 1042 }, { 15625, 919 }, { 14706, 817 }, { 13889, 731 }, { 13158, 658 },
+ { 12500, 595 }, { 11905, 541 }, { 11364, 494 }, { 10870, 453 }, { 10417, 417 }, { 10000, 385 }, { 9615, 356 }, { 9259, 330 },
+ { 8929, 308 }, { 8621, 288 }, { 8333, 268 }, { 8065, 252 }, { 7813, 237 }, { 7576, 223 }, { 7353, 210 }, { 7143, 199 },
+ { 6944, 187 }, { 6757, 178 }, { 6579, 169 }, { 6410, 160 }, { 6250, 152 }, { 6098, 146 }, { 5952, 138 }, { 5814, 132 },
+ { 5682, 126 }, { 5556, 121 }, { 5435, 116 }, { 5319, 111 }, { 5208, 106 }, { 5102, 102 }, { 5000, 98 }, { 4902, 94 },
+ { 4808, 91 }, { 4717, 87 }, { 4630, 85 }, { 4545, 81 }, { 4464, 78 }, { 4386, 76 }, { 4310, 73 }, { 4237, 70 },
+ { 4167, 69 }, { 4098, 66 }, { 4032, 64 }, { 3968, 62 }, { 3906, 60 }, { 3846, 58 }, { 3788, 57 }, { 3731, 55 },
+ { 3676, 53 }, { 3623, 52 }, { 3571, 50 }, { 3521, 49 }, { 3472, 47 }, { 3425, 47 }, { 3378, 45 }, { 3333, 44 },
+ { 3289, 42 }, { 3247, 42 }, { 3205, 40 }, { 3165, 40 }, { 3125, 39 }, { 3086, 37 }, { 3049, 37 }, { 3012, 36 },
+ { 2976, 35 }, { 2941, 34 }, { 2907, 33 }, { 2874, 33 }, { 2841, 32 }, { 2809, 31 }, { 2778, 31 }, { 2747, 30 },
+ { 2717, 29 }, { 2688, 28 }, { 2660, 28 }, { 2632, 28 }, { 2604, 27 }, { 2577, 26 }, { 2551, 26 }, { 2525, 25 },
+ { 2500, 25 }, { 2475, 24 }, { 2451, 24 }, { 2427, 23 }, { 2404, 23 }, { 2381, 23 }, { 2358, 22 }, { 2336, 21 },
+ { 2315, 21 }, { 2294, 21 }, { 2273, 21 }, { 2252, 20 }, { 2232, 20 }, { 2212, 19 }, { 2193, 19 }, { 2174, 19 },
+ { 2155, 18 }, { 2137, 18 }, { 2119, 18 }, { 2101, 18 }, { 2083, 17 }, { 2066, 17 }, { 2049, 16 }, { 2033, 17 },
+ { 2016, 16 }, { 2000, 16 }, { 1984, 15 }, { 1969, 16 }, { 1953, 15 }, { 1938, 15 }, { 1923, 15 }, { 1908, 14 },
+ { 1894, 14 }, { 1880, 14 }, { 1866, 14 }, { 1852, 14 }, { 1838, 13 }, { 1825, 13 }, { 1812, 13 }, { 1799, 13 },
+ { 1786, 13 }, { 1773, 12 }, { 1761, 13 }, { 1748, 12 }, { 1736, 12 }, { 1724, 12 }, { 1712, 11 }, { 1701, 12 },
+ { 1689, 11 }, { 1678, 11 }, { 1667, 11 }, { 1656, 11 }, { 1645, 11 }, { 1634, 11 }, { 1623, 10 }, { 1613, 10 },
+ { 1603, 11 }, { 1592, 10 }, { 1582, 10 }, { 1572, 9 }, { 1563, 10 }, { 1553, 10 }, { 1543, 9 }, { 1534, 10 },
+ { 1524, 9 }, { 1515, 9 }, { 1506, 9 }, { 1497, 9 }, { 1488, 9 }, { 1479, 8 }, { 1471, 9 }, { 1462, 9 },
+ { 1453, 8 }, { 1445, 8 }, { 1437, 8 }, { 1429, 9 }, { 1420, 8 }, { 1412, 8 }, { 1404, 7 }, { 1397, 8 },
+ { 1389, 8 }, { 1381, 7 }, { 1374, 8 }, { 1366, 7 }, { 1359, 8 }, { 1351, 7 }, { 1344, 7 }, { 1337, 7 },
+ { 1330, 7 }, { 1323, 7 }, { 1316, 7 }, { 1309, 7 }, { 1302, 7 }, { 1295, 6 }, { 1289, 7 }, { 1282, 6 },
+ { 1276, 7 }, { 1269, 6 }, { 1263, 7 }, { 1256, 6 }, { 1250, 6 }, { 1244, 6 }, { 1238, 6 }, { 1232, 7 },
+ { 1225, 5 }, { 1220, 6 }, { 1214, 6 }, { 1208, 6 }, { 1202, 6 }, { 1196, 6 }, { 1190, 5 }, { 1185, 6 },
+ { 1179, 5 }, { 1174, 6 }, { 1168, 5 }, { 1163, 6 }, { 1157, 5 }, { 1152, 5 }, { 1147, 5 }, { 1142, 6 },
{ 1136, 5 }, { 1131, 5 }, { 1126, 5 }, { 1121, 5 }, { 1116, 5 }, { 1111, 5 }, { 1106, 5 }, { 1101, 5 },
- { 1096, 5 }, { 1091, 5 }, { 1086, 4 }, { 1082, 5 }, { 1077, 5 }, { 1072, 4 }, { 1068, 5 }, { 1063, 4 },
- { 1059, 5 }, { 1054, 4 }, { 1050, 4 }, { 1046, 5 }, { 1041, 4 }, { 1037, 4 }, { 1033, 5 }, { 1028, 4 },
- { 1024, 4 }, { 1020, 4 }, { 1016, 4 }, { 1012, 4 }, { 1008, 4 }, { 1004, 4 }, { 1000, 4 }, { 996, 4 },
- { 992, 4 }, { 988, 4 }, { 984, 4 }, { 980, 4 }, { 976, 4 }, { 972, 4 }, { 968, 3 }, { 965, 3 }
+ { 1096, 4 }, { 1092, 5 }, { 1087, 5 }, { 1082, 4 }, { 1078, 5 }, { 1073, 5 }, { 1068, 4 }, { 1064, 5 },
+ { 1059, 4 }, { 1055, 5 }, { 1050, 4 }, { 1046, 4 }, { 1042, 5 }, { 1037, 4 }, { 1033, 4 }, { 1029, 4 },
+ { 1025, 5 }, { 1020, 4 }, { 1016, 4 }, { 1012, 4 }, { 1008, 4 }, { 1004, 4 }, { 1000, 4 }, { 996, 4 },
+ { 992, 4 }, { 988, 4 }, { 984, 4 }, { 980, 3 }, { 977, 4 }, { 973, 4 }, { 969, 4 }, { 965, 4 },
};
#elif F_CPU == 20000000
- const uint16_t speed_lookuptable_fast[256][2] PROGMEM = {
+ const struct { uint16_t base; uint8_t gain; } speed_lookuptable_fast[256] PROGMEM = {
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, // dummy first row
- { 1197, 131 }, { 1066, 105 }, { 961, 86 }, { 875, 72 }, { 803, 61 }, { 742, 53 }, { 689, 45 }, { 644, 40 },
- { 604, 35 }, { 569, 32 }, { 537, 28 }, { 509, 25 }, { 484, 23 }, { 461, 21 }, { 440, 19 }, { 421, 17 },
- { 404, 16 }, { 388, 15 }, { 373, 14 }, { 359, 13 }, { 346, 12 }, { 334, 11 }, { 323, 10 }, { 313, 10 },
- { 303, 9 }, { 294, 9 }, { 285, 8 }, { 277, 7 }, { 270, 8 }, { 262, 7 }, { 255, 6 }, { 249, 6 },
- { 243, 6 }, { 237, 6 }, { 231, 5 }, { 226, 5 }, { 221, 5 }, { 216, 5 }, { 211, 4 }, { 207, 5 },
- { 202, 4 }, { 198, 4 }, { 194, 4 }, { 190, 3 }, { 187, 4 }, { 183, 3 }, { 180, 3 }, { 177, 4 },
- { 173, 3 }, { 170, 3 }, { 167, 2 }, { 165, 3 }, { 162, 3 }, { 159, 2 }, { 157, 3 }, { 154, 2 },
- { 152, 3 }, { 149, 2 }, { 147, 2 }, { 145, 2 }, { 143, 2 }, { 141, 2 }, { 139, 2 }, { 137, 2 },
- { 135, 2 }, { 133, 2 }, { 131, 2 }, { 129, 1 }, { 128, 2 }, { 126, 2 }, { 124, 1 }, { 123, 2 },
- { 121, 1 }, { 120, 2 }, { 118, 1 }, { 117, 1 }, { 116, 2 }, { 114, 1 }, { 113, 1 }, { 112, 2 },
- { 110, 1 }, { 109, 1 }, { 108, 1 }, { 107, 2 }, { 105, 1 }, { 104, 1 }, { 103, 1 }, { 102, 1 },
- { 101, 1 }, { 100, 1 }, { 99, 1 }, { 98, 1 }, { 97, 1 }, { 96, 1 }, { 95, 1 }, { 94, 1 },
- { 93, 1 }, { 92, 1 }, { 91, 0 }, { 91, 1 }, { 90, 1 }, { 89, 1 }, { 88, 1 }, { 87, 0 },
- { 87, 1 }, { 86, 1 }, { 85, 1 }, { 84, 0 }, { 84, 1 }, { 83, 1 }, { 82, 1 }, { 81, 0 },
- { 81, 1 }, { 80, 1 }, { 79, 0 }, { 79, 1 }, { 78, 0 }, { 78, 1 }, { 77, 1 }, { 76, 0 },
- { 76, 1 }, { 75, 0 }, { 75, 1 }, { 74, 1 }, { 73, 0 }, { 73, 1 }, { 72, 0 }, { 72, 1 },
- { 71, 0 }, { 71, 1 }, { 70, 0 }, { 70, 1 }, { 69, 0 }, { 69, 1 }, { 68, 0 }, { 68, 1 },
- { 67, 0 }, { 67, 1 }, { 66, 0 }, { 66, 1 }, { 65, 0 }, { 65, 0 }, { 65, 1 }, { 64, 0 },
- { 64, 1 }, { 63, 0 }, { 63, 1 }, { 62, 0 }, { 62, 0 }, { 62, 1 }, { 61, 0 }, { 61, 1 },
- { 60, 0 }, { 60, 0 }, { 60, 1 }, { 59, 0 }, { 59, 0 }, { 59, 1 }, { 58, 0 }, { 58, 0 },
- { 58, 1 }, { 57, 0 }, { 57, 0 }, { 57, 1 }, { 56, 0 }, { 56, 0 }, { 56, 1 }, { 55, 0 },
- { 55, 0 }, { 55, 1 }, { 54, 0 }, { 54, 0 }, { 54, 1 }, { 53, 0 }, { 53, 0 }, { 53, 0 },
- { 53, 1 }, { 52, 0 }, { 52, 0 }, { 52, 1 }, { 51, 0 }, { 51, 0 }, { 51, 0 }, { 51, 1 },
- { 50, 0 }, { 50, 0 }, { 50, 0 }, { 50, 1 }, { 49, 0 }, { 49, 0 }, { 49, 0 }, { 49, 1 },
- { 48, 0 }, { 48, 0 }, { 48, 0 }, { 48, 1 }, { 47, 0 }, { 47, 0 }, { 47, 0 }, { 47, 1 },
- { 46, 0 }, { 46, 0 }, { 46, 0 }, { 46, 0 }, { 46, 1 }, { 45, 0 }, { 45, 0 }, { 45, 0 },
- { 45, 1 }, { 44, 0 }, { 44, 0 }, { 44, 0 }, { 44, 0 }, { 44, 1 }, { 43, 0 }, { 43, 0 },
- { 43, 0 }, { 43, 0 }, { 43, 1 }, { 42, 0 }, { 42, 0 }, { 42, 0 }, { 42, 0 }, { 42, 0 },
- { 42, 1 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 1 }, { 40, 0 },
- { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 1 }, { 39, 0 }, { 39, 0 }, { 39, 0 }, { 39, 0 },
- { 39, 0 }, { 39, 0 }, { 39, 1 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 }, { 38, 0 },
+ { 1221, 136 }, { 1085, 108 }, { 977, 89 }, { 888, 74 }, { 814, 63 }, { 751, 53 }, { 698, 47 }, { 651, 41 },
+ { 610, 36 }, { 574, 31 }, { 543, 29 }, { 514, 26 }, { 488, 23 }, { 465, 21 }, { 444, 19 }, { 425, 18 },
+ { 407, 16 }, { 391, 15 }, { 376, 14 }, { 362, 13 }, { 349, 12 }, { 337, 11 }, { 326, 11 }, { 315, 10 },
+ { 305, 9 }, { 296, 9 }, { 287, 8 }, { 279, 8 }, { 271, 7 }, { 264, 7 }, { 257, 7 }, { 250, 6 },
+ { 244, 6 }, { 238, 5 }, { 233, 6 }, { 227, 5 }, { 222, 5 }, { 217, 5 }, { 212, 4 }, { 208, 5 },
+ { 203, 4 }, { 199, 4 }, { 195, 4 }, { 191, 3 }, { 188, 4 }, { 184, 3 }, { 181, 3 }, { 178, 4 },
+ { 174, 3 }, { 171, 3 }, { 168, 2 }, { 166, 3 }, { 163, 3 }, { 160, 2 }, { 158, 3 }, { 155, 2 },
+ { 153, 3 }, { 150, 2 }, { 148, 2 }, { 146, 2 }, { 144, 2 }, { 142, 2 }, { 140, 2 }, { 138, 2 },
+ { 136, 2 }, { 134, 2 }, { 132, 2 }, { 130, 2 }, { 128, 1 }, { 127, 2 }, { 125, 1 }, { 124, 2 },
+ { 122, 1 }, { 121, 2 }, { 119, 1 }, { 118, 2 }, { 116, 1 }, { 115, 1 }, { 114, 2 }, { 112, 1 },
+ { 111, 1 }, { 110, 1 }, { 109, 2 }, { 107, 1 }, { 106, 1 }, { 105, 1 }, { 104, 1 }, { 103, 1 },
+ { 102, 1 }, { 101, 1 }, { 100, 1 }, { 99, 1 }, { 98, 1 }, { 97, 1 }, { 96, 1 }, { 95, 1 },
+ { 94, 1 }, { 93, 1 }, { 92, 1 }, { 91, 1 }, { 90, 0 }, { 90, 1 }, { 89, 1 }, { 88, 1 },
+ { 87, 1 }, { 86, 0 }, { 86, 1 }, { 85, 1 }, { 84, 1 }, { 83, 0 }, { 83, 1 }, { 82, 1 },
+ { 81, 0 }, { 81, 1 }, { 80, 1 }, { 79, 0 }, { 79, 1 }, { 78, 0 }, { 78, 1 }, { 77, 1 },
+ { 76, 0 }, { 76, 1 }, { 75, 0 }, { 75, 1 }, { 74, 1 }, { 73, 0 }, { 73, 1 }, { 72, 0 },
+ { 72, 1 }, { 71, 0 }, { 71, 1 }, { 70, 0 }, { 70, 1 }, { 69, 0 }, { 69, 1 }, { 68, 0 },
+ { 68, 1 }, { 67, 0 }, { 67, 1 }, { 66, 0 }, { 66, 0 }, { 66, 1 }, { 65, 0 }, { 65, 1 },
+ { 64, 0 }, { 64, 1 }, { 63, 0 }, { 63, 0 }, { 63, 1 }, { 62, 0 }, { 62, 1 }, { 61, 0 },
+ { 61, 0 }, { 61, 1 }, { 60, 0 }, { 60, 0 }, { 60, 1 }, { 59, 0 }, { 59, 1 }, { 58, 0 },
+ { 58, 0 }, { 58, 1 }, { 57, 0 }, { 57, 0 }, { 57, 1 }, { 56, 0 }, { 56, 0 }, { 56, 1 },
+ { 55, 0 }, { 55, 0 }, { 55, 0 }, { 55, 1 }, { 54, 0 }, { 54, 0 }, { 54, 1 }, { 53, 0 },
+ { 53, 0 }, { 53, 0 }, { 53, 1 }, { 52, 0 }, { 52, 0 }, { 52, 1 }, { 51, 0 }, { 51, 0 },
+ { 51, 0 }, { 51, 1 }, { 50, 0 }, { 50, 0 }, { 50, 0 }, { 50, 1 }, { 49, 0 }, { 49, 0 },
+ { 49, 0 }, { 49, 1 }, { 48, 0 }, { 48, 0 }, { 48, 0 }, { 48, 1 }, { 47, 0 }, { 47, 0 },
+ { 47, 0 }, { 47, 0 }, { 47, 1 }, { 46, 0 }, { 46, 0 }, { 46, 0 }, { 46, 1 }, { 45, 0 },
+ { 45, 0 }, { 45, 0 }, { 45, 0 }, { 45, 1 }, { 44, 0 }, { 44, 0 }, { 44, 0 }, { 44, 0 },
+ { 44, 1 }, { 43, 0 }, { 43, 0 }, { 43, 0 }, { 43, 0 }, { 43, 1 }, { 42, 0 }, { 42, 0 },
+ { 42, 0 }, { 42, 0 }, { 42, 0 }, { 42, 1 }, { 41, 0 }, { 41, 0 }, { 41, 0 }, { 41, 0 },
+ { 41, 0 }, { 41, 1 }, { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 0 }, { 40, 1 },
+ { 39, 0 }, { 39, 0 }, { 39, 0 }, { 39, 0 }, { 39, 0 }, { 39, 1 }, { 38, 0 }, { 38, 0 },
};
const uint16_t speed_lookuptable_slow[256][2] PROGMEM = {
- { 62500, 10417 }, { 52083, 7441 }, { 44642, 5580 }, { 39062, 4340 }, { 34722, 3472 }, { 31250, 2841 }, { 28409, 2368 }, { 26041, 2003 },
- { 24038, 1717 }, { 22321, 1488 }, { 20833, 1302 }, { 19531, 1149 }, { 18382, 1021 }, { 17361, 914 }, { 16447, 822 }, { 15625, 745 },
- { 14880, 676 }, { 14204, 618 }, { 13586, 566 }, { 13020, 520 }, { 12500, 481 }, { 12019, 445 }, { 11574, 414 }, { 11160, 385 },
- { 10775, 359 }, { 10416, 336 }, { 10080, 315 }, { 9765, 296 }, { 9469, 278 }, { 9191, 263 }, { 8928, 248 }, { 8680, 235 },
- { 8445, 222 }, { 8223, 211 }, { 8012, 200 }, { 7812, 191 }, { 7621, 181 }, { 7440, 173 }, { 7267, 165 }, { 7102, 158 },
- { 6944, 151 }, { 6793, 145 }, { 6648, 138 }, { 6510, 133 }, { 6377, 127 }, { 6250, 123 }, { 6127, 118 }, { 6009, 113 },
- { 5896, 109 }, { 5787, 106 }, { 5681, 101 }, { 5580, 98 }, { 5482, 95 }, { 5387, 91 }, { 5296, 88 }, { 5208, 86 },
- { 5122, 82 }, { 5040, 80 }, { 4960, 78 }, { 4882, 75 }, { 4807, 73 }, { 4734, 70 }, { 4664, 69 }, { 4595, 67 },
- { 4528, 64 }, { 4464, 63 }, { 4401, 61 }, { 4340, 60 }, { 4280, 58 }, { 4222, 56 }, { 4166, 55 }, { 4111, 53 },
- { 4058, 52 }, { 4006, 51 }, { 3955, 49 }, { 3906, 48 }, { 3858, 48 }, { 3810, 45 }, { 3765, 45 }, { 3720, 44 },
- { 3676, 43 }, { 3633, 42 }, { 3591, 40 }, { 3551, 40 }, { 3511, 39 }, { 3472, 38 }, { 3434, 38 }, { 3396, 36 },
- { 3360, 36 }, { 3324, 35 }, { 3289, 34 }, { 3255, 34 }, { 3221, 33 }, { 3188, 32 }, { 3156, 31 }, { 3125, 31 },
- { 3094, 31 }, { 3063, 30 }, { 3033, 29 }, { 3004, 28 }, { 2976, 28 }, { 2948, 28 }, { 2920, 27 }, { 2893, 27 },
- { 2866, 26 }, { 2840, 25 }, { 2815, 25 }, { 2790, 25 }, { 2765, 24 }, { 2741, 24 }, { 2717, 24 }, { 2693, 23 },
- { 2670, 22 }, { 2648, 22 }, { 2626, 22 }, { 2604, 22 }, { 2582, 21 }, { 2561, 21 }, { 2540, 20 }, { 2520, 20 },
- { 2500, 20 }, { 2480, 20 }, { 2460, 19 }, { 2441, 19 }, { 2422, 19 }, { 2403, 18 }, { 2385, 18 }, { 2367, 18 },
- { 2349, 17 }, { 2332, 18 }, { 2314, 17 }, { 2297, 16 }, { 2281, 17 }, { 2264, 16 }, { 2248, 16 }, { 2232, 16 },
- { 2216, 16 }, { 2200, 15 }, { 2185, 15 }, { 2170, 15 }, { 2155, 15 }, { 2140, 15 }, { 2125, 14 }, { 2111, 14 },
- { 2097, 14 }, { 2083, 14 }, { 2069, 14 }, { 2055, 13 }, { 2042, 13 }, { 2029, 13 }, { 2016, 13 }, { 2003, 13 },
- { 1990, 13 }, { 1977, 12 }, { 1965, 12 }, { 1953, 13 }, { 1940, 11 }, { 1929, 12 }, { 1917, 12 }, { 1905, 12 },
- { 1893, 11 }, { 1882, 11 }, { 1871, 11 }, { 1860, 11 }, { 1849, 11 }, { 1838, 11 }, { 1827, 11 }, { 1816, 10 },
- { 1806, 11 }, { 1795, 10 }, { 1785, 10 }, { 1775, 10 }, { 1765, 10 }, { 1755, 10 }, { 1745, 9 }, { 1736, 10 },
- { 1726, 9 }, { 1717, 10 }, { 1707, 9 }, { 1698, 9 }, { 1689, 9 }, { 1680, 9 }, { 1671, 9 }, { 1662, 9 },
- { 1653, 9 }, { 1644, 8 }, { 1636, 9 }, { 1627, 8 }, { 1619, 9 }, { 1610, 8 }, { 1602, 8 }, { 1594, 8 },
- { 1586, 8 }, { 1578, 8 }, { 1570, 8 }, { 1562, 8 }, { 1554, 7 }, { 1547, 8 }, { 1539, 8 }, { 1531, 7 },
- { 1524, 8 }, { 1516, 7 }, { 1509, 7 }, { 1502, 7 }, { 1495, 7 }, { 1488, 7 }, { 1481, 7 }, { 1474, 7 },
- { 1467, 7 }, { 1460, 7 }, { 1453, 7 }, { 1446, 6 }, { 1440, 7 }, { 1433, 7 }, { 1426, 6 }, { 1420, 6 },
- { 1414, 7 }, { 1407, 6 }, { 1401, 6 }, { 1395, 7 }, { 1388, 6 }, { 1382, 6 }, { 1376, 6 }, { 1370, 6 },
- { 1364, 6 }, { 1358, 6 }, { 1352, 6 }, { 1346, 5 }, { 1341, 6 }, { 1335, 6 }, { 1329, 5 }, { 1324, 6 },
- { 1318, 5 }, { 1313, 6 }, { 1307, 5 }, { 1302, 6 }, { 1296, 5 }, { 1291, 5 }, { 1286, 6 }, { 1280, 5 },
- { 1275, 5 }, { 1270, 5 }, { 1265, 5 }, { 1260, 5 }, { 1255, 5 }, { 1250, 5 }, { 1245, 5 }, { 1240, 5 },
- { 1235, 5 }, { 1230, 5 }, { 1225, 5 }, { 1220, 5 }, { 1215, 4 }, { 1211, 5 }, { 1206, 5 }, { 1201, 5 },
+ { 62500, 10417 }, { 52083, 7440 }, { 44643, 5580 }, { 39063, 4341 }, { 34722, 3472 }, { 31250, 2841 }, { 28409, 2367 }, { 26042, 2004 },
+ { 24038, 1717 }, { 22321, 1488 }, { 20833, 1302 }, { 19531, 1149 }, { 18382, 1021 }, { 17361, 914 }, { 16447, 822 }, { 15625, 744 },
+ { 14881, 676 }, { 14205, 618 }, { 13587, 566 }, { 13021, 521 }, { 12500, 481 }, { 12019, 445 }, { 11574, 413 }, { 11161, 385 },
+ { 10776, 359 }, { 10417, 336 }, { 10081, 315 }, { 9766, 296 }, { 9470, 279 }, { 9191, 262 }, { 8929, 248 }, { 8681, 235 },
+ { 8446, 222 }, { 8224, 211 }, { 8013, 200 }, { 7813, 191 }, { 7622, 182 }, { 7440, 173 }, { 7267, 165 }, { 7102, 158 },
+ { 6944, 151 }, { 6793, 144 }, { 6649, 139 }, { 6510, 132 }, { 6378, 128 }, { 6250, 123 }, { 6127, 117 }, { 6010, 114 },
+ { 5896, 109 }, { 5787, 105 }, { 5682, 102 }, { 5580, 98 }, { 5482, 94 }, { 5388, 91 }, { 5297, 89 }, { 5208, 85 },
+ { 5123, 83 }, { 5040, 80 }, { 4960, 77 }, { 4883, 75 }, { 4808, 73 }, { 4735, 71 }, { 4664, 68 }, { 4596, 67 },
+ { 4529, 65 }, { 4464, 63 }, { 4401, 61 }, { 4340, 59 }, { 4281, 58 }, { 4223, 56 }, { 4167, 55 }, { 4112, 54 },
+ { 4058, 52 }, { 4006, 50 }, { 3956, 50 }, { 3906, 48 }, { 3858, 47 }, { 3811, 46 }, { 3765, 45 }, { 3720, 44 },
+ { 3676, 42 }, { 3634, 42 }, { 3592, 41 }, { 3551, 40 }, { 3511, 39 }, { 3472, 38 }, { 3434, 37 }, { 3397, 37 },
+ { 3360, 36 }, { 3324, 35 }, { 3289, 34 }, { 3255, 33 }, { 3222, 33 }, { 3189, 32 }, { 3157, 32 }, { 3125, 31 },
+ { 3094, 30 }, { 3064, 30 }, { 3034, 29 }, { 3005, 29 }, { 2976, 28 }, { 2948, 27 }, { 2921, 27 }, { 2894, 27 },
+ { 2867, 26 }, { 2841, 26 }, { 2815, 25 }, { 2790, 25 }, { 2765, 24 }, { 2741, 24 }, { 2717, 23 }, { 2694, 23 },
+ { 2671, 23 }, { 2648, 22 }, { 2626, 22 }, { 2604, 21 }, { 2583, 22 }, { 2561, 20 }, { 2541, 21 }, { 2520, 20 },
+ { 2500, 20 }, { 2480, 19 }, { 2461, 20 }, { 2441, 19 }, { 2422, 18 }, { 2404, 19 }, { 2385, 18 }, { 2367, 17 },
+ { 2350, 18 }, { 2332, 17 }, { 2315, 17 }, { 2298, 17 }, { 2281, 17 }, { 2264, 16 }, { 2248, 16 }, { 2232, 16 },
+ { 2216, 15 }, { 2201, 16 }, { 2185, 15 }, { 2170, 15 }, { 2155, 15 }, { 2140, 14 }, { 2126, 15 }, { 2111, 14 },
+ { 2097, 14 }, { 2083, 13 }, { 2070, 14 }, { 2056, 14 }, { 2042, 13 }, { 2029, 13 }, { 2016, 13 }, { 2003, 13 },
+ { 1990, 12 }, { 1978, 13 }, { 1965, 12 }, { 1953, 12 }, { 1941, 12 }, { 1929, 12 }, { 1917, 12 }, { 1905, 11 },
+ { 1894, 11 }, { 1883, 12 }, { 1871, 11 }, { 1860, 11 }, { 1849, 11 }, { 1838, 11 }, { 1827, 10 }, { 1817, 11 },
+ { 1806, 10 }, { 1796, 10 }, { 1786, 10 }, { 1776, 10 }, { 1766, 10 }, { 1756, 10 }, { 1746, 10 }, { 1736, 9 },
+ { 1727, 10 }, { 1717, 9 }, { 1708, 10 }, { 1698, 9 }, { 1689, 9 }, { 1680, 9 }, { 1671, 9 }, { 1662, 9 },
+ { 1653, 8 }, { 1645, 9 }, { 1636, 8 }, { 1628, 9 }, { 1619, 8 }, { 1611, 8 }, { 1603, 9 }, { 1594, 8 },
+ { 1586, 8 }, { 1578, 8 }, { 1570, 7 }, { 1563, 8 }, { 1555, 8 }, { 1547, 8 }, { 1539, 7 }, { 1532, 8 },
+ { 1524, 7 }, { 1517, 7 }, { 1510, 8 }, { 1502, 7 }, { 1495, 7 }, { 1488, 7 }, { 1481, 7 }, { 1474, 7 },
+ { 1467, 7 }, { 1460, 7 }, { 1453, 6 }, { 1447, 7 }, { 1440, 7 }, { 1433, 6 }, { 1427, 7 }, { 1420, 6 },
+ { 1414, 6 }, { 1408, 7 }, { 1401, 6 }, { 1395, 6 }, { 1389, 6 }, { 1383, 6 }, { 1377, 6 }, { 1371, 6 },
+ { 1365, 6 }, { 1359, 6 }, { 1353, 6 }, { 1347, 6 }, { 1341, 6 }, { 1335, 5 }, { 1330, 6 }, { 1324, 5 },
+ { 1319, 6 }, { 1313, 5 }, { 1308, 6 }, { 1302, 5 }, { 1297, 6 }, { 1291, 5 }, { 1286, 5 }, { 1281, 5 },
+ { 1276, 6 }, { 1270, 5 }, { 1265, 5 }, { 1260, 5 }, { 1255, 5 }, { 1250, 5 }, { 1245, 5 }, { 1240, 5 },
+ { 1235, 5 }, { 1230, 5 }, { 1225, 4 }, { 1221, 5 }, { 1216, 5 }, { 1211, 4 }, { 1207, 5 }, { 1202, 5 },
};
#endif
diff --git a/buildroot/share/scripts/createSpeedLookupTable.py b/buildroot/share/scripts/createSpeedLookupTable.py
index da24c7c811..70ed953e54 100755
--- a/buildroot/share/scripts/createSpeedLookupTable.py
+++ b/buildroot/share/scripts/createSpeedLookupTable.py
@@ -19,34 +19,36 @@ args = parser.parse_args()
cpu_freq = args.cpu_freq * 1000000
timer_freq = cpu_freq / args.divider
-print("#ifndef SPEED_LOOKUPTABLE_H")
-print("#define SPEED_LOOKUPTABLE_H")
+print("#pragma once")
print()
-print('#include "MarlinCore.h"')
+print("#if F_CPU == %d" % cpu_freq)
print()
-print("const uint16_t speed_lookuptable_fast[256][2] PROGMEM = {")
-a = [ timer_freq / ((i*256)+(args.cpu_freq*2)) for i in range(256) ]
+print(" const struct { uint16_t base; uint8_t gain; } speed_lookuptable_fast[256] PROGMEM = {")
+a = [0 for i in range(8)] + [ int(0.5 + float(timer_freq) / (i*256)) for i in range(8, 256) ]
+b = [0 for i in range(8)] + [ a[i] - a[i+1] for i in range(8, 255) ]
+b.append(b[-1])
+for i in range(32):
+ print(" ", end='')
+ for j in range(8):
+ print("{ %5d, %5d }," % (a[8*i+j], b[8*i+j]), end='')
+ if j < 7: print(" ", end='')
+ if i == 0: print(" // dummy first row")
+ else: print()
+print(" };")
+print()
+
+print(" const uint16_t speed_lookuptable_slow[256][2] PROGMEM = {")
+a = [ int(0.5 + float(timer_freq) / ((i*8)+(args.cpu_freq*2))) for i in range(256) ]
b = [ a[i] - a[i+1] for i in range(255) ]
b.append(b[-1])
for i in range(32):
- print(" ", end=' ')
+ print(" ", end='')
for j in range(8):
- print("{%d, %d}," % (a[8*i+j], b[8*i+j]), end=' ')
+ print("{ %5d, %5d }," % (a[8*i+j], b[8*i+j]), end='')
+ if j < 7: print(" ", end='')
print()
-print("};")
-print()
-
-print("const uint16_t speed_lookuptable_slow[256][2] PROGMEM = {")
-a = [ timer_freq / ((i*8)+(args.cpu_freq*2)) for i in range(256) ]
-b = [ a[i] - a[i+1] for i in range(255) ]
-b.append(b[-1])
-for i in range(32):
- print(" ", end=' ')
- for j in range(8):
- print("{%d, %d}," % (a[8*i+j], b[8*i+j]), end=' ')
- print()
-print("};")
+print(" };")
print()
print("#endif")
From db2b8a695d2c1db99af009c3b72a60f566823484 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sun, 12 Mar 2023 16:30:10 -0500
Subject: [PATCH 017/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Update=20ISR=20cyc?=
=?UTF-8?q?le=20counts?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: tombrazier <68918209+tombrazier@users.noreply.github.com>
---
Marlin/src/module/stepper.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 820d1d9a73..797a72791c 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -111,7 +111,7 @@
#define TIMER_READ_ADD_AND_STORE_CYCLES 13UL
// The base ISR
- #define ISR_BASE_CYCLES 996UL
+ #define ISR_BASE_CYCLES 882UL
// Linear advance base time is 32 cycles
#if ENABLED(LIN_ADVANCE)
@@ -138,7 +138,7 @@
#define ISR_LOOP_BASE_CYCLES 32UL
// And each stepper (start + stop pulse) takes in worst case
- #define ISR_STEPPER_CYCLES 88UL
+ #define ISR_STEPPER_CYCLES 60UL
#endif
From 9039e99df1b95f6a352fb1b2ae27f893b091cfe7 Mon Sep 17 00:00:00 2001
From: Neo2003
Date: Mon, 13 Mar 2023 22:55:03 +0100
Subject: [PATCH 018/225] =?UTF-8?q?=F0=9F=93=BA=20DGUS=5FRELOADED=201.03?=
=?UTF-8?q?=20(#25490)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration.h | 2 +-
Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp | 9 +++------
.../src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h | 12 ++++++------
.../extui/dgus_reloaded/definition/DGUS_VPList.cpp | 9 ++++-----
4 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 3b90555cec..111aa18d5d 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -3044,7 +3044,7 @@
* - Product: https://www.aliexpress.com/item/1005002008179262.html
*
* RELOADED (T5UID1)
- * - Download https://github.com/Desuuuu/DGUS-reloaded/releases
+ * - Download https://github.com/Neo2003/DGUS-reloaded/releases
* - Copy the downloaded DWIN_SET folder to the SD card.
*
* IA_CREALITY (T5UID1)
diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp
index dc2aea8bef..b27988a89f 100644
--- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp
+++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp
@@ -180,12 +180,9 @@
#endif // SDSUPPORT
void DGUSTxHandler::PositionZ(DGUS_VP &vp) {
- float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ?
- planner.get_axis_position_mm(Z_AXIS)
- : 0;
-
- const int16_t data = dgus_display.ToFixedPoint(position);
- dgus_display.Write((uint16_t)vp.addr, Swap16(data));
+ const float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ? planner.get_axis_position_mm(Z_AXIS) : 0;
+ const int32_t data = dgus_display.ToFixedPoint(int32_t(position * 50.0f) / 50.0f); // Round to 0.02
+ dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data));
}
void DGUSTxHandler::Elapsed(DGUS_VP &vp) {
diff --git a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h
index 39cc040f19..8cec8e59c9 100644
--- a/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h
+++ b/Marlin/src/lcd/extui/dgus_reloaded/config/DGUS_Addr.h
@@ -107,10 +107,9 @@ enum class DGUS_Addr : uint16_t {
SD_FileName4 = 0x30A5, // 0x30A5 - 0x30C4
SD_ScrollIcons = 0x30C5, // Bits: DGUS_Data::ScrollIcon
SD_SelectedFileName = 0x30C6, // 0x30C6 - 0x30E5
- STATUS_PositionZ = 0x30E6, // Type: Fixed point, 1 decimal (16 bits signed)
- STATUS_Elapsed = 0x30E7, // 0x30E7 - 0x30F5
- STATUS_Percent = 0x30F6, // Type: Integer (16 bits unsigned)
- STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon
+ STATUS_PositionZ = 0x30E6, // Type: Fixed point, 2 decimal (32 bits signed)
+ STATUS_Elapsed = 0x30E8, // 0x30E8 - 0x30F6
+ STATUS_Percent = 0x30F7, // Type: Integer (16 bits unsigned)
ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed)
ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed)
#if HAS_MULTI_EXTRUDER
@@ -120,11 +119,11 @@ enum class DGUS_Addr : uint16_t {
TEMP_Current_Bed = 0x30FC, // Type: Integer (16 bits signed)
TEMP_Target_Bed = 0x30FD, // Type: Integer (16 bits signed)
TEMP_Max_Bed = 0x30FE, // Type: Integer (16 bits unsigned)
- TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed)
+ TEMP_Current_H0 = 0x30FF, // Type: Fixed point, 1 decimal (16 bits signed)
TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed)
TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned)
#if HAS_MULTI_HOTEND
- TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed)
+ TEMP_Current_H1 = 0x3102, // Type: Fixed point, 1 decimal (16 bits signed)
TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed)
TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned)
#endif
@@ -156,6 +155,7 @@ enum class DGUS_Addr : uint16_t {
INFOS_LongestPrint = 0x318D, // 0x318D - 0x31A4
INFOS_FilamentUsed = 0x31A5, // 0x31A5 - 0x31BC
WAIT_Icons = 0x31BD, // Bits: DGUS_Data::WaitIcon
+ STATUS_Icons = 0x31BE, // Bits: DGUS_Data::StatusIcon
// READ-WRITE VARIABLES
diff --git a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp
index 4def1c48f8..3f00dbb037 100644
--- a/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp
+++ b/Marlin/src/lcd/extui/dgus_reloaded/definition/DGUS_VPList.cpp
@@ -116,8 +116,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
VP_HELPER_RX(DGUS_Addr::LEVEL_MANUAL_Point, &DGUSRxHandler::MoveToPoint),
VP_HELPER_RX_NODATA(DGUS_Addr::LEVEL_AUTO_Probe, &DGUSRxHandler::Probe),
- VP_HELPER_RX_NODATA(DGUS_Addr::LEVEL_AUTO_Disable,
- &DGUSRxHandler::DisableABL),
+ VP_HELPER_RX_NODATA(DGUS_Addr::LEVEL_AUTO_Disable, &DGUSRxHandler::DisableABL),
VP_HELPER_RX(DGUS_Addr::FILAMENT_Select, &DGUSRxHandler::FilamentSelect),
VP_HELPER_RX(DGUS_Addr::FILAMENT_SetLength, &DGUSRxHandler::FilamentLength),
@@ -205,14 +204,14 @@ const struct DGUS_VP vp_list[] PROGMEM = {
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_Bed,
&thermalManager.temp_bed.celsius,
- &DGUSTxHandler::ExtraToInteger),
+ (&DGUSTxHandler::ExtraToFixedPoint)),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_Bed,
&thermalManager.temp_bed.target,
&DGUSTxHandler::ExtraToInteger),
VP_HELPER_TX(DGUS_Addr::TEMP_Max_Bed, &DGUSTxHandler::TempMax),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_H0,
&thermalManager.temp_hotend[ExtUI::heater_t::H0].celsius,
- &DGUSTxHandler::ExtraToInteger),
+ (&DGUSTxHandler::ExtraToFixedPoint)),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_H0,
&thermalManager.temp_hotend[ExtUI::heater_t::H0].target,
&DGUSTxHandler::ExtraToInteger),
@@ -220,7 +219,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
#if HAS_MULTI_HOTEND
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_H1,
&thermalManager.temp_hotend[ExtUI::heater_t::H1].celsius,
- &DGUSTxHandler::ExtraToInteger),
+ (&DGUSTxHandler::ExtraToFixedPoint)),
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Target_H1,
&thermalManager.temp_hotend[ExtUI::heater_t::H1].target,
&DGUSTxHandler::ExtraToInteger),
From 6f5d33ce5567310af8988c3db35c728455ff425f Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Tue, 14 Mar 2023 00:20:33 +0000
Subject: [PATCH 019/225] [cron] Bump distribution date (2023-03-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 c76ff2632a..a98cc9d316 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 "2023-03-13"
+//#define STRING_DISTRIBUTION_DATE "2023-03-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 3b57bf0d03..d973188f38 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 "2023-03-13"
+ #define STRING_DISTRIBUTION_DATE "2023-03-14"
#endif
/**
From 3156595078c4d6ecdae5a5976ef0dbba060fa603 Mon Sep 17 00:00:00 2001
From: jbubik
Date: Tue, 14 Mar 2023 02:19:24 +0100
Subject: [PATCH 020/225] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Polargraph=20witho?=
=?UTF-8?q?ut=20Z=20(#25514)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/feature/mmu/mmu2.cpp | 3 +-
Marlin/src/inc/SanityCheck.h | 6 +--
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 13 +++---
Marlin/src/lcd/menu/menu_advanced.cpp | 2 +-
Marlin/src/libs/nozzle.cpp | 51 +++++++++++----------
Marlin/src/module/polargraph.cpp | 2 +-
6 files changed, 41 insertions(+), 36 deletions(-)
diff --git a/Marlin/src/feature/mmu/mmu2.cpp b/Marlin/src/feature/mmu/mmu2.cpp
index 4f86578a60..7b6a48954b 100644
--- a/Marlin/src/feature/mmu/mmu2.cpp
+++ b/Marlin/src/feature/mmu/mmu2.cpp
@@ -815,8 +815,7 @@ void MMU2::manage_response(const bool move_axes, const bool turn_off_nozzle) {
resume_hotend_temp = thermalManager.degTargetHotend(active_extruder);
resume_position = current_position;
- if (move_axes && all_axes_homed())
- nozzle.park(0, park_point /*= NOZZLE_PARK_POINT*/);
+ if (move_axes && all_axes_homed()) nozzle.park(0, park_point);
if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder);
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index 5f20b205a0..a03a489a01 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -1148,11 +1148,11 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#if ENABLED(NOZZLE_PARK_FEATURE)
constexpr float npp[] = NOZZLE_PARK_POINT;
- static_assert(COUNT(npp) == XYZ, "NOZZLE_PARK_POINT requires X, Y, and Z values.");
+ static_assert(COUNT(npp) == _MIN(NUM_AXES, XYZ), "NOZZLE_PARK_POINT requires coordinates for enabled axes, but only up to X,Y,Z.");
constexpr xyz_pos_t npp_xyz = NOZZLE_PARK_POINT;
static_assert(WITHIN(npp_xyz.x, X_MIN_POS, X_MAX_POS), "NOZZLE_PARK_POINT.X is out of bounds (X_MIN_POS, X_MAX_POS).");
- static_assert(WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
- static_assert(WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
+ static_assert(TERN1(HAS_Y_AXIS, WITHIN(npp_xyz.y, Y_MIN_POS, Y_MAX_POS)), "NOZZLE_PARK_POINT.Y is out of bounds (Y_MIN_POS, Y_MAX_POS).");
+ static_assert(TERN1(HAS_Z_AXIS, WITHIN(npp_xyz.z, Z_MIN_POS, Z_MAX_POS)), "NOZZLE_PARK_POINT.Z is out of bounds (Z_MIN_POS, Z_MAX_POS).");
#endif
/**
diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
index 9093fa3eab..416c07c8f7 100644
--- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
+++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
@@ -521,7 +521,7 @@ FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const
else if (axis_should_home(axis))
while (const char c = *value++) lcd_put_lchar(c <= '.' ? c : '?');
else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !axis_is_trusted(axis))
- lcd_put_u8str(axis == Z_AXIS ? F(" ") : F(" "));
+ lcd_put_u8str(TERN0(HAS_Z_AXIS, axis == Z_AXIS) ? F(" ") : F(" "));
else
lcd_put_u8str(value);
}
@@ -998,11 +998,12 @@ void MarlinUI::draw_status_screen() {
#endif // LCD_WIDTH >= 20
- lcd_moveto(LCD_WIDTH - 8, 1);
- _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
-
- #if HAS_LEVELING && !HAS_HEATED_BED
- lcd_put_lchar(planner.leveling_active || blink ? '_' : ' ');
+ #if HAS_Z_AXIS
+ lcd_moveto(LCD_WIDTH - 8, 1);
+ _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
+ #if HAS_LEVELING && !HAS_HEATED_BED
+ lcd_put_lchar(planner.leveling_active || blink ? '_' : ' ');
+ #endif
#endif
#endif // LCD_HEIGHT > 2
diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp
index 0e24d0ed80..71188a8688 100644
--- a/Marlin/src/lcd/menu/menu_advanced.cpp
+++ b/Marlin/src/lcd/menu/menu_advanced.cpp
@@ -597,7 +597,7 @@ void menu_backlash();
;
LOOP_LOGICAL_AXES(a) {
- if (a == C_AXIS || TERN0(HAS_EXTRUDERS, a == E_AXIS))
+ if (TERN0(HAS_C_AXIS, a == C_AXIS) || TERN0(HAS_EXTRUDERS, a == E_AXIS))
EDIT_ITEM_FAST_N(float52sign, a, MSG_VN_JERK, &planner.max_jerk[a], 0.1f, max_jerk_edit[a]);
else
EDIT_ITEM_FAST_N(float3, a, MSG_VN_JERK, &planner.max_jerk[a], 1.0f, max_jerk_edit[a]);
diff --git a/Marlin/src/libs/nozzle.cpp b/Marlin/src/libs/nozzle.cpp
index 575e74a814..74f61c33d0 100644
--- a/Marlin/src/libs/nozzle.cpp
+++ b/Marlin/src/libs/nozzle.cpp
@@ -225,38 +225,43 @@ Nozzle nozzle;
#if ENABLED(NOZZLE_PARK_FEATURE)
- float Nozzle::park_mode_0_height(const_float_t park_z) {
- // Apply a minimum raise, if specified. Use park.z as a minimum height instead.
- return _MAX(park_z, // Minimum height over 0 based on input
- _MIN(Z_MAX_POS, // Maximum height is fixed
- #ifdef NOZZLE_PARK_Z_RAISE_MIN
- NOZZLE_PARK_Z_RAISE_MIN + // Minimum raise...
- #endif
- current_position.z // ...over current position
- )
- );
- }
+ #if HAS_Z_AXIS
+ float Nozzle::park_mode_0_height(const_float_t park_z) {
+ // Apply a minimum raise, if specified. Use park.z as a minimum height instead.
+ return _MAX(park_z, // Minimum height over 0 based on input
+ _MIN(Z_MAX_POS, // Maximum height is fixed
+ #ifdef NOZZLE_PARK_Z_RAISE_MIN
+ NOZZLE_PARK_Z_RAISE_MIN + // Minimum raise...
+ #endif
+ current_position.z // ...over current position
+ )
+ );
+ }
+ #endif // HAS_Z_AXIS
void Nozzle::park(const uint8_t z_action, const xyz_pos_t &park/*=NOZZLE_PARK_POINT*/) {
- constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE, fr_z = NOZZLE_PARK_Z_FEEDRATE;
+ #if HAS_Z_AXIS
+ constexpr feedRate_t fr_z = NOZZLE_PARK_Z_FEEDRATE;
- switch (z_action) {
- case 1: // Go to Z-park height
- do_blocking_move_to_z(park.z, fr_z);
- break;
+ switch (z_action) {
+ case 1: // Go to Z-park height
+ do_blocking_move_to_z(park.z, fr_z);
+ break;
- case 2: // Raise by Z-park height
- do_blocking_move_to_z(_MIN(current_position.z + park.z, Z_MAX_POS), fr_z);
- break;
+ case 2: // Raise by Z-park height
+ do_blocking_move_to_z(_MIN(current_position.z + park.z, Z_MAX_POS), fr_z);
+ break;
- default: // Raise by NOZZLE_PARK_Z_RAISE_MIN, use park.z as a minimum height
- do_blocking_move_to_z(park_mode_0_height(park.z), fr_z);
- break;
- }
+ default: // Raise by NOZZLE_PARK_Z_RAISE_MIN, use park.z as a minimum height
+ do_blocking_move_to_z(park_mode_0_height(park.z), fr_z);
+ break;
+ }
+ #endif // HAS_Z_AXIS
#ifndef NOZZLE_PARK_MOVE
#define NOZZLE_PARK_MOVE 0
#endif
+ constexpr feedRate_t fr_xy = NOZZLE_PARK_XY_FEEDRATE;
switch (NOZZLE_PARK_MOVE) {
case 0: do_blocking_move_to_xy(park, fr_xy); break;
case 1: do_blocking_move_to_x(park.x, fr_xy); break;
diff --git a/Marlin/src/module/polargraph.cpp b/Marlin/src/module/polargraph.cpp
index d55d36a6d6..ef6a4c0db4 100644
--- a/Marlin/src/module/polargraph.cpp
+++ b/Marlin/src/module/polargraph.cpp
@@ -43,7 +43,7 @@ xy_pos_t draw_area_min, draw_area_max;
void inverse_kinematics(const xyz_pos_t &raw) {
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);
+ delta.set(HYPOT(x1, y), HYPOT(x2, y) OPTARG(HAS_Z_AXIS, raw.z));
}
#endif // POLARGRAPH
From f90c49910defc4124f7ef0a75dc8a292b9ee85c7 Mon Sep 17 00:00:00 2001
From: Eduard Sukharev
Date: Wed, 15 Mar 2023 00:49:49 +0300
Subject: [PATCH 021/225] =?UTF-8?q?=F0=9F=90=9B=20Fix=20long=20filename=20?=
=?UTF-8?q?read/report=20(#25509)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/sd/SdBaseFile.cpp | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp
index e3f95623ac..b8b49b7ba0 100644
--- a/Marlin/src/sd/SdBaseFile.cpp
+++ b/Marlin/src/sd/SdBaseFile.cpp
@@ -1013,8 +1013,7 @@ bool SdBaseFile::openNext(SdBaseFile *dirFile, uint8_t oflag) {
* \return false if the dirname is a short file name 8.3 (SFN)
*/
bool SdBaseFile::isDirNameLFN(const char *dirname) {
- uint8_t length = strlen(dirname);
- uint8_t idx = length;
+ uint8_t length = strlen(dirname), idx = length;
bool dotFound = false;
if (idx > 12) return true; // LFN due to filename length > 12 ("filename.ext")
// Check dot(s) position
@@ -1508,8 +1507,8 @@ int8_t SdBaseFile::readDir(dir_t *dir, char *longFilename) {
if (DIR_IS_FILE_OR_SUBDIR(dir)) {
#if ENABLED(UTF_FILENAME_SUPPORT)
#if LONG_FILENAME_CHARSIZE > 2
- // Add warning for developers for currently not supported 3-byte cases (Conversion series of 2-byte
- // codepoints to 3-byte in-place will break the rest of filename)
+ // Add warning for developers for unsupported 3-byte cases.
+ // (Converting 2-byte codepoints to 3-byte in-place would break the rest of filename.)
#error "Currently filename re-encoding is done in-place. It may break the remaining chars to use 3-byte codepoints."
#endif
@@ -1517,22 +1516,22 @@ int8_t SdBaseFile::readDir(dir_t *dir, char *longFilename) {
if (longFilename) {
// Reset n to the start of the long name
n = 0;
- for (uint16_t idx = 0; idx < (LONG_FILENAME_LENGTH) / 2; idx += 2) { // idx is fixed since FAT LFN always contains UTF-16LE encoding
+ for (uint16_t idx = 0; idx < (LONG_FILENAME_LENGTH); idx += 2) { // idx is fixed since FAT LFN always contains UTF-16LE encoding
const uint16_t utf16_ch = longFilename[idx] | (longFilename[idx + 1] << 8);
- if (0xD800 == (utf16_ch & 0xF800)) // Surrogate pair - encode as '_'
+ if (0xD800 == (utf16_ch & 0xF800)) // Surrogate pair - encode as '_'
longFilename[n++] = '_';
- else if (0 == (utf16_ch & 0xFF80)) // Encode as 1-byte UTF-8 char
+ else if (0 == (utf16_ch & 0xFF80)) // Encode as 1-byte UTF-8 char
longFilename[n++] = utf16_ch & 0x007F;
- else if (0 == (utf16_ch & 0xF800)) { // Encode as 2-byte UTF-8 char
+ else if (0 == (utf16_ch & 0xF800)) { // Encode as 2-byte UTF-8 char
longFilename[n++] = 0xC0 | ((utf16_ch >> 6) & 0x1F);
longFilename[n++] = 0x80 | ( utf16_ch & 0x3F);
}
else {
- #if LONG_FILENAME_CHARSIZE > 2 // Encode as 3-byte UTF-8 char
+ #if LONG_FILENAME_CHARSIZE > 2 // Encode as 3-byte UTF-8 char
longFilename[n++] = 0xE0 | ((utf16_ch >> 12) & 0x0F);
longFilename[n++] = 0xC0 | ((utf16_ch >> 6) & 0x3F);
longFilename[n++] = 0xC0 | ( utf16_ch & 0x3F);
- #else // Encode as '_'
+ #else // Encode as '_'
longFilename[n++] = '_';
#endif
}
From 1cf85196b660795d00160ea6d83dbbdaffb290b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Davide=20Rombol=C3=A0?=
Date: Wed, 15 Mar 2023 00:54:24 +0100
Subject: [PATCH 022/225] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20IA=5FCREALITY=20fl?=
=?UTF-8?q?oat,=20startup=20(#25493)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Followup to #25440
---
Marlin/Configuration.h | 3 +-
.../lcd/extui/ia_creality/creality_extui.cpp | 77 ++++++++++++-------
.../lcd/extui/ia_creality/creality_extui.h | 2 +-
3 files changed, 52 insertions(+), 30 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 111aa18d5d..d66870949f 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -3061,7 +3061,8 @@
#if DGUS_UI_IS(MKS)
#define USE_MKS_GREEN_UI
#elif DGUS_UI_IS(IA_CREALITY)
- //#define LCD_SCREEN_ROTATE 90 // Portrait Mode or 800x480 displays
+ //#define LCD_SCREEN_ROTATE 90 // Portrait Mode or 800x480 displays
+ //#define IA_CREALITY_BOOT_DELAY 1500 // (ms)
#endif
//
diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
index 547b500106..15dcd84bb9 100644
--- a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
+++ b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
@@ -87,6 +87,9 @@ namespace ExtUI {
#ifndef CUSTOM_MACHINE_NAME
#define CUSTOM_MACHINE_NAME MACHINE_NAME
#endif
+ #ifndef IA_CREALITY_BOOT_DELAY
+ #define IA_CREALITY_BOOT_DELAY 500
+ #endif
void onStartup() {
DWIN_SERIAL.begin(115200);
@@ -94,7 +97,7 @@ namespace ExtUI {
rtscheck.recdat.head[1] = rtscheck.snddat.head[1] = FHTWO;
ZERO(rtscheck.databuf);
- delay_ms(TERN(DWINOS_4, 1500, 500)); // Delay to allow screen startup
+ delay_ms(IA_CREALITY_BOOT_DELAY); // Delay to allow screen startup
SetTouchScreenConfiguration();
rtscheck.RTS_SndData(StartSoundSet, SoundAddr);
delay_ms(400); // Delay to allow screen to configure
@@ -314,31 +317,31 @@ namespace ExtUI {
else
rtscheck.RTS_SndData(2, DisplayStandbyEnableIndicator);
- rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(X)) * 10, StepMM_X);
- rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(Y)) * 10, StepMM_Y);
- rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(Z)) * 10, StepMM_Z);
- rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(E0)) * 10, StepMM_E);
+ rtscheck.RTS_SndData(getAxisSteps_per_mm(X) * 10, StepMM_X);
+ rtscheck.RTS_SndData(getAxisSteps_per_mm(Y) * 10, StepMM_Y);
+ rtscheck.RTS_SndData(getAxisSteps_per_mm(Z) * 10, StepMM_Z);
+ rtscheck.RTS_SndData(getAxisSteps_per_mm(E0) * 10, StepMM_E);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(X)) / 100, Accel_X);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(Y)) / 100, Accel_Y);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(Z)) / 10, Accel_Z);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxAcceleration_mm_s2(E0)), Accel_E);
+ rtscheck.RTS_SndData(getAxisMaxAcceleration_mm_s2(X) / 100, Accel_X);
+ rtscheck.RTS_SndData(getAxisMaxAcceleration_mm_s2(Y) / 100, Accel_Y);
+ rtscheck.RTS_SndData(getAxisMaxAcceleration_mm_s2(Z) / 10, Accel_Z);
+ rtscheck.RTS_SndData(getAxisMaxAcceleration_mm_s2(E0), Accel_E);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(X)), Feed_X);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(Y)), Feed_Y);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(Z)), Feed_Z);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxFeedrate_mm_s(E0)), Feed_E);
+ rtscheck.RTS_SndData(getAxisMaxFeedrate_mm_s(X), Feed_X);
+ rtscheck.RTS_SndData(getAxisMaxFeedrate_mm_s(Y), Feed_Y);
+ rtscheck.RTS_SndData(getAxisMaxFeedrate_mm_s(Z), Feed_Z);
+ rtscheck.RTS_SndData(getAxisMaxFeedrate_mm_s(E0), Feed_E);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(X)) * 100, Jerk_X);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(Y)) * 100, Jerk_Y);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(Z)) * 100, Jerk_Z);
- rtscheck.RTS_SndData(uint16_t(getAxisMaxJerk_mm_s(E0)) * 100, Jerk_E);
+ rtscheck.RTS_SndData(getAxisMaxJerk_mm_s(X) * 100, Jerk_X);
+ rtscheck.RTS_SndData(getAxisMaxJerk_mm_s(Y) * 100, Jerk_Y);
+ rtscheck.RTS_SndData(getAxisMaxJerk_mm_s(Z) * 100, Jerk_Z);
+ rtscheck.RTS_SndData(getAxisMaxJerk_mm_s(E0) * 100, Jerk_E);
#if HAS_HOTEND_OFFSET
- rtscheck.RTS_SndData(uint16_t(getNozzleOffset_mm(X, E1)) * 10, T2Offset_X);
- rtscheck.RTS_SndData(uint16_t(getNozzleOffset_mm(Y, E1)) * 10, T2Offset_Y);
- rtscheck.RTS_SndData(uint16_t(getNozzleOffset_mm(Z, E1)) * 10, T2Offset_Z);
- rtscheck.RTS_SndData(uint16_t(getAxisSteps_per_mm(E1)) * 10, T2StepMM_E);
+ rtscheck.RTS_SndData(getNozzleOffset_mm(X, E1) * 10, T2Offset_X);
+ rtscheck.RTS_SndData(getNozzleOffset_mm(Y, E1) * 10, T2Offset_Y);
+ rtscheck.RTS_SndData(getNozzleOffset_mm(Z, E1) * 10, T2Offset_Z);
+ rtscheck.RTS_SndData(getAxisSteps_per_mm(E1) * 10, T2StepMM_E);
#endif
#if HAS_BED_PROBE
@@ -349,13 +352,13 @@ namespace ExtUI {
#if HAS_PID_HEATING
rtscheck.RTS_SndData(pid_hotendAutoTemp, HotendPID_AutoTmp);
rtscheck.RTS_SndData(pid_bedAutoTemp, BedPID_AutoTmp);
- rtscheck.RTS_SndData(uint16_t(getPID_Kp(E0)) * 10, HotendPID_P);
- rtscheck.RTS_SndData(uint16_t(getPID_Ki(E0)) * 10, HotendPID_I);
- rtscheck.RTS_SndData(uint16_t(getPID_Kd(E0)) * 10, HotendPID_D);
+ rtscheck.RTS_SndData(getPID_Kp(E0) * 10, HotendPID_P);
+ rtscheck.RTS_SndData(getPID_Ki(E0) * 10, HotendPID_I);
+ rtscheck.RTS_SndData(getPID_Kd(E0) * 10, HotendPID_D);
#if ENABLED(PIDTEMPBED)
- rtscheck.RTS_SndData(uint16_t(getBedPID_Kp()) * 10, BedPID_P);
- rtscheck.RTS_SndData(uint16_t(getBedPID_Ki()) * 10, BedPID_I);
- rtscheck.RTS_SndData(uint16_t(getBedPID_Kd()) * 10, BedPID_D);
+ rtscheck.RTS_SndData(getBedPID_Kp() * 10, BedPID_P);
+ rtscheck.RTS_SndData(getBedPID_Ki() * 10, BedPID_I);
+ rtscheck.RTS_SndData(getBedPID_Kd() * 10, BedPID_D);
#endif
#endif
}
@@ -567,6 +570,25 @@ namespace ExtUI {
RTS_SndData();
}
+ void RTSSHOW::RTS_SndData(const_float_t f, const uint32_t addr, const uint8_t cmd/*=VarAddr_W*/) {
+ int16_t n = f;
+ if (cmd == VarAddr_W) {
+ snddat.data[0] = n;
+ snddat.len = 5;
+ }
+ else if (cmd == RegAddr_W) {
+ snddat.data[0] = n;
+ snddat.len = 3;
+ }
+ else if (cmd == VarAddr_R) {
+ snddat.bytelen = n;
+ snddat.len = 4;
+ }
+ snddat.command = cmd;
+ snddat.addr = addr;
+ RTS_SndData();
+ }
+
void RTSSHOW::RTS_SndData(const int n, const uint32_t addr, const uint8_t cmd/*=VarAddr_W*/) {
if (cmd == VarAddr_W) {
if ((unsigned int)n > 0xFFFF) {
@@ -789,7 +811,6 @@ namespace ExtUI {
}
else {
onStatusChanged(F("Requested Offset Beyond Limits"));
- RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z);
}
rtscheck.RTS_SndData(getZOffset_mm() * 100, ProbeOffset_Z);
diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.h b/Marlin/src/lcd/extui/ia_creality/creality_extui.h
index 35162eebee..099f8c238a 100644
--- a/Marlin/src/lcd/extui/ia_creality/creality_extui.h
+++ b/Marlin/src/lcd/extui/ia_creality/creality_extui.h
@@ -232,10 +232,10 @@ namespace ExtUI {
void RTS_SndData(char, const uint32_t, const uint8_t=VarAddr_W);
void RTS_SndData(int, const uint32_t, const uint8_t=VarAddr_W);
void RTS_SndData(unsigned long, const uint32_t, const uint8_t=VarAddr_W);
+ void RTS_SndData(const_float_t, const uint32_t, const uint8_t=VarAddr_W);
void RTS_SndData(uint8_t * const str, const uint32_t addr, const uint8_t cmd=VarAddr_W) { RTS_SndData((char *)str, addr, cmd); }
void RTS_SndData(const unsigned int n, uint32_t addr, const uint8_t cmd=VarAddr_W) { RTS_SndData(int(n), addr, cmd); }
- void RTS_SndData(const_float_t n, const uint32_t addr, const uint8_t cmd=VarAddr_W) { RTS_SndData(int(n), addr, cmd); }
void RTS_SndData(const long n, const uint32_t addr, const uint8_t cmd=VarAddr_W) { RTS_SndData((unsigned long)n, addr, cmd); }
void RTS_SDcard_Stop();
From 50893c414d43e2d9a351eac983ed8ebeed126ab0 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Wed, 15 Mar 2023 00:30:47 +0000
Subject: [PATCH 023/225] [cron] Bump distribution date (2023-03-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 a98cc9d316..c993bd48b9 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 "2023-03-14"
+//#define STRING_DISTRIBUTION_DATE "2023-03-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 d973188f38..5f78729bd4 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 "2023-03-14"
+ #define STRING_DISTRIBUTION_DATE "2023-03-15"
#endif
/**
From 66d94ece33c5f7499b1901ee7510b1017cc0fb6f Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Tue, 14 Mar 2023 16:48:17 -0500
Subject: [PATCH 024/225] =?UTF-8?q?=F0=9F=8E=A8=20Misc.=20formatting?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/gcode/bedlevel/abl/G29.cpp | 4 ++--
buildroot/share/git/mfadd | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp
index 114fa55520..e1fd0124c4 100644
--- a/Marlin/src/gcode/bedlevel/abl/G29.cpp
+++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp
@@ -409,7 +409,7 @@ G29_TYPE GcodeSuite::G29() {
if (!probe.good_bounds(abl.probe_position_lf, abl.probe_position_rb)) {
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPGM("G29 L", abl.probe_position_lf.x, " R", abl.probe_position_rb.x,
- " F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
+ " F", abl.probe_position_lf.y, " B", abl.probe_position_rb.y);
}
SERIAL_ECHOLNPGM("? (L,R,F,B) out of bounds.");
G29_RETURN(false, false);
@@ -417,7 +417,7 @@ G29_TYPE GcodeSuite::G29() {
// Probe at the points of a lattice grid
abl.gridSpacing.set((abl.probe_position_rb.x - abl.probe_position_lf.x) / (abl.grid_points.x - 1),
- (abl.probe_position_rb.y - abl.probe_position_lf.y) / (abl.grid_points.y - 1));
+ (abl.probe_position_rb.y - abl.probe_position_lf.y) / (abl.grid_points.y - 1));
#endif // ABL_USES_GRID
diff --git a/buildroot/share/git/mfadd b/buildroot/share/git/mfadd
index 30be1ec0f7..d6fc07bde0 100755
--- a/buildroot/share/git/mfadd
+++ b/buildroot/share/git/mfadd
@@ -29,7 +29,7 @@ REPO=${INFO[2]}
set -e
-echo "Adding and fetching $USER..."
+echo "Adding and fetching $USER/$REPO..."
git remote add "$USER" "git@github.com:$USER/$REPO.git" >/dev/null 2>&1 || echo "Remote exists."
git fetch "$USER"
From 10983d0cfe3e353ba465cfcadf8aeb51327f1197 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Wed, 15 Mar 2023 00:29:37 -0500
Subject: [PATCH 025/225] =?UTF-8?q?=F0=9F=8E=A8=20Misc.=20tramming=20menu?=
=?UTF-8?q?=20cleanup=20(#25519)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration.h | 4 +-
.../lcd/extui/mks_ui/draw_z_offset_wizard.cpp | 8 +-
Marlin/src/lcd/menu/menu.cpp | 2 +-
Marlin/src/lcd/menu/menu.h | 2 +-
Marlin/src/lcd/menu/menu_bed_leveling.cpp | 2 +-
..._bed_corners.cpp => menu_bed_tramming.cpp} | 94 ++++++++++---------
Marlin/src/lcd/menu/menu_item.h | 2 +-
Marlin/src/lcd/menu/menu_motion.cpp | 2 +-
Marlin/src/lcd/menu/menu_probe_offset.cpp | 4 +-
..._tramming.cpp => menu_tramming_wizard.cpp} | 0
Marlin/src/lcd/menu/menu_x_twist.cpp | 4 +-
Marlin/src/module/probe.cpp | 4 +-
Marlin/src/module/probe.h | 8 +-
.../PlatformIO/scripts/common-dependencies.h | 4 +-
buildroot/tests/BIGTREE_GTR_V1_0 | 3 +-
ini/features.ini | 4 +-
platformio.ini | 4 +-
17 files changed, 80 insertions(+), 71 deletions(-)
rename Marlin/src/lcd/menu/{menu_bed_corners.cpp => menu_bed_tramming.cpp} (83%)
rename Marlin/src/lcd/menu/{menu_tramming.cpp => menu_tramming_wizard.cpp} (100%)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index d66870949f..b57c66a9a8 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -2114,8 +2114,8 @@
#if ENABLED(LCD_BED_TRAMMING)
#define BED_TRAMMING_INSET_LFRB { 30, 30, 30, 30 } // (mm) Left, Front, Right, Back insets
- #define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at leveling points
- #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between leveling points
+ #define BED_TRAMMING_HEIGHT 0.0 // (mm) Z height of nozzle at tramming points
+ #define BED_TRAMMING_Z_HOP 4.0 // (mm) Z height of nozzle between tramming points
//#define BED_TRAMMING_INCLUDE_CENTER // Move to the center after the last corner
//#define BED_TRAMMING_USE_PROBE
#if ENABLED(BED_TRAMMING_USE_PROBE)
diff --git a/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp
index d143234fd5..dbe8577dc9 100644
--- a/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp
+++ b/Marlin/src/lcd/extui/mks_ui/draw_z_offset_wizard.cpp
@@ -36,7 +36,7 @@
#if HAS_LEVELING
#include "../../../feature/bedlevel/bedlevel.h"
- bool leveling_was_active;
+ bool mks_leveling_was_active;
#endif
extern lv_group_t *g;
@@ -110,7 +110,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
case ID_M_RETURN:
probe.offset.z = z_offset_backup;
SET_SOFT_ENDSTOP_LOOSE(false);
- TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
+ TERN_(HAS_LEVELING, set_bed_leveling_enabled(mks_leveling_was_active));
#if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z)
set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction
queue.inject_P(PSTR("G28Z"));
@@ -149,8 +149,8 @@ void lv_draw_z_offset_wizard() {
// Store Bed-Leveling-State and disable
#if HAS_LEVELING
- leveling_was_active = planner.leveling_active;
- set_bed_leveling_enabled(leveling_was_active);
+ mks_leveling_was_active = planner.leveling_active;
+ set_bed_leveling_enabled(mks_leveling_was_active);
#endif
queue.inject_P(PSTR("G28"));
diff --git a/Marlin/src/lcd/menu/menu.cpp b/Marlin/src/lcd/menu/menu.cpp
index c529ae757a..85b773bebc 100644
--- a/Marlin/src/lcd/menu/menu.cpp
+++ b/Marlin/src/lcd/menu/menu.cpp
@@ -48,7 +48,7 @@
////////////////////////////////////////////
#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION)
- bool leveling_was_active; // = false
+ bool menu_leveling_was_active; // = false
#endif
#if ANY(PROBE_MANUALLY, MESH_BED_LEVELING, X_AXIS_TWIST_COMPENSATION)
uint8_t manual_probe_index; // = 0
diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h
index befffe5f72..9b9c678868 100644
--- a/Marlin/src/lcd/menu/menu.h
+++ b/Marlin/src/lcd/menu/menu.h
@@ -264,7 +264,7 @@ inline void clear_menu_history() { screen_history_depth = 0; }
#define STICKY_SCREEN(S) []{ ui.defer_status_screen(); ui.goto_screen(S); }
#if HAS_LEVELING && ANY(LCD_BED_TRAMMING, PROBE_OFFSET_WIZARD, X_AXIS_TWIST_COMPENSATION)
- extern bool leveling_was_active;
+ extern bool menu_leveling_was_active;
#endif
#if ANY(PROBE_MANUALLY, MESH_BED_LEVELING, X_AXIS_TWIST_COMPENSATION)
diff --git a/Marlin/src/lcd/menu/menu_bed_leveling.cpp b/Marlin/src/lcd/menu/menu_bed_leveling.cpp
index d25d35011e..a7fb54f68d 100644
--- a/Marlin/src/lcd/menu/menu_bed_leveling.cpp
+++ b/Marlin/src/lcd/menu/menu_bed_leveling.cpp
@@ -293,7 +293,7 @@ void menu_bed_leveling() {
#endif
#if ENABLED(LCD_BED_TRAMMING)
- SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners);
+ SUBMENU(MSG_BED_TRAMMING, _lcd_bed_tramming);
#endif
#if ENABLED(EEPROM_SETTINGS)
diff --git a/Marlin/src/lcd/menu/menu_bed_corners.cpp b/Marlin/src/lcd/menu/menu_bed_tramming.cpp
similarity index 83%
rename from Marlin/src/lcd/menu/menu_bed_corners.cpp
rename to Marlin/src/lcd/menu/menu_bed_tramming.cpp
index 0e0051e65d..5f1b547871 100644
--- a/Marlin/src/lcd/menu/menu_bed_corners.cpp
+++ b/Marlin/src/lcd/menu/menu_bed_tramming.cpp
@@ -21,7 +21,7 @@
*/
//
-// Level Bed Corners menu
+// Bed Tramming menu
//
#include "../../inc/MarlinConfigPre.h"
@@ -54,7 +54,7 @@
#endif
float last_z;
int good_points;
- bool corner_probing_done, wait_for_probe;
+ bool tramming_done, wait_for_probe;
#if HAS_MARLINUI_U8GLIB
#include "../dogm/marlinui_DOGM.h"
@@ -66,6 +66,11 @@
static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration.");
+#define LF 1
+#define RF 2
+#define RB 3
+#define LB 4
+
#ifndef BED_TRAMMING_LEVELING_ORDER
#define BED_TRAMMING_LEVELING_ORDER { LF, RF, LB, RB } // Default
//#define BED_TRAMMING_LEVELING_ORDER { LF, LB, RF } // 3 hard-coded points
@@ -75,18 +80,14 @@ static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please
//#define BED_TRAMMING_LEVELING_ORDER { LB, RB } // 3-Point tramming - Front
#endif
-#define LF 1
-#define RF 2
-#define RB 3
-#define LB 4
constexpr int lco[] = BED_TRAMMING_LEVELING_ORDER;
-constexpr bool level_corners_3_points = COUNT(lco) == 2;
-static_assert(level_corners_3_points || COUNT(lco) == 4, "BED_TRAMMING_LEVELING_ORDER must have exactly 2 or 4 corners.");
+constexpr bool tramming_3_points = COUNT(lco) == 2;
+static_assert(tramming_3_points || COUNT(lco) == 4, "BED_TRAMMING_LEVELING_ORDER must have exactly 2 or 4 corners.");
constexpr int lcodiff = ABS(lco[0] - lco[1]);
static_assert(COUNT(lco) == 4 || lcodiff == 1 || lcodiff == 3, "The first two BED_TRAMMING_LEVELING_ORDER corners must be on the same edge.");
-constexpr int nr_edge_points = level_corners_3_points ? 3 : 4;
+constexpr int nr_edge_points = tramming_3_points ? 3 : 4;
constexpr int available_points = nr_edge_points + ENABLED(BED_TRAMMING_INCLUDE_CENTER);
constexpr int center_index = TERN(BED_TRAMMING_INCLUDE_CENTER, available_points - 1, -1);
constexpr float inset_lfrb[4] = BED_TRAMMING_INSET_LFRB;
@@ -98,9 +99,9 @@ static int8_t bed_corner;
/**
* Select next corner coordinates
*/
-static void _lcd_level_bed_corners_get_next_position() {
+static void _lcd_bed_tramming_get_next_position() {
- if (level_corners_3_points) {
+ if (tramming_3_points) {
if (bed_corner >= available_points) bed_corner = 0; // Above max position -> move back to first corner
switch (bed_corner) {
case 0 ... 1:
@@ -141,9 +142,9 @@ static void _lcd_level_bed_corners_get_next_position() {
else {
current_position = lf; // Left front
switch (lco[bed_corner]) {
- case RF: current_position.x = rb.x; break; // Right front
- case RB: current_position = rb; break; // Right rear
- case LB: current_position.y = rb.y; break; // Left rear
+ case RF: current_position.x = rb.x; break; // Right Front
+ case RB: current_position = rb; break; // Right Back
+ case LB: current_position.y = rb.y; break; // Left Back
}
}
}
@@ -198,7 +199,7 @@ static void _lcd_level_bed_corners_get_next_position() {
if (!ui.should_draw()) return;
MenuItem_confirm::select_screen(
GET_TEXT_F(MSG_BUTTON_DONE), GET_TEXT_F(MSG_BUTTON_SKIP)
- , []{ corner_probing_done = true; wait_for_probe = false; }
+ , []{ tramming_done = true; wait_for_probe = false; }
, []{ wait_for_probe = false; }
, GET_TEXT_F(MSG_BED_TRAMMING_RAISE)
);
@@ -207,23 +208,25 @@ static void _lcd_level_bed_corners_get_next_position() {
void _lcd_draw_level_prompt() {
if (!ui.should_draw()) return;
MenuItem_confirm::select_screen(
- GET_TEXT_F(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE)),
- TERN(HAS_LEVELING, GET_TEXT_F(MSG_BUTTON_BACK), nullptr)
+ GET_TEXT_F(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE))
+ , TERN(HAS_LEVELING, GET_TEXT_F(MSG_BUTTON_BACK), nullptr)
, []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); }
, TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{})
, GET_TEXT_F(MSG_BED_TRAMMING_IN_RANGE)
);
}
- bool _lcd_level_bed_corners_probe(bool verify=false) {
- if (verify) do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP); // do clearance if needed
+ bool _lcd_bed_tramming_probe(bool verify=false) {
+ if (verify) line_to_z(BED_TRAMMING_Z_HOP); // do clearance if needed
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
do_blocking_move_to_z(last_z - BED_TRAMMING_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
endstops.hit_on_purpose();
set_current_from_steppers_for_axis(Z_AXIS);
sync_plan_position();
+
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
+
// Triggered outside tolerance range?
if (ABS(current_position.z - last_z) > BED_TRAMMING_PROBE_TOLERANCE) {
last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
@@ -231,13 +234,13 @@ static void _lcd_level_bed_corners_get_next_position() {
}
return true; // probe triggered
}
- do_blocking_move_to_z(last_z); // go back to tolerance middle point before raise
+ line_to_z(last_z); // go back to tolerance middle point before raise
return false; // probe not triggered
}
- bool _lcd_level_bed_corners_raise() {
+ bool _lcd_bed_tramming_raise() {
bool probe_triggered = false;
- corner_probing_done = false;
+ tramming_done = false;
wait_for_probe = true;
ui.goto_screen(_lcd_draw_raise); // show raise screen
ui.set_selection(true);
@@ -264,25 +267,25 @@ static void _lcd_level_bed_corners_get_next_position() {
ui.refresh(LCDVIEW_REDRAW_NOW);
_lcd_draw_probing(); // update screen with # of good points
- do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
+ line_to_z(current_position.z + BED_TRAMMING_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
- _lcd_level_bed_corners_get_next_position(); // Select next corner coordinates
+ _lcd_bed_tramming_get_next_position(); // Select next corner coordinates
current_position -= probe.offset_xy; // Account for probe offsets
do_blocking_move_to_xy(current_position); // Goto corner
TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE
- if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance
- if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
- #if ENABLED(BED_TRAMMING_VERIFY_RAISED) // Verify
- while (!_lcd_level_bed_corners_probe(true)) { // Loop while corner verified
- if (!_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
- if (corner_probing_done) return; // Done was selected
+ if (!_lcd_bed_tramming_probe()) { // Probe down to tolerance
+ if (_lcd_bed_tramming_raise()) { // Prompt user to raise bed if needed
+ #if ENABLED(BED_TRAMMING_VERIFY_RAISED) // Verify
+ while (!_lcd_bed_tramming_probe(true)) { // Loop while corner verified
+ if (!_lcd_bed_tramming_raise()) { // Prompt user to raise bed if needed
+ if (tramming_done) return; // Done was selected
break; // Skip was selected
}
}
#endif
}
- else if (corner_probing_done) // Done was selected
+ else if (tramming_done) // Done was selected
return;
}
@@ -293,9 +296,9 @@ static void _lcd_level_bed_corners_get_next_position() {
#if ENABLED(BLTOUCH)
if (bltouch.high_speed_mode) {
- // In HIGH SPEED MODE do clearance and stow at the very end
- do_blocking_move_to_z(current_position.z + BED_TRAMMING_Z_HOP);
+ // In HIGH SPEED MODE do stow and clearance at the very end
bltouch.stow();
+ do_z_clearance(BED_TRAMMING_Z_HOP);
}
#endif
@@ -309,7 +312,7 @@ static void _lcd_level_bed_corners_get_next_position() {
line_to_z(BED_TRAMMING_Z_HOP);
// Select next corner coordinates
- _lcd_level_bed_corners_get_next_position();
+ _lcd_bed_tramming_get_next_position();
line_to_current_position(manual_feedrate_mm_s.x);
line_to_z(BED_TRAMMING_HEIGHT);
@@ -318,15 +321,19 @@ static void _lcd_level_bed_corners_get_next_position() {
#endif // !BED_TRAMMING_USE_PROBE
-static void _lcd_level_bed_corners_homing() {
+void _lcd_bed_tramming_homing() {
_lcd_draw_homing();
if (!all_axes_homed()) return;
+
#if ENABLED(BED_TRAMMING_USE_PROBE)
+
_lcd_test_corners();
- if (corner_probing_done) ui.goto_previous_screen_no_defer();
- TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
+ if (tramming_done) ui.goto_previous_screen_no_defer();
+ TERN_(HAS_LEVELING, set_bed_leveling_enabled(menu_leveling_was_active));
endstops.enable_z_probe(false);
- #else
+
+ #else // !BED_TRAMMING_USE_PROBE
+
bed_corner = 0;
ui.goto_screen([]{
MenuItem_confirm::select_screen(
@@ -334,7 +341,7 @@ static void _lcd_level_bed_corners_homing() {
, _lcd_goto_next_corner
, []{
line_to_z(BED_TRAMMING_Z_HOP); // Raise Z off the bed when done
- TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
+ TERN_(HAS_LEVELING, set_bed_leveling_enabled(menu_leveling_was_active));
ui.goto_previous_screen_no_defer();
}
, GET_TEXT_F(TERN(BED_TRAMMING_INCLUDE_CENTER, MSG_LEVEL_BED_NEXT_POINT, MSG_NEXT_CORNER))
@@ -343,10 +350,11 @@ static void _lcd_level_bed_corners_homing() {
});
ui.set_selection(true);
_lcd_goto_next_corner();
- #endif
+
+ #endif // !BED_TRAMMING_USE_PROBE
}
-void _lcd_level_bed_corners() {
+void _lcd_bed_tramming() {
ui.defer_status_screen();
if (!all_axes_trusted()) {
set_all_unhomed();
@@ -355,11 +363,11 @@ void _lcd_level_bed_corners() {
// Disable leveling so the planner won't mess with us
#if HAS_LEVELING
- leveling_was_active = planner.leveling_active;
+ menu_leveling_was_active = planner.leveling_active;
set_bed_leveling_enabled(false);
#endif
- ui.goto_screen(_lcd_level_bed_corners_homing);
+ ui.goto_screen(_lcd_bed_tramming_homing);
}
#endif // HAS_MARLINUI_MENU && LCD_BED_TRAMMING
diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h
index 5cc5f11142..fcf7a9ea30 100644
--- a/Marlin/src/lcd/menu/menu_item.h
+++ b/Marlin/src/lcd/menu/menu_item.h
@@ -537,7 +537,7 @@ class MenuItem_bool : public MenuEditItemBase {
#define YESNO_ITEM_N(N,LABEL, V...) YESNO_ITEM_N_F(N, GET_TEXT_F(LABEL), ##V)
#if ENABLED(LCD_BED_TRAMMING)
- void _lcd_level_bed_corners();
+ void _lcd_bed_tramming();
#endif
#if HAS_FAN
diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp
index 215497c4c9..d5c1a8a38a 100644
--- a/Marlin/src/lcd/menu/menu_motion.cpp
+++ b/Marlin/src/lcd/menu/menu_motion.cpp
@@ -411,7 +411,7 @@ void menu_motion() {
#endif
#if ENABLED(LCD_BED_TRAMMING) && DISABLED(LCD_BED_LEVELING)
- SUBMENU(MSG_BED_TRAMMING, _lcd_level_bed_corners);
+ SUBMENU(MSG_BED_TRAMMING, _lcd_bed_tramming);
#endif
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp
index c7cbebaade..428052bf2a 100644
--- a/Marlin/src/lcd/menu/menu_probe_offset.cpp
+++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp
@@ -51,7 +51,7 @@ inline void z_clearance_move() {
void set_offset_and_go_back(const_float_t z) {
probe.offset.z = z;
SET_SOFT_ENDSTOP_LOOSE(false);
- TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
+ TERN_(HAS_LEVELING, set_bed_leveling_enabled(menu_leveling_was_active));
ui.goto_previous_screen_no_defer();
}
@@ -143,7 +143,7 @@ void goto_probe_offset_wizard() {
// Store Bed-Leveling-State and disable
#if HAS_LEVELING
- leveling_was_active = planner.leveling_active;
+ menu_leveling_was_active = planner.leveling_active;
set_bed_leveling_enabled(false);
#endif
diff --git a/Marlin/src/lcd/menu/menu_tramming.cpp b/Marlin/src/lcd/menu/menu_tramming_wizard.cpp
similarity index 100%
rename from Marlin/src/lcd/menu/menu_tramming.cpp
rename to Marlin/src/lcd/menu/menu_tramming_wizard.cpp
diff --git a/Marlin/src/lcd/menu/menu_x_twist.cpp b/Marlin/src/lcd/menu/menu_x_twist.cpp
index a069b427c6..d1850a1eb2 100644
--- a/Marlin/src/lcd/menu/menu_x_twist.cpp
+++ b/Marlin/src/lcd/menu/menu_x_twist.cpp
@@ -46,7 +46,7 @@ float measured_z, z_offset;
void xatc_wizard_done() {
if (!ui.wait_for_move) {
xatc.print_points();
- set_bed_leveling_enabled(leveling_was_active);
+ set_bed_leveling_enabled(menu_leveling_was_active);
SET_SOFT_ENDSTOP_LOOSE(false);
ui.goto_screen(menu_advanced_settings);
}
@@ -199,7 +199,7 @@ void xatc_wizard_homing() {
void xatc_wizard_continue() {
// Store Bed-Leveling-State and disable
#if HAS_LEVELING
- leveling_was_active = planner.leveling_active;
+ menu_leveling_was_active = planner.leveling_active;
set_bed_leveling_enabled(false);
#endif
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index 7daafd1139..faa3aec03d 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -528,7 +528,7 @@ bool Probe::set_deployed(const bool deploy) {
}
#endif
- const xy_pos_t old_xy = current_position;
+ const xy_pos_t old_xy = current_position; // Remember location before probe deployment
#if ENABLED(PROBE_TRIGGERED_WHEN_STOWED_TEST)
@@ -625,7 +625,7 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
// Offset sensorless probing
#if HAS_DELTA_SENSORLESS_PROBING
- if (probe_triggered) probe.refresh_largest_sensorless_adj();
+ if (probe_triggered) refresh_largest_sensorless_adj();
#endif
TERN_(HAS_QUIET_PROBING, set_probing_paused(false));
diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h
index a179eb21d8..9fdbfdf9ce 100644
--- a/Marlin/src/module/probe.h
+++ b/Marlin/src/module/probe.h
@@ -114,7 +114,7 @@ public:
}
#endif
- #else
+ #else // !IS_KINEMATIC
static bool obstacle_check(const_float_t rx, const_float_t ry) {
#if ENABLED(AVOID_OBSTACLES)
@@ -166,7 +166,7 @@ public:
}
}
- #endif
+ #endif // !IS_KINEMATIC
static void move_z_after_probing() {
#ifdef Z_AFTER_PROBING
@@ -178,7 +178,7 @@ public:
return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check);
}
- #else
+ #else // !HAS_BED_PROBE
static constexpr xyz_pos_t offset = xyz_pos_t(NUM_AXIS_ARRAY_1(0)); // See #16767
@@ -186,7 +186,7 @@ public:
static bool can_reach(const_float_t rx, const_float_t ry, const bool=true) { return position_is_reachable(rx, ry); }
- #endif
+ #endif // !HAS_BED_PROBE
static void move_z_after_homing() {
#if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) || defined(Z_AFTER_HOMING)
diff --git a/buildroot/share/PlatformIO/scripts/common-dependencies.h b/buildroot/share/PlatformIO/scripts/common-dependencies.h
index da2d380a82..344669c49b 100644
--- a/buildroot/share/PlatformIO/scripts/common-dependencies.h
+++ b/buildroot/share/PlatformIO/scripts/common-dependencies.h
@@ -54,7 +54,7 @@
#define HAS_MENU_BACKLASH
#endif
#if ENABLED(LCD_BED_TRAMMING)
- #define HAS_MENU_BED_CORNERS
+ #define HAS_MENU_BED_TRAMMING
#endif
#if ENABLED(CANCEL_OBJECTS)
#define HAS_MENU_CANCELOBJECT
@@ -99,7 +99,7 @@
#define HAS_MENU_TOUCH_SCREEN
#endif
#if ENABLED(ASSISTED_TRAMMING_WIZARD)
- #define HAS_MENU_TRAMMING
+ #define HAS_MENU_TRAMMING_WIZARD
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
#define HAS_MENU_UBL
diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0
index 09e36d6475..e0769b6a10 100755
--- a/buildroot/tests/BIGTREE_GTR_V1_0
+++ b/buildroot/tests/BIGTREE_GTR_V1_0
@@ -16,7 +16,8 @@ opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_
FIL_RUNOUT6_PIN 8 FIL_RUNOUT7_PIN 9 FIL_RUNOUT8_PIN 10 FIL_RUNOUT4_STATE HIGH FIL_RUNOUT8_STATE HIGH \
FILAMENT_RUNOUT_SCRIPT '"M600 T%c"'
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH NEOPIXEL_LED Z_SAFE_HOMING NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE \
- FILAMENT_RUNOUT_SENSOR FIL_RUNOUT4_PULLUP FIL_RUNOUT8_PULLUP FILAMENT_CHANGE_RESUME_ON_INSERT PAUSE_REHEAT_FAST_RESUME
+ FILAMENT_RUNOUT_SENSOR FIL_RUNOUT4_PULLUP FIL_RUNOUT8_PULLUP FILAMENT_CHANGE_RESUME_ON_INSERT PAUSE_REHEAT_FAST_RESUME \
+ LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE
exec_test $1 $2 "BigTreeTech GTR | 8 Extruders | Auto-Fan | Mixed TMC Drivers | Runout Sensors w/ distinct states" "$3"
restore_configs
diff --git a/ini/features.ini b/ini/features.ini
index c9c7528658..bfaca56ab3 100644
--- a/ini/features.ini
+++ b/ini/features.ini
@@ -60,8 +60,8 @@ MARLIN_INVADERS = src_filter=+
MARLIN_SNAKE = src_filter=+
HAS_MENU_BACKLASH = src_filter=+
-HAS_MENU_BED_CORNERS = src_filter=+
LCD_BED_LEVELING = src_filter=+
+HAS_MENU_BED_TRAMMING = src_filter=+
HAS_MENU_CANCELOBJECT = src_filter=+
HAS_MENU_DELTA_CALIBRATE = src_filter=+
HAS_MENU_FILAMENT = src_filter=+
@@ -78,7 +78,7 @@ HAS_MENU_CUTTER = src_filter=+
HAS_MENU_TMC = src_filter=+
HAS_MENU_TOUCH_SCREEN = src_filter=+
-HAS_MENU_TRAMMING = src_filter=+
+HAS_MENU_TRAMMING_WIZARD = src_filter=+
HAS_MENU_UBL = src_filter=+
ANYCUBIC_LCD_CHIRON = src_filter=+
ANYCUBIC_LCD_I3MEGA = src_filter=+
diff --git a/platformio.ini b/platformio.ini
index 991c17b2ff..d31f23abec 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -60,8 +60,8 @@ default_src_filter = + - - + - - -
- -
-
- -
-
+ -
-
-
-
@@ -77,7 +77,7 @@ default_src_filter = + - - + -
-
-
- -
+ -
-
-
-
From 65b97438fa92743ac5b2659ae55013a4c413da39 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Wed, 15 Mar 2023 19:13:09 -0500
Subject: [PATCH 026/225] =?UTF-8?q?=F0=9F=A9=B9=20Fan=20Menu=20/=20Status?=
=?UTF-8?q?=20fixes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Followup to #21888
---
Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 2 +-
.../lcd/e3v2/marlinui/ui_status_480x272.cpp | 160 +++++++-----------
Marlin/src/lcd/language/language_en.h | 8 -
Marlin/src/lcd/marlinui.cpp | 1 -
Marlin/src/lcd/marlinui.h | 1 -
Marlin/src/lcd/menu/menu_item.h | 8 +
Marlin/src/lcd/menu/menu_tune.cpp | 14 +-
Marlin/src/lcd/tft/touch.cpp | 2 +-
8 files changed, 80 insertions(+), 116 deletions(-)
diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp
index 12d16887d1..778bed6335 100644
--- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp
+++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp
@@ -195,7 +195,7 @@ void MarlinUI::draw_status_message(const bool blink) {
}
const bool hash_changed = hash != old_hash;
old_hash = hash;
- return hash_changed || !ui.did_first_redraw;
+ return hash_changed || !did_first_redraw;
};
#if ENABLED(STATUS_MESSAGE_SCROLLING)
diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
index 205913ca69..7ac0e3fcb4 100644
--- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
+++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
@@ -61,72 +61,54 @@
#define STATUS_CHR_WIDTH 14
#define STATUS_CHR_HEIGHT 28
+bool old_is_printing;
+
//
// Before homing, blink '123' <-> '???'.
// Homed but unknown... '123' <-> ' '.
// Homed and known, display constantly.
//
-FORCE_INLINE void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink, const uint16_t x, const uint16_t y) {
+void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink, const uint16_t x, const uint16_t y) {
+ const bool x_redraw = !ui.did_first_redraw || old_is_printing != print_job_timer.isRunning();
+ if (x_redraw) {
+ dwin_string.set('X' + axis);
+ DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black,
+ #if ENABLED(DWIN_MARLINUI_PORTRAIT)
+ x + (utf8_strlen(value) * 14 - 14) / 2, y + 2
+ #else
+ x, y
+ #endif
+ , S(dwin_string.string())
+ );
+ }
- #if ENABLED(DWIN_MARLINUI_PORTRAIT)
+ dwin_string.set();
+ if (blink)
+ dwin_string.add(value);
+ else if (!TEST(axes_homed, axis))
+ while (const char c = *value++) dwin_string.add(c <= '.' ? c : '?');
+ else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !TEST(axes_trusted, axis))
+ dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" "));
+ else
+ dwin_string.add(value);
- uint8_t vallen = utf8_strlen(value);
- if (!ui.did_first_redraw) {
- dwin_string.set('X' + axis);
- DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (vallen * 14 - 14) / 2, y + 2, S(dwin_string.string()));
- }
+ // For E_TOTAL there may be some characters to cover up
+ if (TERN0(LCD_SHOW_E_TOTAL, x_redraw && axis == X_AXIS))
+ dwin_string.add(F(" "));
- dwin_string.set();
- if (blink)
- dwin_string.add(value);
- else if (!TEST(axes_homed, axis))
- while (const char c = *value++) dwin_string.add(c <= '.' ? c : '?');
- else if (NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING) && !TEST(axes_trusted, axis))
- dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" "));
- else
- dwin_string.add(value);
-
- // For E_TOTAL there may be some characters to cover up
- if (BOTH(DWIN_MARLINUI_PORTRAIT, LCD_SHOW_E_TOTAL) && axis == X_AXIS)
- dwin_string.add(F(" "));
-
- DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + 32, S(dwin_string.string()));
-
- #else // !DWIN_MARLINUI_PORTRAIT
-
- if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) {
- dwin_string.set('X' + axis);
- DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string()));
- }
-
- dwin_string.set();
- if (blink)
- dwin_string.add(value);
- else {
- if (!TEST(axes_homed, axis))
- while (const char c = *value++) dwin_string.add(c <= '.' ? c : '?');
- else {
- #if NONE(HOME_AFTER_DEACTIVATE, DISABLE_REDUCED_ACCURACY_WARNING)
- if (!TEST(axes_trusted, axis))
- dwin_string.add(TERN1(DWIN_MARLINUI_PORTRAIT, axis == Z_AXIS) ? PSTR(" ") : PSTR(" "));
- else
- #endif
- dwin_string.add(value);
- }
- }
-
- // For E_TOTAL there may be some characters to cover up
- if (ENABLED(LCD_SHOW_E_TOTAL) && (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) && axis == X_AXIS)
- dwin_string.add(F(" "));
-
- DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x + 32, y + 4, S(dwin_string.string()));
-
- #endif // !DWIN_MARLINUI_PORTRAIT
+ DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black,
+ #if ENABLED(DWIN_MARLINUI_PORTRAIT)
+ x, y + 32
+ #else
+ x + 32, y + 4
+ #endif
+ , S(dwin_string.string())
+ );
}
#if ENABLED(LCD_SHOW_E_TOTAL)
- FORCE_INLINE void _draw_e_value(const_float_t value, const uint16_t x, const uint16_t y) {
+ void _draw_e_value(const_float_t value, const uint16_t x, const uint16_t y) {
const uint8_t scale = value >= 100000.0f ? 10 : 1; // show cm after 99,999mm
#if ENABLED(DWIN_MARLINUI_PORTRAIT)
@@ -207,72 +189,56 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater, const uint16_t x
#endif
#endif
- #if HAS_HOTEND && HAS_HEATED_BED
- float tc, tt;
- bool c_draw, t_draw, i_draw, ta;
- const bool isBed = heater < 0;
- if (isBed) {
+ celsius_float_t tc = 0, tt = 0;
+ bool isBed = (DISABLED(HAS_HOTEND) && ENABLED(HAS_HEATED_BED)) || (BOTH(HAS_HOTEND, HAS_HEATED_BED) && heater < 0),
+ ta = false, c_draw, t_draw, i_draw;
+ c_draw = t_draw = i_draw = !ui.did_first_redraw;
+ if (isBed) {
+ #if HAS_HEATED_BED
tc = thermalManager.degBed();
tt = thermalManager.degTargetBed();
ta = thermalManager.isHeatingBed();
- c_draw = tc != old_bed_temp;
- t_draw = tt != old_bed_target;
- i_draw = ta != old_bed_on;
+ c_draw |= tc != old_bed_temp;
+ t_draw |= tt != old_bed_target;
+ i_draw |= ta != old_bed_on;
old_bed_temp = tc;
old_bed_target = tt;
old_bed_on = ta;
- }
- else {
+ #if HAS_LEVELING
+ i_draw |= planner.leveling_active != old_leveling_on;
+ old_leveling_on = planner.leveling_active;
+ #endif
+ #endif
+ }
+ else {
+ #if HAS_HOTEND
tc = thermalManager.degHotend(heater);
tt = thermalManager.degTargetHotend(heater);
ta = thermalManager.isHeatingHotend(heater);
- c_draw = tc != old_temp[heater];
- t_draw = tt != old_target[heater];
- i_draw = ta != old_on[heater];
+ c_draw |= tc != old_temp[heater];
+ t_draw |= tt != old_target[heater];
+ i_draw |= ta != old_on[heater];
old_temp[heater] = tc;
old_target[heater] = tt;
old_on[heater] = ta;
- }
- #elif HAS_HOTEND
- constexpr bool isBed = false;
- const float tc = thermalManager.degHotend(heater), tt = thermalManager.degTargetHotend(heater);
- const uint8_t ta = thermalManager.isHeatingHotend(heater);
- bool c_draw = tc != old_temp[heater], t_draw = tt != old_target[heater], i_draw = ta != old_on[heater];
- old_temp[heater] = tc; old_target[heater] = tt; old_on[heater] = ta;
- #elif HAS_HEATED_BED
- constexpr bool isBed = true;
- const float tc = thermalManager.degBed(), tt = thermalManager.degTargetBed();
- const uint8_t ta = thermalManager.isHeatingBed();
- bool c_draw = tc != old_bed_temp, t_draw = tt != old_bed_target, i_draw = ta != old_bed_on;
- old_bed_temp = tc; old_bed_target = tt; old_bed_on = ta;
- #else
- bool c_draw = false, t_draw = false, i_draw = false;
- constexpr float tc = 0, tt = 0;
- constexpr uint8_t ta = 0;
- #endif
-
- #if HAS_HEATED_BED && HAS_LEVELING
- if (isBed) {
- i_draw |= (planner.leveling_active != old_leveling_on);
- old_leveling_on = planner.leveling_active;
- }
- #endif
+ #endif
+ }
// Draw target temperature, if needed
- if (!ui.did_first_redraw || t_draw) {
+ if (t_draw) {
dwin_string.set(i16tostr3rj(tt + 0.5));
dwin_string.add(LCD_STR_DEGREE);
DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y, S(dwin_string.string()));
}
// Draw heater icon with on / off / leveled states
- if (!ui.did_first_redraw || i_draw) {
+ if (i_draw) {
const uint8_t ico = isBed ? (TERN0(HAS_LEVELING, planner.leveling_active) ? ICON_BedLevelOff : ICON_BedOff) : ICON_HotendOff;
DWIN_ICON_Show(ICON, ico + ta, x, y + STATUS_CHR_HEIGHT + 2);
}
// Draw current temperature, if needed
- if (!ui.did_first_redraw || c_draw) {
+ if (c_draw) {
dwin_string.set(i16tostr3rj(tc + 0.5));
dwin_string.add(LCD_STR_DEGREE);
DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + 70, S(dwin_string.string()));
@@ -414,7 +380,7 @@ void MarlinUI::draw_status_screen() {
}
DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, 378, 170, S(dwin_string.string()));
}
- else if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) {
+ else if (!ui.did_first_redraw || old_is_printing != print_job_timer.isRunning()) {
dwin_string.set(F(" "));
DWIN_Draw_String(true, font14x28, Color_IconBlue, Color_Bg_Black, 336, 170, S(dwin_string.string()));
}
@@ -470,7 +436,7 @@ void MarlinUI::draw_status_screen() {
draw_status_message(blink);
ui.did_first_redraw = true;
- ui.old_is_printing = print_job_timer.isRunning();
+ old_is_printing = print_job_timer.isRunning();
}
#endif // IS_DWIN_MARLINUI
diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h
index 5012f8c496..55f426017c 100644
--- a/Marlin/src/lcd/language/language_en.h
+++ b/Marlin/src/lcd/language/language_en.h
@@ -908,11 +908,3 @@ namespace Language_en {
LSTR DGUS_MSG_FILAMENT_RUNOUT = _UxGT("Filament runout E%d");
}
-
-#if FAN_COUNT == 1
- #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED
- #define MSG_EXTRA_FIRST_FAN_SPEED MSG_EXTRA_FAN_SPEED
-#else
- #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED_N
- #define MSG_EXTRA_FIRST_FAN_SPEED MSG_EXTRA_FAN_SPEED_N
-#endif
diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp
index d3f01e6d23..88cdb99076 100644
--- a/Marlin/src/lcd/marlinui.cpp
+++ b/Marlin/src/lcd/marlinui.cpp
@@ -351,7 +351,6 @@ void MarlinUI::init() {
#if IS_DWIN_MARLINUI
bool MarlinUI::did_first_redraw;
- bool MarlinUI::old_is_printing;
#endif
#if ENABLED(SDSUPPORT)
diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h
index fa18878c1b..9d6d235e96 100644
--- a/Marlin/src/lcd/marlinui.h
+++ b/Marlin/src/lcd/marlinui.h
@@ -503,7 +503,6 @@ public:
#if IS_DWIN_MARLINUI
static bool did_first_redraw;
- static bool old_is_printing;
#endif
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h
index fcf7a9ea30..3186852002 100644
--- a/Marlin/src/lcd/menu/menu_item.h
+++ b/Marlin/src/lcd/menu/menu_item.h
@@ -555,6 +555,14 @@ class MenuItem_bool : public MenuEditItemBase {
#define EDIT_EXTRA_FAN_SPEED(...)
#endif
+ #if FAN_COUNT == 1
+ #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED
+ #define MSG_EXTRA_FIRST_FAN_SPEED MSG_EXTRA_FAN_SPEED
+ #else
+ #define MSG_FIRST_FAN_SPEED MSG_FAN_SPEED_N
+ #define MSG_EXTRA_FIRST_FAN_SPEED MSG_EXTRA_FAN_SPEED_N
+ #endif
+
#define _FAN_EDIT_ITEMS(F,L) do{ \
editable.uint8 = thermalManager.fan_speed[F]; \
EDIT_ITEM_FAST_N(percent, F, MSG_##L, &editable.uint8, 0, 255, on_fan_update); \
diff --git a/Marlin/src/lcd/menu/menu_tune.cpp b/Marlin/src/lcd/menu/menu_tune.cpp
index 8c4b2b1cfc..9247607269 100644
--- a/Marlin/src/lcd/menu/menu_tune.cpp
+++ b/Marlin/src/lcd/menu/menu_tune.cpp
@@ -156,37 +156,37 @@ void menu_tune() {
#if HAS_FAN0
_FAN_EDIT_ITEMS(0,FIRST_FAN_SPEED);
#endif
- #if HAS_FAN1
+ #if HAS_FAN1 && REDUNDANT_PART_COOLING_FAN != 1
FAN_EDIT_ITEMS(1);
#elif SNFAN(1)
singlenozzle_item(1);
#endif
- #if HAS_FAN2
+ #if HAS_FAN2 && REDUNDANT_PART_COOLING_FAN != 2
FAN_EDIT_ITEMS(2);
#elif SNFAN(2)
singlenozzle_item(2);
#endif
- #if HAS_FAN3
+ #if HAS_FAN3 && REDUNDANT_PART_COOLING_FAN != 3
FAN_EDIT_ITEMS(3);
#elif SNFAN(3)
singlenozzle_item(3);
#endif
- #if HAS_FAN4
+ #if HAS_FAN4 && REDUNDANT_PART_COOLING_FAN != 4
FAN_EDIT_ITEMS(4);
#elif SNFAN(4)
singlenozzle_item(4);
#endif
- #if HAS_FAN5
+ #if HAS_FAN5 && REDUNDANT_PART_COOLING_FAN != 5
FAN_EDIT_ITEMS(5);
#elif SNFAN(5)
singlenozzle_item(5);
#endif
- #if HAS_FAN6
+ #if HAS_FAN6 && REDUNDANT_PART_COOLING_FAN != 6
FAN_EDIT_ITEMS(6);
#elif SNFAN(6)
singlenozzle_item(6);
#endif
- #if HAS_FAN7
+ #if HAS_FAN7 && REDUNDANT_PART_COOLING_FAN != 7
FAN_EDIT_ITEMS(7);
#elif SNFAN(7)
singlenozzle_item(7);
diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp
index cc800cddc3..b73f67e744 100644
--- a/Marlin/src/lcd/tft/touch.cpp
+++ b/Marlin/src/lcd/tft/touch.cpp
@@ -27,7 +27,7 @@
#include "touch.h"
#include "../marlinui.h" // for ui methods
-#include "../menu/menu_item.h" // for touch_screen_calibration
+#include "../menu/menu_item.h" // for MSG_FIRST_FAN_SPEED
#include "../../module/temperature.h"
#include "../../module/planner.h"
From 0a00662b54dbfbe913feb676ac35ad1aea472759 Mon Sep 17 00:00:00 2001
From: dwzg <50058606+dwzg@users.noreply.github.com>
Date: Thu, 16 Mar 2023 01:15:54 +0100
Subject: [PATCH 027/225] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DWIN=20MarlinUI=20?=
=?UTF-8?q?Fan/E/XY=20(#25502)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
index 7ac0e3fcb4..d0a04a3c4b 100644
--- a/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
+++ b/Marlin/src/lcd/e3v2/marlinui/ui_status_480x272.cpp
@@ -110,10 +110,11 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,
void _draw_e_value(const_float_t value, const uint16_t x, const uint16_t y) {
const uint8_t scale = value >= 100000.0f ? 10 : 1; // show cm after 99,999mm
+ const bool e_redraw = !ui.did_first_redraw || old_is_printing != print_job_timer.isRunning();
#if ENABLED(DWIN_MARLINUI_PORTRAIT)
- if (!ui.did_first_redraw) {
+ if (e_redraw) {
// Extra spaces to erase previous value
dwin_string.set(F("E "));
DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x + (4 * 14 / 2) - 7, y + 2, S(dwin_string.string()));
@@ -127,7 +128,7 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,
#else // !DWIN_MARLINUI_PORTRAIT
- if (!ui.did_first_redraw || ui.old_is_printing != print_job_timer.isRunning()) {
+ if (e_redraw) {
dwin_string.set(F("E "));
DWIN_Draw_String(true, font16x32, Color_IconBlue, Color_Bg_Black, x, y, S(dwin_string.string()));
}
@@ -147,11 +148,10 @@ void _draw_axis_value(const AxisEnum axis, const char *value, const bool blink,
//
FORCE_INLINE void _draw_fan_status(const uint16_t x, const uint16_t y) {
const uint16_t fanx = (4 * STATUS_CHR_WIDTH - STATUS_FAN_WIDTH) / 2;
- const uint8_t fan_pct = thermalManager.scaledFanSpeedPercent(0);
- const bool fan_on = !!fan_pct;
+ const bool fan_on = !!thermalManager.scaledFanSpeed(0);
if (fan_on) {
DWIN_ICON_Animation(0, fan_on, ICON, ICON_Fan0, ICON_Fan3, x + fanx, y, 25);
- dwin_string.set(i8tostr3rj(fan_pct));
+ dwin_string.set(i8tostr3rj(thermalManager.scaledFanSpeedPercent(0)));
dwin_string.add('%');
DWIN_Draw_String(true, font14x28, Color_White, Color_Bg_Black, x, y + STATUS_FAN_HEIGHT, S(dwin_string.string()));
}
From 32c7e24b4bce9fb42b4523cf35df3c51444ace71 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Thu, 16 Mar 2023 00:52:51 +0000
Subject: [PATCH 028/225] [cron] Bump distribution date (2023-03-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 c993bd48b9..922cdfeeb4 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 "2023-03-15"
+//#define STRING_DISTRIBUTION_DATE "2023-03-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 5f78729bd4..a2c451f900 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 "2023-03-15"
+ #define STRING_DISTRIBUTION_DATE "2023-03-16"
#endif
/**
From 41b3409ba86d5f6e0826cdf577253a801b9be1c1 Mon Sep 17 00:00:00 2001
From: ellensp <530024+ellensp@users.noreply.github.com>
Date: Thu, 16 Mar 2023 18:42:52 +1300
Subject: [PATCH 029/225] =?UTF-8?q?=F0=9F=94=A7=20Safer=20default=20for=20?=
=?UTF-8?q?Z=5FMIN=5FPROBE=5FPIN=20override=20(#25524)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/Configuration.h | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index b57c66a9a8..40f4fe4cbd 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -1345,19 +1345,17 @@
/**
* Z_MIN_PROBE_PIN
*
- * Define this pin if the probe is not connected to Z_MIN_PIN.
- * If not defined the default pin for the selected MOTHERBOARD
- * will be used. Most of the time the default is what you want.
+ * Override this pin only if the probe cannot be connected to
+ * the default Z_MIN_PROBE_PIN for the selected MOTHERBOARD.
*
* - The simplest option is to use a free endstop connector.
* - Use 5V for powered (usually inductive) sensors.
*
- * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin:
- * - For simple switches connect...
- * - normally-closed switches to GND and D32.
- * - normally-open switches to 5V and D32.
+ * - For simple switches...
+ * - Normally-closed (NC) also connect to GND.
+ * - Normally-open (NO) also connect to 5V.
*/
-//#define Z_MIN_PROBE_PIN 32 // Pin 32 is the RAMPS default
+//#define Z_MIN_PROBE_PIN -1
/**
* Probe Type
From 51d3eabf463f28411670a543a7bd7418aad46fe4 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Wed, 15 Mar 2023 22:16:53 -0500
Subject: [PATCH 030/225] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20PROBE?=
=?UTF-8?q?=5FPT=5F[123]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration_adv.h | 11 ++++-------
Marlin/src/inc/Conditionals_post.h | 8 ++------
Marlin/src/inc/SanityCheck.h | 8 ++++++++
Marlin/src/module/probe.h | 10 +++++-----
buildroot/tests/mega2560 | 3 ++-
5 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 6ef72d9f04..35c43c7f2c 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -2152,13 +2152,10 @@
* Points to probe for all 3-point Leveling procedures.
* Override if the automatically selected points are inadequate.
*/
-#if EITHER(AUTO_BED_LEVELING_3POINT, AUTO_BED_LEVELING_UBL)
- //#define PROBE_PT_1_X 15
- //#define PROBE_PT_1_Y 180
- //#define PROBE_PT_2_X 15
- //#define PROBE_PT_2_Y 20
- //#define PROBE_PT_3_X 170
- //#define PROBE_PT_3_Y 20
+#if NEEDS_THREE_PROBE_POINTS
+ //#define PROBE_PT_1 { 15, 180 } // (mm) { x, y }
+ //#define PROBE_PT_2 { 15, 20 }
+ //#define PROBE_PT_3 { 170, 20 }
#endif
/**
diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h
index 249aa5c30e..9305e86594 100644
--- a/Marlin/src/inc/Conditionals_post.h
+++ b/Marlin/src/inc/Conditionals_post.h
@@ -3188,13 +3188,9 @@
#undef MESH_MAX_Y
#endif
-#define _POINT_COUNT (defined(PROBE_PT_1_X) + defined(PROBE_PT_2_X) + defined(PROBE_PT_3_X) + defined(PROBE_PT_1_Y) + defined(PROBE_PT_2_Y) + defined(PROBE_PT_3_Y))
-#if _POINT_COUNT == 6
- #define HAS_FIXED_3POINT 1
-#elif _POINT_COUNT > 0
- #error "For 3-Point Leveling all XY points must be defined (or none for the defaults)."
+#if NEEDS_THREE_PROBE_POINTS && defined(PROBE_PT_1)
+ #define HAS_FIXED_3POINT 1 // Points are defined for ABL/UBL. Else calculated in probe.get_three_points.
#endif
-#undef _POINT_COUNT
/**
* Buzzer/Speaker
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index a03a489a01..a795bfb93f 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -676,6 +676,8 @@
#error "DISABLE_INACTIVE_E is now set with DISABLE_INACTIVE_EXTRUDER."
#elif defined(INVERT_X_STEP_PIN) || defined(INVERT_Y_STEP_PIN) || defined(INVERT_Z_STEP_PIN) || defined(INVERT_I_STEP_PIN) || defined(INVERT_J_STEP_PIN) || defined(INVERT_K_STEP_PIN) || defined(INVERT_U_STEP_PIN) || defined(INVERT_V_STEP_PIN) || defined(INVERT_W_STEP_PIN) || defined(INVERT_E_STEP_PIN)
#error "INVERT_*_STEP_PIN true is now STEP_STATE_* LOW, and INVERT_*_STEP_PIN false is now STEP_STATE_* HIGH."
+#elif defined(PROBE_PT_1_X) || defined(PROBE_PT_1_Y) || defined(PROBE_PT_2_X) || defined(PROBE_PT_2_Y) || defined(PROBE_PT_3_X) || defined(PROBE_PT_3_Y)
+ #error "PROBE_PT_[123]_[XY] is now defined using PROBE_PT_[123] with an array { x, y }."
#endif
// L64xx stepper drivers have been removed
@@ -2102,6 +2104,12 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#endif
+#define _POINT_COUNT (defined(PROBE_PT_1) + defined(PROBE_PT_2) + defined(PROBE_PT_3))
+#if _POINT_COUNT != 0 && _POINT_COUNT != 3
+ #error "For 3-Point Procedures all XY points must be defined (or none for the defaults)."
+#endif
+#undef _POINT_COUNT
+
#if ALL(HAS_LEVELING, RESTORE_LEVELING_AFTER_G28, ENABLE_LEVELING_AFTER_G28)
#error "Only enable RESTORE_LEVELING_AFTER_G28 or ENABLE_LEVELING_AFTER_G28, but not both."
#endif
diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h
index 9fdbfdf9ce..42b6c4fe41 100644
--- a/Marlin/src/module/probe.h
+++ b/Marlin/src/module/probe.h
@@ -294,12 +294,12 @@ public:
template
static void get_three_points(T points[3]) {
#if HAS_FIXED_3POINT
- #define VALIDATE_PROBE_PT(N) static_assert(Probe::build_time::can_reach(xy_pos_t{PROBE_PT_##N##_X, PROBE_PT_##N##_Y}), \
- "PROBE_PT_" STRINGIFY(N) "_(X|Y) is unreachable using default NOZZLE_TO_PROBE_OFFSET and PROBING_MARGIN");
+ #define VALIDATE_PROBE_PT(N) static_assert(Probe::build_time::can_reach(xy_pos_t(PROBE_PT_##N)), \
+ "PROBE_PT_" STRINGIFY(N) " is unreachable using default NOZZLE_TO_PROBE_OFFSET and PROBING_MARGIN.");
VALIDATE_PROBE_PT(1); VALIDATE_PROBE_PT(2); VALIDATE_PROBE_PT(3);
- points[0] = xy_float_t({ PROBE_PT_1_X, PROBE_PT_1_Y });
- points[1] = xy_float_t({ PROBE_PT_2_X, PROBE_PT_2_Y });
- points[2] = xy_float_t({ PROBE_PT_3_X, PROBE_PT_3_Y });
+ points[0] = xy_float_t(PROBE_PT_1);
+ points[1] = xy_float_t(PROBE_PT_2);
+ points[2] = xy_float_t(PROBE_PT_3);
#else
#if IS_KINEMATIC
constexpr float SIN0 = 0.0, SIN120 = 0.866025, SIN240 = -0.866025,
diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560
index bd855f1df1..363c386a4e 100755
--- a/buildroot/tests/mega2560
+++ b/buildroot/tests/mega2560
@@ -62,7 +62,8 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO NUM_SERVOS 1 \
NUM_RUNOUT_SENSORS 5 FIL_RUNOUT2_PIN 44 FIL_RUNOUT3_PIN 45 FIL_RUNOUT4_PIN 46 FIL_RUNOUT5_PIN 47 \
FIL_RUNOUT3_STATE HIGH FILAMENT_RUNOUT_SCRIPT '"M600 T%c"'
opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \
- Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE \
+ Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \
+ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE PROBE_PT_1 PROBE_PT_2 PROBE_PT_3 \
EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL AUTO_REPORT_POSITION \
NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \
From 507c122fcff686bc83d6c8b06bc05f3bf01bcc73 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Wed, 15 Mar 2023 22:21:03 -0500
Subject: [PATCH 031/225] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20UBL=20'?=
=?UTF-8?q?G29=20J'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 168 ++++++++------------
1 file changed, 65 insertions(+), 103 deletions(-)
diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
index 02efb3e065..e504379848 100644
--- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
+++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
@@ -1479,82 +1479,33 @@ void unified_bed_leveling::smart_fill_mesh() {
void unified_bed_leveling::tilt_mesh_based_on_probed_grid(const bool do_3_pt_leveling) {
- #ifdef G29J_MESH_TILT_MARGIN
- const float x_min = _MAX(probe.min_x() + (G29J_MESH_TILT_MARGIN), X_MIN_POS),
- x_max = _MIN(probe.max_x() - (G29J_MESH_TILT_MARGIN), X_MAX_POS),
- y_min = _MAX(probe.min_y() + (G29J_MESH_TILT_MARGIN), Y_MIN_POS),
- y_max = _MIN(probe.max_y() - (G29J_MESH_TILT_MARGIN), Y_MAX_POS);
- #else
- const float x_min = probe.min_x(), x_max = probe.max_x(),
- y_min = probe.min_y(), y_max = probe.max_y();
- #endif
- const float dx = (x_max - x_min) / (param.J_grid_size - 1),
- dy = (y_max - y_min) / (param.J_grid_size - 1);
-
- xy_float_t points[3];
- probe.get_three_points(points);
-
float measured_z;
bool abort_flag = false;
- #if ENABLED(VALIDATE_MESH_TILT)
- float z1, z2, z3; // Needed for algorithm validation below
- #endif
-
struct linear_fit_data lsf_results;
incremental_LSF_reset(&lsf_results);
if (do_3_pt_leveling) {
- SERIAL_ECHOLNPGM("Tilting mesh (1/3)");
- TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
+ xy_float_t points[3];
+ probe.get_three_points(points);
- measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, param.V_verbosity);
- if (isnan(measured_z))
- abort_flag = true;
- else {
- measured_z -= get_z_correction(points[0]);
- TERN_(VALIDATE_MESH_TILT, z1 = measured_z);
- if (param.V_verbosity > 3) {
- serial_spaces(16);
- SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
- }
- incremental_LSF(&lsf_results, points[0], measured_z);
- }
+ #if ENABLED(VALIDATE_MESH_TILT)
+ float gotz[3]; // Used for algorithm validation below
+ #endif
- if (!abort_flag) {
- SERIAL_ECHOLNPGM("Tilting mesh (2/3)");
- TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 2/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
+ LOOP_L_N(i, 3) {
+ SERIAL_ECHOLNPGM("Tilting mesh (", i + 1, "/3)");
+ TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/3"), i + 1, GET_TEXT(MSG_LCD_TILTING_MESH)));
- measured_z = probe.probe_at_point(points[1], PROBE_PT_RAISE, param.V_verbosity);
- TERN_(VALIDATE_MESH_TILT, z2 = measured_z);
- if (isnan(measured_z))
- abort_flag = true;
- else {
- measured_z -= get_z_correction(points[1]);
- if (param.V_verbosity > 3) {
- serial_spaces(16);
- SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
- }
- incremental_LSF(&lsf_results, points[1], measured_z);
- }
- }
+ measured_z = probe.probe_at_point(points[i], i < 2 ? PROBE_PT_RAISE : PROBE_PT_LAST_STOW, param.V_verbosity);
+ if ((abort_flag = isnan(measured_z))) break;
- if (!abort_flag) {
- SERIAL_ECHOLNPGM("Tilting mesh (3/3)");
- TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " 3/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
+ measured_z -= get_z_correction(points[i]);
+ TERN_(VALIDATE_MESH_TILT, gotz[i] = measured_z);
- measured_z = probe.probe_at_point(points[2], PROBE_PT_LAST_STOW, param.V_verbosity);
- TERN_(VALIDATE_MESH_TILT, z3 = measured_z);
- if (isnan(measured_z))
- abort_flag = true;
- else {
- measured_z -= get_z_correction(points[2]);
- if (param.V_verbosity > 3) {
- serial_spaces(16);
- SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
- }
- incremental_LSF(&lsf_results, points[2], measured_z);
- }
+ if (param.V_verbosity > 3) { serial_spaces(16); SERIAL_ECHOLNPGM("Corrected_Z=", measured_z); }
+
+ incremental_LSF(&lsf_results, points[i], measured_z);
}
probe.stow();
@@ -1567,54 +1518,62 @@ void unified_bed_leveling::smart_fill_mesh() {
}
else { // !do_3_pt_leveling
+ #ifdef G29J_MESH_TILT_MARGIN
+ const float x_min = _MAX(probe.min_x() + (G29J_MESH_TILT_MARGIN), X_MIN_POS),
+ x_max = _MIN(probe.max_x() - (G29J_MESH_TILT_MARGIN), X_MAX_POS),
+ y_min = _MAX(probe.min_y() + (G29J_MESH_TILT_MARGIN), Y_MIN_POS),
+ y_max = _MIN(probe.max_y() - (G29J_MESH_TILT_MARGIN), Y_MAX_POS);
+ #else
+ const float x_min = probe.min_x(), x_max = probe.max_x(),
+ y_min = probe.min_y(), y_max = probe.max_y();
+ #endif
+ const float dx = (x_max - x_min) / (param.J_grid_size - 1),
+ dy = (y_max - y_min) / (param.J_grid_size - 1);
+
bool zig_zag = false;
const uint16_t total_points = sq(param.J_grid_size);
uint16_t point_num = 1;
- xy_pos_t rpos;
LOOP_L_N(ix, param.J_grid_size) {
+ xy_pos_t rpos;
rpos.x = x_min + ix * dx;
LOOP_L_N(iy, param.J_grid_size) {
rpos.y = y_min + dy * (zig_zag ? param.J_grid_size - 1 - iy : iy);
- if (!abort_flag) {
- SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n");
- TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
+ SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n");
+ TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
- measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
+ measured_z = probe.probe_at_point(rpos, parser.seen_test('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
- abort_flag = isnan(measured_z);
+ if ((abort_flag = isnan(measured_z))) break;
- #if ENABLED(DEBUG_LEVELING_FEATURE)
- if (DEBUGGING(LEVELING)) {
- const xy_pos_t lpos = rpos.asLogical();
- DEBUG_CHAR('(');
- DEBUG_ECHO_F(rpos.x, 7);
- DEBUG_CHAR(',');
- DEBUG_ECHO_F(rpos.y, 7);
- DEBUG_ECHOPAIR_F(") logical: (", lpos.x, 7);
- DEBUG_CHAR(',');
- DEBUG_ECHO_F(lpos.y, 7);
- DEBUG_ECHOPAIR_F(") measured: ", measured_z, 7);
- DEBUG_ECHOPAIR_F(" correction: ", get_z_correction(rpos), 7);
- }
- #endif
+ const float zcorr = get_z_correction(rpos);
- measured_z -= get_z_correction(rpos) /* + probe.offset.z */ ;
-
- if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_F(" final >>>---> ", measured_z, 7);
-
- if (param.V_verbosity > 3) {
- serial_spaces(16);
- SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ if (DEBUGGING(LEVELING)) {
+ const xy_pos_t lpos = rpos.asLogical();
+ DEBUG_CHAR('('); DEBUG_ECHO_F(rpos.x, 7); DEBUG_CHAR(','); DEBUG_ECHO_F(rpos.y, 7);
+ DEBUG_ECHOPAIR_F(") logical: (", lpos.x, 7); DEBUG_CHAR(','); DEBUG_ECHO_F(lpos.y, 7);
+ DEBUG_ECHOPAIR_F(") measured: ", measured_z, 7);
+ DEBUG_ECHOPAIR_F(" correction: ", zcorr, 7);
}
- incremental_LSF(&lsf_results, rpos, measured_z);
+ #endif
+
+ measured_z -= zcorr;
+
+ if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR_F(" final >>>---> ", measured_z, 7);
+
+ if (param.V_verbosity > 3) {
+ serial_spaces(16);
+ SERIAL_ECHOLNPGM("Corrected_Z=", measured_z);
}
+ incremental_LSF(&lsf_results, rpos, measured_z);
point_num++;
}
+ if (abort_flag) break;
zig_zag ^= true;
}
}
@@ -1696,20 +1655,23 @@ void unified_bed_leveling::smart_fill_mesh() {
auto normed = [&](const xy_pos_t &pos, const_float_t zadd) {
return normal.x * pos.x + normal.y * pos.y + zadd;
};
- auto debug_pt = [](FSTR_P const pre, const xy_pos_t &pos, const_float_t zadd) {
- d_from(); SERIAL_ECHOF(pre);
+ auto debug_pt = [](const int num, const xy_pos_t &pos, const_float_t zadd) {
+ d_from(); DEBUG_ECHOPGM("Point ", num, ":");
DEBUG_ECHO_F(normed(pos, zadd), 6);
DEBUG_ECHOLNPAIR_F(" Z error = ", zadd - get_z_correction(pos), 6);
};
- debug_pt(F("1st point: "), probe_pt[0], normal.z * z1);
- debug_pt(F("2nd point: "), probe_pt[1], normal.z * z2);
- debug_pt(F("3rd point: "), probe_pt[2], normal.z * z3);
- d_from(); DEBUG_ECHOPGM("safe home with Z=");
- DEBUG_ECHOLNPAIR_F("0 : ", normed(safe_homing_xy, 0), 6);
- d_from(); DEBUG_ECHOPGM("safe home with Z=");
- DEBUG_ECHOLNPAIR_F("mesh value ", normed(safe_homing_xy, get_z_correction(safe_homing_xy)), 6);
- DEBUG_ECHOPGM(" Z error = (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT);
- DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(safe_homing_xy), 6);
+ debug_pt(1, probe_pt[0], normal.z * gotz[0]);
+ debug_pt(2, probe_pt[1], normal.z * gotz[1]);
+ debug_pt(3, probe_pt[2], normal.z * gotz[2]);
+ #if ENABLED(Z_SAFE_HOMING)
+ constexpr xy_float_t safe_xy = { Z_SAFE_HOMING_X_POINT, Z_SAFE_HOMING_Y_POINT };
+ d_from(); DEBUG_ECHOPGM("safe home with Z=");
+ DEBUG_ECHOLNPAIR_F("0 : ", normed(safe_xy, 0), 6);
+ d_from(); DEBUG_ECHOPGM("safe home with Z=");
+ DEBUG_ECHOLNPAIR_F("mesh value ", normed(safe_xy, get_z_correction(safe_xy)), 6);
+ DEBUG_ECHOPGM(" Z error = (", Z_SAFE_HOMING_X_POINT, ",", Z_SAFE_HOMING_Y_POINT);
+ DEBUG_ECHOLNPAIR_F(") = ", get_z_correction(safe_xy), 6);
+ #endif
#endif
} // DEBUGGING(LEVELING)
From ae4fa0ab685f80124a9d183e28c7beae4234edaf Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Fri, 17 Mar 2023 00:22:26 +0000
Subject: [PATCH 032/225] [cron] Bump distribution date (2023-03-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 922cdfeeb4..eb0bc31d9f 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 "2023-03-16"
+//#define STRING_DISTRIBUTION_DATE "2023-03-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 a2c451f900..62d7817606 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 "2023-03-16"
+ #define STRING_DISTRIBUTION_DATE "2023-03-17"
#endif
/**
From 89e8257008507821543af8811ab78ef0365b2741 Mon Sep 17 00:00:00 2001
From: jamespearson04
Date: Fri, 17 Mar 2023 01:06:55 +0000
Subject: [PATCH 033/225] =?UTF-8?q?=F0=9F=9A=B8=20Refinements=20for=20UBL?=
=?UTF-8?q?=20G29=20J=20(tilt=20mesh)=20(#25486)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration.h | 3 ++
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 45 ++++++++++++++++-----
Marlin/src/inc/Conditionals_post.h | 8 ++--
Marlin/src/module/probe.h | 4 ++
buildroot/tests/mega2560 | 3 +-
5 files changed, 47 insertions(+), 16 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 40f4fe4cbd..4d6f64e874 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -2054,6 +2054,9 @@
//#define UBL_HILBERT_CURVE // Use Hilbert distribution for less travel when probing multiple points
+ //#define UBL_TILT_ON_MESH_POINTS // Use nearest mesh points with G29 J for better Z reference
+ //#define UBL_TILT_ON_MESH_POINTS_3POINT // Use nearest mesh points with G29 J0 (3-point)
+
#define UBL_MESH_EDIT_MOVES_Z // Sophisticated users prefer no movement of nozzle
#define UBL_SAVE_ACTIVE_ON_M500 // Save the currently active mesh in the current slot on M500
diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
index e504379848..7b9783bfac 100644
--- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
+++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
@@ -1489,6 +1489,14 @@ void unified_bed_leveling::smart_fill_mesh() {
xy_float_t points[3];
probe.get_three_points(points);
+ #if ENABLED(UBL_TILT_ON_MESH_POINTS_3POINT)
+ mesh_index_pair cpos[3];
+ LOOP_L_N(ix, 3) { // Convert points to coordinates of mesh points
+ cpos[ix] = find_closest_mesh_point_of_type(REAL, points[ix], true);
+ points[ix] = cpos[ix].meshpos();
+ }
+ #endif
+
#if ENABLED(VALIDATE_MESH_TILT)
float gotz[3]; // Used for algorithm validation below
#endif
@@ -1500,7 +1508,7 @@ void unified_bed_leveling::smart_fill_mesh() {
measured_z = probe.probe_at_point(points[i], i < 2 ? PROBE_PT_RAISE : PROBE_PT_LAST_STOW, param.V_verbosity);
if ((abort_flag = isnan(measured_z))) break;
- measured_z -= get_z_correction(points[i]);
+ measured_z -= TERN(UBL_TILT_ON_MESH_POINTS_3POINT, z_values[cpos[i].pos.x][cpos[i].pos.y], get_z_correction(points[i]));
TERN_(VALIDATE_MESH_TILT, gotz[i] = measured_z);
if (param.V_verbosity > 3) { serial_spaces(16); SERIAL_ECHOLNPGM("Corrected_Z=", measured_z); }
@@ -1518,16 +1526,14 @@ void unified_bed_leveling::smart_fill_mesh() {
}
else { // !do_3_pt_leveling
- #ifdef G29J_MESH_TILT_MARGIN
- const float x_min = _MAX(probe.min_x() + (G29J_MESH_TILT_MARGIN), X_MIN_POS),
- x_max = _MIN(probe.max_x() - (G29J_MESH_TILT_MARGIN), X_MAX_POS),
- y_min = _MAX(probe.min_y() + (G29J_MESH_TILT_MARGIN), Y_MIN_POS),
- y_max = _MIN(probe.max_y() - (G29J_MESH_TILT_MARGIN), Y_MAX_POS);
- #else
- const float x_min = probe.min_x(), x_max = probe.max_x(),
- y_min = probe.min_y(), y_max = probe.max_y();
+ #ifndef G29J_MESH_TILT_MARGIN
+ #define G29J_MESH_TILT_MARGIN 0
#endif
- const float dx = (x_max - x_min) / (param.J_grid_size - 1),
+ const float x_min = _MAX((X_MIN_POS) + (G29J_MESH_TILT_MARGIN), MESH_MIN_X, probe.min_x()),
+ x_max = _MIN((X_MAX_POS) - (G29J_MESH_TILT_MARGIN), MESH_MAX_X, probe.max_x()),
+ y_min = _MAX((Y_MIN_POS) + (G29J_MESH_TILT_MARGIN), MESH_MIN_Y, probe.min_y()),
+ y_max = _MIN((Y_MAX_POS) - (G29J_MESH_TILT_MARGIN), MESH_MAX_Y, probe.max_y()),
+ dx = (x_max - x_min) / (param.J_grid_size - 1),
dy = (y_max - y_min) / (param.J_grid_size - 1);
bool zig_zag = false;
@@ -1541,6 +1547,17 @@ void unified_bed_leveling::smart_fill_mesh() {
LOOP_L_N(iy, param.J_grid_size) {
rpos.y = y_min + dy * (zig_zag ? param.J_grid_size - 1 - iy : iy);
+ #if ENABLED(UBL_TILT_ON_MESH_POINTS)
+ #if ENABLED(DEBUG_LEVELING_FEATURE)
+ xy_pos_t oldRpos;
+ if (DEBUGGING(LEVELING)) oldRpos = rpos;
+ #endif
+ mesh_index_pair cpos;
+ rpos -= probe.offset;
+ cpos = find_closest_mesh_point_of_type(REAL, rpos, true);
+ rpos = cpos.meshpos();
+ #endif
+
SERIAL_ECHOLNPGM("Tilting mesh point ", point_num, "/", total_points, "\n");
TERN_(HAS_STATUS_MESSAGE, ui.status_printf(0, F(S_FMT " %i/%i"), GET_TEXT(MSG_LCD_TILTING_MESH), point_num, total_points));
@@ -1548,11 +1565,17 @@ void unified_bed_leveling::smart_fill_mesh() {
if ((abort_flag = isnan(measured_z))) break;
- const float zcorr = get_z_correction(rpos);
+ const float zcorr = TERN(UBL_TILT_ON_MESH_POINTS, z_values[cpos.pos.x][cpos.pos.y], get_z_correction(rpos));
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
const xy_pos_t lpos = rpos.asLogical();
+ #if ENABLED(UBL_TILT_ON_MESH_POINTS)
+ const xy_pos_t oldLpos = oldRpos.asLogical();
+ DEBUG_ECHOPGM("Calculated point: ("); DEBUG_ECHO_F(oldRpos.x, 7); DEBUG_CHAR(','); DEBUG_ECHO_F(oldRpos.y, 7);
+ DEBUG_ECHOPAIR_F(") logical: (", oldLpos.x, 7); DEBUG_CHAR(','); DEBUG_ECHO_F(oldLpos.y, 7);
+ DEBUG_ECHOPGM(")\nSelected mesh point: ");
+ #endif
DEBUG_CHAR('('); DEBUG_ECHO_F(rpos.x, 7); DEBUG_CHAR(','); DEBUG_ECHO_F(rpos.y, 7);
DEBUG_ECHOPAIR_F(") logical: (", lpos.x, 7); DEBUG_CHAR(','); DEBUG_ECHO_F(lpos.y, 7);
DEBUG_ECHOPAIR_F(") measured: ", measured_z, 7);
diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h
index 9305e86594..c41f87c859 100644
--- a/Marlin/src/inc/Conditionals_post.h
+++ b/Marlin/src/inc/Conditionals_post.h
@@ -3156,14 +3156,14 @@
// Probing points may be verified at compile time within the radius
// using static_assert(HYPOT2(X2-X1,Y2-Y1)<=sq(PRINTABLE_RADIUS),"bad probe point!")
// so that may be added to SanityCheck.h in the future.
- #define _MESH_MIN_X (X_MIN_BED + MESH_INSET)
- #define _MESH_MIN_Y (Y_MIN_BED + MESH_INSET)
+ #define _MESH_MIN_X (X_MIN_BED + (MESH_INSET))
+ #define _MESH_MIN_Y (Y_MIN_BED + (MESH_INSET))
#define _MESH_MAX_X (X_MAX_BED - (MESH_INSET))
#define _MESH_MAX_Y (Y_MAX_BED - (MESH_INSET))
#else
// Boundaries for Cartesian probing based on set limits
- #define _MESH_MIN_X (_MAX(X_MIN_BED + MESH_INSET, X_MIN_POS)) // UBL is careful not to probe off the bed. It does not
- #define _MESH_MIN_Y (_MAX(Y_MIN_BED + MESH_INSET, Y_MIN_POS)) // need NOZZLE_TO_PROBE_OFFSET in the mesh dimensions
+ #define _MESH_MIN_X (_MAX(X_MIN_BED + (MESH_INSET), X_MIN_POS)) // UBL is careful not to probe off the bed. It doesn't
+ #define _MESH_MIN_Y (_MAX(Y_MIN_BED + (MESH_INSET), Y_MIN_POS)) // need NOZZLE_TO_PROBE_OFFSET in the mesh dimensions.
#define _MESH_MAX_X (_MIN(X_MAX_BED - (MESH_INSET), X_MAX_POS))
#define _MESH_MAX_Y (_MIN(Y_MAX_BED - (MESH_INSET), Y_MAX_POS))
#endif
diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h
index 42b6c4fe41..b50f79ed5d 100644
--- a/Marlin/src/module/probe.h
+++ b/Marlin/src/module/probe.h
@@ -307,6 +307,10 @@ public:
points[0] = xy_float_t({ (X_CENTER) + probe_radius() * COS0, (Y_CENTER) + probe_radius() * SIN0 });
points[1] = xy_float_t({ (X_CENTER) + probe_radius() * COS120, (Y_CENTER) + probe_radius() * SIN120 });
points[2] = xy_float_t({ (X_CENTER) + probe_radius() * COS240, (Y_CENTER) + probe_radius() * SIN240 });
+ #elif ENABLED(AUTO_BED_LEVELING_UBL)
+ points[0] = xy_float_t({ _MAX(MESH_MIN_X, min_x()), _MAX(MESH_MIN_Y, min_y()) });
+ points[1] = xy_float_t({ _MIN(MESH_MAX_X, max_x()), _MAX(MESH_MIN_Y, min_y()) });
+ points[2] = xy_float_t({ (_MAX(MESH_MIN_X, min_x()) + _MIN(MESH_MAX_X, max_x())) / 2, _MIN(MESH_MAX_Y, max_y()) });
#else
points[0] = xy_float_t({ min_x(), min_y() });
points[1] = xy_float_t({ max_x(), min_y() });
diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560
index 363c386a4e..daa9cc2fad 100755
--- a/buildroot/tests/mega2560
+++ b/buildroot/tests/mega2560
@@ -44,7 +44,8 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO LCD_LANGUAGE jp_kana DEFAULT_EJERK 10 \
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER LIGHTWEIGHT_UI SHOW_CUSTOM_BOOTSCREEN BOOT_MARLIN_LOGO_SMALL \
SET_PROGRESS_MANUALLY SET_PROGRESS_PERCENT PRINT_PROGRESS_SHOW_DECIMALS SHOW_REMAINING_TIME STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES \
SDSUPPORT LONG_FILENAME_WRITE_SUPPORT SDCARD_SORT_ALPHA NO_SD_AUTOSTART USB_FLASH_DRIVE_SUPPORT CANCEL_OBJECTS \
- Z_PROBE_SLED AUTO_BED_LEVELING_UBL UBL_HILBERT_CURVE RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT \
+ Z_PROBE_SLED AUTO_BED_LEVELING_UBL UBL_HILBERT_CURVE UBL_TILT_ON_MESH_POINTS UBL_TILT_ON_MESH_POINTS_3POINT \
+ RESTORE_LEVELING_AFTER_G28 DEBUG_LEVELING_FEATURE G26_MESH_VALIDATION ENABLE_LEVELING_FADE_HEIGHT \
EEPROM_SETTINGS EEPROM_CHITCHAT GCODE_MACROS CUSTOM_MENU_MAIN \
MULTI_NOZZLE_DUPLICATION CLASSIC_JERK LIN_ADVANCE QUICK_HOME \
NANODLP_Z_SYNC I2C_POSITION_ENCODERS M114_DETAIL \
From 6f5b7a8b265066249782cea6485fb9fd3839e424 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Sat, 18 Mar 2023 00:21:56 +0000
Subject: [PATCH 034/225] [cron] Bump distribution date (2023-03-18)
---
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 eb0bc31d9f..2938b98713 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 "2023-03-17"
+//#define STRING_DISTRIBUTION_DATE "2023-03-18"
/**
* 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 62d7817606..df04b198ac 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 "2023-03-17"
+ #define STRING_DISTRIBUTION_DATE "2023-03-18"
#endif
/**
From b5836b243ac9321841daa9380d55b298375aaa2e Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 17 Mar 2023 20:12:36 -0500
Subject: [PATCH 035/225] =?UTF-8?q?=F0=9F=94=A7=20Optional=20MPC=5FAUTOTUN?=
=?UTF-8?q?E=20to=20save=205.5=20-=205.8KB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration.h | 1 +
Marlin/src/core/language.h | 7 +-
Marlin/src/gcode/temp/M306.cpp | 19 ++--
Marlin/src/inc/Conditionals_LCD.h | 4 +
Marlin/src/inc/Conditionals_post.h | 2 +-
Marlin/src/inc/SanityCheck.h | 4 +
Marlin/src/lcd/e3v2/proui/dwin.cpp | 125 ++++++++++++++++-----------
Marlin/src/lcd/e3v2/proui/dwin.h | 10 ++-
Marlin/src/module/temperature.cpp | 10 +--
Marlin/src/module/temperature.h | 2 +-
buildroot/tests/BIGTREE_GTR_V1_0 | 2 +-
buildroot/tests/STM32F103RE_creality | 2 +-
12 files changed, 109 insertions(+), 79 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 4d6f64e874..82b107ae44 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -691,6 +691,7 @@
* @section mpctemp
*/
#if ENABLED(MPCTEMP)
+ //#define MPC_AUTOTUNE // Include a method to do MPC auto-tuning (~5664-5882 bytes of flash)
//#define MPC_EDIT_MENU // Add MPC editing to the "Advanced Settings" menu. (~1300 bytes of flash)
//#define MPC_AUTOTUNE_MENU // Add MPC auto-tuning to the "Advanced Settings" menu. (~350 bytes of flash)
diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h
index d231a7d3e9..bf309293ac 100644
--- a/Marlin/src/core/language.h
+++ b/Marlin/src/core/language.h
@@ -230,10 +230,9 @@
#define STR_PID_DEBUG_INPUT ": Input "
#define STR_PID_DEBUG_OUTPUT " Output "
#define STR_INVALID_EXTRUDER_NUM " - Invalid extruder number !"
-#define STR_MPC_AUTOTUNE "MPC Autotune"
-#define STR_MPC_AUTOTUNE_START " start for " STR_E
-#define STR_MPC_AUTOTUNE_INTERRUPTED " interrupted!"
-#define STR_MPC_AUTOTUNE_FINISHED " finished! Put the constants below into Configuration.h"
+#define STR_MPC_AUTOTUNE_START "MPC Autotune start for " STR_E
+#define STR_MPC_AUTOTUNE_INTERRUPTED "MPC Autotune interrupted!"
+#define STR_MPC_AUTOTUNE_FINISHED "MPC Autotune finished! Put the constants below into Configuration.h"
#define STR_MPC_COOLING_TO_AMBIENT "Cooling to ambient"
#define STR_MPC_HEATING_PAST_200 "Heating to over 200C"
#define STR_MPC_MEASURING_AMBIENT "Measuring ambient heatloss at "
diff --git a/Marlin/src/gcode/temp/M306.cpp b/Marlin/src/gcode/temp/M306.cpp
index 928f375c38..d0c005ea4e 100644
--- a/Marlin/src/gcode/temp/M306.cpp
+++ b/Marlin/src/gcode/temp/M306.cpp
@@ -33,8 +33,6 @@
*
* E Extruder index. (Default: Active Extruder)
*
- * T Autotune the specified or active extruder.
- *
* Set MPC values manually for the specified or active extruder:
* A Ambient heat transfer coefficient (no fan).
* C Block heat capacity.
@@ -42,6 +40,9 @@
* H Filament heat capacity per mm.
* P Heater power.
* R Sensor responsiveness (= transfer coefficient / heat capcity).
+ *
+ * With MPC_AUTOTUNE:
+ * T Autotune the specified or active extruder.
*/
void GcodeSuite::M306() {
@@ -51,12 +52,14 @@ void GcodeSuite::M306() {
return;
}
- if (parser.seen_test('T')) {
- LCD_MESSAGE(MSG_MPC_AUTOTUNE);
- thermalManager.MPC_autotune(e);
- ui.reset_status();
- return;
- }
+ #if ENABLED(MPC_AUTOTUNE)
+ if (parser.seen_test('T')) {
+ LCD_MESSAGE(MSG_MPC_AUTOTUNE);
+ thermalManager.MPC_autotune(e);
+ ui.reset_status();
+ return;
+ }
+ #endif
if (parser.seen("ACFPRH")) {
MPC_t &mpc = thermalManager.temp_hotend[e].mpc;
diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h
index 0031e17eea..dc9849399c 100644
--- a/Marlin/src/inc/Conditionals_LCD.h
+++ b/Marlin/src/inc/Conditionals_LCD.h
@@ -1471,6 +1471,10 @@
#define HAS_PID_DEBUG 1
#endif
+#if DISABLED(MPC_AUTOTUNE)
+ #undef MPC_AUTOTUNE_MENU
+#endif
+
/**
* TFT Displays
*
diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h
index c41f87c859..a054f90840 100644
--- a/Marlin/src/inc/Conditionals_post.h
+++ b/Marlin/src/inc/Conditionals_post.h
@@ -2499,7 +2499,7 @@
#if EITHER(PIDTEMP, PIDTEMPBED)
#define DWIN_PID_TUNE 1
#endif
- #if EITHER(DWIN_PID_TUNE, MPCTEMP) && DISABLED(DISABLE_TUNING_GRAPH)
+ #if EITHER(DWIN_PID_TUNE, MPC_AUTOTUNE) && DISABLED(DISABLE_TUNING_GRAPH)
#define SHOW_TUNING_GRAPH 1
#endif
#endif
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index a795bfb93f..cd4c4efee2 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -1560,6 +1560,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
*/
#if BOTH(PIDTEMP, MPCTEMP)
#error "Only enable PIDTEMP or MPCTEMP, but not both."
+ #undef MPCTEMP
+ #undef MPC_AUTOTUNE
+ #undef MPC_EDIT_MENU
+ #undef MPC_AUTOTUNE_MENU
#endif
#if ENABLED(MPC_INCLUDE_FAN)
diff --git a/Marlin/src/lcd/e3v2/proui/dwin.cpp b/Marlin/src/lcd/e3v2/proui/dwin.cpp
index 6be56b0ded..b0d1fb3ff6 100644
--- a/Marlin/src/lcd/e3v2/proui/dwin.cpp
+++ b/Marlin/src/lcd/e3v2/proui/dwin.cpp
@@ -266,7 +266,7 @@ MenuClass *MaxAccelMenu = nullptr;
MenuClass *MaxJerkMenu = nullptr;
#endif
MenuClass *StepsMenu = nullptr;
-#if ENABLED(MPCTEMP)
+#if EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
MenuClass *HotendMPCMenu = nullptr;
#endif
#if ENABLED(PIDTEMP)
@@ -1480,46 +1480,59 @@ void DWIN_LevelingDone() {
DWINUI::ClearMainArea();
Draw_Popup_Bkgd();
- #if ENABLED(MPCTEMP)
+ switch (HMI_value.pidresult) {
+ default: return;
+ #if ENABLED(MPC_AUTOTUNE)
+ case MPCTEMP_START:
+ DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_MPC_AUTOTUNE));
+ DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius"));
+ break;
+ #endif
+ #if EITHER(PIDTEMP, PIDTEMPBED)
+ TERN_(PIDTEMP, case PIDTEMP_START:)
+ TERN_(PIDTEMPBED, case PIDTEMPBED_START:)
+ DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE));
+ DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius"));
+ break;
+ #endif
+ }
- switch (HMI_value.pidresult) {
+ switch (HMI_value.pidresult) {
+ default: break;
+ #if EITHER(PIDTEMP, MPC_AUTOTUNE)
+ TERN_(PIDTEMP, case PIDTEMP_START:)
+ TERN_(MPC_AUTOTUNE, case MPCTEMP_START:)
+ DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running."));
+ break;
+ #endif
+ #if ENABLED(PIDTEMPBED)
+ case PIDTEMPBED_START:
+ DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running."));
+ break;
+ #endif
+ }
+
+ switch (HMI_value.pidresult) {
+ default: break;
+ #if ENABLED(MPC_AUTOTUNE)
case MPCTEMP_START:
_maxtemp = thermalManager.hotend_maxtemp[0];
_target = 200;
- DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_MPC_AUTOTUNE));
- DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("MPC target: Celsius"));
- DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running."));
break;
- case PIDTEMPBED_START:
- _maxtemp = BED_MAXTEMP;
- _target = HMI_data.BedPidT;
- DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE));
- DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius"));
- DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running."));
- break;
- default: return;
- }
-
- #else // PID
-
- DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 100, GET_TEXT_F(MSG_PID_AUTOTUNE));
- DWINUI::Draw_String(HMI_data.PopupTxt_Color, gfrm.x, gfrm.y - DWINUI::fontHeight() - 4, F("PID target: Celsius"));
-
- switch (HMI_value.pidresult) {
+ #endif
+ #if ENABLED(PIDTEMP)
case PIDTEMP_START:
_maxtemp = thermalManager.hotend_maxtemp[0];
_target = HMI_data.HotendPidT;
- DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for Nozzle is running."));
break;
+ #endif
+ #if ENABLED(PIDTEMPBED)
case PIDTEMPBED_START:
_maxtemp = BED_MAXTEMP;
_target = HMI_data.BedPidT;
- DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 120, F("for BED is running."));
break;
- default: return;
- }
-
- #endif // PID
+ #endif
+ }
plot.Draw(gfrm, _maxtemp, _target);
DWINUI::Draw_Int(HMI_data.PopupTxt_Color, 3, gfrm.x + 90, gfrm.y - DWINUI::fontHeight() - 4, _target);
@@ -1587,7 +1600,7 @@ void DWIN_LevelingDone() {
#endif // DWIN_PID_TUNE
-#if ENABLED(MPCTEMP)
+#if ENABLED(MPC_AUTOTUNE)
void DWIN_MPCTuning(tempcontrol_t result) {
HMI_value.pidresult = result;
@@ -1607,7 +1620,7 @@ void DWIN_LevelingDone() {
break;
case MPC_INTERRUPTED:
checkkey = last_checkkey;
- DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), F(STR_MPC_AUTOTUNE STR_MPC_AUTOTUNE_INTERRUPTED));
+ DWIN_Popup_Confirm(ICON_TempTooHigh, GET_TEXT_F(MSG_ERROR), F(STR_MPC_AUTOTUNE_INTERRUPTED));
ui.reset_alert_level();
break;
case MPC_DONE:
@@ -1622,7 +1635,7 @@ void DWIN_LevelingDone() {
}
}
-#endif // MPCTEMP
+#endif // MPC_AUTOTUNE
// Started a Print Job
void DWIN_Print_Started() {
@@ -3090,8 +3103,8 @@ void Draw_AdvancedSettings_Menu() {
#if ENABLED(PIDTEMP)
MENU_ITEM_F(ICON_PIDNozzle, STR_HOTEND_PID " Settings", onDrawSubMenu, Draw_HotendPID_Menu);
#endif
- #if ENABLED(MPCTEMP)
- MENU_ITEM_F(ICON_MPCNozzle, STR_MPC_AUTOTUNE " Settings", onDrawSubMenu, Draw_HotendMPC_Menu);
+ #if EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
+ MENU_ITEM_F(ICON_MPCNozzle, "MPC Settings", onDrawSubMenu, Draw_HotendMPC_Menu);
#endif
#if ENABLED(PIDTEMPBED)
MENU_ITEM_F(ICON_PIDBed, STR_BED_PID " Settings", onDrawSubMenu, Draw_BedPID_Menu);
@@ -3524,37 +3537,45 @@ void Draw_Steps_Menu() {
#endif
-#if ENABLED(MPCTEMP)
+#if EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
- void HotendMPC() { thermalManager.MPC_autotune(active_extruder); }
- void SetHeaterPower() { SetPFloatOnClick(1, 200, 1); }
- void SetBlkHeatCapacity() { SetPFloatOnClick(0, 40, 2); }
- void SetSensorRespons() { SetPFloatOnClick(0, 1, 4); }
- void SetAmbientXfer() { SetPFloatOnClick(0, 1, 4); }
- #if ENABLED(MPC_INCLUDE_FAN)
- void onDrawFanAdj(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 4, thermalManager.temp_hotend[0].fanCoefficient()); }
- void ApplyFanAdj() { thermalManager.temp_hotend[0].applyFanAdjustment(MenuData.Value / POW(10, 4)); }
- void SetFanAdj() { SetFloatOnClick(0, 1, 4, thermalManager.temp_hotend[0].fanCoefficient(), ApplyFanAdj); }
+ #if ENABLED(MPC_AUTOTUNE_MENU)
+ void HotendMPC() { thermalManager.MPC_autotune(active_extruder); }
+ #endif
+ #if ENABLED(MPC_EDIT_MENU)
+ void SetHeaterPower() { SetPFloatOnClick(1, 200, 1); }
+ void SetBlkHeatCapacity() { SetPFloatOnClick(0, 40, 2); }
+ void SetSensorResponse() { SetPFloatOnClick(0, 1, 4); }
+ void SetAmbientXfer() { SetPFloatOnClick(0, 1, 4); }
+ #if ENABLED(MPC_INCLUDE_FAN)
+ void onDrawFanAdj(MenuItemClass* menuitem, int8_t line) { onDrawFloatMenu(menuitem, line, 4, thermalManager.temp_hotend[0].fanCoefficient()); }
+ void ApplyFanAdj() { thermalManager.temp_hotend[0].applyFanAdjustment(MenuData.Value / POW(10, 4)); }
+ void SetFanAdj() { SetFloatOnClick(0, 1, 4, thermalManager.temp_hotend[0].fanCoefficient(), ApplyFanAdj); }
+ #endif
#endif
void Draw_HotendMPC_Menu() {
checkkey = Menu;
- if (SET_MENU_F(HotendMPCMenu, STR_MPC_AUTOTUNE " Settings", 7)) {
+ if (SET_MENU_F(HotendMPCMenu, "MPC Settings", 7)) {
MPC_t &mpc = thermalManager.temp_hotend[0].mpc;
BACK_ITEM(Draw_AdvancedSettings_Menu);
- MENU_ITEM(ICON_MPCNozzle, MSG_MPC_AUTOTUNE, onDrawMenuItem, HotendMPC);
- EDIT_ITEM(ICON_MPCHeater, MSG_MPC_POWER, onDrawPFloatMenu, SetHeaterPower, &mpc.heater_power);
- EDIT_ITEM(ICON_MPCHeatCap, MSG_MPC_BLOCK_HEAT_CAPACITY, onDrawPFloat2Menu, SetBlkHeatCapacity, &mpc.block_heat_capacity);
- EDIT_ITEM(ICON_MPCValue, MSG_SENSOR_RESPONSIVENESS, onDrawPFloat4Menu, SetSensorRespons, &mpc.sensor_responsiveness);
- EDIT_ITEM(ICON_MPCValue, MSG_MPC_AMBIENT_XFER_COEFF, onDrawPFloat4Menu, SetAmbientXfer, &mpc.ambient_xfer_coeff_fan0);
- #if ENABLED(MPC_INCLUDE_FAN)
- EDIT_ITEM(ICON_MPCFan, MSG_MPC_AMBIENT_XFER_COEFF_FAN, onDrawFanAdj, SetFanAdj, &mpc.fan255_adjustment);
+ #if ENABLED(MPC_AUTOTUNE_MENU)
+ MENU_ITEM(ICON_MPCNozzle, MSG_MPC_AUTOTUNE, onDrawMenuItem, HotendMPC);
+ #endif
+ #if ENABLED(MPC_EDIT_MENU)
+ EDIT_ITEM(ICON_MPCHeater, MSG_MPC_POWER, onDrawPFloatMenu, SetHeaterPower, &mpc.heater_power);
+ EDIT_ITEM(ICON_MPCHeatCap, MSG_MPC_BLOCK_HEAT_CAPACITY, onDrawPFloat2Menu, SetBlkHeatCapacity, &mpc.block_heat_capacity);
+ EDIT_ITEM(ICON_MPCValue, MSG_SENSOR_RESPONSIVENESS, onDrawPFloat4Menu, SetSensorResponse, &mpc.sensor_responsiveness);
+ EDIT_ITEM(ICON_MPCValue, MSG_MPC_AMBIENT_XFER_COEFF, onDrawPFloat4Menu, SetAmbientXfer, &mpc.ambient_xfer_coeff_fan0);
+ #if ENABLED(MPC_INCLUDE_FAN)
+ EDIT_ITEM(ICON_MPCFan, MSG_MPC_AMBIENT_XFER_COEFF_FAN, onDrawFanAdj, SetFanAdj, &mpc.fan255_adjustment);
+ #endif
#endif
}
UpdateMenu(HotendMPCMenu);
}
-#endif // MPCTEMP
+#endif // MPC_EDIT_MENU || MPC_AUTOTUNE_MENU
#if ENABLED(PIDTEMPBED)
diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h
index 112df5cae1..4197da4390 100644
--- a/Marlin/src/lcd/e3v2/proui/dwin.h
+++ b/Marlin/src/lcd/e3v2/proui/dwin.h
@@ -74,7 +74,7 @@ enum processID : uint8_t {
NothingToDo
};
-#if EITHER(DWIN_PID_TUNE, MPCTEMP)
+#if EITHER(DWIN_PID_TUNE, MPC_AUTOTUNE)
enum tempcontrol_t : uint8_t {
#if DWIN_PID_TUNE
@@ -85,7 +85,7 @@ enum processID : uint8_t {
PID_TEMP_TOO_HIGH,
PID_TUNING_TIMEOUT,
#endif
- #if ENABLED(MPCTEMP)
+ #if ENABLED(MPC_AUTOTUNE)
MPC_DONE,
MPCTEMP_START,
MPC_TEMP_ERROR,
@@ -384,7 +384,9 @@ void Draw_Steps_Menu();
#endif
// MPC
-#if ENABLED(MPCTEMP)
- void DWIN_MPCTuning(tempcontrol_t result);
+#if EITHER(MPC_EDIT_MENU, MPC_AUTOTUNE_MENU)
void Draw_HotendMPC_Menu();
#endif
+#if ENABLED(MPC_AUTOTUNE)
+ void DWIN_MPCTuning(tempcontrol_t result);
+#endif
diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index b572690256..bc978077f0 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -580,7 +580,6 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
volatile bool Temperature::raw_temps_ready = false;
-
#if ENABLED(MPCTEMP)
int32_t Temperature::mpc_e_position; // = 0
#endif
@@ -925,7 +924,7 @@ volatile bool Temperature::raw_temps_ready = false;
#endif // HAS_PID_HEATING
-#if ENABLED(MPCTEMP)
+#if ENABLED(MPC_AUTOTUNE)
#if EITHER(MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND)
#define SINGLEFAN 1
@@ -951,7 +950,6 @@ volatile bool Temperature::raw_temps_ready = false;
TERN(DWIN_CREALITY_LCD, DWIN_Update(), ui.update());
if (!wait_for_heatup) {
- SERIAL_ECHOPGM(STR_MPC_AUTOTUNE);
SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_INTERRUPTED);
TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_INTERRUPTED));
return true;
@@ -981,7 +979,6 @@ volatile bool Temperature::raw_temps_ready = false;
}
} on_exit(e);
- SERIAL_ECHOPGM(STR_MPC_AUTOTUNE);
SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_START, e);
MPCHeaterInfo &hotend = temp_hotend[e];
MPC_t &mpc = hotend.mpc;
@@ -1150,7 +1147,6 @@ volatile bool Temperature::raw_temps_ready = false;
mpc.block_heat_capacity = mpc.ambient_xfer_coeff_fan0 / block_responsiveness;
mpc.sensor_responsiveness = block_responsiveness / (1.0f - (ambient_temp - asymp_temp) * exp(-block_responsiveness * t1_time) / (t1 - asymp_temp));
- SERIAL_ECHOPGM(STR_MPC_AUTOTUNE);
SERIAL_ECHOLNPGM(STR_MPC_AUTOTUNE_FINISHED);
TERN_(DWIN_LCD_PROUI, DWIN_MPCTuning(MPC_DONE));
@@ -1171,7 +1167,7 @@ volatile bool Temperature::raw_temps_ready = false;
TERN_(HAS_FAN, SERIAL_ECHOLNPAIR_F("MPC_AMBIENT_XFER_COEFF_FAN255 ", ambient_xfer_coeff_fan255, 4));
}
-#endif // MPCTEMP
+#endif // MPC_AUTOTUNE
int16_t Temperature::getHeaterPower(const heater_id_t heater_id) {
switch (heater_id) {
@@ -1509,7 +1505,7 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
const int32_t e_position = stepper.position(E_AXIS);
const float e_speed = (e_position - mpc_e_position) * planner.mm_per_step[E_AXIS] / MPC_dT;
- // The position can appear to make big jumps when, e.g. homing
+ // The position can appear to make big jumps when, e.g., homing
if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS])
mpc_e_position = e_position;
else if (e_speed > 0.0f) { // Ignore retract/recover moves
diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h
index b7f388cbb6..4178973a9d 100644
--- a/Marlin/src/module/temperature.h
+++ b/Marlin/src/module/temperature.h
@@ -1194,7 +1194,7 @@ class Temperature {
#endif
- #if ENABLED(MPCTEMP)
+ #if ENABLED(MPC_AUTOTUNE)
void MPC_autotune(const uint8_t e);
#endif
diff --git a/buildroot/tests/BIGTREE_GTR_V1_0 b/buildroot/tests/BIGTREE_GTR_V1_0
index e0769b6a10..8f69f5b069 100755
--- a/buildroot/tests/BIGTREE_GTR_V1_0
+++ b/buildroot/tests/BIGTREE_GTR_V1_0
@@ -40,7 +40,7 @@ opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 SERIAL_PORT -1 \
MPC_AMBIENT_XFER_COEFF '{ 0.068f, 0.068f, 0.068f }' \
MPC_AMBIENT_XFER_COEFF_FAN255 '{ 0.097f, 0.097f, 0.097f }' \
FILAMENT_HEAT_CAPACITY_PERMM '{ 5.6e-3f, 3.6e-3f, 5.6e-3f }'
-opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR MPCTEMP MPC_EDIT_MENU MPC_AUTOTUNE_MENU
+opt_enable SWITCHING_TOOLHEAD TOOL_SENSOR MPCTEMP MPC_EDIT_MENU MPC_AUTOTUNE MPC_AUTOTUNE_MENU
opt_disable PIDTEMP
exec_test $1 $2 "BigTreeTech GTR | MPC | Switching Toolhead | Tool Sensors" "$3"
diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality
index 8910db0017..a05f1d96be 100755
--- a/buildroot/tests/STM32F103RE_creality
+++ b/buildroot/tests/STM32F103RE_creality
@@ -28,7 +28,7 @@ opt_set PREHEAT_3_LABEL '"CUSTOM"' PREHEAT_3_TEMP_HOTEND 240 PREHEAT_3_TEMP_BED
exec_test $1 $2 "Ender-3 S1 with ProUI (PIDTEMP)" "$3"
opt_disable PIDTEMP
-opt_enable MPCTEMP
+opt_enable MPCTEMP MPC_AUTOTUNE
exec_test $1 $2 "Ender-3 S1 with ProUI (MPCTEMP)" "$3"
restore_configs
From c914761327077cb0e715171bd0fd5db741eafeb9 Mon Sep 17 00:00:00 2001
From: Michael Hill
Date: Sat, 18 Mar 2023 01:56:07 -0400
Subject: [PATCH 036/225] =?UTF-8?q?=E2=9C=A8=20Sovol=20v1.3.1=20(Sovol=20S?=
=?UTF-8?q?V06)=20(#25267)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/core/boards.h | 1 +
Marlin/src/inc/Warnings.cpp | 7 +
Marlin/src/pins/pins.h | 2 +
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 1 +
Marlin/src/pins/stm32f1/pins_SOVOL_V131.h | 236 ++++++++++++++++++
buildroot/share/PlatformIO/ldscripts/sovol.ld | 14 ++
ini/stm32f1-maple.ini | 14 ++
7 files changed, 275 insertions(+)
create mode 100644 Marlin/src/pins/stm32f1/pins_SOVOL_V131.h
create mode 100644 buildroot/share/PlatformIO/ldscripts/sovol.ld
diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h
index f861e8864f..8a1cec714e 100644
--- a/Marlin/src/core/boards.h
+++ b/Marlin/src/core/boards.h
@@ -381,6 +381,7 @@
#define BOARD_ZONESTAR_ZM3E4V2 5064 // Zonestar ZM3E4 V2 (STM32F103VC)
#define BOARD_ERYONE_ERY32_MINI 5065 // Eryone Ery32 mini (STM32F103VE)
#define BOARD_PANDA_PI_V29 5066 // Panda Pi V2.9 - Standalone (STM32F103RC)
+#define BOARD_SOVOL_V131 5067 // Sovol V1.3.1 (GD32F103RET6)
//
// ARM Cortex-M4F
diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp
index 184d1a08da..55b9a18e77 100644
--- a/Marlin/src/inc/Warnings.cpp
+++ b/Marlin/src/inc/Warnings.cpp
@@ -777,6 +777,13 @@
#warning "Define MK3_FAN_PINS to swap hotend and part cooling fan pins. (Define NO_MK3_FAN_PINS_WARNING to suppress this warning.)"
#endif
+/**
+ * GD32 is not exactly like STM32
+ */
+#if MB(SOVOL_V131)
+ #warning "GD32 based controllers may not be fully compatible with Maple Generic STM32F103RE. Please report any issues."
+#endif
+
/**
* BD Sensor should always include BABYSTEPPING
*/
diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index 721e037b8c..6269eecb0b 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -627,6 +627,8 @@
#include "stm32f1/pins_ERYONE_ERY32_MINI.h" // STM32F103VET6 env:ERYONE_ERY32_MINI_maple
#elif MB(PANDA_PI_V29)
#include "stm32f1/pins_PANDA_PI_V29.h" // STM32F103RCT6 env:PANDA_PI_V29
+#elif MB(SOVOL_V131)
+ #include "stm32f1/pins_SOVOL_V131.h" // GD32F1 env:GD32F103RET6_sovol_maple
//
// ARM Cortex-M4F
diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
index f633ee0983..7c4df3520c 100644
--- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
+++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
@@ -53,6 +53,7 @@
#if NO_EEPROM_SELECTED
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
//#define SDCARD_EEPROM_EMULATION
+ #undef NO_EEPROM_SELECTED
#endif
#if ENABLED(IIC_BL24CXX_EEPROM)
diff --git a/Marlin/src/pins/stm32f1/pins_SOVOL_V131.h b/Marlin/src/pins/stm32f1/pins_SOVOL_V131.h
new file mode 100644
index 0000000000..67b2944f45
--- /dev/null
+++ b/Marlin/src/pins/stm32f1/pins_SOVOL_V131.h
@@ -0,0 +1,236 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+/**
+ * Sovol 1.3.1 (GD32F103RET6) board pin assignments
+ */
+
+#include "env_validate.h"
+
+#if HOTENDS > 1 || E_STEPPERS > 1
+ #error "SOVOL V131 only supports 1 hotend / E-stepper."
+#endif
+
+#ifndef BOARD_INFO_NAME
+ #define BOARD_INFO_NAME "Sovol V131"
+#endif
+#ifndef DEFAULT_MACHINE_NAME
+ #define DEFAULT_MACHINE_NAME "Sovol SV06"
+#endif
+
+//#define BOARD_NO_NATIVE_USB
+
+//
+// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
+//
+#ifndef DISABLE_DEBUG
+ #define DISABLE_DEBUG
+#endif
+
+//
+// EEPROM
+//
+#if NO_EEPROM_SELECTED
+ #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
+ //#define SDCARD_EEPROM_EMULATION
+ #undef NO_EEPROM_SELECTED
+#endif
+
+#if ENABLED(IIC_BL24CXX_EEPROM)
+ #define IIC_EEPROM_SDA PA11
+ #define IIC_EEPROM_SCL PA12
+ #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
+#elif ENABLED(SDCARD_EEPROM_EMULATION)
+ #define MARLIN_EEPROM_SIZE 0x800 // 2K
+#endif
+
+//
+// Servos
+//
+#ifndef SERVO0_PIN
+ #ifndef HAS_PIN_27_BOARD
+ #define SERVO0_PIN PB0 // BLTouch OUT
+ #else
+ #define SERVO0_PIN PC6
+ #endif
+#endif
+
+//
+// Limit Switches
+//
+#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
+
+#ifndef Z_MIN_PROBE_PIN
+ #define Z_MIN_PROBE_PIN PB1 // BLTouch IN
+#endif
+
+//
+// Filament Runout Sensor
+//
+#ifndef FIL_RUNOUT_PIN
+ #define FIL_RUNOUT_PIN PA4 // "Pulled-high"
+#endif
+
+//
+// Steppers
+//
+#ifndef X_STEP_PIN
+ #define X_STEP_PIN PC2
+#endif
+#ifndef X_DIR_PIN
+ #define X_DIR_PIN PB9
+#endif
+#define X_ENABLE_PIN PC3 // Shared
+
+#ifndef Y_STEP_PIN
+ #define Y_STEP_PIN PB8
+#endif
+#ifndef Y_DIR_PIN
+ #define Y_DIR_PIN PB7
+#endif
+#define Y_ENABLE_PIN X_ENABLE_PIN
+
+#ifndef Z_STEP_PIN
+ #define Z_STEP_PIN PB6
+#endif
+#ifndef Z_DIR_PIN
+ #define Z_DIR_PIN PB5
+#endif
+#define Z_ENABLE_PIN X_ENABLE_PIN
+
+#ifndef E0_STEP_PIN
+ #define E0_STEP_PIN PB4
+#endif
+#ifndef E0_DIR_PIN
+ #define E0_DIR_PIN PB3
+#endif
+#define E0_ENABLE_PIN X_ENABLE_PIN
+
+#if HAS_TMC_UART
+
+ /**
+ * TMC2208/TMC2209 stepper drivers
+ *
+ * Hardware serial communication ports.
+ * If undefined software serial is used according to the pins below
+ */
+
+ #define X_SERIAL_TX_PIN PC1
+ #define X_SERIAL_RX_PIN PC1
+
+ #define Y_SERIAL_TX_PIN PC0
+ #define Y_SERIAL_RX_PIN PC0
+
+ #define Z_SERIAL_TX_PIN PA15
+ #define Z_SERIAL_RX_PIN PA15
+
+ #define E0_SERIAL_TX_PIN PC14
+ #define E0_SERIAL_RX_PIN PC14
+
+ // Reduce baud rate to improve software serial reliability
+ #define TMC_BAUD_RATE 19200
+
+#endif // HAS_TMC_UART
+
+//
+// Temperature Sensors
+//
+#define TEMP_0_PIN PC5 // TH1
+#define TEMP_BED_PIN PC4 // TB1
+
+//
+// Heaters / Fans
+//
+#ifndef HEATER_0_PIN
+ #define HEATER_0_PIN PA1 // HEATER1
+#endif
+#ifndef HEATER_BED_PIN
+ #define HEATER_BED_PIN PA2 // HOT BED
+#endif
+#ifndef FAN_PIN
+ #define FAN_PIN PA0 // FAN
+#endif
+#define FAN_SOFT_PWM_REQUIRED
+
+//
+// SD Card
+//
+#define SD_DETECT_PIN PC7
+#define SDCARD_CONNECTION ONBOARD
+#define ONBOARD_SPI_DEVICE 1
+#define ONBOARD_SD_CS_PIN PA4 // SDSS
+#define SDIO_SUPPORT
+#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
+
+#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
+ /**
+ * RET6 12864 LCD
+ * ------
+ * PC6 | 1 2 | PB2
+ * PB10 | 3 4 | PB11
+ * PB14 5 6 | PB13
+ * PB12 | 7 8 | PB15
+ * GND | 9 10 | 5V
+ * ------
+ */
+ #define EXP3_01_PIN PC6
+ #define EXP3_02_PIN PB2
+ #define EXP3_03_PIN PB10
+ #define EXP3_04_PIN PB11
+ #define EXP3_05_PIN PB14
+ #define EXP3_06_PIN PB13
+ #define EXP3_07_PIN PB12
+ #define EXP3_08_PIN PB15
+#endif
+
+#if ENABLED(CR10_STOCKDISPLAY)
+
+ #if ENABLED(RET6_12864_LCD)
+
+ #define LCD_PINS_RS EXP3_07_PIN
+ #define LCD_PINS_ENABLE EXP3_08_PIN
+ #define LCD_PINS_D4 EXP3_06_PIN
+
+ #define BTN_ENC EXP3_02_PIN
+ #define BTN_EN1 EXP3_03_PIN
+ #define BTN_EN2 EXP3_05_PIN
+
+ #ifndef HAS_PIN_27_BOARD
+ #define BEEPER_PIN EXP3_01_PIN
+ #endif
+
+ #else
+
+ #error "Only the RET6_12864_LCD variant of CR10_STOCKDISPLAY is supported."
+
+ #endif
+
+#endif
diff --git a/buildroot/share/PlatformIO/ldscripts/sovol.ld b/buildroot/share/PlatformIO/ldscripts/sovol.ld
new file mode 100644
index 0000000000..785345543c
--- /dev/null
+++ b/buildroot/share/PlatformIO/ldscripts/sovol.ld
@@ -0,0 +1,14 @@
+MEMORY
+{
+ ram (rwx) : ORIGIN = 0x20000000, LENGTH = 64K - 40
+ rom (rx) : ORIGIN = 0x08007000, LENGTH = 512K - 28K
+}
+
+/* Provide memory region aliases for common.inc */
+REGION_ALIAS("REGION_TEXT", rom);
+REGION_ALIAS("REGION_DATA", ram);
+REGION_ALIAS("REGION_BSS", ram);
+REGION_ALIAS("REGION_RODATA", rom);
+
+/* Let common.inc handle the real work. */
+INCLUDE common.inc
diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini
index be7966be9d..e223bdb4eb 100644
--- a/ini/stm32f1-maple.ini
+++ b/ini/stm32f1-maple.ini
@@ -392,3 +392,17 @@ board_build.variant = MARLIN_F103Vx
board_build.ldscript = eryone_ery32_mini.ld
board_build.address = 0x08004000
build_unflags = ${STM32F1_maple.build_unflags}
+
+#
+# Sovol (GD32F103RET6)
+#
+[env:GD32F103RET6_sovol_maple]
+extends = env:STM32F103RE_maple
+build_flags = ${STM32F1_maple.build_flags} -DTEMP_TIMER_CHAN=4
+board_build.address = 0x08007000
+board_build.ldscript = sovol.ld
+extra_scripts = ${STM32F1_maple.extra_scripts}
+ pre:buildroot/share/PlatformIO/scripts/random-bin.py
+ buildroot/share/PlatformIO/scripts/custom_board.py
+debug_tool = jlink
+upload_protocol = jlink
From f50603ff1d380f759addffd2e54ac008ebec5985 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 18 Mar 2023 01:22:50 -0500
Subject: [PATCH 037/225] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Mor?=
=?UTF-8?q?e=20IntelliSense-friendly=20declares?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/module/temperature.cpp | 16 ++++++++++++----
Marlin/src/module/temperature.h | 14 +++++++++-----
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index bc978077f0..bafade45dd 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -508,8 +508,12 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
// Init min and max temp with extreme values to prevent false errors during startup
raw_adc_t Temperature::mintemp_raw_BED = TEMP_SENSOR_BED_RAW_LO_TEMP,
Temperature::maxtemp_raw_BED = TEMP_SENSOR_BED_RAW_HI_TEMP;
- TERN_(WATCH_BED, bed_watch_t Temperature::watch_bed); // = { 0 }
- IF_DISABLED(PIDTEMPBED, millis_t Temperature::next_bed_check_ms);
+ #if WATCH_BED
+ bed_watch_t Temperature::watch_bed; // = { 0 }
+ #endif
+ #if DISABLED(PIDTEMPBED)
+ millis_t Temperature::next_bed_check_ms;
+ #endif
#endif
#if HAS_TEMP_CHAMBER
@@ -519,8 +523,12 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
celsius_float_t old_temp = 9999;
raw_adc_t Temperature::mintemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_LO_TEMP,
Temperature::maxtemp_raw_CHAMBER = TEMP_SENSOR_CHAMBER_RAW_HI_TEMP;
- TERN_(WATCH_CHAMBER, chamber_watch_t Temperature::watch_chamber{0});
- IF_DISABLED(PIDTEMPCHAMBER, millis_t Temperature::next_chamber_check_ms);
+ #if WATCH_CHAMBER
+ chamber_watch_t Temperature::watch_chamber; // = { 0 }
+ #endif
+ #if DISABLED(PIDTEMPCHAMBER)
+ millis_t Temperature::next_chamber_check_ms;
+ #endif
#endif
#endif
diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h
index 4178973a9d..b8bf03bf31 100644
--- a/Marlin/src/module/temperature.h
+++ b/Marlin/src/module/temperature.h
@@ -725,23 +725,27 @@ class Temperature {
#endif
#if HAS_HEATED_BED
- #if ENABLED(WATCH_BED)
+ #if WATCH_BED
static bed_watch_t watch_bed;
#endif
- IF_DISABLED(PIDTEMPBED, static millis_t next_bed_check_ms);
+ #if DISABLED(PIDTEMPBED)
+ static millis_t next_bed_check_ms;
+ #endif
static raw_adc_t mintemp_raw_BED, maxtemp_raw_BED;
#endif
#if HAS_HEATED_CHAMBER
- #if ENABLED(WATCH_CHAMBER)
+ #if WATCH_CHAMBER
static chamber_watch_t watch_chamber;
#endif
- TERN(PIDTEMPCHAMBER,,static millis_t next_chamber_check_ms);
+ #if DISABLED(PIDTEMPCHAMBER)
+ static millis_t next_chamber_check_ms;
+ #endif
static raw_adc_t mintemp_raw_CHAMBER, maxtemp_raw_CHAMBER;
#endif
#if HAS_COOLER
- #if ENABLED(WATCH_COOLER)
+ #if WATCH_COOLER
static cooler_watch_t watch_cooler;
#endif
static millis_t next_cooler_check_ms, cooler_fan_flush_ms;
From ce97e42aa0a385f52fc5814595274241f73184a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Davide=20Rombol=C3=A0?=
Date: Sat, 18 Mar 2023 07:33:57 +0100
Subject: [PATCH 038/225] =?UTF-8?q?=F0=9F=8E=A8=20Clean=20up=20IA=5FCREALI?=
=?UTF-8?q?TY=20includes=20(#25530)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp | 6 +-----
Marlin/src/lcd/extui/ia_creality/FileNavigator.h | 3 ---
Marlin/src/lcd/extui/ia_creality/creality_extui.cpp | 10 +---------
.../{creality_extui.h => ia_creality_extui.h} | 3 +--
4 files changed, 3 insertions(+), 19 deletions(-)
rename Marlin/src/lcd/extui/ia_creality/{creality_extui.h => ia_creality_extui.h} (99%)
diff --git a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
index 448d078cc4..4e2d294a9b 100644
--- a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
+++ b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
@@ -33,13 +33,11 @@
#if DGUS_LCD_UI_IA_CREALITY
+#include "ia_creality_extui.h"
#include "FileNavigator.h"
using namespace ExtUI;
-#define DEBUG_OUT ENABLED(DEBUG_DWIN)
-#include "../../../core/debug_out.h"
-
FileList FileNavigator::filelist; // Instance of the Marlin file API
char FileNavigator::currentfoldername[MAX_PATH_LEN]; // Current folder path
uint16_t FileNavigator::lastindex;
@@ -124,8 +122,6 @@ void FileNavigator::getFiles(uint16_t index) {
const int filelen = strlen(filelist.filename());
if (filelen > 20) {
char *buf = (char *)filelist.filename();
- //char buf[filelen];
- //strcpy(&buf[filelen], filelist.filename());
buf[18] = '\0'; // cutoff at screen edge
rtscheck.RTS_SndData(buf, (SDFILE_ADDR + (fcnt * 20)));
}
diff --git a/Marlin/src/lcd/extui/ia_creality/FileNavigator.h b/Marlin/src/lcd/extui/ia_creality/FileNavigator.h
index 29f5628455..28d97c6746 100644
--- a/Marlin/src/lcd/extui/ia_creality/FileNavigator.h
+++ b/Marlin/src/lcd/extui/ia_creality/FileNavigator.h
@@ -30,9 +30,6 @@
* Written by Insanity Automation
* ***************************************/
-#include "creality_extui.h"
-#include "../ui_api.h"
-
#define MAX_FOLDER_DEPTH 4 // Limit folder depth TFT has a limit for the file path
#define MAX_CMND_LEN 16 * MAX_FOLDER_DEPTH // Maximum Length for a Panel command
#define MAX_PATH_LEN 16 * MAX_FOLDER_DEPTH // Maximum number of characters in a SD file path
diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
index 15dcd84bb9..c9c064fdc8 100644
--- a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
+++ b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
@@ -34,16 +34,8 @@
#if DGUS_LCD_UI_IA_CREALITY
-#include "creality_extui.h"
+#include "ia_creality_extui.h"
#include "FileNavigator.h"
-#include "../ui_api.h"
-
-#include
-#include
-#include
-
-#define DEBUG_OUT ENABLED(DEBUG_DWIN)
-#include "../../../core/debug_out.h"
namespace ExtUI {
static uint16_t fileIndex = 0;
diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.h b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.h
similarity index 99%
rename from Marlin/src/lcd/extui/ia_creality/creality_extui.h
rename to Marlin/src/lcd/extui/ia_creality/ia_creality_extui.h
index 099f8c238a..0d93255663 100644
--- a/Marlin/src/lcd/extui/ia_creality/creality_extui.h
+++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.h
@@ -22,7 +22,7 @@
#pragma once
/* ****************************************
- * lcd/extui/ia_creality/creality_extui.h
+ * lcd/extui/ia_creality/ia_creality_extui.h
* ****************************************
* Extensible_UI implementation for Creality DWIN
* 10SPro, Max, CRX, and others
@@ -32,7 +32,6 @@
* ***************************************/
#include "string.h"
-#include
#include "../ui_api.h"
/*********************************/
From ac1e2d0fbcb96c27da6225233be1a28ef3b5ee01 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Davide=20Rombol=C3=A0?=
Date: Sat, 18 Mar 2023 07:35:54 +0100
Subject: [PATCH 039/225] =?UTF-8?q?=F0=9F=8E=A8=20Suppress=20warning=20(#2?=
=?UTF-8?q?5529)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/gcode/feature/trinamic/M569.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp
index db31fe3d8e..e0aa182bf2 100644
--- a/Marlin/src/gcode/feature/trinamic/M569.cpp
+++ b/Marlin/src/gcode/feature/trinamic/M569.cpp
@@ -53,6 +53,8 @@ static void set_stealth_status(const bool enable, const int8_t eindex) {
constexpr int8_t index = -1;
#endif
+ UNUSED(index);
+
LOOP_LOGICAL_AXES(i) if (parser.seen(AXIS_CHAR(i))) {
switch (i) {
case X_AXIS:
From 98c0cc044d1be2c098335d9656f2d0eadf524129 Mon Sep 17 00:00:00 2001
From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com>
Date: Sat, 18 Mar 2023 00:22:17 -0700
Subject: [PATCH 040/225] =?UTF-8?q?=F0=9F=94=A7=20SQUARE=5FWAVE=5FSTEPPING?=
=?UTF-8?q?=20=3D>=20EDGE=5FSTEPPING=20(#25526)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Scott Lahteine
---
Marlin/Configuration_adv.h | 9 +++--
Marlin/src/inc/SanityCheck.h | 2 ++
Marlin/src/module/stepper/trinamic.cpp | 14 ++++----
Marlin/src/module/stepper/trinamic.h | 46 +++++++++++++-------------
buildroot/tests/FYSETC_F6 | 2 +-
buildroot/tests/SAMD21_minitronics20 | 2 +-
buildroot/tests/SAMD51_grandcentral_m4 | 2 +-
7 files changed, 39 insertions(+), 38 deletions(-)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 35c43c7f2c..284ecb6b1c 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -3160,7 +3160,7 @@
*
* It is recommended to set HOMING_BUMP_MM to { 0, 0, 0 }.
*
- * SPI_ENDSTOPS *** Beta feature! *** TMC2130/TMC5160 Only ***
+ * SPI_ENDSTOPS *** TMC2130/TMC5160 Only ***
* Poll the driver through SPI to determine load when homing.
* Removes the need for a wire from DIAG1 to an endstop pin.
*
@@ -3188,7 +3188,7 @@
//#define U_STALL_SENSITIVITY 8
//#define V_STALL_SENSITIVITY 8
//#define W_STALL_SENSITIVITY 8
- //#define SPI_ENDSTOPS // TMC2130 only
+ //#define SPI_ENDSTOPS // TMC2130/TMC5160 only
//#define IMPROVE_HOMING_RELIABILITY
#endif
@@ -3207,10 +3207,9 @@
//#define TMC_HOME_PHASE { 896, 896, 896 }
/**
- * Beta feature!
- * Create a 50/50 square wave step pulse optimal for stepper drivers.
+ * Step on both rising and falling edge signals (as with a square wave).
*/
- //#define SQUARE_WAVE_STEPPING
+ //#define EDGE_STEPPING
/**
* Enable M122 debugging command for TMC stepper drivers.
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index cd4c4efee2..c1e9b29444 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -678,6 +678,8 @@
#error "INVERT_*_STEP_PIN true is now STEP_STATE_* LOW, and INVERT_*_STEP_PIN false is now STEP_STATE_* HIGH."
#elif defined(PROBE_PT_1_X) || defined(PROBE_PT_1_Y) || defined(PROBE_PT_2_X) || defined(PROBE_PT_2_Y) || defined(PROBE_PT_3_X) || defined(PROBE_PT_3_Y)
#error "PROBE_PT_[123]_[XY] is now defined using PROBE_PT_[123] with an array { x, y }."
+#elif defined(SQUARE_WAVE_STEPPING)
+ #error "SQUARE_WAVE_STEPPING is now EDGE_STEPPING."
#endif
// L64xx stepper drivers have been removed
diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp
index 48ce020d3d..7d87e5953f 100644
--- a/Marlin/src/module/stepper/trinamic.cpp
+++ b/Marlin/src/module/stepper/trinamic.cpp
@@ -227,7 +227,7 @@ enum StealthIndex : uint8_t {
chopconf.intpol = interpolate;
chopconf.hend = chop_init.hend + 3;
chopconf.hstrt = chop_init.hstrt - 1;
- TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
+ TERN_(EDGE_STEPPING, chopconf.dedge = true);
st.CHOPCONF(chopconf.sr);
st.rms_current(mA, hold_multiplier);
@@ -262,7 +262,7 @@ enum StealthIndex : uint8_t {
chopconf.intpol = interpolate;
chopconf.hend = chop_init.hend + 3;
chopconf.hstrt = chop_init.hstrt - 1;
- TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
+ TERN_(EDGE_STEPPING, chopconf.dedge = true);
st.CHOPCONF(chopconf.sr);
st.rms_current(mA, hold_multiplier);
@@ -684,7 +684,7 @@ enum StealthIndex : uint8_t {
chopconf.intpol = interpolate;
chopconf.hend = chop_init.hend + 3;
chopconf.hstrt = chop_init.hstrt - 1;
- TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
+ TERN_(EDGE_STEPPING, chopconf.dedge = true);
st.CHOPCONF(chopconf.sr);
st.rms_current(mA, hold_multiplier);
@@ -726,7 +726,7 @@ enum StealthIndex : uint8_t {
chopconf.intpol = interpolate;
chopconf.hend = chop_init.hend + 3;
chopconf.hstrt = chop_init.hstrt - 1;
- TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
+ TERN_(EDGE_STEPPING, chopconf.dedge = true);
st.CHOPCONF(chopconf.sr);
st.rms_current(mA, hold_multiplier);
@@ -766,7 +766,7 @@ enum StealthIndex : uint8_t {
st.sdoff(0);
st.rms_current(mA);
st.microsteps(microsteps);
- TERN_(SQUARE_WAVE_STEPPING, st.dedge(true));
+ TERN_(EDGE_STEPPING, st.dedge(true));
st.intpol(interpolate);
st.diss2g(true); // Disable short to ground protection. Too many false readings?
TERN_(TMC_DEBUG, st.rdsel(0b01));
@@ -784,7 +784,7 @@ enum StealthIndex : uint8_t {
chopconf.intpol = interpolate;
chopconf.hend = chop_init.hend + 3;
chopconf.hstrt = chop_init.hstrt - 1;
- TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
+ TERN_(EDGE_STEPPING, chopconf.dedge = true);
st.CHOPCONF(chopconf.sr);
st.rms_current(mA, hold_multiplier);
@@ -819,7 +819,7 @@ enum StealthIndex : uint8_t {
chopconf.intpol = interpolate;
chopconf.hend = chop_init.hend + 3;
chopconf.hstrt = chop_init.hstrt - 1;
- TERN_(SQUARE_WAVE_STEPPING, chopconf.dedge = true);
+ TERN_(EDGE_STEPPING, chopconf.dedge = true);
st.CHOPCONF(chopconf.sr);
st.rms_current(mA, hold_multiplier);
diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h
index 95bab7652c..3705543c99 100644
--- a/Marlin/src/module/stepper/trinamic.h
+++ b/Marlin/src/module/stepper/trinamic.h
@@ -115,7 +115,7 @@
void restore_trinamic_drivers();
void reset_trinamic_drivers();
-#define AXIS_HAS_SQUARE_WAVE(A) (AXIS_IS_TMC(A) && ENABLED(SQUARE_WAVE_STEPPING))
+#define AXIS_HAS_DEDGE(A) (AXIS_IS_TMC(A) && ENABLED(EDGE_STEPPING))
// X Stepper
#if AXIS_IS_TMC(X)
@@ -126,7 +126,7 @@ void reset_trinamic_drivers();
#define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing_X.toff : 0)
#define X_ENABLE_READ() stepperX.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(X)
+ #if AXIS_HAS_DEDGE(X)
#define X_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X_STEP_PIN); }while(0)
#endif
#endif
@@ -140,7 +140,7 @@ void reset_trinamic_drivers();
#define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing_Y.toff : 0)
#define Y_ENABLE_READ() stepperY.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(Y)
+ #if AXIS_HAS_DEDGE(Y)
#define Y_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y_STEP_PIN); }while(0)
#endif
#endif
@@ -154,7 +154,7 @@ void reset_trinamic_drivers();
#define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z.toff : 0)
#define Z_ENABLE_READ() stepperZ.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(Z)
+ #if AXIS_HAS_DEDGE(Z)
#define Z_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z_STEP_PIN); }while(0)
#endif
#endif
@@ -171,7 +171,7 @@ void reset_trinamic_drivers();
#define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing_X2.toff : 0)
#define X2_ENABLE_READ() stepperX2.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(X2)
+ #if AXIS_HAS_DEDGE(X2)
#define X2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(X2_STEP_PIN); }while(0)
#endif
#endif
@@ -188,7 +188,7 @@ void reset_trinamic_drivers();
#define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing_Y2.toff : 0)
#define Y2_ENABLE_READ() stepperY2.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(Y2)
+ #if AXIS_HAS_DEDGE(Y2)
#define Y2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Y2_STEP_PIN); }while(0)
#endif
#endif
@@ -205,7 +205,7 @@ void reset_trinamic_drivers();
#define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z2.toff : 0)
#define Z2_ENABLE_READ() stepperZ2.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(Z2)
+ #if AXIS_HAS_DEDGE(Z2)
#define Z2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z2_STEP_PIN); }while(0)
#endif
#endif
@@ -222,7 +222,7 @@ void reset_trinamic_drivers();
#define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z3.toff : 0)
#define Z3_ENABLE_READ() stepperZ3.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(Z3)
+ #if AXIS_HAS_DEDGE(Z3)
#define Z3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z3_STEP_PIN); }while(0)
#endif
#endif
@@ -239,7 +239,7 @@ void reset_trinamic_drivers();
#define Z4_ENABLE_WRITE(STATE) stepperZ4.toff((STATE)==Z_ENABLE_ON ? chopper_timing_Z4.toff : 0)
#define Z4_ENABLE_READ() stepperZ4.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(Z4)
+ #if AXIS_HAS_DEDGE(Z4)
#define Z4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(Z4_STEP_PIN); }while(0)
#endif
#endif
@@ -253,7 +253,7 @@ void reset_trinamic_drivers();
#define I_ENABLE_WRITE(STATE) stepperI.toff((STATE)==I_ENABLE_ON ? chopper_timing.toff : 0)
#define I_ENABLE_READ() stepperI.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(I)
+ #if AXIS_HAS_DEDGE(I)
#define I_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(I_STEP_PIN); }while(0)
#endif
#endif
@@ -267,7 +267,7 @@ void reset_trinamic_drivers();
#define J_ENABLE_WRITE(STATE) stepperJ.toff((STATE)==J_ENABLE_ON ? chopper_timing.toff : 0)
#define J_ENABLE_READ() stepperJ.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(J)
+ #if AXIS_HAS_DEDGE(J)
#define J_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(J_STEP_PIN); }while(0)
#endif
#endif
@@ -281,7 +281,7 @@ void reset_trinamic_drivers();
#define K_ENABLE_WRITE(STATE) stepperK.toff((STATE)==K_ENABLE_ON ? chopper_timing.toff : 0)
#define K_ENABLE_READ() stepperK.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(K)
+ #if AXIS_HAS_DEDGE(K)
#define K_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(K_STEP_PIN); }while(0)
#endif
#endif
@@ -295,7 +295,7 @@ void reset_trinamic_drivers();
#define U_ENABLE_WRITE(STATE) stepperU.toff((STATE)==U_ENABLE_ON ? chopper_timing_U.toff : 0)
#define U_ENABLE_READ() stepperU.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(U)
+ #if AXIS_HAS_DEDGE(U)
#define U_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(U_STEP_PIN); }while(0)
#endif
#endif
@@ -309,7 +309,7 @@ void reset_trinamic_drivers();
#define V_ENABLE_WRITE(STATE) stepperV.toff((STATE)==V_ENABLE_ON ? chopper_timing_V.toff : 0)
#define V_ENABLE_READ() stepperV.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(V)
+ #if AXIS_HAS_DEDGE(V)
#define V_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(V_STEP_PIN); }while(0)
#endif
#endif
@@ -323,7 +323,7 @@ void reset_trinamic_drivers();
#define W_ENABLE_WRITE(STATE) stepperW.toff((STATE)==W_ENABLE_ON ? chopper_timing_W.toff : 0)
#define W_ENABLE_READ() stepperW.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(W)
+ #if AXIS_HAS_DEDGE(W)
#define W_STEP_WRITE(STATE) do{ if(STATE) TOGGLE(W_STEP_PIN); }while(0)
#endif
#endif
@@ -340,7 +340,7 @@ void reset_trinamic_drivers();
#define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing_E0.toff : 0)
#define E0_ENABLE_READ() stepperE0.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E0)
+ #if AXIS_HAS_DEDGE(E0)
#define E0_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E0_STEP_PIN); }while(0)
#endif
#endif
@@ -357,7 +357,7 @@ void reset_trinamic_drivers();
#define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing_E1.toff : 0)
#define E1_ENABLE_READ() stepperE1.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E1)
+ #if AXIS_HAS_DEDGE(E1)
#define E1_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E1_STEP_PIN); }while(0)
#endif
#endif
@@ -374,7 +374,7 @@ void reset_trinamic_drivers();
#define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing_E2.toff : 0)
#define E2_ENABLE_READ() stepperE2.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E2)
+ #if AXIS_HAS_DEDGE(E2)
#define E2_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E2_STEP_PIN); }while(0)
#endif
#endif
@@ -391,7 +391,7 @@ void reset_trinamic_drivers();
#define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing_E3.toff : 0)
#define E3_ENABLE_READ() stepperE3.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E3)
+ #if AXIS_HAS_DEDGE(E3)
#define E3_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E3_STEP_PIN); }while(0)
#endif
#endif
@@ -408,7 +408,7 @@ void reset_trinamic_drivers();
#define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing_E4.toff : 0)
#define E4_ENABLE_READ() stepperE4.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E4)
+ #if AXIS_HAS_DEDGE(E4)
#define E4_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E4_STEP_PIN); }while(0)
#endif
#endif
@@ -425,7 +425,7 @@ void reset_trinamic_drivers();
#define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing_E5.toff : 0)
#define E5_ENABLE_READ() stepperE5.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E5)
+ #if AXIS_HAS_DEDGE(E5)
#define E5_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E5_STEP_PIN); }while(0)
#endif
#endif
@@ -442,7 +442,7 @@ void reset_trinamic_drivers();
#define E6_ENABLE_WRITE(STATE) stepperE6.toff((STATE)==E_ENABLE_ON ? chopper_timing_E6.toff : 0)
#define E6_ENABLE_READ() stepperE6.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E6)
+ #if AXIS_HAS_DEDGE(E6)
#define E6_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E6_STEP_PIN); }while(0)
#endif
#endif
@@ -459,7 +459,7 @@ void reset_trinamic_drivers();
#define E7_ENABLE_WRITE(STATE) stepperE7.toff((STATE)==E_ENABLE_ON ? chopper_timing_E7.toff : 0)
#define E7_ENABLE_READ() stepperE7.isEnabled()
#endif
- #if AXIS_HAS_SQUARE_WAVE(E7)
+ #if AXIS_HAS_DEDGE(E7)
#define E7_STEP_WRITE(STATE) do{ if (STATE) TOGGLE(E7_STEP_PIN); }while(0)
#endif
#endif
diff --git a/buildroot/tests/FYSETC_F6 b/buildroot/tests/FYSETC_F6
index f8fce4b5b8..f4f05ceea7 100755
--- a/buildroot/tests/FYSETC_F6
+++ b/buildroot/tests/FYSETC_F6
@@ -64,7 +64,7 @@ opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \
X_HARDWARE_SERIAL Serial2
opt_enable USE_ZMIN_PLUG FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR PAUSE_BEFORE_DEPLOY_STOW \
FYSETC_242_OLED_12864 EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL Z_SAFE_HOMING \
- STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING SQUARE_WAVE_STEPPING
+ STEALTHCHOP_XY STEALTHCHOP_Z STEALTHCHOP_E HYBRID_THRESHOLD SENSORLESS_HOMING EDGE_STEPPING
exec_test $1 $2 "FYSETC_F6 | SCARA | Mixed TMC | EEPROM" "$3"
# clean up
diff --git a/buildroot/tests/SAMD21_minitronics20 b/buildroot/tests/SAMD21_minitronics20
index b46fb9f08a..f4a75afafe 100755
--- a/buildroot/tests/SAMD21_minitronics20
+++ b/buildroot/tests/SAMD21_minitronics20
@@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \
SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \
- SQUARE_WAVE_STEPPING
+ EDGE_STEPPING
exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3"
# clean up
diff --git a/buildroot/tests/SAMD51_grandcentral_m4 b/buildroot/tests/SAMD51_grandcentral_m4
index 042733072d..72996e7b7f 100755
--- a/buildroot/tests/SAMD51_grandcentral_m4
+++ b/buildroot/tests/SAMD51_grandcentral_m4
@@ -26,7 +26,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R
SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \
- SQUARE_WAVE_STEPPING TMC_DEBUG
+ EDGE_STEPPING TMC_DEBUG
exec_test $1 $2 "Grand Central M4 with assorted features" "$3"
# clean up
From 88da531e5d873c342a4a6625d9cb57adb2644cce Mon Sep 17 00:00:00 2001
From: James Gilliland
Date: Sat, 18 Mar 2023 03:30:30 -0500
Subject: [PATCH 041/225] =?UTF-8?q?=F0=9F=9A=B8=20Improve=20Z-Probe=20rais?=
=?UTF-8?q?e=20for=20deploy=20(#25498)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/src/gcode/bedlevel/G35.cpp | 1 -
Marlin/src/gcode/calibrate/G76_M871.cpp | 1 -
Marlin/src/lcd/menu/menu_tramming_wizard.cpp | 4 +--
Marlin/src/module/probe.cpp | 30 +++++++++++++-------
4 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp
index dd828bf0c8..ff0321e4aa 100644
--- a/Marlin/src/gcode/bedlevel/G35.cpp
+++ b/Marlin/src/gcode/bedlevel/G35.cpp
@@ -108,7 +108,6 @@ void GcodeSuite::G35() {
// length of the deployed pin (BLTOUCH stroke < 7mm)
// Unsure if this is even required. The probe seems to lift correctly after probe done.
- do_blocking_move_to_z(SUM_TERN(BLTOUCH, Z_CLEARANCE_BETWEEN_PROBES, bltouch.z_extra_clearance()));
const float z_probed_height = probe.probe_at_point(tramming_points[i], PROBE_PT_RAISE, 0, true);
if (isnan(z_probed_height)) {
diff --git a/Marlin/src/gcode/calibrate/G76_M871.cpp b/Marlin/src/gcode/calibrate/G76_M871.cpp
index c484d4f1b7..9bea0a0b86 100644
--- a/Marlin/src/gcode/calibrate/G76_M871.cpp
+++ b/Marlin/src/gcode/calibrate/G76_M871.cpp
@@ -108,7 +108,6 @@
};
auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) {
- do_z_clearance(5.0); // Raise nozzle before probing
ptc.set_enabled(false);
const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false
ptc.set_enabled(true);
diff --git a/Marlin/src/lcd/menu/menu_tramming_wizard.cpp b/Marlin/src/lcd/menu/menu_tramming_wizard.cpp
index 1dd8a1cab6..4ce2cd6460 100644
--- a/Marlin/src/lcd/menu/menu_tramming_wizard.cpp
+++ b/Marlin/src/lcd/menu/menu_tramming_wizard.cpp
@@ -53,9 +53,7 @@ static int8_t reference_index; // = 0
#endif
static bool probe_single_point() {
- do_blocking_move_to_z(TERN(BLTOUCH, Z_CLEARANCE_DEPLOY_PROBE, Z_CLEARANCE_BETWEEN_PROBES));
- // Stow after each point with BLTouch "HIGH SPEED" mode for push-pin safety
- const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], TERN0(BLTOUCH, bltouch.high_speed_mode) ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
+ const float z_probed_height = probe.probe_at_point(tramming_points[tram_index], PROBE_PT_RAISE, 0, true);
z_measured[tram_index] = z_probed_height;
if (reference_index < 0) reference_index = tram_index;
move_to_tramming_wait_pos();
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index faa3aec03d..da69b725b9 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -147,7 +147,7 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
WRITE(MAGLEV_TRIGGER_PIN, LOW);
}
- inline void maglev_idle() { do_blocking_move_to_z(10); }
+ inline void maglev_idle() { do_z_clearance(10); }
#elif ENABLED(TOUCH_MI_PROBE)
@@ -749,7 +749,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("1st Probe Z:", first_probe_z);
// Raise to give the probe clearance
- do_blocking_move_to_z(current_position.z + Z_CLEARANCE_MULTI_PROBE, z_probe_fast_mm_s);
+ do_z_clearance(current_position.z + Z_CLEARANCE_MULTI_PROBE);
#elif Z_PROBE_FEEDRATE_FAST != Z_PROBE_FEEDRATE_SLOW
@@ -759,7 +759,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
if (current_position.z > z) {
// Probe down fast. If the probe never triggered, raise for probe clearance
if (!probe_down_to_z(z, z_probe_fast_mm_s))
- do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES, z_probe_fast_mm_s);
+ do_z_clearance(current_position.z + Z_CLEARANCE_BETWEEN_PROBES);
}
#endif
@@ -810,7 +810,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
#if EXTRA_PROBING > 0
< TOTAL_PROBING - 1
#endif
- ) do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, z_probe_fast_mm_s);
+ ) do_z_clearance(z + Z_CLEARANCE_MULTI_PROBE);
#endif
}
@@ -878,13 +878,16 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
}
#if ENABLED(BLTOUCH)
- if (bltouch.high_speed_mode && bltouch.triggered())
- bltouch._reset();
+ // Reset a BLTouch in HS mode if already triggered
+ if (bltouch.high_speed_mode && bltouch.triggered()) bltouch._reset();
#endif
+ // Use a safe Z height for the XY move
+ const float safe_z = _MAX(current_position.z, SUM_TERN(BLTOUCH, Z_CLEARANCE_BETWEEN_PROBES, bltouch.z_extra_clearance()));
+
// On delta keep Z below clip height or do_blocking_move_to will abort
xyz_pos_t npos = NUM_AXIS_ARRAY(
- rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, current_position.z), current_position.z),
+ rx, ry, TERN(DELTA, _MIN(delta_clip_start_height, safe_z), safe_z),
current_position.i, current_position.j, current_position.k,
current_position.u, current_position.v, current_position.w
);
@@ -907,17 +910,22 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
TERN_(HAS_PTC, ptc.apply_compensation(measured_z));
TERN_(X_AXIS_TWIST_COMPENSATION, measured_z += xatc.compensation(npos + offset_xy));
}
+
+ // Deploy succeeded and a successful measurement was done.
+ // Raise and/or stow the probe depending on 'raise_after' and settings.
if (!isnan(measured_z)) {
- const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
- if (big_raise || raise_after == PROBE_PT_RAISE)
- do_blocking_move_to_z(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), z_probe_fast_mm_s);
- else if (raise_after == PROBE_PT_STOW || raise_after == PROBE_PT_LAST_STOW)
+ const ProbePtRaise raise_type = (TERN0(BLTOUCH, !bltouch.high_speed_mode) && raise_after == PROBE_PT_RAISE) ? PROBE_PT_STOW : raise_after;
+ const bool big_raise = raise_type == PROBE_PT_BIG_RAISE;
+ if (big_raise || raise_type == PROBE_PT_RAISE)
+ do_z_clearance(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES));
+ else if (raise_type == PROBE_PT_STOW || raise_type == PROBE_PT_LAST_STOW)
if (stow()) measured_z = NAN; // Error on stow?
if (verbose_level > 2)
SERIAL_ECHOLNPGM("Bed X: ", LOGICAL_X_POSITION(rx), " Y: ", LOGICAL_Y_POSITION(ry), " Z: ", measured_z);
}
+ // If any error occurred stow the probe and set an alert
if (isnan(measured_z)) {
stow();
LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
From d0669527c43ce69d5d2313367a8752b6cac8119b Mon Sep 17 00:00:00 2001
From: Eduard Sukharev
Date: Sat, 18 Mar 2023 11:33:38 +0300
Subject: [PATCH 042/225] =?UTF-8?q?=F0=9F=90=9B=20Fix=20LVGL=20/=20MKS=20W?=
=?UTF-8?q?iFi=20long=20filename=20(#25483)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
.../extui/mks_ui/tft_lvgl_configuration.cpp | 6 +-
Marlin/src/lcd/extui/mks_ui/wifi_module.cpp | 893 +++++++++---------
Marlin/src/lcd/extui/mks_ui/wifi_module.h | 12 +-
Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp | 6 +-
Marlin/src/lcd/extui/mks_ui/wifi_upload.h | 4 +-
5 files changed, 472 insertions(+), 449 deletions(-)
diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
index a5a8f7cbe4..2248ef334f 100644
--- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
+++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
@@ -298,10 +298,8 @@ void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv
W25QXX.init(SPI_QUARTER_SPEED);
}
-#define TICK_CYCLE 1
-
-uint16_t getTickDiff(uint16_t curTick, uint16_t lastTick) {
- return TICK_CYCLE * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick));
+uint16_t getTickDiff(const uint16_t curTick, const uint16_t lastTick) {
+ return (TICK_CYCLE) * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick));
}
static bool get_point(int16_t *x, int16_t *y) {
diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
index 215281d450..b389109975 100644
--- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
+++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
@@ -55,11 +55,11 @@
#define WIFI_IO1_SET() WRITE(WIFI_IO1_PIN, HIGH);
#define WIFI_IO1_RESET() WRITE(WIFI_IO1_PIN, LOW);
-extern uint8_t Explore_Disk(char *path, uint8_t recu_level);
+uint8_t Explore_Disk(const char * const path, const uint8_t recu_level, const bool with_longnames);
extern uint8_t commands_in_queue;
extern uint8_t sel_id;
-extern uint16_t getTickDiff(uint16_t curTick, uint16_t lastTick);
+uint16_t getTickDiff(const uint16_t curTick, const uint16_t lastTick);
volatile SZ_USART_FIFO WifiRxFifo;
@@ -114,33 +114,34 @@ extern CLOUD_PARA cloud_para;
extern bool once_flag, flash_preview_begin, default_preview_flg, gcode_preview_over;
extern bool flash_dma_mode;
-uint32_t getWifiTick() { return millis(); }
+millis_t getWifiTick() { return millis(); }
-uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick) {
- return (lastTick <= curTick ? curTick - lastTick : 0xFFFFFFFF - lastTick + curTick) * TICK_CYCLE;
+millis_t getWifiTickDiff(const millis_t lastTick, const millis_t curTick) {
+ return (TICK_CYCLE) * (lastTick <= curTick ? curTick - lastTick : 0xFFFFFFFFUL - lastTick + curTick);
}
-void wifi_delay(int n) {
- const uint32_t start = getWifiTick();
- while (getWifiTickDiff(start, getWifiTick()) < (uint32_t)n)
+void wifi_delay(const uint16_t n) {
+ const millis_t start = getWifiTick();
+ while (getWifiTickDiff(start, getWifiTick()) < millis_t(n))
hal.watchdog_refresh();
}
void wifi_reset() {
- uint32_t start = getWifiTick();
+ const millis_t start = getWifiTick();
WIFI_RESET();
while (getWifiTickDiff(start, getWifiTick()) < 500) { /* nada */ }
WIFI_SET();
}
-void mount_file_sys(uint8_t disk_type) {
- if (disk_type == FILE_SYS_SD) {
- TERN_(SDSUPPORT, card.mount());
- }
- else if (disk_type == FILE_SYS_USB) {
+void mount_file_sys(const uint8_t disk_type) {
+ switch (disk_type) {
+ case FILE_SYS_SD: TERN_(SDSUPPORT, card.mount()); break;
+ case FILE_SYS_USB: break;
}
}
+#define ILLEGAL_CHAR_REPLACE 0x5F // '_'
+
static bool longName2DosName(const char *longName, char *dosName) {
uint8_t i = FILENAME_LENGTH;
while (i) dosName[--i] = '\0';
@@ -152,18 +153,24 @@ static bool longName2DosName(const char *longName, char *dosName) {
strcat_P(dosName, PSTR(".GCO"));
return dosName[0] != '\0';
}
+
+ // Fail for illegal characters
+ if (c < 0x21 || c == 0x7F) // Check size, non-printable characters
+ c = ILLEGAL_CHAR_REPLACE; // replace non-printable chars with underscore '_'
else {
- // Fail for illegal characters
PGM_P p = PSTR("|<>^+=?/[];,*\"\\");
- while (uint8_t b = pgm_read_byte(p++)) if (b == c) return false;
- if (c < 0x21 || c == 0x7F) return false; // Check size, non-printable characters
- dosName[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name
+ while (const uint8_t b = pgm_read_byte(p++))
+ if (b == c) c = ILLEGAL_CHAR_REPLACE; // replace illegal chars with underscore '_'
}
+
+ dosName[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name
+
if (i >= 5) {
strcat_P(dosName, PSTR("~1.GCO"));
return dosName[0] != '\0';
}
}
+
return dosName[0] != '\0'; // Return true if any name was set
}
@@ -562,8 +569,8 @@ static bool longName2DosName(const char *longName, char *dosName) {
#if ENABLED(MKS_WIFI_MODULE)
- int raw_send_to_wifi(uint8_t *buf, int len) {
- if (buf == 0 || len <= 0) return 0;
+ int raw_send_to_wifi(uint8_t * const buf, const int len) {
+ if (buf == nullptr || len <= 0) return 0;
for (int i = 0; i < len; i++) WIFISERIAL.write(*(buf + i));
return len;
}
@@ -701,13 +708,13 @@ int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len) {
return 1;
}
+int send_to_wifi(uint8_t * const buf, const int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); }
-#define SEND_OK_TO_WIFI send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n"))
-int send_to_wifi(uint8_t *buf, int len) { return package_to_wifi(WIFI_TRANS_INF, buf, len); }
+inline void send_ok_to_wifi() { send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n")); }
void set_cur_file_sys(int fileType) { gCfgItems.fileSysType = fileType; }
-void get_file_list(char *path) {
+void get_file_list(const char * const path, const bool with_longnames) {
if (!path) return;
if (gCfgItems.fileSysType == FILE_SYS_SD) {
@@ -716,7 +723,7 @@ void get_file_list(char *path) {
else if (gCfgItems.fileSysType == FILE_SYS_USB) {
// udisk
}
- Explore_Disk(path, 0);
+ Explore_Disk(path, 0, with_longnames);
}
char wait_ip_back_flag = 0;
@@ -795,7 +802,7 @@ typedef struct {
uint8_t tail;
} ESP_PROTOC_FRAME;
-static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) {
+static int cut_msg_head(uint8_t * const msg, const uint16_t msgLen, uint16_t cutLen) {
if (msgLen < cutLen) return 0;
else if (msgLen == cutLen) {
@@ -811,25 +818,31 @@ static int cut_msg_head(uint8_t *msg, uint16_t msgLen, uint16_t cutLen) {
return msgLen - cutLen;
}
-uint8_t Explore_Disk(char *path , uint8_t recu_level) {
- char tmp[200];
+uint8_t Explore_Disk(const char * const path, const uint8_t recu_level, const bool with_longnames) {
char Fstream[200];
if (!path) return 0;
const uint8_t fileCnt = card.get_num_Files();
+ MediaFile file;
+ MediaFile *diveDir;
for (uint8_t i = 0; i < fileCnt; i++) {
card.getfilename_sorted(SD_ORDER(i, fileCnt));
- ZERO(tmp);
- strcpy(tmp, card.filename);
ZERO(Fstream);
- strcpy(Fstream, tmp);
+ strcpy(Fstream, card.filename);
if (card.flag.filenameIsDir && recu_level <= 10)
strcat_P(Fstream, PSTR(".DIR"));
+ strcat_P(Fstream, PSTR(" 0")); // report 0 file size
+
+ if (with_longnames) {
+ strcat_P(Fstream, PSTR(" "));
+ strcat_P(Fstream, card.longest_filename());
+ }
+
strcat_P(Fstream, PSTR("\r\n"));
send_to_wifi((uint8_t*)Fstream, strlen(Fstream));
}
@@ -837,434 +850,449 @@ uint8_t Explore_Disk(char *path , uint8_t recu_level) {
return fileCnt;
}
-static void wifi_gcode_exec(uint8_t *cmd_line) {
+static void wifi_gcode_exec(uint8_t * const cmd_line) {
int8_t tempBuf[100] = { 0 };
- uint8_t *tmpStr = 0;
int cmd_value;
volatile int print_rate;
- if (strchr((char *)cmd_line, '\n') && (strchr((char *)cmd_line, 'G') || strchr((char *)cmd_line, 'M') || strchr((char *)cmd_line, 'T'))) {
- tmpStr = (uint8_t *)strchr((char *)cmd_line, '\n');
- if (tmpStr) *tmpStr = '\0';
- tmpStr = (uint8_t *)strchr((char *)cmd_line, '\r');
- if (tmpStr) *tmpStr = '\0';
+ // Only accept commands with a linefeed
+ char * const lfStr = strchr((char *)cmd_line, '\n');
+ if (!lfStr) return;
- tmpStr = (uint8_t *)strchr((char *)cmd_line, '*');
- if (tmpStr) *tmpStr = '\0';
+ // Only accept commands with G, M, or T somewhere
+ const char * const gStr = strchr((char *)cmd_line, 'G');
+ const char * const mStr = strchr((char *)cmd_line, 'M');
+ const char * const tStr = strchr((char *)cmd_line, 'T');
+ if (!(gStr || mStr || tStr)) return;
- tmpStr = (uint8_t *)strchr((char *)cmd_line, 'M');
- if (tmpStr) {
- cmd_value = atoi((char *)(tmpStr + 1));
- tmpStr = (uint8_t *)strchr((char *)tmpStr, ' ');
+ // Replace the linefeed with nul terminator
+ *lfStr = '\0';
- switch (cmd_value) {
+ // Terminate on the first cr, if any
+ char * const crStr = strchr((char *)cmd_line, '\r');
+ if (crStr) *crStr = '\0';
- case 20: // M20: Print SD / µdisk file
- file_writer.fileTransfer = 0;
- if (uiCfg.print_state == IDLE) {
- int index = 0;
+ // Terminate on the checksum marker, if any
+ char * const aStr = strchr((char *)cmd_line, '*');
+ if (aStr) *aStr = '\0';
- if (tmpStr == 0) {
- gCfgItems.fileSysType = FILE_SYS_SD;
+ // Handle some M commands here
+ if (mStr) {
+ cmd_value = atoi(mStr + 1);
+ char * const spStr = strchr(mStr, ' ');
+
+ switch (cmd_value) {
+
+ case 20: // M20: Print SD / µdisk file
+ file_writer.fileTransfer = 0;
+ if (uiCfg.print_state == IDLE) {
+ int index = 0;
+ if (spStr == nullptr) {
+ gCfgItems.fileSysType = FILE_SYS_SD;
+ send_to_wifi((uint8_t *)(STR_BEGIN_FILE_LIST "\r\n"), strlen(STR_BEGIN_FILE_LIST "\r\n"));
+ get_file_list("0:/", false);
+ send_to_wifi((uint8_t *)(STR_END_FILE_LIST "\r\n"), strlen(STR_END_FILE_LIST "\r\n"));
+ send_ok_to_wifi();
+ break;
+ }
+
+ while (mStr[index] == ' ') index++;
+
+ if (gCfgItems.wifi_type == ESP_WIFI) {
+ char * const path = (char *)tempBuf;
+ if (strlen(&mStr[index]) < 80) {
send_to_wifi((uint8_t *)(STR_BEGIN_FILE_LIST "\r\n"), strlen(STR_BEGIN_FILE_LIST "\r\n"));
- get_file_list((char *)"0:/");
+
+ if (strncmp(&mStr[index], "1:", 2) == 0)
+ gCfgItems.fileSysType = FILE_SYS_SD;
+ else if (strncmp(&mStr[index], "0:", 2) == 0)
+ gCfgItems.fileSysType = FILE_SYS_USB;
+
+ strcpy(path, &mStr[index]);
+ const bool with_longnames = strchr(mStr, 'L') != nullptr;
+ get_file_list(path, with_longnames);
send_to_wifi((uint8_t *)(STR_END_FILE_LIST "\r\n"), strlen(STR_END_FILE_LIST "\r\n"));
- SEND_OK_TO_WIFI;
- break;
}
+ send_ok_to_wifi();
+ }
+ }
+ break;
- while (tmpStr[index] == ' ') index++;
+ case 21: send_ok_to_wifi(); break; // Init SD card
- if (gCfgItems.wifi_type == ESP_WIFI) {
- char *path = (char *)tempBuf;
+ case 23:
+ // Select the file
+ if (uiCfg.print_state == IDLE) {
+ int index = 0;
+ while (mStr[index] == ' ') index++;
- if (strlen((char *)&tmpStr[index]) < 80) {
- send_to_wifi((uint8_t *)(STR_BEGIN_FILE_LIST "\r\n"), strlen(STR_BEGIN_FILE_LIST "\r\n"));
+ if (strstr_P(&mStr[index], PSTR(".g")) || strstr_P(&mStr[index], PSTR(".G"))) {
+ if (strlen(&mStr[index]) < 80) {
+ ZERO(list_file.file_name[sel_id]);
+ ZERO(list_file.long_name[sel_id]);
+ uint8_t has_path_selected = 0;
- if (strncmp((char *)&tmpStr[index], "1:", 2) == 0)
+ if (gCfgItems.wifi_type == ESP_WIFI) {
+ if (strncmp_P(&mStr[index], PSTR("1:"), 2) == 0) {
gCfgItems.fileSysType = FILE_SYS_SD;
- else if (strncmp((char *)&tmpStr[index], "0:", 2) == 0)
+ has_path_selected = 1;
+ }
+ else if (strncmp_P(&mStr[index], PSTR("0:"), 2) == 0) {
gCfgItems.fileSysType = FILE_SYS_USB;
+ has_path_selected = 1;
+ }
+ else if (mStr[index] != '/')
+ strcat_P((char *)list_file.file_name[sel_id], PSTR("/"));
- strcpy((char *)path, (char *)&tmpStr[index]);
- get_file_list(path);
- send_to_wifi((uint8_t *)(STR_END_FILE_LIST "\r\n"), strlen(STR_END_FILE_LIST "\r\n"));
- }
- SEND_OK_TO_WIFI;
- }
- }
- break;
-
- case 21: SEND_OK_TO_WIFI; break; // Init SD card
-
- case 23:
- // Select the file
- if (uiCfg.print_state == IDLE) {
- int index = 0;
- while (tmpStr[index] == ' ') index++;
-
- if (strstr_P((char *)&tmpStr[index], PSTR(".g")) || strstr_P((char *)&tmpStr[index], PSTR(".G"))) {
- if (strlen((char *)&tmpStr[index]) < 80) {
- ZERO(list_file.file_name[sel_id]);
- ZERO(list_file.long_name[sel_id]);
- uint8_t has_path_selected = 0;
-
- if (gCfgItems.wifi_type == ESP_WIFI) {
- if (strncmp_P((char *)&tmpStr[index], PSTR("1:"), 2) == 0) {
- gCfgItems.fileSysType = FILE_SYS_SD;
- has_path_selected = 1;
- }
- else if (strncmp_P((char *)&tmpStr[index], PSTR("0:"), 2) == 0) {
- gCfgItems.fileSysType = FILE_SYS_USB;
- has_path_selected = 1;
- }
- else if (tmpStr[index] != '/')
+ if (file_writer.fileTransfer == 1) {
+ char dosName[FILENAME_LENGTH];
+ uint8_t fileName[sizeof(list_file.file_name[sel_id])];
+ fileName[0] = '\0';
+ if (has_path_selected == 1) {
+ strcat((char *)fileName, &mStr[index + 3]);
strcat_P((char *)list_file.file_name[sel_id], PSTR("/"));
-
- if (file_writer.fileTransfer == 1) {
- char dosName[FILENAME_LENGTH];
- uint8_t fileName[sizeof(list_file.file_name[sel_id])];
- fileName[0] = '\0';
- if (has_path_selected == 1) {
- strcat((char *)fileName, (char *)&tmpStr[index + 3]);
- strcat_P((char *)list_file.file_name[sel_id], PSTR("/"));
- }
- else strcat((char *)fileName, (char *)&tmpStr[index]);
- if (!longName2DosName((const char *)fileName, dosName))
- strcpy_P(list_file.file_name[sel_id], PSTR("notValid"));
- strcat((char *)list_file.file_name[sel_id], dosName);
- strcat((char *)list_file.long_name[sel_id], dosName);
}
- else {
- strcat((char *)list_file.file_name[sel_id], (char *)&tmpStr[index]);
- strcat((char *)list_file.long_name[sel_id], (char *)&tmpStr[index]);
- }
-
+ else strcat((char *)fileName, &mStr[index]);
+ if (!longName2DosName((const char *)fileName, dosName))
+ strcpy_P(list_file.file_name[sel_id], PSTR("notValid"));
+ strcat((char *)list_file.file_name[sel_id], dosName);
+ strcat((char *)list_file.long_name[sel_id], (const char *)fileName);
}
- else
- strcpy(list_file.file_name[sel_id], (char *)&tmpStr[index]);
-
- char *cur_name=strrchr(list_file.file_name[sel_id],'/');
-
- card.openFileRead(cur_name);
-
- if (card.isFileOpen())
- send_to_wifi((uint8_t *)"File selected\r\n", strlen("File selected\r\n"));
else {
- send_to_wifi((uint8_t *)"file.open failed\r\n", strlen("file.open failed\r\n"));
- strcpy_P(list_file.file_name[sel_id], PSTR("notValid"));
+ strcat((char *)list_file.file_name[sel_id], &mStr[index]);
+ strcat((char *)list_file.long_name[sel_id], &mStr[index]);
}
- SEND_OK_TO_WIFI;
+
}
+ else
+ strcpy(list_file.file_name[sel_id], &mStr[index]);
+
+ char *cur_name = strrchr(list_file.file_name[sel_id],'/');
+
+ card.openFileRead(cur_name);
+
+ if (card.isFileOpen())
+ send_to_wifi((uint8_t *)"File selected\r\n", strlen("File selected\r\n"));
+ else {
+ send_to_wifi((uint8_t *)"file.open failed\r\n", strlen("file.open failed\r\n"));
+ strcpy_P(list_file.file_name[sel_id], PSTR("notValid"));
+ }
+ send_ok_to_wifi();
}
}
- break;
-
- case 24:
- if (strcmp_P(list_file.file_name[sel_id], PSTR("notValid")) != 0) {
- if (uiCfg.print_state == IDLE) {
- clear_cur_ui();
- reset_print_time();
- start_print_time();
- preview_gcode_prehandle(list_file.file_name[sel_id]);
- uiCfg.print_state = WORKING;
- lv_draw_printing();
-
- #if ENABLED(SDSUPPORT)
- if (!gcode_preview_over) {
- char *cur_name = strrchr(list_file.file_name[sel_id], '/');
-
- MediaFile file;
- MediaFile *curDir;
- card.abortFilePrintNow();
- const char * const fname = card.diveToFile(false, curDir, cur_name);
- if (!fname) return;
- if (file.open(curDir, fname, O_READ)) {
- gCfgItems.curFilesize = file.fileSize();
- file.close();
- update_spi_flash();
- }
- card.openFileRead(cur_name);
- if (card.isFileOpen()) {
- //saved_feedrate_percentage = feedrate_percentage;
- feedrate_percentage = 100;
- #if HAS_EXTRUDERS
- planner.flow_percentage[0] = 100;
- planner.e_factor[0] = planner.flow_percentage[0] * 0.01f;
- #endif
- #if HAS_MULTI_EXTRUDER
- planner.flow_percentage[1] = 100;
- planner.e_factor[1] = planner.flow_percentage[1] * 0.01f;
- #endif
- card.startOrResumeFilePrinting();
- TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
- once_flag = false;
- }
- }
- #endif
- }
- else if (uiCfg.print_state == PAUSED) {
- uiCfg.print_state = RESUMING;
- clear_cur_ui();
- start_print_time();
-
- if (gCfgItems.from_flash_pic)
- flash_preview_begin = true;
- else
- default_preview_flg = true;
- lv_draw_printing();
- }
- else if (uiCfg.print_state == REPRINTING) {
- uiCfg.print_state = REPRINTED;
- clear_cur_ui();
- start_print_time();
- if (gCfgItems.from_flash_pic)
- flash_preview_begin = true;
- else
- default_preview_flg = true;
- lv_draw_printing();
- }
- }
- SEND_OK_TO_WIFI;
- break;
-
- case 25:
- // Pause print file
- if (uiCfg.print_state == WORKING) {
- stop_print_time();
+ }
+ break;
+ case 24:
+ if (strcmp_P(list_file.file_name[sel_id], PSTR("notValid")) != 0) {
+ if (uiCfg.print_state == IDLE) {
clear_cur_ui();
+ reset_print_time();
+ start_print_time();
+ preview_gcode_prehandle(list_file.file_name[sel_id]);
+ uiCfg.print_state = WORKING;
+ lv_draw_printing();
#if ENABLED(SDSUPPORT)
- card.pauseSDPrint();
- uiCfg.print_state = PAUSING;
+ if (!gcode_preview_over) {
+ char *cur_name = strrchr(list_file.file_name[sel_id], '/');
+
+ MediaFile file;
+ MediaFile *curDir;
+ card.abortFilePrintNow();
+ const char * const fname = card.diveToFile(false, curDir, cur_name);
+ if (!fname) return;
+ if (file.open(curDir, fname, O_READ)) {
+ gCfgItems.curFilesize = file.fileSize();
+ file.close();
+ update_spi_flash();
+ }
+ card.openFileRead(cur_name);
+ if (card.isFileOpen()) {
+ //saved_feedrate_percentage = feedrate_percentage;
+ feedrate_percentage = 100;
+ #if HAS_EXTRUDERS
+ planner.flow_percentage[0] = 100;
+ planner.e_factor[0] = planner.flow_percentage[0] * 0.01f;
+ #endif
+ #if HAS_MULTI_EXTRUDER
+ planner.flow_percentage[1] = 100;
+ planner.e_factor[1] = planner.flow_percentage[1] * 0.01f;
+ #endif
+ card.startOrResumeFilePrinting();
+ TERN_(POWER_LOSS_RECOVERY, recovery.prepare());
+ once_flag = false;
+ }
+ }
#endif
+ }
+ else if (uiCfg.print_state == PAUSED) {
+ uiCfg.print_state = RESUMING;
+ clear_cur_ui();
+ start_print_time();
+
if (gCfgItems.from_flash_pic)
flash_preview_begin = true;
else
default_preview_flg = true;
lv_draw_printing();
- SEND_OK_TO_WIFI;
- }
- break;
-
- case 26:
- // Stop print file
- if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED) || (uiCfg.print_state == REPRINTING)) {
- stop_print_time();
-
- clear_cur_ui();
- #if ENABLED(SDSUPPORT)
- uiCfg.print_state = IDLE;
- card.abortFilePrintSoon();
- #endif
-
- lv_draw_ready_print();
-
- SEND_OK_TO_WIFI;
- }
- break;
-
- case 27:
- // Report print rate
- if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)|| (uiCfg.print_state == REPRINTING)) {
- print_rate = uiCfg.totalSend;
- ZERO(tempBuf);
- sprintf_P((char *)tempBuf, PSTR("M27 %d\r\n"), print_rate);
- send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
- }
- break;
-
- case 28:
- // Begin to transfer file to filesys
- if (uiCfg.print_state == IDLE) {
-
- int index = 0;
- while (tmpStr[index] == ' ') index++;
-
- if (strstr_P((char *)&tmpStr[index], PSTR(".g")) || strstr_P((char *)&tmpStr[index], PSTR(".G"))) {
- strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]);
-
- if (gCfgItems.fileSysType == FILE_SYS_SD) {
- ZERO(tempBuf);
- sprintf_P((char *)tempBuf, PSTR("%s"), file_writer.saveFileName);
- }
- else if (gCfgItems.fileSysType == FILE_SYS_USB) {
- ZERO(tempBuf);
- sprintf_P((char *)tempBuf, PSTR("%s"), (char *)file_writer.saveFileName);
- }
- mount_file_sys(gCfgItems.fileSysType);
-
- #if ENABLED(SDSUPPORT)
- char *cur_name = strrchr(list_file.file_name[sel_id], '/');
- card.openFileWrite(cur_name);
- if (card.isFileOpen()) {
- ZERO(file_writer.saveFileName);
- strcpy((char *)file_writer.saveFileName, (char *)&tmpStr[index]);
- ZERO(tempBuf);
- sprintf_P((char *)tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName);
- wifi_ret_ack();
- send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
- wifi_link_state = WIFI_WAIT_TRANS_START;
- }
- else {
- wifi_link_state = WIFI_CONNECTED;
- clear_cur_ui();
- lv_draw_dialog(DIALOG_TRANSFER_NO_DEVICE);
- }
- #endif
- }
- }
- break;
-
- case 105:
- case 991:
- ZERO(tempBuf);
- if (cmd_value == 105) {
-
- SEND_OK_TO_WIFI;
-
- char *outBuf = (char *)tempBuf;
- char tbuf[34];
-
- sprintf_P(tbuf, PSTR("%d /%d"), thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0));
-
- const int tlen = strlen(tbuf);
- sprintf_P(outBuf, PSTR("T:%s"), tbuf);
- outBuf += 2 + tlen;
-
- strcpy_P(outBuf, PSTR(" B:"));
- outBuf += 3;
- #if HAS_HEATED_BED
- sprintf_P(outBuf, PSTR("%d /%d"), thermalManager.wholeDegBed(), thermalManager.degTargetBed());
- #else
- strcpy_P(outBuf, PSTR("0 /0"));
- #endif
- outBuf += 4;
-
- strcat_P(outBuf, PSTR(" T0:"));
- strcat(outBuf, tbuf);
- outBuf += 4 + tlen;
-
- strcat_P(outBuf, PSTR(" T1:"));
- outBuf += 4;
- #if HAS_MULTI_HOTEND
- sprintf_P(outBuf, PSTR("%d /%d"), thermalManager.wholeDegHotend(1), thermalManager.degTargetHotend(1));
- #else
- strcpy_P(outBuf, PSTR("0 /0"));
- #endif
- outBuf += 4;
-
- strcat_P(outBuf, PSTR(" @:0 B@:0\r\n"));
- }
- else {
- sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
- thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0),
- TERN0(HAS_HEATED_BED, thermalManager.wholeDegBed()),
- TERN0(HAS_HEATED_BED, thermalManager.degTargetBed()),
- thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0),
- TERN0(HAS_MULTI_HOTEND, thermalManager.wholeDegHotend(1)),
- TERN0(HAS_MULTI_HOTEND, thermalManager.degTargetHotend(1))
- );
- }
-
- send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
- queue.enqueue_one(F("M105"));
- break;
-
- case 992:
- if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) {
- ZERO(tempBuf);
- sprintf_P((char *)tempBuf, PSTR("M992 %d%d:%d%d:%d%d\r\n"), print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10);
- wifi_ret_ack();
- send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
- }
- break;
-
- case 994:
- if ((uiCfg.print_state == WORKING) || (uiCfg.print_state == PAUSED)) {
- ZERO(tempBuf);
- if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return;
- sprintf_P((char *)tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
- wifi_ret_ack();
- send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
- }
- break;
-
- case 997:
- if (uiCfg.print_state == IDLE) {
- wifi_ret_ack();
- send_to_wifi((uint8_t *)"M997 IDLE\r\n", strlen("M997 IDLE\r\n"));
- }
- else if (uiCfg.print_state == WORKING) {
- wifi_ret_ack();
- send_to_wifi((uint8_t *)"M997 PRINTING\r\n", strlen("M997 PRINTING\r\n"));
- }
- else if (uiCfg.print_state == PAUSED) {
- wifi_ret_ack();
- send_to_wifi((uint8_t *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n"));
}
else if (uiCfg.print_state == REPRINTING) {
- wifi_ret_ack();
- send_to_wifi((uint8_t *)"M997 PAUSE\r\n", strlen("M997 PAUSE\r\n"));
+ uiCfg.print_state = REPRINTED;
+ clear_cur_ui();
+ start_print_time();
+ if (gCfgItems.from_flash_pic)
+ flash_preview_begin = true;
+ else
+ default_preview_flg = true;
+ lv_draw_printing();
}
- if (!uiCfg.command_send) get_wifi_list_command_send();
- break;
-
- case 998:
- if (uiCfg.print_state == IDLE) {
- const int v = atoi((char *)tmpStr);
- if (v == 0 || v == 1) set_cur_file_sys(v);
- wifi_ret_ack();
- }
- break;
-
- case 115:
- ZERO(tempBuf);
- SEND_OK_TO_WIFI;
- send_to_wifi((uint8_t *)"FIRMWARE_NAME:Robin_nano\r\n", strlen("FIRMWARE_NAME:Robin_nano\r\n"));
- break;
-
- default:
- strcat_P((char *)cmd_line, PSTR("\n"));
-
- if (espGcodeFifo.wait_tick > 5) {
- const uint32_t left = espGcodeFifo.r > espGcodeFifo.w
- ? espGcodeFifo.r - espGcodeFifo.w - 1
- : WIFI_GCODE_BUFFER_SIZE + espGcodeFifo.r - espGcodeFifo.w - 1;
-
- if (left >= strlen((const char *)cmd_line)) {
- for (uint32_t index = 0; index < strlen((const char *)cmd_line); index++) {
- espGcodeFifo.Buffer[espGcodeFifo.w] = cmd_line[index] ;
- espGcodeFifo.w = (espGcodeFifo.w + 1) % WIFI_GCODE_BUFFER_SIZE;
- }
- if (left - WIFI_GCODE_BUFFER_LEAST_SIZE >= strlen((const char *)cmd_line))
- SEND_OK_TO_WIFI;
- else
- need_ok_later = true;
- }
- }
- break;
- }
- }
- else {
- strcat_P((char *)cmd_line, PSTR("\n"));
-
- if (espGcodeFifo.wait_tick > 5) {
- const uint32_t left_g = espGcodeFifo.r > espGcodeFifo.w
- ? espGcodeFifo.r - espGcodeFifo.w - 1
- : WIFI_GCODE_BUFFER_SIZE + espGcodeFifo.r - espGcodeFifo.w - 1;
-
- if (left_g >= strlen((const char *)cmd_line)) {
- for (uint32_t index = 0; index < strlen((const char *)cmd_line); index++) {
- espGcodeFifo.Buffer[espGcodeFifo.w] = cmd_line[index] ;
- espGcodeFifo.w = (espGcodeFifo.w + 1) % WIFI_GCODE_BUFFER_SIZE;
- }
- if (left_g - WIFI_GCODE_BUFFER_LEAST_SIZE >= strlen((const char *)cmd_line))
- SEND_OK_TO_WIFI;
- else
- need_ok_later = true;
}
+ send_ok_to_wifi();
+ break;
+
+ case 25:
+ // Pause print file
+ if (uiCfg.print_state == WORKING) {
+ stop_print_time();
+
+ clear_cur_ui();
+
+ #if ENABLED(SDSUPPORT)
+ card.pauseSDPrint();
+ uiCfg.print_state = PAUSING;
+ #endif
+ if (gCfgItems.from_flash_pic)
+ flash_preview_begin = true;
+ else
+ default_preview_flg = true;
+ lv_draw_printing();
+ send_ok_to_wifi();
+ }
+ break;
+
+ case 26:
+ // Stop print file
+ if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED || uiCfg.print_state == REPRINTING) {
+ stop_print_time();
+
+ clear_cur_ui();
+ #if ENABLED(SDSUPPORT)
+ uiCfg.print_state = IDLE;
+ card.abortFilePrintSoon();
+ #endif
+
+ lv_draw_ready_print();
+
+ send_ok_to_wifi();
+ }
+ break;
+
+ case 27:
+ // Report print rate
+ if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED|| uiCfg.print_state == REPRINTING) {
+ print_rate = uiCfg.totalSend;
+ ZERO(tempBuf);
+ sprintf_P((char *)tempBuf, PSTR("M27 %d\r\n"), print_rate);
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
+ }
+ break;
+
+ case 28:
+ // Begin to transfer file to filesys
+ if (uiCfg.print_state == IDLE) {
+
+ int index = 0;
+ while (mStr[index] == ' ') index++;
+
+ if (strstr_P(&mStr[index], PSTR(".g")) || strstr_P(&mStr[index], PSTR(".G"))) {
+ strcpy((char *)file_writer.saveFileName, &mStr[index]);
+
+ if (gCfgItems.fileSysType == FILE_SYS_SD) {
+ ZERO(tempBuf);
+ sprintf_P((char *)tempBuf, PSTR("%s"), file_writer.saveFileName);
+ }
+ else if (gCfgItems.fileSysType == FILE_SYS_USB) {
+ ZERO(tempBuf);
+ sprintf_P((char *)tempBuf, PSTR("%s"), (char *)file_writer.saveFileName);
+ }
+ mount_file_sys(gCfgItems.fileSysType);
+
+ #if ENABLED(SDSUPPORT)
+ char *cur_name = strrchr(list_file.file_name[sel_id], '/');
+ card.openFileWrite(cur_name);
+ if (card.isFileOpen()) {
+ ZERO(file_writer.saveFileName);
+ strcpy((char *)file_writer.saveFileName, &mStr[index]);
+ ZERO(tempBuf);
+ sprintf_P((char *)tempBuf, PSTR("Writing to file: %s\r\n"), (char *)file_writer.saveFileName);
+ wifi_ret_ack();
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
+ wifi_link_state = WIFI_WAIT_TRANS_START;
+ }
+ else {
+ wifi_link_state = WIFI_CONNECTED;
+ clear_cur_ui();
+ lv_draw_dialog(DIALOG_TRANSFER_NO_DEVICE);
+ }
+ #endif
+ }
+ }
+ break;
+
+ case 105:
+ case 991:
+ ZERO(tempBuf);
+ if (cmd_value == 105) {
+
+ send_ok_to_wifi();
+
+ char *outBuf = (char *)tempBuf;
+ char tbuf[34];
+
+ sprintf_P(tbuf, PSTR("%d /%d"), thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0));
+
+ const int tlen = strlen(tbuf);
+ sprintf_P(outBuf, PSTR("T:%s"), tbuf);
+ outBuf += 2 + tlen;
+
+ strcpy_P(outBuf, PSTR(" B:"));
+ outBuf += 3;
+ #if HAS_HEATED_BED
+ sprintf_P(outBuf, PSTR("%d /%d"), thermalManager.wholeDegBed(), thermalManager.degTargetBed());
+ #else
+ strcpy_P(outBuf, PSTR("0 /0"));
+ #endif
+ outBuf += 4;
+
+ strcat_P(outBuf, PSTR(" T0:"));
+ strcat(outBuf, tbuf);
+ outBuf += 4 + tlen;
+
+ strcat_P(outBuf, PSTR(" T1:"));
+ outBuf += 4;
+ #if HAS_MULTI_HOTEND
+ sprintf_P(outBuf, PSTR("%d /%d"), thermalManager.wholeDegHotend(1), thermalManager.degTargetHotend(1));
+ #else
+ strcpy_P(outBuf, PSTR("0 /0"));
+ #endif
+ outBuf += 4;
+
+ strcat_P(outBuf, PSTR(" @:0 B@:0\r\n"));
+ }
+ else {
+ sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
+ thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0),
+ TERN0(HAS_HEATED_BED, thermalManager.wholeDegBed()),
+ TERN0(HAS_HEATED_BED, thermalManager.degTargetBed()),
+ thermalManager.wholeDegHotend(0), thermalManager.degTargetHotend(0),
+ TERN0(HAS_MULTI_HOTEND, thermalManager.wholeDegHotend(1)),
+ TERN0(HAS_MULTI_HOTEND, thermalManager.degTargetHotend(1))
+ );
+ }
+
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
+ queue.enqueue_one(F("M105"));
+ break;
+
+ case 992:
+ if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED) {
+ ZERO(tempBuf);
+ sprintf_P((char *)tempBuf, PSTR("M992 %d%d:%d%d:%d%d\r\n"), print_time.hours/10, print_time.hours%10, print_time.minutes/10, print_time.minutes%10, print_time.seconds/10, print_time.seconds%10);
+ wifi_ret_ack();
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
+ }
+ break;
+
+ case 994:
+ if (uiCfg.print_state == WORKING || uiCfg.print_state == PAUSED) {
+ ZERO(tempBuf);
+ if (strlen((char *)list_file.file_name[sel_id]) > (100 - 1)) return;
+ sprintf_P((char *)tempBuf, PSTR("M994 %s;%d\n"), list_file.file_name[sel_id], (int)gCfgItems.curFilesize);
+ wifi_ret_ack();
+ send_to_wifi((uint8_t *)tempBuf, strlen((char *)tempBuf));
+ }
+ break;
+
+ case 997:
+ #define SENDIDLE "M997 IDLE\r\n"
+ #define SENDPRINTING "M997 PRINTING\r\n"
+ #define SENDPAUSE "M997 PAUSE\r\n"
+ switch (uiCfg.print_state) {
+ default: break;
+ case IDLE:
+ wifi_ret_ack();
+ send_to_wifi((uint8_t *)SENDIDLE, strlen(SENDIDLE));
+ break;
+ case WORKING:
+ wifi_ret_ack();
+ send_to_wifi((uint8_t *)SENDPRINTING, strlen(SENDPRINTING));
+ break;
+ case PAUSED:
+ wifi_ret_ack();
+ send_to_wifi((uint8_t *)SENDPAUSE, strlen(SENDPAUSE));
+ break;
+ case REPRINTING:
+ wifi_ret_ack();
+ send_to_wifi((uint8_t *)SENDPAUSE, strlen(SENDPAUSE));
+ break;
+ }
+ if (!uiCfg.command_send) get_wifi_list_command_send();
+ break;
+
+ case 998:
+ if (uiCfg.print_state == IDLE) {
+ const int v = atoi(mStr);
+ if (v == 0 || v == 1) set_cur_file_sys(v);
+ wifi_ret_ack();
+ }
+ break;
+
+ case 115:
+ ZERO(tempBuf);
+ send_ok_to_wifi();
+ #define SENDFW "FIRMWARE_NAME:Robin_nano\r\n"
+ send_to_wifi((uint8_t *)SENDFW, strlen(SENDFW));
+ break;
+
+ default:
+ strcat_P((char *)cmd_line, PSTR("\n"));
+
+ if (espGcodeFifo.wait_tick > 5) {
+ uint32_t left = espGcodeFifo.r - espGcodeFifo.w - 1;
+ if (espGcodeFifo.r > espGcodeFifo.w) left += WIFI_GCODE_BUFFER_SIZE;
+
+ if (left >= strlen((const char *)cmd_line)) {
+ for (uint32_t index = 0; index < strlen((const char *)cmd_line); index++) {
+ espGcodeFifo.Buffer[espGcodeFifo.w] = cmd_line[index];
+ espGcodeFifo.w = (espGcodeFifo.w + 1) % (WIFI_GCODE_BUFFER_SIZE);
+ }
+ if (left - (WIFI_GCODE_BUFFER_LEAST_SIZE) >= strlen((const char *)cmd_line))
+ send_ok_to_wifi();
+ else
+ need_ok_later = true;
+ }
+ }
+ break;
+ }
+ }
+ else {
+ // Add another linefeed to the command, terminate with null
+ strcat_P((char *)cmd_line, PSTR("\n"));
+
+ if (espGcodeFifo.wait_tick > 5) {
+ uint32_t left_g = espGcodeFifo.r - espGcodeFifo.w - 1;
+ if (espGcodeFifo.r > espGcodeFifo.w) left_g += WIFI_GCODE_BUFFER_SIZE;
+
+ if (left_g >= strlen((char * const)cmd_line)) {
+ for (uint32_t index = 0; index < strlen((char * const)cmd_line); index++) {
+ espGcodeFifo.Buffer[espGcodeFifo.w] = cmd_line[index];
+ espGcodeFifo.w = (espGcodeFifo.w + 1) % (WIFI_GCODE_BUFFER_SIZE);
+ }
+ if (left_g - (WIFI_GCODE_BUFFER_LEAST_SIZE) >= strlen((char * const)cmd_line))
+ send_ok_to_wifi();
+ else
+ need_ok_later = true;
}
}
}
@@ -1281,7 +1309,7 @@ void get_wifi_list_command_send() {
raw_send_to_wifi(cmd_wifi_list, COUNT(cmd_wifi_list));
}
-static void net_msg_handle(uint8_t * msg, uint16_t msgLen) {
+static void net_msg_handle(const uint8_t * const msg, const uint16_t msgLen) {
int wifiNameLen, wifiKeyLen, hostLen, id_len, ver_len;
if (msgLen <= 0) return;
@@ -1316,7 +1344,7 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) {
}
}
- cloud_para.state =msg[10 + wifiNameLen + wifiKeyLen];
+ cloud_para.state = msg[10 + wifiNameLen + wifiKeyLen];
hostLen = msg[11 + wifiNameLen + wifiKeyLen];
if (cloud_para.state) {
if (hostLen < 96) {
@@ -1356,7 +1384,7 @@ static void net_msg_handle(uint8_t * msg, uint16_t msgLen) {
}
}
-static void wifi_list_msg_handle(uint8_t * msg, uint16_t msgLen) {
+static void wifi_list_msg_handle(const uint8_t * const msg, const uint16_t msgLen) {
int wifiNameLen,wifiMsgIdex = 1;
int8_t wifi_name_is_same = 0;
int8_t i, j;
@@ -1415,16 +1443,15 @@ static void wifi_list_msg_handle(uint8_t * msg, uint16_t msgLen) {
}
}
-static void gcode_msg_handle(uint8_t * msg, uint16_t msgLen) {
+static void gcode_msg_handle(const uint8_t * const msg, const uint16_t msgLen) {
uint8_t gcodeBuf[100] = { 0 };
- char *index_s, *index_e;
if (msgLen <= 0) return;
- index_s = (char *)msg;
- index_e = (char *)strchr((char *)msg, '\n');
+ char *index_s = (char *)msg,
+ *index_e = strchr((char *)msg, '\n');
if (*msg == 'N') {
- index_s = (char *)strchr((char *)msg, ' ');
+ index_s = strchr((char *)msg, ' ');
while (*index_s == ' ') index_s++;
}
while ((index_e != 0) && ((int)index_s < (int)index_e)) {
@@ -1435,7 +1462,7 @@ static void gcode_msg_handle(uint8_t * msg, uint16_t msgLen) {
}
while ((*index_e == '\r') || (*index_e == '\n')) index_e++;
index_s = index_e;
- index_e = (char *)strchr(index_s, '\n');
+ index_e = strchr(index_s, '\n');
}
}
@@ -1482,8 +1509,8 @@ void utf8_2_unicode(uint8_t *source, uint8_t Len) {
COPY(source, FileName_unicode);
}
-static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) {
- uint8_t fileNameLen = *msg;
+static void file_first_msg_handle(const uint8_t * const msg, const uint16_t msgLen) {
+ const uint8_t fileNameLen = *msg;
if (msgLen != fileNameLen + 5) return;
@@ -1565,8 +1592,8 @@ static void file_first_msg_handle(uint8_t * msg, uint16_t msgLen) {
#define FRAG_MASK ~_BV32(31)
-static void file_fragment_msg_handle(uint8_t * msg, uint16_t msgLen) {
- uint32_t frag = *((uint32_t *)msg);
+static void file_fragment_msg_handle(const uint8_t * const msg, const uint16_t msgLen) {
+ const uint32_t frag = *((uint32_t *)msg);
if ((frag & FRAG_MASK) != (uint32_t)(lastFragment + 1)) {
ZERO(public_buf);
file_writer.write_index = 0;
@@ -1842,7 +1869,7 @@ void wifi_rcv_handle() {
}
if (need_ok_later && !queue.ring_buffer.full()) {
need_ok_later = false;
- send_to_wifi((uint8_t *)"ok\r\n", strlen("ok\r\n"));
+ send_ok_to_wifi();
}
}
@@ -1872,7 +1899,7 @@ void wifi_rcv_handle() {
if (wifiTransError.flag == 0x1) {
wifiTransError.now_tick = getWifiTick();
- if (getWifiTickDiff(wifiTransError.start_tick, wifiTransError.now_tick) > WAIT_ESP_TRANS_TIMEOUT_TICK) {
+ if (getWifiTickDiff(wifiTransError.start_tick, wifiTransError.now_tick) > (WAIT_ESP_TRANS_TIMEOUT_TICK)) {
wifiTransError.flag = 0;
WIFI_IO1_RESET();
}
@@ -1992,7 +2019,7 @@ void get_wifi_commands() {
char wifi_char = espGcodeFifo.Buffer[espGcodeFifo.r];
- espGcodeFifo.r = (espGcodeFifo.r + 1) % WIFI_GCODE_BUFFER_SIZE;
+ espGcodeFifo.r = (espGcodeFifo.r + 1) % (WIFI_GCODE_BUFFER_SIZE);
/**
* If the character ends the line
diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.h b/Marlin/src/lcd/extui/mks_ui/wifi_module.h
index 36998899b4..851e85c512 100644
--- a/Marlin/src/lcd/extui/mks_ui/wifi_module.h
+++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.h
@@ -163,8 +163,8 @@ typedef struct {
//uint8_t uartTxBuffer[UART_FIFO_BUFFER_SIZE];
} SZ_USART_FIFO;
-#define WIFI_GCODE_BUFFER_LEAST_SIZE 96
-#define WIFI_GCODE_BUFFER_SIZE (WIFI_GCODE_BUFFER_LEAST_SIZE * 3)
+#define WIFI_GCODE_BUFFER_LEAST_SIZE 96
+#define WIFI_GCODE_BUFFER_SIZE (WIFI_GCODE_BUFFER_LEAST_SIZE * 3)
typedef struct {
uint8_t wait_tick;
uint8_t Buffer[WIFI_GCODE_BUFFER_SIZE];
@@ -179,14 +179,14 @@ extern CLOUD_PARA cloud_para;
extern WIFI_GCODE_BUFFER espGcodeFifo;
-uint32_t getWifiTick();
-uint32_t getWifiTickDiff(int32_t lastTick, int32_t curTick);
+millis_t getWifiTick();
+millis_t getWifiTickDiff(const millis_t lastTick, const millis_t curTick);
void mks_esp_wifi_init();
extern int cfg_cloud_flag;
-int send_to_wifi(uint8_t *buf, int len);
+int send_to_wifi(uint8_t * const buf, const int len);
void wifi_looping();
-int raw_send_to_wifi(uint8_t *buf, int len);
+int raw_send_to_wifi(uint8_t * const buf, const int len);
int package_to_wifi(WIFI_RET_TYPE type, uint8_t *buf, int len);
void get_wifi_list_command_send();
void get_wifi_commands();
diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp
index 44869d4770..398d35fdc3 100644
--- a/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp
+++ b/Marlin/src/lcd/extui/mks_ui/wifi_upload.cpp
@@ -38,10 +38,8 @@
extern SZ_USART_FIFO WifiRxFifo;
-extern int readUsartFifo(SZ_USART_FIFO *fifo, int8_t *buf, int32_t len);
-extern int writeUsartFifo(SZ_USART_FIFO * fifo, int8_t * buf, int32_t len);
void esp_port_begin(uint8_t interrupt);
-void wifi_delay(int n);
+void wifi_delay(const uint16_t n);
#define ARRAY_SIZE(a) sizeof(a) / sizeof((a)[0])
@@ -246,7 +244,7 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t
const size_t headerLength = 8;
- uint32_t startTime = getWifiTick();
+ const millis_t startTime = getWifiTick();
uint8_t hdr[headerLength];
uint16_t hdrIdx = 0;
diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_upload.h b/Marlin/src/lcd/extui/mks_ui/wifi_upload.h
index 2daa505d90..524fb28f85 100644
--- a/Marlin/src/lcd/extui/mks_ui/wifi_upload.h
+++ b/Marlin/src/lcd/extui/mks_ui/wifi_upload.h
@@ -59,8 +59,8 @@ typedef struct {
UploadState state;
uint32_t retriesPerBaudRate;
uint32_t connectAttemptNumber;
- uint32_t lastAttemptTime;
- uint32_t lastResetTime;
+ millis_t lastAttemptTime;
+ millis_t lastResetTime;
uint32_t uploadBlockNumber;
uint32_t uploadNextPercentToReport;
EspUploadResult uploadResult;
From 8c64fdd091f825d7fdcb0eb903c5d1af49c76129 Mon Sep 17 00:00:00 2001
From: Liam Powell
Date: Sat, 18 Mar 2023 17:41:20 +0800
Subject: [PATCH 043/225] =?UTF-8?q?=F0=9F=94=A8=20Fix=20STM32H723Vx=5Fbtt?=
=?UTF-8?q?=20for=20case-sensitive=20(#25535)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json b/buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json
index 73620c162d..a2154d448a 100644
--- a/buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json
+++ b/buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json
@@ -6,7 +6,7 @@
"f_cpu": "550000000L",
"mcu": "stm32h723vet6",
"product_line": "STM32H723xx",
- "variant": "MARLIN_H723vx"
+ "variant": "MARLIN_H723Vx"
},
"connectivity": [
"can",
From 927915a4e68772c348d3c67689363fc512559d14 Mon Sep 17 00:00:00 2001
From: George Fu
Date: Sat, 18 Mar 2023 17:47:54 +0800
Subject: [PATCH 044/225] =?UTF-8?q?=F0=9F=90=9B=20Fix=20FYSETC=20Cheetah?=
=?UTF-8?q?=20v2.0=20Servo/Probe=20pins=20(#24635)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
.../pins/stm32f4/pins_FYSETC_CHEETAH_V20.h | 26 ++++++++++---------
.../MARLIN_FYSETC_CHEETAH_V20/variant.h | 2 +-
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h
index 32ec518bf8..031caa1ce1 100644
--- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h
+++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h
@@ -43,22 +43,24 @@
#define FLASH_ADDRESS_START 0x8004000
#endif
-//
-// Z Probe
-//
-#if ENABLED(BLTOUCH)
- #error "You need to set jumper to 5v for Bltouch, then comment out this line to proceed."
- #define SERVO0_PIN PA0
-#elif !defined(Z_MIN_PROBE_PIN)
- #define Z_MIN_PROBE_PIN PA0
-#endif
+#define SERVO0_PIN PB1 // BL-TOUCH/PWM
//
// Limit Switches
//
-#define X_STOP_PIN PB4
-#define Y_STOP_PIN PC8
-#define Z_STOP_PIN PB1
+#define X_STOP_PIN PB4 // X-MIN
+#define Y_STOP_PIN PC8 // Y-MIN
+#define Z_STOP_PIN PA0 // Z-MIN
+
+//
+// Z Probe
+//
+#if ENABLED(BLTOUCH)
+ #error "You need to set jumper to 5V for BLTouch, then comment out this line to proceed."
+#endif
+#ifndef Z_MIN_PROBE_PIN
+ #define Z_MIN_PROBE_PIN PB1 // BL-TOUCH/PWM repurposed
+#endif
//
// Filament runout
diff --git a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h
index a090113fa3..041c43b55f 100644
--- a/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h
+++ b/buildroot/share/PlatformIO/variants/MARLIN_FYSETC_CHEETAH_V20/variant.h
@@ -95,7 +95,7 @@ extern "C" {
// Timer Definitions
#define TIMER_TONE TIM2 // TIMER_TONE must be defined in this file
-#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file
+#define TIMER_SERVO TIM3 // TIMER_SERVO must be defined in this file
#define TIMER_SERIAL TIM11 // TIMER_SERIAL must be defined in this file
// UART Definitions
From fbb1c82bc2acbbe3339e2283a797126b3c3ea515 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Paczy=C5=84ski?=
Date: Sat, 18 Mar 2023 11:01:10 +0100
Subject: [PATCH 045/225] =?UTF-8?q?=F0=9F=90=9B=20Prevent=20MPC=20E-permm?=
=?UTF-8?q?=20overrun=20in=20Load=20Filament=20(#25531)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/src/feature/pause.cpp | 5 +++++
Marlin/src/module/temperature.cpp | 17 +++++++++--------
Marlin/src/module/temperature.h | 8 +++-----
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp
index 83d149fa09..488f5920c2 100644
--- a/Marlin/src/feature/pause.cpp
+++ b/Marlin/src/feature/pause.cpp
@@ -234,6 +234,8 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
TERN_(BELTPRINTER, do_blocking_move_to_xy(0.00, 50.00));
+ TERN_(MPCTEMP, MPC::e_paused = true);
+
// Slow Load filament
if (slow_load_length) unscaled_e_move(slow_load_length, FILAMENT_CHANGE_SLOW_LOAD_FEEDRATE);
@@ -297,6 +299,9 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load
} while (TERN0(M600_PURGE_MORE_RESUMABLE, pause_menu_response == PAUSE_RESPONSE_EXTRUDE_MORE));
#endif
+
+ TERN_(MPCTEMP, MPC::e_paused = false);
+
TERN_(HOST_PROMPT_SUPPORT, hostui.prompt_end());
return true;
diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index bafade45dd..578fd112d2 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -319,6 +319,11 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
hotend_info_t Temperature::temp_hotend[HOTENDS];
constexpr celsius_t Temperature::hotend_maxtemp[HOTENDS];
+ #if ENABLED(MPCTEMP)
+ bool MPC::e_paused; // = false
+ int32_t MPC::e_position; // = 0
+ #endif
+
// Sanity-check max readable temperatures
#define CHECK_MAXTEMP_(N,M,S) static_assert( \
S >= 998 || M <= _MAX(TT_NAME(S)[0].celsius, TT_NAME(S)[COUNT(TT_NAME(S)) - 1].celsius) - HOTEND_OVERSHOOT, \
@@ -588,10 +593,6 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
volatile bool Temperature::raw_temps_ready = false;
-#if ENABLED(MPCTEMP)
- int32_t Temperature::mpc_e_position; // = 0
-#endif
-
#define TEMPDIR(N) ((TEMP_SENSOR_##N##_RAW_LO_TEMP) < (TEMP_SENSOR_##N##_RAW_HI_TEMP) ? 1 : -1)
#define TP_CMP(S,A,B) (TEMPDIR(S) < 0 ? ((A)<(B)) : ((A)>(B)))
@@ -1511,14 +1512,14 @@ void Temperature::mintemp_error(const heater_id_t heater_id) {
if (this_hotend) {
const int32_t e_position = stepper.position(E_AXIS);
- const float e_speed = (e_position - mpc_e_position) * planner.mm_per_step[E_AXIS] / MPC_dT;
+ const float e_speed = (e_position - MPC::e_position) * planner.mm_per_step[E_AXIS] / MPC_dT;
// The position can appear to make big jumps when, e.g., homing
if (fabs(e_speed) > planner.settings.max_feedrate_mm_s[E_AXIS])
- mpc_e_position = e_position;
+ MPC::e_position = e_position;
else if (e_speed > 0.0f) { // Ignore retract/recover moves
- ambient_xfer_coeff += e_speed * mpc.filament_heat_capacity_permm;
- mpc_e_position = e_position;
+ if (!MPC::e_paused) ambient_xfer_coeff += e_speed * mpc.filament_heat_capacity_permm;
+ MPC::e_position = e_position;
}
}
diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h
index b8bf03bf31..0ab00ef768 100644
--- a/Marlin/src/module/temperature.h
+++ b/Marlin/src/module/temperature.h
@@ -377,7 +377,9 @@ typedef struct { float p, i, d, c, f; } raw_pidcf_t;
#elif ENABLED(MPCTEMP)
- typedef struct {
+ typedef struct MPC {
+ static bool e_paused; // Pause E filament permm tracking
+ static int32_t e_position; // For E tracking
float heater_power; // M306 P
float block_heat_capacity; // M306 C
float sensor_responsiveness; // M306 R
@@ -716,10 +718,6 @@ class Temperature {
static hotend_watch_t watch_hotend[HOTENDS];
#endif
- #if ENABLED(MPCTEMP)
- static int32_t mpc_e_position;
- #endif
-
#if HAS_HOTEND
static temp_range_t temp_range[HOTENDS];
#endif
From 5abfc6160f57f5e37c7e88bead4b5eef88832a9e Mon Sep 17 00:00:00 2001
From: Farva42 <100859196+Farva42@users.noreply.github.com>
Date: Sat, 18 Mar 2023 04:14:51 -0600
Subject: [PATCH 046/225] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20/=20improve=20LCD?=
=?UTF-8?q?=5FBED=5FTRAMMING=20(#25425)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/src/gcode/probe/M401_M402.cpp | 27 ++--
Marlin/src/lcd/menu/menu_bed_tramming.cpp | 142 +++++++++++++---------
Marlin/src/module/probe.cpp | 7 +-
Marlin/src/module/probe.h | 8 +-
4 files changed, 105 insertions(+), 79 deletions(-)
diff --git a/Marlin/src/gcode/probe/M401_M402.cpp b/Marlin/src/gcode/probe/M401_M402.cpp
index 3389574919..7114cad9e8 100644
--- a/Marlin/src/gcode/probe/M401_M402.cpp
+++ b/Marlin/src/gcode/probe/M401_M402.cpp
@@ -38,30 +38,33 @@
* With BLTOUCH_HS_MODE:
* H Report the current BLTouch HS mode state and exit
* S Set High Speed (HS) Mode and exit without deploy
+ *
+ * R Remain in place after deploying (and before activating) the probe
*/
void GcodeSuite::M401() {
- const bool seenH = parser.seen_test('H'),
- seenS = parser.seen('S');
- if (seenH || seenS) {
- #ifdef BLTOUCH_HS_MODE
+ #ifdef BLTOUCH_HS_MODE
+ const bool seenH = parser.seen_test('H'),
+ seenS = parser.seen('S');
+ if (seenH || seenS) {
if (seenS) bltouch.high_speed_mode = parser.value_bool();
SERIAL_ECHO_START();
SERIAL_ECHOPGM("BLTouch HS mode ");
serialprintln_onoff(bltouch.high_speed_mode);
- #endif
- }
- else {
- probe.deploy();
- TERN_(PROBE_TARE, probe.tare());
- report_current_position();
- }
+ return;
+ }
+ #endif
+
+ probe.deploy(parser.boolval('R'));
+ TERN_(PROBE_TARE, probe.tare());
+ report_current_position();
}
/**
* M402: Deactivate and stow the Z probe
+ * R Remain in place after stowing (and before deactivating) the probe
*/
void GcodeSuite::M402() {
- probe.stow();
+ probe.stow(parser.boolval('R'));
probe.move_z_after_probing();
report_current_position();
}
diff --git a/Marlin/src/lcd/menu/menu_bed_tramming.cpp b/Marlin/src/lcd/menu/menu_bed_tramming.cpp
index 5f1b547871..8129a347c3 100644
--- a/Marlin/src/lcd/menu/menu_bed_tramming.cpp
+++ b/Marlin/src/lcd/menu/menu_bed_tramming.cpp
@@ -43,6 +43,10 @@
#define BED_TRAMMING_HEIGHT 0.0
#endif
+#if BOTH(HAS_STOWABLE_PROBE, BED_TRAMMING_USE_PROBE) && DISABLED(BLTOUCH)
+ #define NEEDS_PROBE_DEPLOY 1
+#endif
+
#if ENABLED(BED_TRAMMING_USE_PROBE)
#include "../../module/probe.h"
#include "../../module/endstops.h"
@@ -97,38 +101,38 @@ constexpr xy_pos_t lf { (X_MIN_BED) + inset_lfrb[0], (Y_MIN_BED) + inset_lfrb[1]
static int8_t bed_corner;
/**
- * Select next corner coordinates
+ * Move to the next corner coordinates
*/
-static void _lcd_bed_tramming_get_next_position() {
+static void _lcd_goto_next_corner() {
+ xy_pos_t corner_point = lf; // Left front
if (tramming_3_points) {
if (bed_corner >= available_points) bed_corner = 0; // Above max position -> move back to first corner
switch (bed_corner) {
case 0 ... 1:
// First two corners set explicitly by the configuration
- current_position = lf; // Left front
switch (lco[bed_corner]) {
- case RF: current_position.x = rb.x; break; // Right Front
- case RB: current_position = rb; break; // Right Back
- case LB: current_position.y = rb.y; break; // Left Back
+ case RF: corner_point.x = rb.x; break; // Right Front
+ case RB: corner_point = rb; break; // Right Back
+ case LB: corner_point.y = rb.y; break; // Left Back
}
break;
case 2:
// Determine which edge to probe for 3rd point
- current_position.set(lf.x + (rb.x - lf.x) / 2, lf.y + (rb.y - lf.y) / 2);
- if ((lco[0] == LB && lco[1] == RB) || (lco[0] == RB && lco[1] == LB)) current_position.y = lf.y; // Front Center
- if ((lco[0] == LF && lco[1] == LB) || (lco[0] == LB && lco[1] == LF)) current_position.x = rb.x; // Center Right
- if ((lco[0] == RF && lco[1] == RB) || (lco[0] == RB && lco[1] == RF)) current_position.x = lf.x; // Left Center
- if ((lco[0] == LF && lco[1] == RF) || (lco[0] == RF && lco[1] == LF)) current_position.y = rb.y; // Center Back
- #if DISABLED(BED_TRAMMING_INCLUDE_CENTER) && ENABLED(BED_TRAMMING_USE_PROBE)
+ corner_point.set(lf.x + (rb.x - lf.x) / 2, lf.y + (rb.y - lf.y) / 2);
+ if ((lco[0] == LB && lco[1] == RB) || (lco[0] == RB && lco[1] == LB)) corner_point.y = lf.y; // Front Center
+ if ((lco[0] == LF && lco[1] == LB) || (lco[0] == LB && lco[1] == LF)) corner_point.x = rb.x; // Center Right
+ if ((lco[0] == RF && lco[1] == RB) || (lco[0] == RB && lco[1] == RF)) corner_point.x = lf.x; // Left Center
+ if ((lco[0] == LF && lco[1] == RF) || (lco[0] == RF && lco[1] == LF)) corner_point.y = rb.y; // Center Back
+ #if ENABLED(BED_TRAMMING_USE_PROBE) && DISABLED(BED_TRAMMING_INCLUDE_CENTER)
bed_corner++; // Must increment the count to ensure it resets the loop if the 3rd point is out of tolerance
#endif
break;
#if ENABLED(BED_TRAMMING_INCLUDE_CENTER)
case 3:
- current_position.set(X_CENTER, Y_CENTER);
+ corner_point.set(X_CENTER, Y_CENTER);
break;
#endif
}
@@ -136,23 +140,29 @@ static void _lcd_bed_tramming_get_next_position() {
else {
// Four-Corner Bed Tramming with optional center
if (TERN0(BED_TRAMMING_INCLUDE_CENTER, bed_corner == center_index)) {
- current_position.set(X_CENTER, Y_CENTER);
- TERN_(BED_TRAMMING_USE_PROBE, good_points--); // Decrement to allow one additional probe point
+ corner_point.set(X_CENTER, Y_CENTER);
}
else {
- current_position = lf; // Left front
switch (lco[bed_corner]) {
- case RF: current_position.x = rb.x; break; // Right Front
- case RB: current_position = rb; break; // Right Back
- case LB: current_position.y = rb.y; break; // Left Back
+ case RF: corner_point.x = rb.x; break; // Right Front
+ case RB: corner_point = rb; break; // Right Back
+ case LB: corner_point.y = rb.y; break; // Left Back
}
}
}
+
+ float z = BED_TRAMMING_Z_HOP;
+ #if BOTH(BED_TRAMMING_USE_PROBE, BLTOUCH)
+ z += bltouch.z_extra_clearance();
+ #endif
+ line_to_z(z);
+ do_blocking_move_to_xy(DIFF_TERN(BED_TRAMMING_USE_PROBE, corner_point, probe.offset_xy), manual_feedrate_mm_s.x);
+ #if DISABLED(BED_TRAMMING_USE_PROBE)
+ line_to_z(BED_TRAMMING_HEIGHT);
+ if (++bed_corner >= available_points) bed_corner = 0;
+ #endif
}
-/**
- * Level corners, starting in the front-left corner.
- */
#if ENABLED(BED_TRAMMING_USE_PROBE)
#define VALIDATE_POINT(X, Y, STR) static_assert(Probe::build_time::can_reach((X), (Y)), \
@@ -210,13 +220,21 @@ static void _lcd_bed_tramming_get_next_position() {
MenuItem_confirm::select_screen(
GET_TEXT_F(TERN(HAS_LEVELING, MSG_BUTTON_LEVEL, MSG_BUTTON_DONE))
, TERN(HAS_LEVELING, GET_TEXT_F(MSG_BUTTON_BACK), nullptr)
- , []{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); }
- , TERN(HAS_LEVELING, ui.goto_previous_screen_no_defer, []{})
+ , []{
+ tramming_done = true;
+ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR)));
+ ui.goto_previous_screen_no_defer();
+ }
+ , []{
+ tramming_done = true;
+ TERN_(HAS_LEVELING, ui.goto_previous_screen_no_defer());
+ TERN_(NEEDS_PROBE_DEPLOY, probe.stow(true));
+ }
, GET_TEXT_F(MSG_BED_TRAMMING_IN_RANGE)
);
}
- bool _lcd_bed_tramming_probe(bool verify=false) {
+ bool _lcd_bed_tramming_probe(const bool verify=false) {
if (verify) line_to_z(BED_TRAMMING_Z_HOP); // do clearance if needed
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
do_blocking_move_to_z(last_z - BED_TRAMMING_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
@@ -232,6 +250,11 @@ static void _lcd_bed_tramming_get_next_position() {
last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
good_points = 0; // ...and start over
}
+
+ // Raise the probe after the last point to give clearance for stow
+ if (TERN0(NEEDS_PROBE_DEPLOY, good_points == nr_edge_points - 1))
+ line_to_z(BED_TRAMMING_Z_HOP);
+
return true; // probe triggered
}
line_to_z(last_z); // go back to tolerance middle point before raise
@@ -267,11 +290,7 @@ static void _lcd_bed_tramming_get_next_position() {
ui.refresh(LCDVIEW_REDRAW_NOW);
_lcd_draw_probing(); // update screen with # of good points
- line_to_z(current_position.z + BED_TRAMMING_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
-
- _lcd_bed_tramming_get_next_position(); // Select next corner coordinates
- current_position -= probe.offset_xy; // Account for probe offsets
- do_blocking_move_to_xy(current_position); // Goto corner
+ _lcd_goto_next_corner(); // Goto corner
TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE
if (!_lcd_bed_tramming_probe()) { // Probe down to tolerance
@@ -306,31 +325,26 @@ static void _lcd_bed_tramming_get_next_position() {
ui.set_selection(true);
}
-#else // !BED_TRAMMING_USE_PROBE
-
- static void _lcd_goto_next_corner() {
- line_to_z(BED_TRAMMING_Z_HOP);
-
- // Select next corner coordinates
- _lcd_bed_tramming_get_next_position();
-
- line_to_current_position(manual_feedrate_mm_s.x);
- line_to_z(BED_TRAMMING_HEIGHT);
- if (++bed_corner >= available_points) bed_corner = 0;
- }
-
-#endif // !BED_TRAMMING_USE_PROBE
+#endif // BED_TRAMMING_USE_PROBE
void _lcd_bed_tramming_homing() {
- _lcd_draw_homing();
- if (!all_axes_homed()) return;
+ if (!all_axes_homed() && TERN1(NEEDS_PROBE_DEPLOY, probe.deploy())) return;
+
+ #if HAS_LEVELING // Disable leveling so the planner won't mess with us
+ menu_leveling_was_active = planner.leveling_active;
+ set_bed_leveling_enabled(false);
+ #endif
#if ENABLED(BED_TRAMMING_USE_PROBE)
- _lcd_test_corners();
- if (tramming_done) ui.goto_previous_screen_no_defer();
+ if (!tramming_done) _lcd_test_corners(); // May set tramming_done
+ if (tramming_done) {
+ ui.goto_previous_screen_no_defer();
+ TERN_(NEEDS_PROBE_DEPLOY, probe.stow(true));
+ }
+ tramming_done = true;
TERN_(HAS_LEVELING, set_bed_leveling_enabled(menu_leveling_was_active));
- endstops.enable_z_probe(false);
+ TERN_(BLTOUCH, endstops.enable_z_probe(false));
#else // !BED_TRAMMING_USE_PROBE
@@ -354,20 +368,28 @@ void _lcd_bed_tramming_homing() {
#endif // !BED_TRAMMING_USE_PROBE
}
-void _lcd_bed_tramming() {
- ui.defer_status_screen();
- if (!all_axes_trusted()) {
- set_all_unhomed();
- queue.inject_P(G28_STR);
+#if NEEDS_PROBE_DEPLOY
+
+ void deploy_probe() {
+ if (!tramming_done) probe.deploy(true);
+ ui.goto_screen([]{
+ if (ui.should_draw()) MenuItem_static::draw((LCD_HEIGHT - 1) / 2, GET_TEXT_F(MSG_MANUAL_DEPLOY));
+ if (!probe.deploy() && !tramming_done) _lcd_bed_tramming_homing();
+ });
}
- // Disable leveling so the planner won't mess with us
- #if HAS_LEVELING
- menu_leveling_was_active = planner.leveling_active;
- set_bed_leveling_enabled(false);
- #endif
+#endif // NEEDS_PROBE_DEPLOY
- ui.goto_screen(_lcd_bed_tramming_homing);
+void _lcd_bed_tramming() {
+ TERN_(BED_TRAMMING_USE_PROBE, tramming_done = false);
+ ui.defer_status_screen();
+ set_all_unhomed();
+ queue.inject(TERN(CAN_SET_LEVELING_AFTER_G28, F("G28L0"), FPSTR(G28_STR)));
+ ui.goto_screen([]{
+ _lcd_draw_homing();
+ if (!all_axes_homed()) return;
+ TERN(NEEDS_PROBE_DEPLOY, deploy_probe(), ui.goto_screen(_lcd_bed_tramming_homing));
+ });
}
#endif // HAS_MARLINUI_MENU && LCD_BED_TRAMMING
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index da69b725b9..ea17eee6ee 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -500,11 +500,11 @@ void Probe::probe_error_stop() {
*
* Return TRUE if the probe could not be deployed/stowed
*/
-bool Probe::set_deployed(const bool deploy) {
+bool Probe::set_deployed(const bool deploy, const bool no_return/*=false*/) {
if (DEBUGGING(LEVELING)) {
DEBUG_POS("Probe::set_deployed", current_position);
- DEBUG_ECHOLNPGM("deploy: ", deploy);
+ DEBUG_ECHOLNPGM("deploy=", deploy, " no_return=", no_return);
}
if (endstops.z_probe_enabled == deploy) return false;
@@ -557,7 +557,8 @@ bool Probe::set_deployed(const bool deploy) {
// If preheating is required before any probing...
TERN_(PREHEAT_BEFORE_PROBING, if (deploy) preheat_for_probing(PROBING_NOZZLE_TEMP, PROBING_BED_TEMP));
- do_blocking_move_to(old_xy);
+ if (!no_return) do_blocking_move_to(old_xy); // Return to the original location unless handled externally
+
endstops.enable_z_probe(deploy);
return false;
}
diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h
index b50f79ed5d..9aff9cff06 100644
--- a/Marlin/src/module/probe.h
+++ b/Marlin/src/module/probe.h
@@ -90,7 +90,7 @@ public:
static void probe_error_stop();
- static bool set_deployed(const bool deploy);
+ static bool set_deployed(const bool deploy, const bool no_return=false);
#if IS_KINEMATIC
@@ -182,7 +182,7 @@ public:
static constexpr xyz_pos_t offset = xyz_pos_t(NUM_AXIS_ARRAY_1(0)); // See #16767
- static bool set_deployed(const bool) { return false; }
+ static bool set_deployed(const bool, const bool=false) { return false; }
static bool can_reach(const_float_t rx, const_float_t ry, const bool=true) { return position_is_reachable(rx, ry); }
@@ -216,8 +216,8 @@ public:
static constexpr xy_pos_t offset_xy = xy_pos_t({ 0, 0 }); // See #16767
#endif
- static bool deploy() { return set_deployed(true); }
- static bool stow() { return set_deployed(false); }
+ static bool deploy(const bool no_return=false) { return set_deployed(true, no_return); }
+ static bool stow(const bool no_return=false) { return set_deployed(false, no_return); }
#if HAS_BED_PROBE || HAS_LEVELING
#if IS_KINEMATIC
From 6f2d8a3872cd98bafd44e563cfbca35596111ee7 Mon Sep 17 00:00:00 2001
From: John Robertson
Date: Sat, 18 Mar 2023 10:33:15 +0000
Subject: [PATCH 047/225] =?UTF-8?q?=F0=9F=94=A7=20Sanity-check=20PRINTCOUN?=
=?UTF-8?q?TER=5FSAVE=5FINTERVAL=20+=20ESP32=20I2S=20Exp=20(#25527)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/src/HAL/ESP32/inc/SanityCheck.h | 4 ++++
Marlin/src/HAL/LPC1768/inc/Conditionals_post.h | 2 +-
Marlin/src/HAL/STM32/inc/Conditionals_post.h | 2 +-
Marlin/src/inc/Warnings.cpp | 2 +-
Marlin/src/module/printcounter.cpp | 2 +-
5 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/Marlin/src/HAL/ESP32/inc/SanityCheck.h b/Marlin/src/HAL/ESP32/inc/SanityCheck.h
index 8c5621f10c..2d1b850330 100644
--- a/Marlin/src/HAL/ESP32/inc/SanityCheck.h
+++ b/Marlin/src/HAL/ESP32/inc/SanityCheck.h
@@ -56,3 +56,7 @@
#if BOTH(I2S_STEPPER_STREAM, LIN_ADVANCE) && DISABLED(EXPERIMENTAL_I2S_LA)
#error "I2S stream is currently incompatible with LIN_ADVANCE."
#endif
+
+#if BOTH(I2S_STEPPER_STREAM, PRINTCOUNTER) && PRINTCOUNTER_SAVE_INTERVAL > 0 && DISABLED(PRINTCOUNTER_SYNC)
+ #error "PRINTCOUNTER_SAVE_INTERVAL may cause issues on ESP32 with an I2S expander. Define PRINTCOUNTER_SYNC in Configuration.h for an imperfect solution."
+#endif
diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
index 3549950008..a0bf421538 100644
--- a/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
+++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_post.h
@@ -30,5 +30,5 @@
// LPC1768 boards seem to lose steps when saving to EEPROM during print (issue #20785)
// TODO: Which other boards are incompatible?
#if defined(MCU_LPC1768) && ENABLED(FLASH_EEPROM_EMULATION) && PRINTCOUNTER_SAVE_INTERVAL > 0
- #define PRINTCOUNTER_SYNC 1
+ #define PRINTCOUNTER_SYNC
#endif
diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_post.h b/Marlin/src/HAL/STM32/inc/Conditionals_post.h
index c5ce66a26f..83ce077c75 100644
--- a/Marlin/src/HAL/STM32/inc/Conditionals_post.h
+++ b/Marlin/src/HAL/STM32/inc/Conditionals_post.h
@@ -30,5 +30,5 @@
// Some STM32F4 boards may lose steps when saving to EEPROM during print (PR #17946)
#if defined(STM32F4xx) && ENABLED(FLASH_EEPROM_EMULATION) && PRINTCOUNTER_SAVE_INTERVAL > 0
- #define PRINTCOUNTER_SYNC 1
+ #define PRINTCOUNTER_SYNC
#endif
diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp
index 55b9a18e77..405e7a351e 100644
--- a/Marlin/src/inc/Warnings.cpp
+++ b/Marlin/src/inc/Warnings.cpp
@@ -715,7 +715,7 @@
#warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label (typically on SD Card module) and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225, H8=HR4988). (Define NO_CREALITY_422_DRIVER_WARNING to suppress this warning.)"
#endif
-#if PRINTCOUNTER_SYNC
+#if ENABLED(PRINTCOUNTER_SYNC)
#warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
#endif
diff --git a/Marlin/src/module/printcounter.cpp b/Marlin/src/module/printcounter.cpp
index 3b6239c667..f3d9ec8a9d 100644
--- a/Marlin/src/module/printcounter.cpp
+++ b/Marlin/src/module/printcounter.cpp
@@ -41,7 +41,7 @@ Stopwatch print_job_timer; // Global Print Job Timer instance
#include "../libs/buzzer.h"
#endif
-#if PRINTCOUNTER_SYNC
+#if ENABLED(PRINTCOUNTER_SYNC)
#include "../module/planner.h"
#endif
From 3c882703619bde0d7cf292bb7dd7918f12edd23c Mon Sep 17 00:00:00 2001
From: tombrazier <68918209+tombrazier@users.noreply.github.com>
Date: Sat, 18 Mar 2023 10:34:53 +0000
Subject: [PATCH 048/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Smart=20Adaptive?=
=?UTF-8?q?=20Multi-Stepping=20(#25474)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/module/stepper.cpp | 166 +++++++++++++++++++++++-----------
Marlin/src/module/stepper.h | 29 +++---
2 files changed, 124 insertions(+), 71 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index ae12f0b7f4..4872e98aa9 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -194,6 +194,10 @@ uint32_t Stepper::acceleration_time, Stepper::deceleration_time;
uint8_t Stepper::steps_per_isr = 1; // Count of steps to perform per Stepper ISR call
#endif
+#if DISABLED(OLD_ADAPTIVE_MULTISTEPPING)
+ hal_timer_t Stepper::time_spent_in_isr = 0, Stepper::time_spent_out_isr = 0;
+#endif
+
#if ENABLED(FREEZE_FEATURE)
bool Stepper::frozen; // = false
#endif
@@ -614,27 +618,26 @@ void Stepper::set_directions() {
TERN_(HAS_V_DIR, SET_STEP_DIR(V));
TERN_(HAS_W_DIR, SET_STEP_DIR(W));
- #if ENABLED(MIXING_EXTRUDER)
+ #if HAS_EXTRUDERS
// Because this is valid for the whole block we don't know
// what E steppers will step. Likely all. Set all.
if (motor_direction(E_AXIS)) {
- MIXER_STEPPER_LOOP(j) REV_E_DIR(j);
+ #if ENABLED(MIXING_EXTRUDER)
+ MIXER_STEPPER_LOOP(j) REV_E_DIR(j);
+ #else
+ REV_E_DIR(stepper_extruder);
+ #endif
count_direction.e = -1;
}
else {
- MIXER_STEPPER_LOOP(j) NORM_E_DIR(j);
+ #if ENABLED(MIXING_EXTRUDER)
+ MIXER_STEPPER_LOOP(j) NORM_E_DIR(j);
+ #else
+ NORM_E_DIR(stepper_extruder);
+ #endif
count_direction.e = 1;
}
- #elif HAS_EXTRUDERS
- if (motor_direction(E_AXIS)) {
- REV_E_DIR(stepper_extruder);
- count_direction.e = -1;
- }
- else {
- NORM_E_DIR(stepper_extruder);
- count_direction.e = 1;
- }
- #endif
+ #endif // HAS_EXTRUDERS
DIR_WAIT_AFTER();
}
@@ -1587,16 +1590,44 @@ void Stepper::isr() {
*/
min_ticks = HAL_timer_get_count(MF_TIMER_STEP) + hal_timer_t(TERN(__AVR__, 8, 1) * (STEPPER_TIMER_TICKS_PER_US));
- /**
- * NB: If for some reason the stepper monopolizes the MPU, eventually the
- * timer will wrap around (and so will 'next_isr_ticks'). So, limit the
- * loop to 10 iterations. Beyond that, there's no way to ensure correct pulse
- * timing, since the MCU isn't fast enough.
- */
- if (!--max_loops) next_isr_ticks = min_ticks;
+ #if ENABLED(OLD_ADAPTIVE_MULTISTEPPING)
+ /**
+ * NB: If for some reason the stepper monopolizes the MPU, eventually the
+ * timer will wrap around (and so will 'next_isr_ticks'). So, limit the
+ * loop to 10 iterations. Beyond that, there's no way to ensure correct pulse
+ * timing, since the MCU isn't fast enough.
+ */
+ if (!--max_loops) next_isr_ticks = min_ticks;
+ #endif
// Advance pulses if not enough time to wait for the next ISR
- } while (next_isr_ticks < min_ticks);
+ } while (TERN(OLD_ADAPTIVE_MULTISTEPPING, true, --max_loops) && next_isr_ticks < min_ticks);
+
+ #if DISABLED(OLD_ADAPTIVE_MULTISTEPPING)
+
+ // Track the time spent in the ISR
+ const hal_timer_t time_spent = HAL_timer_get_count(MF_TIMER_STEP);
+ time_spent_in_isr += time_spent;
+
+ if (next_isr_ticks < min_ticks) {
+ next_isr_ticks = min_ticks;
+
+ // When forced out of the ISR, increase multi-stepping
+ #if MULTISTEPPING_LIMIT > 1
+ if (steps_per_isr < MULTISTEPPING_LIMIT) {
+ steps_per_isr <<= 1;
+ // ticks_nominal will need to be recalculated if we are in cruise phase
+ ticks_nominal = 0;
+ }
+ #endif
+ }
+ else {
+ // Track the time spent voluntarily outside the ISR
+ time_spent_out_isr += next_isr_ticks;
+ time_spent_out_isr -= time_spent;
+ }
+
+ #endif // !OLD_ADAPTIVE_MULTISTEPPING
// Now 'next_isr_ticks' contains the period to the next Stepper ISR - And we are
// sure that the time has not arrived yet - Warrantied by the scheduler
@@ -2091,44 +2122,56 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
// Get the timer interval and the number of loops to perform per tick
hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) {
- #if MULTISTEPPING_LIMIT == 1
- // Just make sure the step rate is doable
- NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X));
+ #if ENABLED(OLD_ADAPTIVE_MULTISTEPPING)
- #else
+ #if MULTISTEPPING_LIMIT == 1
- // The stepping frequency limits for each multistepping rate
- static const uint32_t limit[] PROGMEM = {
- ( MAX_STEP_ISR_FREQUENCY_1X )
- , ( MAX_STEP_ISR_FREQUENCY_2X >> 1)
- #if MULTISTEPPING_LIMIT >= 4
- , ( MAX_STEP_ISR_FREQUENCY_4X >> 2)
- #endif
- #if MULTISTEPPING_LIMIT >= 8
- , ( MAX_STEP_ISR_FREQUENCY_8X >> 3)
- #endif
- #if MULTISTEPPING_LIMIT >= 16
- , ( MAX_STEP_ISR_FREQUENCY_16X >> 4)
- #endif
- #if MULTISTEPPING_LIMIT >= 32
- , ( MAX_STEP_ISR_FREQUENCY_32X >> 5)
- #endif
- #if MULTISTEPPING_LIMIT >= 64
- , ( MAX_STEP_ISR_FREQUENCY_64X >> 6)
- #endif
- #if MULTISTEPPING_LIMIT >= 128
- , (MAX_STEP_ISR_FREQUENCY_128X >> 7)
- #endif
- };
+ // Just make sure the step rate is doable
+ NOMORE(step_rate, uint32_t(MAX_STEP_ISR_FREQUENCY_1X));
- // Find a doable step rate using multistepping
- uint8_t multistep = 1;
- for (uint8_t i = 0; i < COUNT(limit) && step_rate > uint32_t(pgm_read_dword(&limit[i])); ++i) {
- step_rate >>= 1;
- multistep <<= 1;
- }
- steps_per_isr = multistep;
+ #else
+
+ // The stepping frequency limits for each multistepping rate
+ static const uint32_t limit[] PROGMEM = {
+ ( MAX_STEP_ISR_FREQUENCY_1X )
+ , (((F_CPU) / ISR_EXECUTION_CYCLES(1)) >> 1)
+ #if MULTISTEPPING_LIMIT >= 4
+ , (((F_CPU) / ISR_EXECUTION_CYCLES(2)) >> 2)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 8
+ , (((F_CPU) / ISR_EXECUTION_CYCLES(3)) >> 3)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 16
+ , (((F_CPU) / ISR_EXECUTION_CYCLES(4)) >> 4)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 32
+ , (((F_CPU) / ISR_EXECUTION_CYCLES(5)) >> 5)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 64
+ , (((F_CPU) / ISR_EXECUTION_CYCLES(6)) >> 6)
+ #endif
+ #if MULTISTEPPING_LIMIT >= 128
+ , (((F_CPU) / ISR_EXECUTION_CYCLES(7)) >> 7)
+ #endif
+ };
+
+ // Find a doable step rate using multistepping
+ uint8_t multistep = 1;
+ for (uint8_t i = 0; i < COUNT(limit) && step_rate > uint32_t(pgm_read_dword(&limit[i])); ++i) {
+ step_rate >>= 1;
+ multistep <<= 1;
+ }
+ steps_per_isr = multistep;
+
+ #endif
+
+ #elif MULTISTEPPING_LIMIT > 1
+
+ uint8_t loops = steps_per_isr;
+ if (MULTISTEPPING_LIMIT >= 16 && loops >= 16) { step_rate >>= 4; loops >>= 4; }
+ if (MULTISTEPPING_LIMIT >= 4 && loops >= 4) { step_rate >>= 2; loops >>= 2; }
+ if (MULTISTEPPING_LIMIT >= 2 && loops >= 2) { step_rate >>= 1; }
#endif
@@ -2141,6 +2184,19 @@ hal_timer_t Stepper::calc_multistep_timer_interval(uint32_t step_rate) {
* have been done, so it is less time critical.
*/
hal_timer_t Stepper::block_phase_isr() {
+ #if DISABLED(OLD_ADAPTIVE_MULTISTEPPING)
+ // If the ISR uses < 50% of MPU time, halve multi-stepping
+ const hal_timer_t time_spent = HAL_timer_get_count(MF_TIMER_STEP);
+ #if MULTISTEPPING_LIMIT > 1
+ if (steps_per_isr > 1 && time_spent_out_isr >= time_spent_in_isr + time_spent) {
+ steps_per_isr >>= 1;
+ // ticks_nominal will need to be recalculated if we are in cruise phase
+ ticks_nominal = 0;
+ }
+ #endif
+ time_spent_in_isr = -time_spent; // unsigned but guaranteed to be +ve when needed
+ time_spent_out_isr = 0;
+ #endif
// If no queued movements, just wait 1ms for the next block
hal_timer_t interval = (STEPPER_TIMER_RATE) / 1000UL;
diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h
index 797a72791c..704805464c 100644
--- a/Marlin/src/module/stepper.h
+++ b/Marlin/src/module/stepper.h
@@ -212,12 +212,12 @@
#error "Expected at least one of MINIMUM_STEPPER_PULSE or MAXIMUM_STEPPER_RATE to be defined"
#endif
-// The loop takes the base time plus the time for all the bresenham logic for R pulses plus the time
-// between pulses for (R-1) pulses. But the user could be enforcing a minimum time so the loop time is:
+// The loop takes the base time plus the time for all the bresenham logic for 1 << R pulses plus the time
+// between pulses for ((1 << R) - 1) pulses. But the user could be enforcing a minimum time so the loop time is:
#define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * ((1UL << R) - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES))
// Model input shaping as an extra loop call
-#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_SHAPING, ((ISR_LOOP_BASE_CYCLES) + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R))
+#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_SHAPING, (ISR_LOOP_BASE_CYCLES + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R))
// If linear advance is enabled, then it is handled separately
#if ENABLED(LIN_ADVANCE)
@@ -241,24 +241,17 @@
#define ISR_LA_LOOP_CYCLES 0UL
#endif
-// Now estimate the total ISR execution time in cycles given a step per ISR multiplier
-#define ISR_EXECUTION_CYCLES(R) (((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + ISR_SHAPING_BASE_CYCLES + ISR_LOOP_CYCLES(R) + ISR_SHAPING_LOOP_CYCLES(R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES)) >> R)
+// Estimate the total ISR execution time in cycles given a step-per-ISR shift multiplier
+#define ISR_EXECUTION_CYCLES(R) ((ISR_BASE_CYCLES + ISR_S_CURVE_CYCLES + ISR_SHAPING_BASE_CYCLES + ISR_LOOP_CYCLES(R) + ISR_SHAPING_LOOP_CYCLES(R) + ISR_LA_BASE_CYCLES + ISR_LA_LOOP_CYCLES) >> R)
-// The maximum allowable stepping frequency when doing x128-x1 stepping (in Hz)
-#define MAX_STEP_ISR_FREQUENCY_128X ((F_CPU) / ISR_EXECUTION_CYCLES(7))
-#define MAX_STEP_ISR_FREQUENCY_64X ((F_CPU) / ISR_EXECUTION_CYCLES(6))
-#define MAX_STEP_ISR_FREQUENCY_32X ((F_CPU) / ISR_EXECUTION_CYCLES(5))
-#define MAX_STEP_ISR_FREQUENCY_16X ((F_CPU) / ISR_EXECUTION_CYCLES(4))
-#define MAX_STEP_ISR_FREQUENCY_8X ((F_CPU) / ISR_EXECUTION_CYCLES(3))
-#define MAX_STEP_ISR_FREQUENCY_4X ((F_CPU) / ISR_EXECUTION_CYCLES(2))
-#define MAX_STEP_ISR_FREQUENCY_2X ((F_CPU) / ISR_EXECUTION_CYCLES(1))
-#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(0))
+// The maximum allowable stepping frequency when doing 1x stepping (in Hz)
+#define MAX_STEP_ISR_FREQUENCY_1X ((F_CPU) / ISR_EXECUTION_CYCLES(0))
// The minimum step ISR rate used by ADAPTIVE_STEP_SMOOTHING to target 50% CPU usage
// This does not account for the possibility of multi-stepping.
-// Should a MULTISTEPPING_LIMIT of 1 should be required with ADAPTIVE_STEP_SMOOTHING?
-#define MIN_STEP_ISR_FREQUENCY (MAX_STEP_ISR_FREQUENCY_1X / 2)
+#define MIN_STEP_ISR_FREQUENCY (MAX_STEP_ISR_FREQUENCY_1X >> 1)
+// Number of axes that could be enabled/disabled. Dual/multiple steppers are combined.
#define ENABLE_COUNT (NUM_AXES + E_STEPPERS)
typedef bits_t(ENABLE_COUNT) ena_mask_t;
@@ -547,6 +540,10 @@ class Stepper {
static uint8_t steps_per_isr;
#endif
+ #if DISABLED(OLD_ADAPTIVE_MULTISTEPPING)
+ static hal_timer_t time_spent_in_isr, time_spent_out_isr;
+ #endif
+
#if ENABLED(ADAPTIVE_STEP_SMOOTHING)
static uint8_t oversampling_factor; // Oversampling factor (log2(multiplier)) to increase temporal resolution of axis
#else
From 5be895d906d43a64c5e429683d136388d20341e0 Mon Sep 17 00:00:00 2001
From: John Lagonikas <39417467+zeleps@users.noreply.github.com>
Date: Sat, 18 Mar 2023 13:43:15 +0200
Subject: [PATCH 049/225] =?UTF-8?q?=F0=9F=9A=B8=20Temperature=20Variance?=
=?UTF-8?q?=20Monitor=20tweaks=20(#23571)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/Configuration_adv.h | 31 ++++++++++++++++++++++++++++---
Marlin/src/HAL/LPC1768/HAL.cpp | 1 +
Marlin/src/HAL/LPC1768/HAL.h | 13 ++++++++-----
Marlin/src/inc/Warnings.cpp | 5 +++++
Marlin/src/module/temperature.cpp | 11 +++++++++--
5 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 284ecb6b1c..70bbf0a0e6 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -368,10 +368,35 @@
#if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER)
/**
- * Thermal Protection Variance Monitor - EXPERIMENTAL.
- * Kill the machine on a stuck temperature sensor. Disable if you get false positives.
+ * Thermal Protection Variance Monitor - EXPERIMENTAL
+ * Kill the machine on a stuck temperature sensor.
+ *
+ * This feature may cause some thermally-stable systems to halt. Be sure to test it throughly under
+ * a variety of conditions. Disable if you get false positives.
+ *
+ * This feature ensures that temperature sensors are updating regularly. If sensors die or get "stuck",
+ * or if Marlin stops reading them, temperatures will remain constant while heaters may still be powered!
+ * This feature only monitors temperature changes so it should catch any issue, hardware or software.
+ *
+ * By default it uses the THERMAL_PROTECTION_*_PERIOD constants (above) for the time window, within which
+ * at least one temperature change must occur, to indicate that sensor polling is working. If any monitored
+ * heater's temperature remains totally constant (without even a fractional change) during this period, a
+ * thermal malfunction error occurs and the printer is halted.
+ *
+ * A very stable heater might produce a false positive and halt the printer. In this case, try increasing
+ * the corresponding THERMAL_PROTECTION_*_PERIOD constant a bit. Keep in mind that uncontrolled heating
+ * shouldn't be allowed to persist for more than a minite or two.
+ *
+ * Be careful to distinguish false positives from real sensor issues before disabling this feature. If the
+ * heater's temperature appears even slightly higher than expected after restarting, you may have a real
+ * thermal malfunction. Check the temperature graph in your host for any unusual bumps.
*/
- //#define THERMAL_PROTECTION_VARIANCE_MONITOR // Detect a sensor malfunction preventing temperature updates
+ //#define THERMAL_PROTECTION_VARIANCE_MONITOR
+ #if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR)
+ // Variance detection window to override the THERMAL_PROTECTION...PERIOD settings above.
+ // Keep in mind that some heaters heat up faster than others.
+ //#define THERMAL_PROTECTION_VARIANCE_MONITOR_PERIOD 30 // (s) Override all watch periods
+ #endif
#endif
#if ENABLED(PIDTEMP)
diff --git a/Marlin/src/HAL/LPC1768/HAL.cpp b/Marlin/src/HAL/LPC1768/HAL.cpp
index 9ff3a6ba59..746f43a2a4 100644
--- a/Marlin/src/HAL/LPC1768/HAL.cpp
+++ b/Marlin/src/HAL/LPC1768/HAL.cpp
@@ -28,6 +28,7 @@
DefaultSerial1 USBSerial(false, UsbSerial);
uint32_t MarlinHAL::adc_result = 0;
+pin_t MarlinHAL::adc_pin = 0;
// U8glib required functions
extern "C" {
diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h
index b0eeb983b4..63bec2b720 100644
--- a/Marlin/src/HAL/LPC1768/HAL.h
+++ b/Marlin/src/HAL/LPC1768/HAL.h
@@ -241,15 +241,18 @@ public:
// Begin ADC sampling on the given pin. Called from Temperature::isr!
static uint32_t adc_result;
- static void adc_start(const pin_t pin) {
- adc_result = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
- }
+ static pin_t adc_pin;
+
+ static void adc_start(const pin_t pin) { adc_pin = pin; }
// Is the ADC ready for reading?
- static bool adc_ready() { return true; }
+ static bool adc_ready() { return LPC176x::adc_hardware.done(LPC176x::pin_get_adc_channel(adc_pin)); }
// The current value of the ADC register
- static uint16_t adc_value() { return uint16_t(adc_result); }
+ static uint16_t adc_value() {
+ adc_result = FilteredADC::read(adc_pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
+ return uint16_t(adc_result);
+ }
/**
* Set the PWM duty cycle for the pin to the given value.
diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp
index 405e7a351e..01246596c3 100644
--- a/Marlin/src/inc/Warnings.cpp
+++ b/Marlin/src/inc/Warnings.cpp
@@ -63,6 +63,11 @@
#warning "Warning! Don't use dummy thermistors (998/999) for final build!"
#endif
+#if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER) \
+ && NONE(THERMAL_PROTECTION_VARIANCE_MONITOR, NO_VARIANCE_MONITOR_WARNING)
+ #warning "THERMAL_PROTECTION_VARIANCE_MONITOR is recommended. See Configuration_adv.h for details. (Define NO_VARIANCE_MONITOR_WARNING to suppress this.)"
+#endif
+
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT)
#warning "Your Configuration provides no method to acquire user feedback!"
#endif
diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index 578fd112d2..2bb88320b5 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -2915,11 +2915,18 @@ void Temperature::init() {
*/
#if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR)
+
+ #ifdef THERMAL_PROTECTION_VARIANCE_MONITOR_PERIOD
+ #define VARIANCE_WINDOW THERMAL_PROTECTION_VARIANCE_MONITOR_PERIOD
+ #else
+ #define VARIANCE_WINDOW period_seconds
+ #endif
+
if (state == TRMalfunction) { // temperature invariance may continue, regardless of heater state
variance += ABS(current - last_temp); // no need for detection window now, a single change in variance is enough
last_temp = current;
if (!NEAR_ZERO(variance)) {
- variance_timer = millis() + SEC_TO_MS(period_seconds);
+ variance_timer = millis() + SEC_TO_MS(VARIANCE_WINDOW);
variance = 0.0;
state = TRStable; // resume from where we detected the problem
}
@@ -2980,7 +2987,7 @@ void Temperature::init() {
state = TRMalfunction;
break;
}
- variance_timer = now + SEC_TO_MS(period_seconds);
+ variance_timer = now + SEC_TO_MS(VARIANCE_WINDOW);
variance = 0.0;
last_temp = current;
}
From 283d093a4c4601ffa41e2754e790b6ed55c05e11 Mon Sep 17 00:00:00 2001
From: ellensp <530024+ellensp@users.noreply.github.com>
Date: Sun, 19 Mar 2023 13:17:21 +1300
Subject: [PATCH 050/225] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Ender=202=20stock?=
=?UTF-8?q?=20LCD=20(#25538)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/test-builds.yml | 1 +
Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h | 5 +++--
buildroot/tests/melzi_optiboot | 16 ++++++++++++++++
3 files changed, 20 insertions(+), 2 deletions(-)
create mode 100755 buildroot/tests/melzi_optiboot
diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml
index 9debb82bc9..173631e5e5 100644
--- a/.github/workflows/test-builds.yml
+++ b/.github/workflows/test-builds.yml
@@ -55,6 +55,7 @@ jobs:
- rambo
- sanguino1284p
- sanguino644p
+ - melzi_optiboot
# STM32F1 (Maple) Environments
diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
index 437ba35eea..acaf06ed9d 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
@@ -46,11 +46,12 @@
// LCD / Controller
//
#if ANY(MKS_MINI_12864, CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
- #if ENABLED(CR10_STOCKDISPLAY)
+ #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
#define LCD_PINS_RS 28 // ST9720 CS
#define LCD_PINS_ENABLE 17 // ST9720 DAT
#define LCD_PINS_D4 30 // ST9720 CLK
- #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
+ #endif
+ #if EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
#define DOGLCD_CS 28
#define DOGLCD_A0 30
#endif
diff --git a/buildroot/tests/melzi_optiboot b/buildroot/tests/melzi_optiboot
new file mode 100755
index 0000000000..f31c69cdcb
--- /dev/null
+++ b/buildroot/tests/melzi_optiboot
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+#
+# Build tests for melzi_optiboot
+#
+
+# exit on first failure
+set -e
+
+#
+# Ender 2
+#
+use_example_configs Creality/Ender-2
+exec_test $1 $2 "Ender 2" "$3"
+
+# clean up
+restore_configs
From e6ac9ff204b09c0a852f71b77417f99ce4f5473a Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 18 Mar 2023 17:13:06 -0500
Subject: [PATCH 051/225] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Misc.=20optimizati?=
=?UTF-8?q?ons?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/MarlinCore.cpp | 4 ++--
Marlin/src/core/serial.cpp | 5 ----
Marlin/src/core/serial.h | 7 +++++-
Marlin/src/feature/bedlevel/ubl/ubl.cpp | 2 +-
Marlin/src/module/temperature.cpp | 31 ++++++++++++++-----------
Marlin/src/module/temperature.h | 6 ++---
6 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp
index ef6bf6aad5..342f8812d8 100644
--- a/Marlin/src/MarlinCore.cpp
+++ b/Marlin/src/MarlinCore.cpp
@@ -520,8 +520,8 @@ inline void manage_inactivity(const bool no_stepper_sleep=false) {
if (ELAPSED(ms, next_cub_ms_##N)) { \
next_cub_ms_##N = ms + CUB_DEBOUNCE_DELAY_##N; \
CODE; \
- queue.inject(F(BUTTON##N##_GCODE)); \
- TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); \
+ queue.inject(F(BUTTON##N##_GCODE)); \
+ TERN_(HAS_MARLINUI_MENU, ui.quick_feedback()); \
} \
} \
}while(0)
diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp
index 727b191d04..64704c1e6c 100644
--- a/Marlin/src/core/serial.cpp
+++ b/Marlin/src/core/serial.cpp
@@ -85,11 +85,6 @@ void serial_offset(const_float_t v, const uint8_t sp/*=0*/) {
SERIAL_DECIMAL(v);
}
-void serial_ternary(const bool onoff, FSTR_P const pre, FSTR_P const on, FSTR_P const off, FSTR_P const post/*=nullptr*/) {
- if (pre) serial_print(pre);
- serial_print(onoff ? on : off);
- if (post) serial_print(post);
-}
void serialprint_onoff(const bool onoff) { serial_print(onoff ? F(STR_ON) : F(STR_OFF)); }
void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); }
void serialprint_truefalse(const bool tf) { serial_print(tf ? F("true") : F("false")); }
diff --git a/Marlin/src/core/serial.h b/Marlin/src/core/serial.h
index a1126d7461..a741d4b1e4 100644
--- a/Marlin/src/core/serial.h
+++ b/Marlin/src/core/serial.h
@@ -327,7 +327,12 @@ inline void serial_echolnpair(FSTR_P const fstr, T v) { serial_echolnpair_P(FTOP
void serial_echo_start();
void serial_error_start();
-void serial_ternary(const bool onoff, FSTR_P const pre, FSTR_P const on, FSTR_P const off, FSTR_P const post=nullptr);
+inline void serial_ternary(const bool onoff, FSTR_P const pre, FSTR_P const on, FSTR_P const off, FSTR_P const post=nullptr) {
+ if (pre) serial_print(pre);
+ if (onoff && on) serial_print(on);
+ if (!onoff && off) serial_print(off);
+ if (post) serial_print(post);
+}
void serialprint_onoff(const bool onoff);
void serialprintln_onoff(const bool onoff);
void serialprint_truefalse(const bool tf);
diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp
index f2af1445b1..6d60e7a2ef 100644
--- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp
+++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp
@@ -59,7 +59,7 @@ void unified_bed_leveling::report_current_mesh() {
void unified_bed_leveling::report_state() {
echo_name();
- SERIAL_ECHO_TERNARY(planner.leveling_active, " System v" UBL_VERSION " ", "", "in", "active\n");
+ serial_ternary(planner.leveling_active, " System v" UBL_VERSION " ", nullptr, "in", "active\n");
serial_delay(50);
}
diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index 2bb88320b5..cc89d71e50 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -2890,7 +2890,7 @@ void Temperature::init() {
*
* TODO: Embed the last 3 parameters during init, if not less optimal
*/
- void Temperature::tr_state_machine_t::run(const_celsius_float_t current, const_celsius_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc) {
+ void Temperature::tr_state_machine_t::run(const_celsius_float_t current, const_celsius_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_float_t hysteresis_degc) {
#if HEATER_IDLE_HANDLER
// Convert the given heater_id_t to an idle array index
@@ -2959,21 +2959,26 @@ void Temperature::init() {
// While the temperature is stable watch for a bad temperature
case TRStable: {
+ const celsius_float_t rdiff = running_temp - current;
+
#if ENABLED(ADAPTIVE_FAN_SLOWING)
if (adaptive_fan_slowing && heater_id >= 0) {
- const int fan_index = _MIN(heater_id, FAN_COUNT - 1);
- if (fan_speed[fan_index] == 0 || current >= running_temp - (hysteresis_degc * 0.25f))
- fan_speed_scaler[fan_index] = 128;
- else if (current >= running_temp - (hysteresis_degc * 0.3335f))
- fan_speed_scaler[fan_index] = 96;
- else if (current >= running_temp - (hysteresis_degc * 0.5f))
- fan_speed_scaler[fan_index] = 64;
- else if (current >= running_temp - (hysteresis_degc * 0.8f))
- fan_speed_scaler[fan_index] = 32;
+ const int_fast8_t fan_index = _MIN(heater_id, FAN_COUNT - 1);
+ uint8_t scale;
+ if (fan_speed[fan_index] == 0 || rdiff <= hysteresis_degc * 0.25f)
+ scale = 128;
+ else if (rdiff <= hysteresis_degc * 0.3335f)
+ scale = 96;
+ else if (rdiff <= hysteresis_degc * 0.5f)
+ scale = 64;
+ else if (rdiff <= hysteresis_degc * 0.8f)
+ scale = 32;
else
- fan_speed_scaler[fan_index] = 0;
+ scale = 0;
+
+ fan_speed_scaler[fan_index] = scale;
}
- #endif
+ #endif // ADAPTIVE_FAN_SLOWING
const millis_t now = millis();
@@ -2993,7 +2998,7 @@ void Temperature::init() {
}
#endif
- if (current >= running_temp - hysteresis_degc) {
+ if (rdiff <= hysteresis_degc) {
timer = now + SEC_TO_MS(period_seconds);
break;
}
diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h
index 0ab00ef768..4bf76e5d48 100644
--- a/Marlin/src/module/temperature.h
+++ b/Marlin/src/module/temperature.h
@@ -49,7 +49,7 @@
#define E_NAME TERN_(HAS_MULTI_HOTEND, e)
// Element identifiers. Positive values are hotends. Negative values are other heaters or coolers.
-typedef enum : int8_t {
+typedef enum : int_fast8_t {
H_REDUNDANT = HID_REDUNDANT,
H_COOLER = HID_COOLER,
H_PROBE = HID_PROBE,
@@ -1319,12 +1319,12 @@ class Temperature {
typedef struct {
millis_t timer = 0;
TRState state = TRInactive;
- float running_temp;
+ celsius_float_t running_temp;
#if ENABLED(THERMAL_PROTECTION_VARIANCE_MONITOR)
millis_t variance_timer = 0;
celsius_float_t last_temp = 0.0, variance = 0.0;
#endif
- void run(const_celsius_float_t current, const_celsius_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc);
+ void run(const_celsius_float_t current, const_celsius_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_float_t hysteresis_degc);
} tr_state_machine_t;
static tr_state_machine_t tr_state_machine[NR_HEATER_RUNAWAY];
From 432aeeefe30082843e0e3cbb4a0f0673681fcfdb Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Sun, 19 Mar 2023 00:55:20 +0000
Subject: [PATCH 052/225] [cron] Bump distribution date (2023-03-19)
---
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 2938b98713..a70e6910d3 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 "2023-03-18"
+//#define STRING_DISTRIBUTION_DATE "2023-03-19"
/**
* 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 df04b198ac..3e3244a207 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 "2023-03-18"
+ #define STRING_DISTRIBUTION_DATE "2023-03-19"
#endif
/**
From 7e25e87807c7c3dd213ffa558cf6e6d0383b7650 Mon Sep 17 00:00:00 2001
From: StevilKnevil
Date: Sun, 19 Mar 2023 00:57:34 +0000
Subject: [PATCH 053/225] =?UTF-8?q?=E2=9C=A8=20REPORT=5FADAPTIVE=5FFAN=5FS?=
=?UTF-8?q?LOWING=20(#25537)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration_adv.h | 9 ++++++---
Marlin/src/module/temperature.cpp | 6 ++++++
buildroot/tests/LPC1769 | 2 +-
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 70bbf0a0e6..3e23bb8944 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -303,9 +303,12 @@
#define THERMAL_PROTECTION_PERIOD 40 // Seconds
#define THERMAL_PROTECTION_HYSTERESIS 4 // Degrees Celsius
- //#define ADAPTIVE_FAN_SLOWING // Slow part cooling fan if temperature drops
- #if ENABLED(ADAPTIVE_FAN_SLOWING) && EITHER(MPCTEMP, PIDTEMP)
- //#define TEMP_TUNING_MAINTAIN_FAN // Don't slow fan speed during M303 or M306 T
+ //#define ADAPTIVE_FAN_SLOWING // Slow down the part-cooling fan if the temperature drops
+ #if ENABLED(ADAPTIVE_FAN_SLOWING)
+ //#define REPORT_ADAPTIVE_FAN_SLOWING // Report fan slowing activity to the console
+ #if EITHER(MPCTEMP, PIDTEMP)
+ //#define TEMP_TUNING_MAINTAIN_FAN // Don't slow down the fan speed during M303 or M306 T
+ #endif
#endif
/**
diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp
index cc89d71e50..ba2563ccdc 100644
--- a/Marlin/src/module/temperature.cpp
+++ b/Marlin/src/module/temperature.cpp
@@ -2976,6 +2976,12 @@ void Temperature::init() {
else
scale = 0;
+ if (TERN0(REPORT_ADAPTIVE_FAN_SLOWING, DEBUGGING(INFO))) {
+ const uint8_t fss7 = fan_speed_scaler[fan_index] & 0x80;
+ if (fss7 ^ (scale & 0x80))
+ serial_ternary(fss7, F("Adaptive Fan Slowing "), nullptr, F("de"), F("activated.\n"));
+ }
+
fan_speed_scaler[fan_index] = scale;
}
#endif // ADAPTIVE_FAN_SLOWING
diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769
index b3348c6d65..cf2838bdd5 100755
--- a/buildroot/tests/LPC1769
+++ b/buildroot/tests/LPC1769
@@ -18,7 +18,7 @@ opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD \
GRID_MAX_POINTS_X 16 \
NOZZLE_CLEAN_START_POINT "{ { 10, 10, 3 }, { 10, 10, 3 } }" \
NOZZLE_CLEAN_END_POINT "{ { 10, 20, 3 }, { 10, 20, 3 } }"
-opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING TEMP_TUNING_MAINTAIN_FAN \
+opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING REPORT_ADAPTIVE_FAN_SLOWING TEMP_TUNING_MAINTAIN_FAN \
MAX31865_SENSOR_OHMS_0 MAX31865_CALIBRATION_OHMS_0 \
MAG_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BED_TRAMMING_USE_PROBE BED_TRAMMING_VERIFY_RAISED \
From 9249f61a80ea48db8b437f17374c25ed5da1a65b Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sat, 18 Mar 2023 21:57:06 -0500
Subject: [PATCH 054/225] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20a=20serial=5Fterna?=
=?UTF-8?q?ry?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/feature/bedlevel/ubl/ubl.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp
index 6d60e7a2ef..b7ee6aeef8 100644
--- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp
+++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp
@@ -59,7 +59,7 @@ void unified_bed_leveling::report_current_mesh() {
void unified_bed_leveling::report_state() {
echo_name();
- serial_ternary(planner.leveling_active, " System v" UBL_VERSION " ", nullptr, "in", "active\n");
+ serial_ternary(planner.leveling_active, F(" System v" UBL_VERSION " "), nullptr, F("in"), F("active\n"));
serial_delay(50);
}
From fd36e69bd23b60ef8edb0848f219a5ca65dae181 Mon Sep 17 00:00:00 2001
From: FilippoR
Date: Sun, 19 Mar 2023 09:55:34 +0100
Subject: [PATCH 055/225] =?UTF-8?q?=E2=9C=A8=20Z=5FSERVO=5FDEACTIVATE=5FAF?=
=?UTF-8?q?TER=5FSTOW=20(#24215)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration.h | 11 +++++++----
Marlin/src/module/probe.cpp | 7 ++++++-
buildroot/tests/mega2560 | 4 ++--
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 82b107ae44..b96837d50c 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -1387,10 +1387,13 @@
/**
* Z Servo Probe, such as an endstop switch on a rotating arm.
*/
-//#define Z_PROBE_SERVO_NR 0 // Defaults to SERVO 0 connector.
-//#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles
-//#define Z_SERVO_MEASURE_ANGLE 45 // Use if the servo must move to a "free" position for measuring after deploy.
-//#define Z_SERVO_INTERMEDIATE_STOW // Stow the probe between points.
+//#define Z_PROBE_SERVO_NR 0
+#ifdef Z_PROBE_SERVO_NR
+ //#define Z_SERVO_ANGLES { 70, 0 } // Z Servo Deploy and Stow angles
+ //#define Z_SERVO_MEASURE_ANGLE 45 // Use if the servo must move to a "free" position for measuring after deploy
+ //#define Z_SERVO_INTERMEDIATE_STOW // Stow the probe between points
+ //#define Z_SERVO_DEACTIVATE_AFTER_STOW // Deactivate the servo when probe is stowed
+#endif
/**
* The BLTouch probe uses a Hall effect sensor and emulates a servo.
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index ea17eee6ee..d48dc1eb1c 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -403,13 +403,16 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
#elif HAS_Z_SERVO_PROBE
+ // i.e., deploy ? DEPLOY_Z_SERVO() : STOW_Z_SERVO();
servo[Z_PROBE_SERVO_NR].move(servo_angles[Z_PROBE_SERVO_NR][deploy ? 0 : 1]);
#ifdef Z_SERVO_MEASURE_ANGLE
// After deploy move back to the measure angle...
- if (deploy) MOVE_SERVO(Z_PROBE_SERVO_NR, Z_SERVO_MEASURE_ANGLE);
+ if (deploy) servo[Z_PROBE_SERVO_NR].move(Z_SERVO_MEASURE_ANGLE);
#endif
+ if (TERN0(Z_SERVO_DEACTIVATE_AFTER_STOW, !deploy)) servo[Z_PROBE_SERVO_NR].detach();
+
#elif ANY(TOUCH_MI_PROBE, Z_PROBE_ALLEN_KEY, MAG_MOUNTED_PROBE)
deploy ? run_deploy_moves() : run_stow_moves();
@@ -950,6 +953,8 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
* homing has been done - no homing with z-probe without init!
*/
STOW_Z_SERVO();
+
+ TERN_(Z_SERVO_DEACTIVATE_AFTER_STOW, servo[Z_PROBE_SERVO_NR].detach());
}
#endif // HAS_Z_SERVO_PROBE
diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560
index daa9cc2fad..ae3d1c45f8 100755
--- a/buildroot/tests/mega2560
+++ b/buildroot/tests/mega2560
@@ -63,13 +63,13 @@ opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO NUM_SERVOS 1 \
NUM_RUNOUT_SENSORS 5 FIL_RUNOUT2_PIN 44 FIL_RUNOUT3_PIN 45 FIL_RUNOUT4_PIN 46 FIL_RUNOUT5_PIN 47 \
FIL_RUNOUT3_STATE HIGH FILAMENT_RUNOUT_SCRIPT '"M600 T%c"'
opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \
- Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE \
+ Z_PROBE_SERVO_NR Z_SERVO_ANGLES Z_SERVO_MEASURE_ANGLE DEACTIVATE_SERVOS_AFTER_MOVE Z_SERVO_DEACTIVATE_AFTER_STOW \
AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE PROBE_PT_1 PROBE_PT_2 PROBE_PT_3 \
EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL AUTO_REPORT_POSITION \
NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \
FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULLUP
-exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" "$3"
+exec_test $1 $2 "Z Servo Probe | Multiple runout sensors (x5)" "$3"
#
From ca77850cbb8ed57d4cdcf29a12a278d6bfa5c0d5 Mon Sep 17 00:00:00 2001
From: tombrazier <68918209+tombrazier@users.noreply.github.com>
Date: Sun, 19 Mar 2023 21:25:14 +0000
Subject: [PATCH 056/225] =?UTF-8?q?=F0=9F=90=9B=20Avoid=20step=20rate=20ov?=
=?UTF-8?q?erflow=20(#25541)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/module/stepper.cpp | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp
index 4872e98aa9..5c0034a5f9 100644
--- a/Marlin/src/module/stepper.cpp
+++ b/Marlin/src/module/stepper.cpp
@@ -2098,9 +2098,15 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
#else
- // AVR is able to keep up at 30khz Stepping ISR rate.
constexpr uint32_t min_step_rate = (F_CPU) / 500000U; // i.e., 32 or 40
if (step_rate >= 0x0800) { // higher step rate
+ // AVR is able to keep up at around 65kHz Stepping ISR rate at most.
+ // So values for step_rate > 65535 might as well be truncated.
+ // Handle it as quickly as possible. i.e., assume highest byte is zero
+ // because non-zero would represent a step rate far beyond AVR capabilities.
+ if (uint8_t(step_rate >> 16))
+ return uint32_t(STEPPER_TIMER_RATE) / 0x10000;
+
const uintptr_t table_address = uintptr_t(&speed_lookuptable_fast[uint8_t(step_rate >> 8)]);
const uint16_t base = uint16_t(pgm_read_word(table_address));
const uint8_t gain = uint8_t(pgm_read_byte(table_address + 2));
@@ -2112,10 +2118,8 @@ hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
return uint16_t(pgm_read_word(table_address))
- ((uint16_t(pgm_read_word(table_address + 2)) * uint8_t(step_rate & 0x0007)) >> 3);
}
- else {
- step_rate = 0;
- return uint16_t(pgm_read_word(uintptr_t(speed_lookuptable_slow)));
- }
+
+ return uint16_t(pgm_read_word(uintptr_t(speed_lookuptable_slow)));
#endif // !CPU_32_BIT
}
@@ -2250,7 +2254,7 @@ hal_timer_t Stepper::block_phase_isr() {
#if ENABLED(LIN_ADVANCE)
if (la_active) {
const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0;
- la_interval = calc_timer_interval(acc_step_rate + la_step_rate) << current_block->la_scaling;
+ la_interval = calc_timer_interval((acc_step_rate + la_step_rate) >> current_block->la_scaling);
}
#endif
@@ -2322,7 +2326,7 @@ hal_timer_t Stepper::block_phase_isr() {
const uint32_t la_step_rate = la_advance_steps > current_block->final_adv_steps ? current_block->la_advance_rate : 0;
if (la_step_rate != step_rate) {
bool reverse_e = la_step_rate > step_rate;
- la_interval = calc_timer_interval(reverse_e ? la_step_rate - step_rate : step_rate - la_step_rate) << current_block->la_scaling;
+ la_interval = calc_timer_interval((reverse_e ? la_step_rate - step_rate : step_rate - la_step_rate) >> current_block->la_scaling);
if (reverse_e != motor_direction(E_AXIS)) {
TBI(last_direction_bits, E_AXIS);
@@ -2380,7 +2384,7 @@ hal_timer_t Stepper::block_phase_isr() {
#if ENABLED(LIN_ADVANCE)
if (la_active)
- la_interval = calc_timer_interval(current_block->nominal_rate) << current_block->la_scaling;
+ la_interval = calc_timer_interval(current_block->nominal_rate >> current_block->la_scaling);
#endif
}
@@ -2702,7 +2706,7 @@ hal_timer_t Stepper::block_phase_isr() {
#if ENABLED(LIN_ADVANCE)
if (la_active) {
const uint32_t la_step_rate = la_advance_steps < current_block->max_adv_steps ? current_block->la_advance_rate : 0;
- la_interval = calc_timer_interval(current_block->initial_rate + la_step_rate) << current_block->la_scaling;
+ la_interval = calc_timer_interval((current_block->initial_rate + la_step_rate) >> current_block->la_scaling);
}
#endif
}
From d450f67caa0d14386760f472fc3165988db95d37 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Mon, 20 Mar 2023 00:23:12 +0000
Subject: [PATCH 057/225] [cron] Bump distribution date (2023-03-20)
---
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 a70e6910d3..d052c3bff9 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 "2023-03-19"
+//#define STRING_DISTRIBUTION_DATE "2023-03-20"
/**
* 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 3e3244a207..99eb9bd3d7 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 "2023-03-19"
+ #define STRING_DISTRIBUTION_DATE "2023-03-20"
#endif
/**
From 06cfd9c54af1537adf458a719b840cd501395278 Mon Sep 17 00:00:00 2001
From: John Lagonikas <39417467+zeleps@users.noreply.github.com>
Date: Wed, 22 Mar 2023 02:15:51 +0200
Subject: [PATCH 058/225] =?UTF-8?q?=E2=9C=A8=20PROBING=5FTOOL=20(#24411)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/Configuration.h | 6 ++
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 7 +-
Marlin/src/gcode/bedlevel/G35.cpp | 10 +--
Marlin/src/gcode/bedlevel/abl/G29.cpp | 11 +---
Marlin/src/gcode/bedlevel/mbl/G29.cpp | 10 ++-
Marlin/src/gcode/calibrate/G33.cpp | 8 +--
Marlin/src/gcode/calibrate/G34_M422.cpp | 13 ++--
Marlin/src/gcode/probe/G30.cpp | 8 +--
Marlin/src/inc/Conditionals_LCD.h | 8 +++
Marlin/src/inc/SanityCheck.h | 4 ++
Marlin/src/module/probe.cpp | 71 +++++++++++++++------
Marlin/src/module/probe.h | 2 +
12 files changed, 96 insertions(+), 62 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index b96837d50c..2603999bd5 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -1552,6 +1552,12 @@
*/
#define NOZZLE_TO_PROBE_OFFSET { 10, 10, 0 }
+// Enable and set to use a specific tool for probing. Disable to allow any tool.
+#define PROBING_TOOL 0
+#ifdef PROBING_TOOL
+ //#define PROBE_TOOLCHANGE_NO_MOVE // Suppress motion on probe tool-change
+#endif
+
// Most probes should stay away from the edges of the bed, but
// with NOZZLE_AS_PROBE this can be negative for a wider probing area.
#define PROBING_MARGIN 10
diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
index 7b9783bfac..d9205b7577 100644
--- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
+++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
@@ -306,16 +306,13 @@ void unified_bed_leveling::G29() {
const uint8_t p_val = parser.byteval('P');
const bool may_move = p_val == 1 || p_val == 2 || p_val == 4 || parser.seen_test('J');
- #if HAS_MULTI_HOTEND
- const uint8_t old_tool_index = active_extruder;
- #endif
// Check for commands that require the printer to be homed
if (may_move) {
planner.synchronize();
// Send 'N' to force homing before G29 (internal only)
if (axes_should_home() || parser.seen_test('N')) gcode.home_all_axes();
- TERN_(HAS_MULTI_HOTEND, if (active_extruder != 0) tool_change(0, true));
+ probe.use_probing_tool();
// Position bed horizontally and Z probe vertically.
#if HAS_SAFE_BED_LEVELING
@@ -696,7 +693,7 @@ void unified_bed_leveling::G29() {
UNUSED(probe_deployed);
#endif
- TERN_(HAS_MULTI_HOTEND, if (old_tool_index != 0) tool_change(old_tool_index));
+ probe.use_probing_tool(false);
return;
}
diff --git a/Marlin/src/gcode/bedlevel/G35.cpp b/Marlin/src/gcode/bedlevel/G35.cpp
index ff0321e4aa..c1cef2b987 100644
--- a/Marlin/src/gcode/bedlevel/G35.cpp
+++ b/Marlin/src/gcode/bedlevel/G35.cpp
@@ -86,11 +86,7 @@ void GcodeSuite::G35() {
workspace_plane = PLANE_XY;
#endif
- // Always home with tool 0 active
- #if HAS_MULTI_HOTEND
- const uint8_t old_tool_index = active_extruder;
- tool_change(0, true);
- #endif
+ probe.use_probing_tool();
// Disable duplication mode on homing
TERN_(HAS_DUPLICATION_MODE, set_duplication_enabled(false));
@@ -153,9 +149,7 @@ void GcodeSuite::G35() {
SERIAL_ECHOLNPGM("G35 aborted.");
// Restore the active tool after homing
- #if HAS_MULTI_HOTEND
- if (old_tool_index != 0) tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER)); // Fetch previous toolhead if not PARKING_EXTRUDER
- #endif
+ probe.use_probing_tool(false);
#if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G35)
set_bed_leveling_enabled(leveling_was_active);
diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp
index e1fd0124c4..e334412054 100644
--- a/Marlin/src/gcode/bedlevel/abl/G29.cpp
+++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp
@@ -97,10 +97,6 @@ public:
bool dryrun,
reenable;
- #if HAS_MULTI_HOTEND
- uint8_t tool_index;
- #endif
-
#if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
int abl_probe_index;
#endif
@@ -281,10 +277,7 @@ G29_TYPE GcodeSuite::G29() {
*/
if (!g29_in_progress) {
- #if HAS_MULTI_HOTEND
- abl.tool_index = active_extruder;
- if (active_extruder != 0) tool_change(0, true);
- #endif
+ probe.use_probing_tool();
#if EITHER(PROBE_MANUALLY, AUTO_BED_LEVELING_LINEAR)
abl.abl_probe_index = -1;
@@ -947,7 +940,7 @@ G29_TYPE GcodeSuite::G29() {
process_subcommands_now(F(Z_PROBE_END_SCRIPT));
#endif
- TERN_(HAS_MULTI_HOTEND, if (abl.tool_index != 0) tool_change(abl.tool_index));
+ probe.use_probing_tool(false);
report_current_position();
diff --git a/Marlin/src/gcode/bedlevel/mbl/G29.cpp b/Marlin/src/gcode/bedlevel/mbl/G29.cpp
index e3e96a7960..9f902141fb 100644
--- a/Marlin/src/gcode/bedlevel/mbl/G29.cpp
+++ b/Marlin/src/gcode/bedlevel/mbl/G29.cpp
@@ -103,9 +103,8 @@ void GcodeSuite::G29() {
bedlevel.reset();
mbl_probe_index = 0;
if (!ui.wait_for_move) {
- queue.inject(parser.seen_test('N') ? F("G28" TERN(CAN_SET_LEVELING_AFTER_G28, "L0", "") "\nG29S2") : F("G29S2"));
- TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
- TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
+ if (parser.seen_test('N'))
+ queue.inject(F("G28" TERN_(CAN_SET_LEVELING_AFTER_G28, "L0")));
// Position bed horizontally and Z probe vertically.
#if HAS_SAFE_BED_LEVELING
@@ -141,6 +140,11 @@ void GcodeSuite::G29() {
do_blocking_move_to(safe_position);
#endif // HAS_SAFE_BED_LEVELING
+ queue.inject(F("G29S2"));
+
+ TERN_(EXTENSIBLE_UI, ExtUI::onLevelingStart());
+ TERN_(DWIN_LCD_PROUI, DWIN_LevelingStart());
+
return;
}
state = MeshNext;
diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp
index 836d5c867b..61320c0576 100644
--- a/Marlin/src/gcode/calibrate/G33.cpp
+++ b/Marlin/src/gcode/calibrate/G33.cpp
@@ -63,10 +63,6 @@ enum CalEnum : char { // the 7 main calibration points -
#define LOOP_CAL_RAD(VAR) LOOP_CAL_PT(VAR, __A, _7P_STEP)
#define LOOP_CAL_ACT(VAR, _4P, _OP) LOOP_CAL_PT(VAR, _OP ? _AB : __A, _4P ? _4P_STEP : _7P_STEP)
-#if HAS_MULTI_HOTEND
- const uint8_t old_tool_index = active_extruder;
-#endif
-
float lcd_probe_pt(const xy_pos_t &xy);
void ac_home() {
@@ -78,7 +74,7 @@ void ac_home() {
}
void ac_setup(const bool reset_bed) {
- TERN_(HAS_MULTI_HOTEND, tool_change(0, true));
+ TERN_(HAS_BED_PROBE, probe.use_probing_tool());
planner.synchronize();
remember_feedrate_scaling_off();
@@ -92,7 +88,7 @@ void ac_cleanup(TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index)) {
TERN_(DELTA_HOME_TO_SAFE_ZONE, do_blocking_move_to_z(delta_clip_start_height));
TERN_(HAS_BED_PROBE, probe.stow());
restore_feedrate_and_scaling();
- TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index, true));
+ TERN_(HAS_BED_PROBE, probe.use_probing_tool(false));
}
void print_signed_float(FSTR_P const prefix, const_float_t f) {
diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp
index 8cf652cd84..6d5ca8bf19 100644
--- a/Marlin/src/gcode/calibrate/G34_M422.cpp
+++ b/Marlin/src/gcode/calibrate/G34_M422.cpp
@@ -108,6 +108,7 @@ void GcodeSuite::G34() {
}
#if ENABLED(Z_STEPPER_AUTO_ALIGN)
+
do { // break out on error
const int8_t z_auto_align_iterations = parser.intval('I', Z_STEPPER_ALIGN_ITERATIONS);
@@ -142,11 +143,7 @@ void GcodeSuite::G34() {
TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY);
- // Always home with tool 0 active
- #if HAS_MULTI_HOTEND
- const uint8_t old_tool_index = active_extruder;
- tool_change(0, true);
- #endif
+ probe.use_probing_tool();
TERN_(HAS_DUPLICATION_MODE, set_duplication_enabled(false));
@@ -448,14 +445,16 @@ void GcodeSuite::G34() {
sync_plan_position();
#endif
- // Restore the active tool after homing
- TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index, DISABLED(PARKING_EXTRUDER))); // Fetch previous tool for parking extruder
+ probe.use_probing_tool(false);
#if BOTH(HAS_LEVELING, RESTORE_LEVELING_AFTER_G34)
set_bed_leveling_enabled(leveling_was_active);
#endif
}while(0);
+
+ probe.use_probing_tool(false);
+
#endif // Z_STEPPER_AUTO_ALIGN
}
diff --git a/Marlin/src/gcode/probe/G30.cpp b/Marlin/src/gcode/probe/G30.cpp
index 6893d4bec2..0a23e0981c 100644
--- a/Marlin/src/gcode/probe/G30.cpp
+++ b/Marlin/src/gcode/probe/G30.cpp
@@ -53,10 +53,7 @@
*/
void GcodeSuite::G30() {
- #if HAS_MULTI_HOTEND
- const uint8_t old_tool_index = active_extruder;
- tool_change(0);
- #endif
+ probe.use_probing_tool();
// Convert the given logical position to native position
const xy_pos_t pos = {
@@ -106,8 +103,7 @@ void GcodeSuite::G30() {
#endif
}
- // Restore the active tool
- TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));
+ probe.use_probing_tool(false);
}
#endif // HAS_BED_PROBE
diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h
index dc9849399c..32712a86d6 100644
--- a/Marlin/src/inc/Conditionals_LCD.h
+++ b/Marlin/src/inc/Conditionals_LCD.h
@@ -1110,6 +1110,14 @@
#define HAS_BED_PROBE 1
#endif
+// Probing tool change
+#if !HAS_MULTI_EXTRUDER
+ #undef PROBING_TOOL
+#endif
+#if HAS_BED_PROBE && defined(PROBING_TOOL)
+ #define DO_TOOLCHANGE_FOR_PROBING 1
+#endif
+
/**
* Fill in undefined Filament Sensor options
*/
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index c1e9b29444..5218cf792b 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -2664,6 +2664,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
#endif // HOTENDS > 2
#endif // HAS_MULTI_HOTEND
+#if DO_TOOLCHANGE_FOR_PROBING && PROBING_TOOL >= EXTRUDERS
+ #error "PROBING_TOOL must be a valid tool index."
+#endif
+
/**
* Pins must be set for temp sensors, with some other feature requirements.
*/
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index d48dc1eb1c..25581922f6 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -196,35 +196,35 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
inline void run_deploy_moves() {
#ifdef Z_PROBE_ALLEN_KEY_DEPLOY_1
#ifndef Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t deploy_1 = Z_PROBE_ALLEN_KEY_DEPLOY_1;
do_blocking_move_to(deploy_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_1_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_DEPLOY_2
#ifndef Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t deploy_2 = Z_PROBE_ALLEN_KEY_DEPLOY_2;
do_blocking_move_to(deploy_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_2_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_DEPLOY_3
#ifndef Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t deploy_3 = Z_PROBE_ALLEN_KEY_DEPLOY_3;
do_blocking_move_to(deploy_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_3_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_DEPLOY_4
#ifndef Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t deploy_4 = Z_PROBE_ALLEN_KEY_DEPLOY_4;
do_blocking_move_to(deploy_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_4_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_DEPLOY_5
#ifndef Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t deploy_5 = Z_PROBE_ALLEN_KEY_DEPLOY_5;
do_blocking_move_to(deploy_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_DEPLOY_5_FEEDRATE));
@@ -234,35 +234,35 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
inline void run_stow_moves() {
#ifdef Z_PROBE_ALLEN_KEY_STOW_1
#ifndef Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t stow_1 = Z_PROBE_ALLEN_KEY_STOW_1;
do_blocking_move_to(stow_1, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_STOW_2
#ifndef Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t stow_2 = Z_PROBE_ALLEN_KEY_STOW_2;
do_blocking_move_to(stow_2, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_2_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_STOW_3
#ifndef Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t stow_3 = Z_PROBE_ALLEN_KEY_STOW_3;
do_blocking_move_to(stow_3, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_3_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_STOW_4
#ifndef Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t stow_4 = Z_PROBE_ALLEN_KEY_STOW_4;
do_blocking_move_to(stow_4, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_4_FEEDRATE));
#endif
#ifdef Z_PROBE_ALLEN_KEY_STOW_5
#ifndef Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE
- #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0
+ #define Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE 0.0f
#endif
constexpr xyz_pos_t stow_5 = Z_PROBE_ALLEN_KEY_STOW_5;
do_blocking_move_to(stow_5, MMM_TO_MMS(Z_PROBE_ALLEN_KEY_STOW_5_FEEDRATE));
@@ -355,7 +355,8 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
void Probe::do_z_raise(const float z_raise) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Probe::do_z_raise(", z_raise, ")");
float z_dest = z_raise;
- if (offset.z < 0) z_dest -= offset.z;
+ const float zoffs = DIFF_TERN(HAS_HOTEND_OFFSET, offset.z, hotend_offset[active_extruder].z);
+ if (zoffs < 0) z_dest -= zoffs;
do_z_clearance(z_dest);
}
@@ -714,13 +715,15 @@ bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
float Probe::run_z_probe(const bool sanity_check/*=true*/) {
DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING));
+ const float zoffs = SUM_TERN(HAS_HOTEND_OFFSET, -offset.z, hotend_offset[active_extruder].z);
+
auto try_to_probe = [&](PGM_P const plbl, const_float_t z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) -> bool {
// Tare the probe, if supported
if (TERN0(PROBE_TARE, tare())) return true;
// Do a first probe at the fast speed
- const bool probe_fail = probe_down_to_z(z_probe_low_point, fr_mm_s), // No probe trigger?
- early_fail = (scheck && current_position.z > -offset.z + clearance); // Probe triggered too high?
+ const bool probe_fail = probe_down_to_z(z_probe_low_point, fr_mm_s), // No probe trigger?
+ early_fail = (scheck && current_position.z > zoffs + clearance); // Probe triggered too high?
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING) && (probe_fail || early_fail)) {
DEBUG_ECHOPGM_P(plbl);
@@ -737,7 +740,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
// Stop the probe before it goes too low to prevent damage.
// If Z isn't known then probe to -10mm.
- const float z_probe_low_point = axis_is_trusted(Z_AXIS) ? -offset.z + Z_PROBE_LOW_POINT : -10.0;
+ const float z_probe_low_point = axis_is_trusted(Z_AXIS) ? zoffs + Z_PROBE_LOW_POINT : -10.0f;
// Double-probing does a fast probe followed by a slow probe
#if TOTAL_PROBING == 2
@@ -759,7 +762,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
// If the nozzle is well over the travel height then
// move down quickly before doing the slow probe
- const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (offset.z < 0 ? -offset.z : 0);
+ const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0f + (zoffs > 0 ? zoffs : 0);
if (current_position.z > z) {
// Probe down fast. If the probe never triggered, raise for probe clearance
if (!probe_down_to_z(z, z_probe_fast_mm_s))
@@ -847,7 +850,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("2nd Probe Z:", z2, " Discrepancy:", first_probe_z - z2);
// Return a weighted average of the fast and slow probes
- const float measured_z = (z2 * 3.0 + first_probe_z * 2.0) * 0.2;
+ const float measured_z = (z2 * 3.0f + first_probe_z * 2.0f) * 0.2f;
#else
@@ -856,10 +859,33 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
#endif
- return measured_z;
+ return DIFF_TERN(HAS_HOTEND_OFFSET, measured_z, hotend_offset[active_extruder].z);
}
+#if DO_TOOLCHANGE_FOR_PROBING
+
+ #include "tool_change.h"
+
+ /**
+ * Switches to the appropriate tool (PROBING_TOOL) for probing (probing = true), and switches
+ * back to the old tool when probing = false. Uses statics to avoid unnecessary checks and to
+ * cache the previous tool, so always call with false after calling with true.
+ */
+ void Probe::use_probing_tool(const bool probing/*=true*/) {
+ static uint8_t old_tool;
+ static bool old_state = false;
+ if (probing == old_state) return;
+ old_state = probing;
+ if (probing) old_tool = active_extruder;
+ const uint8_t tool = probing ? PROBING_TOOL : old_tool;
+ if (tool != active_extruder)
+ tool_change(tool, ENABLED(PROBE_TOOLCHANGE_NO_MOVE));
+ }
+
+#endif
+
/**
+ * - Switch to PROBING_TOOL if necessary
* - Move to the given XY
* - Deploy the probe, if not already deployed
* - Probe the bed, get the Z position
@@ -867,6 +893,12 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
* - Stow the probe, or
* - Raise to the BETWEEN height
* - Return the probed Z position
+ * - Revert to previous tool
+ *
+ * A batch of multiple probing operations should always be preceded by use_probing_tool() invocation
+ * and succeeded by use_probing_tool(false), in order to avoid multiple tool changes and to end up
+ * with the previously active tool.
+ *
*/
float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const bool sanity_check/*=true*/) {
DEBUG_SECTION(log_probe, "Probe::probe_at_point", DEBUGGING(LEVELING));
@@ -899,7 +931,9 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
return NAN;
}
- if (probe_relative) npos -= offset_xy; // Get the nozzle position
+
+ if (probe_relative) // Get the nozzle position, adjust for active hotend if not 0
+ npos -= DIFF_TERN(HAS_HOTEND_OFFSET, offset_xy, xy_pos_t(hotend_offset[active_extruder]));
// Move the probe to the starting XYZ
do_blocking_move_to(npos, feedRate_t(XY_PROBE_FEEDRATE_MM_S));
@@ -938,6 +972,7 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
#endif
}
DEBUG_ECHOLNPGM("measured_z: ", measured_z);
+
return measured_z;
}
diff --git a/Marlin/src/module/probe.h b/Marlin/src/module/probe.h
index 9aff9cff06..770ca81ef4 100644
--- a/Marlin/src/module/probe.h
+++ b/Marlin/src/module/probe.h
@@ -188,6 +188,8 @@ public:
#endif // !HAS_BED_PROBE
+ static void use_probing_tool(const bool=true) IF_DISABLED(DO_TOOLCHANGE_FOR_PROBING, {});
+
static void move_z_after_homing() {
#if ALL(DWIN_LCD_PROUI, INDIVIDUAL_AXIS_HOMING_SUBMENU, MESH_BED_LEVELING) || defined(Z_AFTER_HOMING)
do_z_clearance(Z_POST_CLEARANCE, true);
From 8b1830c487b29560732b079dd5defaba68560652 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Wed, 22 Mar 2023 00:23:38 +0000
Subject: [PATCH 059/225] [cron] Bump distribution date (2023-03-22)
---
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 d052c3bff9..341cdbb482 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 "2023-03-20"
+//#define STRING_DISTRIBUTION_DATE "2023-03-22"
/**
* 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 99eb9bd3d7..809ba498c1 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 "2023-03-20"
+ #define STRING_DISTRIBUTION_DATE "2023-03-22"
#endif
/**
From 2ecd4cca1b694223802a53d5a7febaac4c4573b6 Mon Sep 17 00:00:00 2001
From: BIGTREETECH <38851044+bigtreetech@users.noreply.github.com>
Date: Wed, 22 Mar 2023 15:46:03 +0800
Subject: [PATCH 060/225] =?UTF-8?q?=E2=9C=A8=20FILAMENT=5FSWITCH=5FAND=5FM?=
=?UTF-8?q?OTION=20(#25548)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/Configuration.h | 41 +++++++
Marlin/src/feature/runout.cpp | 2 +-
Marlin/src/feature/runout.h | 172 ++++++++++++++++++-----------
Marlin/src/inc/Conditionals_LCD.h | 91 +++++++++++++++
Marlin/src/inc/Conditionals_post.h | 2 +-
buildroot/tests/rambo | 4 +-
6 files changed, 243 insertions(+), 69 deletions(-)
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 2603999bd5..9544ac5566 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -1903,6 +1903,47 @@
// as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
// large enough to avoid false positives.)
//#define FILAMENT_MOTION_SENSOR
+
+ #if ENABLED(FILAMENT_MOTION_SENSOR)
+ //#define FILAMENT_SWITCH_AND_MOTION
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ #define NUM_MOTION_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_MOTION#_PIN for each.
+ //#define FIL_MOTION1_PIN -1
+
+ // Override individually if the motion sensors vary
+ //#define FIL_MOTION1_STATE LOW
+ //#define FIL_MOTION1_PULLUP
+ //#define FIL_MOTION1_PULLDOWN
+
+ //#define FIL_MOTION2_STATE LOW
+ //#define FIL_MOTION2_PULLUP
+ //#define FIL_MOTION2_PULLDOWN
+
+ //#define FIL_MOTION3_STATE LOW
+ //#define FIL_MOTION3_PULLUP
+ //#define FIL_MOTION3_PULLDOWN
+
+ //#define FIL_MOTION4_STATE LOW
+ //#define FIL_MOTION4_PULLUP
+ //#define FIL_MOTION4_PULLDOWN
+
+ //#define FIL_MOTION5_STATE LOW
+ //#define FIL_MOTION5_PULLUP
+ //#define FIL_MOTION5_PULLDOWN
+
+ //#define FIL_MOTION6_STATE LOW
+ //#define FIL_MOTION6_PULLUP
+ //#define FIL_MOTION6_PULLDOWN
+
+ //#define FIL_MOTION7_STATE LOW
+ //#define FIL_MOTION7_PULLUP
+ //#define FIL_MOTION7_PULLDOWN
+
+ //#define FIL_MOTION8_STATE LOW
+ //#define FIL_MOTION8_PULLUP
+ //#define FIL_MOTION8_PULLDOWN
+ #endif
+ #endif
#endif
#endif
diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp
index 98b6bd0510..44ebd85b32 100644
--- a/Marlin/src/feature/runout.cpp
+++ b/Marlin/src/feature/runout.cpp
@@ -47,7 +47,7 @@ bool FilamentMonitorBase::enabled = true,
#if HAS_FILAMENT_RUNOUT_DISTANCE
float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM;
- volatile float RunoutResponseDelayed::runout_mm_countdown[NUM_RUNOUT_SENSORS];
+ volatile countdown_t RunoutResponseDelayed::mm_countdown;
#if ENABLED(FILAMENT_MOTION_SENSOR)
uint8_t FilamentSensorEncoder::motion_detected;
#endif
diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h
index e74d857a79..e839db3f5e 100644
--- a/Marlin/src/feature/runout.h
+++ b/Marlin/src/feature/runout.h
@@ -43,12 +43,18 @@
#define FILAMENT_RUNOUT_THRESHOLD 5
#endif
+#if ENABLED(FILAMENT_MOTION_SENSOR)
+ #define HAS_FILAMENT_MOTION 1
+#endif
+#if DISABLED(FILAMENT_MOTION_SENSOR) || ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ #define HAS_FILAMENT_SWITCH 1
+#endif
+
void event_filament_runout(const uint8_t extruder);
template
class TFilamentMonitor;
-class FilamentSensorEncoder;
-class FilamentSensorSwitch;
+class FilamentSensor;
class RunoutResponseDelayed;
class RunoutResponseDebounced;
@@ -56,7 +62,7 @@ class RunoutResponseDebounced;
typedef TFilamentMonitor<
TERN(HAS_FILAMENT_RUNOUT_DISTANCE, RunoutResponseDelayed, RunoutResponseDebounced),
- TERN(FILAMENT_MOTION_SENSOR, FilamentSensorEncoder, FilamentSensorSwitch)
+ FilamentSensor
> FilamentMonitor;
extern FilamentMonitor runout;
@@ -98,6 +104,11 @@ class TFilamentMonitor : public FilamentMonitorBase {
static void filament_present(const uint8_t extruder) {
response.filament_present(extruder);
}
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ static void filament_motion_present(const uint8_t extruder) {
+ response.filament_motion_present(extruder);
+ }
+ #endif
#if HAS_FILAMENT_RUNOUT_DISTANCE
static float& runout_distance() { return response.runout_distance_mm; }
@@ -171,37 +182,25 @@ class FilamentSensorBase {
static void filament_present(const uint8_t extruder) {
runout.filament_present(extruder); // ...which calls response.filament_present(extruder)
}
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ static void filament_motion_present(const uint8_t extruder) {
+ runout.filament_motion_present(extruder); // ...which calls response.filament_motion_present(extruder)
+ }
+ #endif
public:
static void setup() {
- #define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0)
+ #define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0);
#define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN)
- #if NUM_RUNOUT_SENSORS >= 1
- INIT_RUNOUT_PIN(1);
- #endif
- #if NUM_RUNOUT_SENSORS >= 2
- INIT_RUNOUT_PIN(2);
- #endif
- #if NUM_RUNOUT_SENSORS >= 3
- INIT_RUNOUT_PIN(3);
- #endif
- #if NUM_RUNOUT_SENSORS >= 4
- INIT_RUNOUT_PIN(4);
- #endif
- #if NUM_RUNOUT_SENSORS >= 5
- INIT_RUNOUT_PIN(5);
- #endif
- #if NUM_RUNOUT_SENSORS >= 6
- INIT_RUNOUT_PIN(6);
- #endif
- #if NUM_RUNOUT_SENSORS >= 7
- INIT_RUNOUT_PIN(7);
- #endif
- #if NUM_RUNOUT_SENSORS >= 8
- INIT_RUNOUT_PIN(8);
+ REPEAT_1(NUM_RUNOUT_SENSORS, INIT_RUNOUT_PIN);
+ #undef INIT_RUNOUT_PIN
+
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ #define INIT_MOTION_PIN(N) _INIT_RUNOUT_PIN(FIL_MOTION##N##_PIN, FIL_MOTION##N##_STATE, FIL_MOTION##N##_PULLUP, FIL_MOTION##N##_PULLDOWN)
+ REPEAT_1(NUM_MOTION_SENSORS, INIT_MOTION_PIN);
+ #undef INIT_MOTION_PIN
#endif
#undef _INIT_RUNOUT_PIN
- #undef INIT_RUNOUT_PIN
}
// Return a bitmask of runout pin states
@@ -213,36 +212,29 @@ class FilamentSensorBase {
// Return a bitmask of runout flag states (1 bits always indicates runout)
static uint8_t poll_runout_states() {
- return poll_runout_pins() ^ uint8_t(0
- #if NUM_RUNOUT_SENSORS >= 1
- | (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1))
- #endif
- #if NUM_RUNOUT_SENSORS >= 2
- | (FIL_RUNOUT2_STATE ? 0 : _BV(2 - 1))
- #endif
- #if NUM_RUNOUT_SENSORS >= 3
- | (FIL_RUNOUT3_STATE ? 0 : _BV(3 - 1))
- #endif
- #if NUM_RUNOUT_SENSORS >= 4
- | (FIL_RUNOUT4_STATE ? 0 : _BV(4 - 1))
- #endif
- #if NUM_RUNOUT_SENSORS >= 5
- | (FIL_RUNOUT5_STATE ? 0 : _BV(5 - 1))
- #endif
- #if NUM_RUNOUT_SENSORS >= 6
- | (FIL_RUNOUT6_STATE ? 0 : _BV(6 - 1))
- #endif
- #if NUM_RUNOUT_SENSORS >= 7
- | (FIL_RUNOUT7_STATE ? 0 : _BV(7 - 1))
- #endif
- #if NUM_RUNOUT_SENSORS >= 8
- | (FIL_RUNOUT8_STATE ? 0 : _BV(8 - 1))
- #endif
- );
+ #define _OR_RUNOUT(N) | (FIL_RUNOUT##N##_STATE ? 0 : _BV(N - 1))
+ return poll_runout_pins() ^ uint8_t(0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_RUNOUT));
+ #undef _OR_RUNOUT
}
+
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ // Return a bitmask of motion pin states
+ static uint8_t poll_motion_pins() {
+ #define _OR_MOTION(N) | (READ(FIL_MOTION##N##_PIN) ? _BV((N) - 1) : 0)
+ return (0 REPEAT_1(NUM_MOTION_SENSORS, _OR_MOTION));
+ #undef _OR_MOTION
+ }
+
+ // Return a bitmask of motion flag states (1 bits always indicates runout)
+ static uint8_t poll_motion_states() {
+ #define _OR_MOTION(N) | (FIL_MOTION##N##_STATE ? 0 : _BV(N - 1))
+ return poll_motion_pins() ^ uint8_t(0 REPEAT_1(NUM_MOTION_SENSORS, _OR_MOTION));
+ #undef _OR_MOTION
+ }
+ #endif
};
-#if ENABLED(FILAMENT_MOTION_SENSOR)
+#if HAS_FILAMENT_MOTION
/**
* This sensor uses a magnetic encoder disc and a Hall effect
@@ -256,14 +248,14 @@ class FilamentSensorBase {
static void poll_motion_sensor() {
static uint8_t old_state;
- const uint8_t new_state = poll_runout_pins(),
+ const uint8_t new_state = TERN(FILAMENT_SWITCH_AND_MOTION, poll_motion_pins, poll_runout_pins)(),
change = old_state ^ new_state;
old_state = new_state;
#if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG)
if (change) {
SERIAL_ECHOPGM("Motion detected:");
- LOOP_L_N(e, NUM_RUNOUT_SENSORS)
+ LOOP_L_N(e, TERN(FILAMENT_SWITCH_AND_MOTION, NUM_MOTION_SENSORS, NUM_RUNOUT_SENSORS))
if (TEST(change, e)) SERIAL_CHAR(' ', '0' + e);
SERIAL_EOL();
}
@@ -277,7 +269,7 @@ class FilamentSensorBase {
// If the sensor wheel has moved since the last call to
// this method reset the runout counter for the extruder.
if (TEST(motion_detected, b->extruder))
- filament_present(b->extruder);
+ TERN(FILAMENT_SWITCH_AND_MOTION, filament_motion_present, filament_present)(b->extruder);
// Clear motion triggers for next block
motion_detected = 0;
@@ -286,7 +278,9 @@ class FilamentSensorBase {
static void run() { poll_motion_sensor(); }
};
-#else
+#endif // HAS_FILAMENT_MOTION
+
+#if HAS_FILAMENT_SWITCH
/**
* This is a simple endstop switch in the path of the filament.
@@ -324,25 +318,56 @@ class FilamentSensorBase {
}
};
+ #endif // HAS_FILAMENT_SWITCH
+
+ /**
+ * This is a simple endstop switch in the path of the filament.
+ * It can detect filament runout, but not stripouts or jams.
+ */
+ class FilamentSensor : public FilamentSensorBase {
+ private:
+ TERN_(HAS_FILAMENT_MOTION, static FilamentSensorEncoder encoder_sensor);
+ TERN_(HAS_FILAMENT_SWITCH, static FilamentSensorSwitch switch_sensor);
+
+ public:
+ static void block_completed(const block_t * const b) {
+ TERN_(HAS_FILAMENT_MOTION, encoder_sensor.block_completed(b));
+ TERN_(HAS_FILAMENT_SWITCH, switch_sensor.block_completed(b));
+ }
+
+ static void run() {
+ TERN_(HAS_FILAMENT_MOTION, encoder_sensor.run());
+ TERN_(HAS_FILAMENT_SWITCH, switch_sensor.run());
+ }
+ };
-#endif // !FILAMENT_MOTION_SENSOR
/********************************* RESPONSE TYPE *********************************/
#if HAS_FILAMENT_RUNOUT_DISTANCE
+ typedef struct {
+ float runout[NUM_RUNOUT_SENSORS];
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ float motion[NUM_MOTION_SENSORS];
+ #endif
+ } countdown_t;
+
// RunoutResponseDelayed triggers a runout event only if the length
// of filament specified by FILAMENT_RUNOUT_DISTANCE_MM has been fed
// during a runout condition.
class RunoutResponseDelayed {
private:
- static volatile float runout_mm_countdown[NUM_RUNOUT_SENSORS];
+ static volatile countdown_t mm_countdown;
public:
static float runout_distance_mm;
static void reset() {
LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i);
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ LOOP_L_N(i, NUM_MOTION_SENSORS) filament_motion_present(i);
+ #endif
}
static void run() {
@@ -352,7 +377,11 @@ class FilamentSensorBase {
if (ELAPSED(ms, t)) {
t = millis() + 1000UL;
LOOP_L_N(i, NUM_RUNOUT_SENSORS)
- SERIAL_ECHOF(i ? F(", ") : F("Remaining mm: "), runout_mm_countdown[i]);
+ SERIAL_ECHOF(i ? F(", ") : F("Runout remaining mm: "), mm_countdown.runout[i]);
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ LOOP_L_N(i, NUM_MOTION_SENSORS)
+ SERIAL_ECHOF(i ? F(", ") : F("Motion remaining mm: "), mm_countdown.motion[i]);
+ #endif
SERIAL_EOL();
}
#endif
@@ -360,20 +389,33 @@ class FilamentSensorBase {
static uint8_t has_run_out() {
uint8_t runout_flags = 0;
- LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i);
+ LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (mm_countdown.runout[i] < 0) SBI(runout_flags, i);
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ LOOP_L_N(i, NUM_MOTION_SENSORS) if (mm_countdown.motion[i] < 0) SBI(runout_flags, i);
+ #endif
return runout_flags;
}
static void filament_present(const uint8_t extruder) {
- runout_mm_countdown[extruder] = runout_distance_mm;
+ mm_countdown.runout[extruder] = runout_distance_mm;
}
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ static void filament_motion_present(const uint8_t extruder) {
+ mm_countdown.motion[extruder] = runout_distance_mm;
+ }
+ #endif
+
static void block_completed(const block_t * const b) {
if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state
// Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
const uint8_t e = b->extruder;
const int32_t steps = b->steps.e;
- runout_mm_countdown[e] -= (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.mm_per_step[E_AXIS_N(e)];
+ const float mm = (TEST(b->direction_bits, E_AXIS) ? -steps : steps) * planner.mm_per_step[E_AXIS_N(e)];
+ if (e < NUM_RUNOUT_SENSORS) mm_countdown.runout[e] -= mm;
+ #if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ if (e < NUM_MOTION_SENSORS) mm_countdown.motion[e] -= mm;
+ #endif
}
}
};
diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h
index 32712a86d6..ecaeee86e7 100644
--- a/Marlin/src/inc/Conditionals_LCD.h
+++ b/Marlin/src/inc/Conditionals_LCD.h
@@ -1212,6 +1212,97 @@
#endif
#endif // FILAMENT_RUNOUT_SENSOR
+#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
+ #if NUM_MOTION_SENSORS >= 1
+ #ifndef FIL_MOTION1_STATE
+ #define FIL_MOTION1_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION1_PULLUP
+ #define FIL_MOTION1_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION1_PULLDOWN
+ #define FIL_MOTION1_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+ #if NUM_MOTION_SENSORS >= 2
+ #ifndef FIL_MOTION2_STATE
+ #define FIL_MOTION2_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION2_PULLUP
+ #define FIL_MOTION2_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION2_PULLDOWN
+ #define FIL_MOTION2_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+ #if NUM_MOTION_SENSORS >= 3
+ #ifndef FIL_MOTION3_STATE
+ #define FIL_MOTION3_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION3_PULLUP
+ #define FIL_MOTION3_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION3_PULLDOWN
+ #define FIL_MOTION3_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+ #if NUM_MOTION_SENSORS >= 4
+ #ifndef FIL_MOTION4_STATE
+ #define FIL_MOTION4_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION4_PULLUP
+ #define FIL_MOTION4_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION4_PULLDOWN
+ #define FIL_MOTION4_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+ #if NUM_MOTION_SENSORS >= 5
+ #ifndef FIL_MOTION5_STATE
+ #define FIL_MOTION5_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION5_PULLUP
+ #define FIL_MOTION5_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION5_PULLDOWN
+ #define FIL_MOTION5_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+ #if NUM_MOTION_SENSORS >= 6
+ #ifndef FIL_MOTION6_STATE
+ #define FIL_MOTION6_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION6_PULLUP
+ #define FIL_MOTION6_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION6_PULLDOWN
+ #define FIL_MOTION6_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+ #if NUM_MOTION_SENSORS >= 7
+ #ifndef FIL_MOTION7_STATE
+ #define FIL_MOTION7_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION7_PULLUP
+ #define FIL_MOTION7_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION7_PULLDOWN
+ #define FIL_MOTION7_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+ #if NUM_MOTION_SENSORS >= 8
+ #ifndef FIL_MOTION8_STATE
+ #define FIL_MOTION8_STATE FIL_RUNOUT_STATE
+ #endif
+ #ifndef FIL_MOTION8_PULLUP
+ #define FIL_MOTION8_PULLUP FIL_RUNOUT_PULLUP
+ #endif
+ #ifndef FIL_MOTION8_PULLDOWN
+ #define FILMOTION8_PULLDOWN FIL_RUNOUT_PULLDOWN
+ #endif
+ #endif
+#endif // FILAMENT_SWITCH_AND_MOTION
+
// Homing to Min or Max
#if X_HOME_DIR > 0
#define X_HOME_TO_MAX 1
diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h
index a054f90840..58f04a39b6 100644
--- a/Marlin/src/inc/Conditionals_post.h
+++ b/Marlin/src/inc/Conditionals_post.h
@@ -2664,7 +2664,7 @@
#endif
/**
- * Up to 3 PWM fans
+ * Up to 8 PWM fans
*/
#ifndef FAN_INVERTING
#define FAN_INVERTING false
diff --git a/buildroot/tests/rambo b/buildroot/tests/rambo
index 9a017c971f..7e6f71364c 100755
--- a/buildroot/tests/rambo
+++ b/buildroot/tests/rambo
@@ -15,7 +15,7 @@ opt_set MOTHERBOARD BOARD_RAMBO \
TEMP_SENSOR_PROBE 1 TEMP_PROBE_PIN 12 \
TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 3 HEATER_CHAMBER_PIN 45 \
GRID_MAX_POINTS_X 16 AUTO_POWER_E_TEMP 80 \
- FANMUX0_PIN 53
+ FANMUX0_PIN 53 FIL_MOTION1_PIN 45
opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN USE_WATCHDOG
opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TEST \
FIX_MOUNTED_PROBE CODEPENDENT_XY_HOMING PIDTEMPBED PTC_PROBE PTC_BED \
@@ -25,7 +25,7 @@ opt_enable USE_ZMAX_PLUG REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_P
NEOPIXEL_LED NEOPIXEL_PIN CASE_LIGHT_ENABLE CASE_LIGHT_USE_NEOPIXEL CASE_LIGHT_MENU \
PID_PARAMS_PER_HOTEND PID_AUTOTUNE_MENU PID_EDIT_MENU PID_EXTRUSION_SCALING LCD_SHOW_E_TOTAL \
PRINTCOUNTER SERVICE_NAME_1 SERVICE_INTERVAL_1 LCD_BED_TRAMMING BED_TRAMMING_INCLUDE_CENTER \
- NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM \
+ NOZZLE_PARK_FEATURE FILAMENT_RUNOUT_SENSOR FILAMENT_RUNOUT_DISTANCE_MM FILAMENT_MOTION_SENSOR FILAMENT_SWITCH_AND_MOTION \
ADVANCED_PAUSE_FEATURE FILAMENT_LOAD_UNLOAD_GCODES FILAMENT_UNLOAD_ALL_EXTRUDERS \
PASSWORD_FEATURE PASSWORD_ON_STARTUP PASSWORD_ON_SD_PRINT_MENU PASSWORD_AFTER_SD_PRINT_END PASSWORD_AFTER_SD_PRINT_ABORT \
AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DISTINCT_E_FACTORS \
From 91b5015a8b3ec5efd1052fdf7208124ff8b4120b Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Wed, 22 Mar 2023 03:22:29 -0500
Subject: [PATCH 061/225] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Ext?=
=?UTF-8?q?UI::onSetPowerLoss?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/feature/powerloss.cpp | 1 +
Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/dgus/dgus_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/example/example.cpp | 7 +++++--
Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/ia_creality/creality_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/malyan/malyan_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/nextion/nextion_extui.cpp | 7 +++++--
Marlin/src/lcd/extui/ui_api.h | 5 +++--
11 files changed, 49 insertions(+), 20 deletions(-)
diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp
index faec893928..dd20d04278 100644
--- a/Marlin/src/feature/powerloss.cpp
+++ b/Marlin/src/feature/powerloss.cpp
@@ -113,6 +113,7 @@ void PrintJobRecovery::changed() {
purge();
else if (IS_SD_PRINTING())
save(true);
+ TERN_(EXTENSIBLE_UI, ExtUI::onSetPowerLoss(onoff));
}
/**
diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp
index 39b328d808..520ca587e3 100644
--- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp
+++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp
@@ -94,12 +94,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}
- void onSettingsLoaded(bool success) {
+ void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
@@ -120,6 +120,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp
index afe88bf583..a2ad678ac6 100644
--- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp
+++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp
@@ -81,12 +81,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}
- void onSettingsLoaded(bool success) {
+ void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
@@ -106,6 +106,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp
index 2f3bbd64cc..2fe4e03016 100644
--- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp
+++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp
@@ -102,12 +102,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}
- void onSettingsLoaded(bool success) {
+ void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
@@ -126,6 +126,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
index 9aecf65f98..fb8ef8cc84 100644
--- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
+++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
@@ -100,11 +100,11 @@ namespace ExtUI {
void onPostprocessSettings() {}
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
dgus_screen_handler.ConfigurationStoreWritten(success);
}
- void onSettingsLoaded(bool success) {
+ void onSettingsLoaded(const bool success) {
dgus_screen_handler.ConfigurationStoreRead(success);
}
@@ -123,6 +123,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp
index a5e816efd8..83b7a0a3ca 100644
--- a/Marlin/src/lcd/extui/example/example.cpp
+++ b/Marlin/src/lcd/extui/example/example.cpp
@@ -88,12 +88,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}
- void onSettingsLoaded(bool success) {
+ void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
@@ -112,6 +112,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
index 159847bde1..b82b4a07bd 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp
@@ -97,7 +97,7 @@ namespace ExtUI {
void onLoadSettings(const char *buff) { InterfaceSettingsScreen::loadSettings(buff); }
void onPostprocessSettings() {} // Called after loading or resetting stored settings
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
#ifdef ARCHIM2_SPI_FLASH_EEPROM_BACKUP_SIZE
if (success && InterfaceSettingsScreen::backupEEPROM()) {
SERIAL_ECHOLNPGM("EEPROM backed up to SPI Flash");
@@ -106,7 +106,7 @@ namespace ExtUI {
UNUSED(success);
#endif
}
- void onSettingsLoaded(bool) {}
+ void onSettingsLoaded(const bool) {}
void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); }
@@ -125,6 +125,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
index c9c064fdc8..d92517578f 100644
--- a/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
+++ b/Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
@@ -1995,12 +1995,12 @@ namespace ExtUI {
SetTouchScreenConfiguration();
}
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
// This is called after the entire EEPROM has been written,
// whether successful or not.
}
- void onSettingsLoaded(bool success) {
+ void onSettingsLoaded(const bool success) {
#if HAS_MESH
if (ExtUI::getMeshValid()) {
uint8_t abl_probe_index = 0;
@@ -2026,6 +2026,9 @@ namespace ExtUI {
}
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp
index b978937def..8bffa442b6 100644
--- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp
+++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp
@@ -147,8 +147,8 @@ namespace ExtUI {
void onStoreSettings(char*) {}
void onLoadSettings(const char*) {}
void onPostprocessSettings() {}
- void onSettingsStored(bool) {}
- void onSettingsLoaded(bool) {}
+ void onSettingsStored(const bool) {}
+ void onSettingsLoaded(const bool) {}
#if HAS_MESH
void onLevelingStart() {}
@@ -158,6 +158,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp
index 433bbfbe8b..bf40fe97ac 100644
--- a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp
+++ b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp
@@ -79,12 +79,12 @@ namespace ExtUI {
// Called after loading or resetting stored settings
}
- void onSettingsStored(bool success) {
+ void onSettingsStored(const bool success) {
// Called after the entire EEPROM has been written,
// whether successful or not.
}
- void onSettingsLoaded(bool success) {
+ void onSettingsLoaded(const bool success) {
// Called after the entire EEPROM has been read,
// whether successful or not.
}
@@ -103,6 +103,9 @@ namespace ExtUI {
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff) {
+ // Called when power-loss is enabled/disabled
+ }
void onPowerLoss() {
// Called when power-loss state is detected
}
diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h
index 46f0891bb7..98441ccdd9 100644
--- a/Marlin/src/lcd/extui/ui_api.h
+++ b/Marlin/src/lcd/extui/ui_api.h
@@ -423,9 +423,10 @@ namespace ExtUI {
void onStoreSettings(char *);
void onLoadSettings(const char *);
void onPostprocessSettings();
- void onSettingsStored(bool success);
- void onSettingsLoaded(bool success);
+ void onSettingsStored(const bool success);
+ void onSettingsLoaded(const bool success);
#if ENABLED(POWER_LOSS_RECOVERY)
+ void onSetPowerLoss(const bool onoff);
void onPowerLoss();
void onPowerLossResume();
#endif
From 724ba4b4e607364c6c5f68d716648b90cd850fa8 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Thu, 23 Mar 2023 00:22:05 +0000
Subject: [PATCH 062/225] [cron] Bump distribution date (2023-03-23)
---
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 341cdbb482..21baa79660 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 "2023-03-22"
+//#define STRING_DISTRIBUTION_DATE "2023-03-23"
/**
* 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 809ba498c1..50445874e9 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 "2023-03-22"
+ #define STRING_DISTRIBUTION_DATE "2023-03-23"
#endif
/**
From 17b43d6b3d10a816ba534547d37346888f3897b4 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Thu, 23 Mar 2023 17:19:20 -0500
Subject: [PATCH 063/225] =?UTF-8?q?=F0=9F=8E=A8=20calibration=5Fstage=20?=
=?UTF-8?q?=3D>=20stage?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 22 +++++++++----------
.../extui/mks_ui/draw_touch_calibration.cpp | 20 ++++++++---------
Marlin/src/lcd/tft/ui_common.cpp | 20 ++++++++---------
3 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp
index f1bf9d032e..efc010ca89 100644
--- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp
+++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp
@@ -501,26 +501,26 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT,
void MarlinUI::touch_calibration_screen() {
uint16_t x, y;
- calibrationState calibration_stage = touch_calibration.get_calibration_state();
+ calibrationState stage = touch_calibration.get_calibration_state();
- if (calibration_stage == CALIBRATION_NONE) {
+ if (stage == CALIBRATION_NONE) {
// start and clear screen
defer_status_screen(true);
- calibration_stage = touch_calibration.calibration_start();
+ stage = touch_calibration.calibration_start();
tftio.set_window(0, 0, (TFT_WIDTH) - 1, (TFT_HEIGHT) - 1);
tftio.WriteMultiple(TFT_MARLINBG_COLOR, uint32_t(TFT_WIDTH) * (TFT_HEIGHT));
}
else {
// clear last cross
- x = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].x;
- y = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].y;
+ x = touch_calibration.calibration_points[_MIN(stage - 1, CALIBRATION_BOTTOM_RIGHT)].x;
+ y = touch_calibration.calibration_points[_MIN(stage - 1, CALIBRATION_BOTTOM_RIGHT)].y;
drawCross(x, y, TFT_MARLINBG_COLOR);
}
FSTR_P str = nullptr;
- if (calibration_stage < CALIBRATION_SUCCESS) {
+ if (stage < CALIBRATION_SUCCESS) {
// handle current state
- switch (calibration_stage) {
+ switch (stage) {
case CALIBRATION_TOP_LEFT: str = GET_TEXT_F(MSG_TOP_LEFT); break;
case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT_F(MSG_BOTTOM_LEFT); break;
case CALIBRATION_TOP_RIGHT: str = GET_TEXT_F(MSG_TOP_RIGHT); break;
@@ -528,13 +528,13 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT,
default: break;
}
- x = touch_calibration.calibration_points[calibration_stage].x;
- y = touch_calibration.calibration_points[calibration_stage].y;
+ x = touch_calibration.calibration_points[stage].x;
+ y = touch_calibration.calibration_points[stage].y;
drawCross(x, y, TFT_MARLINUI_COLOR);
}
else {
// end calibration
- str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT_F(MSG_CALIBRATION_COMPLETED) : GET_TEXT_F(MSG_CALIBRATION_FAILED);
+ str = stage == CALIBRATION_SUCCESS ? GET_TEXT_F(MSG_CALIBRATION_COMPLETED) : GET_TEXT_F(MSG_CALIBRATION_FAILED);
defer_status_screen(false);
touch_calibration.calibration_end();
TERN_(HAS_TOUCH_BUTTONS, redrawTouchButtons = true);
@@ -548,7 +548,7 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT,
} while (u8g.nextPage());
drawing_screen = false;
safe_delay(250);
- if (calibration_stage == CALIBRATION_SUCCESS) {
+ if (stage == CALIBRATION_SUCCESS) {
safe_delay(500);
ui.goto_previous_screen();
}
diff --git a/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp b/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp
index e0c663e282..a9a25db118 100644
--- a/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp
+++ b/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp
@@ -55,22 +55,22 @@ static void drawCross(uint16_t x, uint16_t y, uint16_t color) {
void lv_update_touch_calibration_screen() {
uint16_t x, y;
- calibrationState calibration_stage = touch_calibration.get_calibration_state();
- if (calibration_stage == CALIBRATION_NONE) {
+ calibrationState stage = touch_calibration.get_calibration_state();
+ if (stage == CALIBRATION_NONE) {
// start and clear screen
- calibration_stage = touch_calibration.calibration_start();
+ stage = touch_calibration.calibration_start();
}
else {
// clear last cross
- x = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].x;
- y = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].y;
+ x = touch_calibration.calibration_points[_MIN(stage - 1, CALIBRATION_BOTTOM_RIGHT)].x;
+ y = touch_calibration.calibration_points[_MIN(stage - 1, CALIBRATION_BOTTOM_RIGHT)].y;
drawCross(x, y, LV_COLOR_BACKGROUND.full);
}
const char *str = nullptr;
- if (calibration_stage < CALIBRATION_SUCCESS) {
+ if (stage < CALIBRATION_SUCCESS) {
// handle current state
- switch (calibration_stage) {
+ switch (stage) {
case CALIBRATION_TOP_LEFT: str = GET_TEXT(MSG_TOP_LEFT); break;
case CALIBRATION_BOTTOM_LEFT: str = GET_TEXT(MSG_BOTTOM_LEFT); break;
case CALIBRATION_TOP_RIGHT: str = GET_TEXT(MSG_TOP_RIGHT); break;
@@ -78,13 +78,13 @@ void lv_update_touch_calibration_screen() {
default: break;
}
- x = touch_calibration.calibration_points[calibration_stage].x;
- y = touch_calibration.calibration_points[calibration_stage].y;
+ x = touch_calibration.calibration_points[stage].x;
+ y = touch_calibration.calibration_points[stage].y;
drawCross(x, y, LV_COLOR_WHITE.full);
}
else {
// end calibration
- str = calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED);
+ str = stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED);
touch_calibration.calibration_end();
lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_TC_RETURN);
}
diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp
index 705438e95b..6fbde79154 100644
--- a/Marlin/src/lcd/tft/ui_common.cpp
+++ b/Marlin/src/lcd/tft/ui_common.cpp
@@ -228,24 +228,24 @@ void MarlinUI::clear_lcd() {
void MarlinUI::touch_calibration_screen() {
uint16_t x, y;
- calibrationState calibration_stage = touch_calibration.get_calibration_state();
+ calibrationState stage = touch_calibration.get_calibration_state();
- if (calibration_stage == CALIBRATION_NONE) {
+ if (stage == CALIBRATION_NONE) {
defer_status_screen(true);
clear_lcd();
- calibration_stage = touch_calibration.calibration_start();
+ stage = touch_calibration.calibration_start();
}
else {
- x = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].x;
- y = touch_calibration.calibration_points[_MIN(calibration_stage - 1, CALIBRATION_BOTTOM_RIGHT)].y;
+ x = touch_calibration.calibration_points[_MIN(stage - 1, CALIBRATION_BOTTOM_RIGHT)].x;
+ y = touch_calibration.calibration_points[_MIN(stage - 1, CALIBRATION_BOTTOM_RIGHT)].y;
tft.canvas(x - 15, y - 15, 31, 31);
tft.set_background(COLOR_BACKGROUND);
}
touch.clear();
- if (calibration_stage < CALIBRATION_SUCCESS) {
- switch (calibration_stage) {
+ if (stage < CALIBRATION_SUCCESS) {
+ switch (stage) {
case CALIBRATION_TOP_LEFT: tft_string.set(GET_TEXT(MSG_TOP_LEFT)); break;
case CALIBRATION_BOTTOM_LEFT: tft_string.set(GET_TEXT(MSG_BOTTOM_LEFT)); break;
case CALIBRATION_TOP_RIGHT: tft_string.set(GET_TEXT(MSG_TOP_RIGHT)); break;
@@ -253,8 +253,8 @@ void MarlinUI::clear_lcd() {
default: break;
}
- x = touch_calibration.calibration_points[calibration_stage].x;
- y = touch_calibration.calibration_points[calibration_stage].y;
+ x = touch_calibration.calibration_points[stage].x;
+ y = touch_calibration.calibration_points[stage].y;
tft.canvas(x - 15, y - 15, 31, 31);
tft.set_background(COLOR_BACKGROUND);
@@ -264,7 +264,7 @@ void MarlinUI::clear_lcd() {
touch.add_control(CALIBRATE, 0, 0, TFT_WIDTH, TFT_HEIGHT, uint32_t(x) << 16 | uint32_t(y));
}
else {
- tft_string.set(calibration_stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED));
+ tft_string.set(stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED));
defer_status_screen(false);
touch_calibration.calibration_end();
touch.add_control(BACK, 0, 0, TFT_WIDTH, TFT_HEIGHT);
From c641208ceb39455985f3665dc9ead2d0ae263012 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Fri, 24 Mar 2023 00:21:09 +0000
Subject: [PATCH 064/225] [cron] Bump distribution date (2023-03-24)
---
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 21baa79660..62330c57c7 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 "2023-03-23"
+//#define STRING_DISTRIBUTION_DATE "2023-03-24"
/**
* 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 50445874e9..d8245208b4 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 "2023-03-23"
+ #define STRING_DISTRIBUTION_DATE "2023-03-24"
#endif
/**
From 28666f2fb28e8b68f641e507359a72dbf4bc117a Mon Sep 17 00:00:00 2001
From: Martin Turski
Date: Fri, 24 Mar 2023 05:08:28 +0100
Subject: [PATCH 065/225] =?UTF-8?q?=F0=9F=A9=B9=20Reset=20touch=20screen?=
=?UTF-8?q?=20calibration=20on=20failure=20(#25334)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Scott Lahteine
---
Marlin/src/lcd/tft_io/touch_calibration.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Marlin/src/lcd/tft_io/touch_calibration.cpp b/Marlin/src/lcd/tft_io/touch_calibration.cpp
index 44ebc73d71..b1ef17df17 100644
--- a/Marlin/src/lcd/tft_io/touch_calibration.cpp
+++ b/Marlin/src/lcd/tft_io/touch_calibration.cpp
@@ -74,7 +74,7 @@ void TouchCalibration::validate_calibration() {
else {
calibration_state = CALIBRATION_FAIL;
calibration_reset();
- if (need_calibration() && failed_count++ < TOUCH_CALIBRATION_MAX_RETRIES) calibration_state = CALIBRATION_TOP_LEFT;
+ if (need_calibration() && failed_count++ < TOUCH_CALIBRATION_MAX_RETRIES) calibration_state = CALIBRATION_NONE;
}
#undef CAL_PTS
From 769ad2764512b38e987ebbed1fe026d68a424bb1 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 24 Mar 2023 00:33:39 -0500
Subject: [PATCH 066/225] =?UTF-8?q?=F0=9F=8E=A8=20TMC=20SPI=20Pins?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Martin Turski
---
Marlin/Configuration_adv.h | 50 +++++++++---------
Marlin/src/HAL/DUE/inc/SanityCheck.h | 2 +-
Marlin/src/HAL/LPC1768/inc/SanityCheck.h | 4 +-
Marlin/src/inc/Conditionals_post.h | 8 +++
Marlin/src/inc/SanityCheck.h | 2 +
Marlin/src/module/stepper/trinamic.cpp | 2 +-
Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 20 ++++---
Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h | 20 ++++---
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 9 ++--
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 22 ++++----
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 20 ++++---
Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 18 +++----
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 20 ++++---
Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 21 ++++----
.../src/pins/lpc1769/pins_COHESION3D_MINI.h | 18 +++----
.../src/pins/lpc1769/pins_COHESION3D_REMIX.h | 18 +++----
Marlin/src/pins/lpc1769/pins_FLY_CDY.h | 20 ++++---
Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 22 ++++----
Marlin/src/pins/mega/pins_GT2560_V3_A20.h | 2 +-
Marlin/src/pins/mega/pins_GT2560_V4_A20.h | 2 +-
Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 6 +--
.../pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h | 6 +--
Marlin/src/pins/mega/pins_SILVER_GATE.h | 2 +-
Marlin/src/pins/pins.h | 2 +-
Marlin/src/pins/pinsDebug_list.h | 21 +++++---
Marlin/src/pins/ramps/pins_3DRAG.h | 2 +-
Marlin/src/pins/ramps/pins_MKS_GEN_L.h | 10 ++--
Marlin/src/pins/ramps/pins_RAMPS.h | 20 ++++---
Marlin/src/pins/ramps/pins_RAMPS_S_12.h | 18 +++----
Marlin/src/pins/ramps/pins_TRIGORILLA_13.h | 14 ++---
Marlin/src/pins/ramps/pins_TT_OSCAR.h | 18 +++----
Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h | 18 +++----
Marlin/src/pins/sam/pins_ARCHIM2.h | 20 ++++---
.../src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h | 1 -
Marlin/src/pins/samd/pins_MINITRONICS20.h | 10 ++--
Marlin/src/pins/samd/pins_RAMPS_144.h | 20 ++++---
.../src/pins/sanguino/pins_SANGUINOLOLU_11.h | 2 +-
Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 20 ++++---
.../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 37 +++++++------
.../src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 2 +-
Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h | 4 +-
Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 50 +++++++++---------
.../pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h | 4 +-
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h | 20 ++++---
.../pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h | 21 ++++----
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 20 ++++---
.../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 4 +-
.../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 20 ++++---
Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 20 ++++---
Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h | 20 ++++---
.../src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 20 ++++---
Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 26 +++++-----
.../pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 20 ++++---
.../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 22 ++++----
.../pins/stm32f4/pins_BTT_SKR_V2_0_common.h | 20 ++++---
Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 20 ++++---
.../pins/stm32f4/pins_FYSETC_CHEETAH_V20.h | 10 ++--
Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h | 20 ++++---
Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h | 20 ++++---
Marlin/src/pins/stm32f4/pins_LERDGE_K.h | 8 +--
.../src/pins/stm32f4/pins_MKS_MONSTER8_V1.h | 2 +-
.../pins/stm32f4/pins_MKS_MONSTER8_common.h | 23 ++++----
.../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 23 ++++----
.../src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h | 52 +++++++++----------
Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h | 10 ++--
.../src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h | 6 +--
.../src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h | 6 +--
Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 18 +++----
Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h | 6 +--
.../pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h | 20 ++++---
.../pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h | 22 ++++----
.../pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h | 24 ++++-----
.../pins/stm32g0/pins_BTT_MANTA_M8P_common.h | 20 ++++---
.../pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h | 20 ++++---
.../pins/stm32h7/pins_BTT_SKR_SE_BX_common.h | 20 ++++---
.../pins/stm32h7/pins_BTT_SKR_V3_0_common.h | 20 ++++---
76 files changed, 572 insertions(+), 638 deletions(-)
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 3e23bb8944..9b4c58be6f 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -2979,28 +2979,28 @@
* Override default SPI pins for TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160 drivers here.
* The default pins can be found in your board's pins file.
*/
- //#define X_CS_PIN -1
- //#define Y_CS_PIN -1
- //#define Z_CS_PIN -1
- //#define X2_CS_PIN -1
- //#define Y2_CS_PIN -1
- //#define Z2_CS_PIN -1
- //#define Z3_CS_PIN -1
- //#define Z4_CS_PIN -1
- //#define I_CS_PIN -1
- //#define J_CS_PIN -1
- //#define K_CS_PIN -1
- //#define U_CS_PIN -1
- //#define V_CS_PIN -1
- //#define W_CS_PIN -1
- //#define E0_CS_PIN -1
- //#define E1_CS_PIN -1
- //#define E2_CS_PIN -1
- //#define E3_CS_PIN -1
- //#define E4_CS_PIN -1
- //#define E5_CS_PIN -1
- //#define E6_CS_PIN -1
- //#define E7_CS_PIN -1
+ //#define X_CS_PIN -1
+ //#define Y_CS_PIN -1
+ //#define Z_CS_PIN -1
+ //#define X2_CS_PIN -1
+ //#define Y2_CS_PIN -1
+ //#define Z2_CS_PIN -1
+ //#define Z3_CS_PIN -1
+ //#define Z4_CS_PIN -1
+ //#define I_CS_PIN -1
+ //#define J_CS_PIN -1
+ //#define K_CS_PIN -1
+ //#define U_CS_PIN -1
+ //#define V_CS_PIN -1
+ //#define W_CS_PIN -1
+ //#define E0_CS_PIN -1
+ //#define E1_CS_PIN -1
+ //#define E2_CS_PIN -1
+ //#define E3_CS_PIN -1
+ //#define E4_CS_PIN -1
+ //#define E5_CS_PIN -1
+ //#define E6_CS_PIN -1
+ //#define E7_CS_PIN -1
/**
* Software option for SPI driven drivers (TMC2130, TMC2160, TMC2660, TMC5130 and TMC5160).
@@ -3008,9 +3008,9 @@
* but you can override or define them here.
*/
//#define TMC_USE_SW_SPI
- //#define TMC_SW_MOSI -1
- //#define TMC_SW_MISO -1
- //#define TMC_SW_SCK -1
+ //#define TMC_SPI_MOSI -1
+ //#define TMC_SPI_MISO -1
+ //#define TMC_SPI_SCK -1
// @section tmc/serial
diff --git a/Marlin/src/HAL/DUE/inc/SanityCheck.h b/Marlin/src/HAL/DUE/inc/SanityCheck.h
index 1f5acc360c..996404a7d0 100644
--- a/Marlin/src/HAL/DUE/inc/SanityCheck.h
+++ b/Marlin/src/HAL/DUE/inc/SanityCheck.h
@@ -64,7 +64,7 @@
* Usually the hardware SPI pins are only available to the LCD. This makes the DUE hard SPI used at the same time
* as the TMC2130 soft SPI the most common setup.
*/
-#define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == SD_MOSI_PIN || TMC_SW_##P == SD_MISO_PIN || TMC_SW_##P == SD_SCK_PIN))
+#define _IS_HW_SPI(P) (defined(TMC_SPI_##P) && (TMC_SPI_##P == SD_MOSI_PIN || TMC_SPI_##P == SD_MISO_PIN || TMC_SPI_##P == SD_SCK_PIN))
#if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130)
#if ENABLED(TMC_USE_SW_SPI)
diff --git a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h
index 8265d58a6e..b9a3360668 100644
--- a/Marlin/src/HAL/LPC1768/inc/SanityCheck.h
+++ b/Marlin/src/HAL/LPC1768/inc/SanityCheck.h
@@ -95,7 +95,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#if USING_HW_SERIAL0
#define IS_TX0(P) (P == P0_02)
#define IS_RX0(P) (P == P0_03)
- #if IS_TX0(TMC_SW_MISO) || IS_RX0(TMC_SW_MOSI)
+ #if IS_TX0(TMC_SPI_MISO) || IS_RX0(TMC_SPI_MOSI)
#error "Serial port pins (0) conflict with Trinamic SPI pins!"
#elif HAS_PRUSA_MMU1 && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN))
#error "Serial port pins (0) conflict with Multi-Material-Unit multiplexer pins!"
@@ -111,7 +111,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#define IS_RX1(P) (P == P0_16)
#define _IS_TX1_1 IS_TX1
#define _IS_RX1_1 IS_RX1
- #if IS_TX1(TMC_SW_SCK)
+ #if IS_TX1(TMC_SPI_SCK)
#error "Serial port pins (1) conflict with other pins!"
#elif HAS_ROTARY_ENCODER
#if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1)
diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h
index 58f04a39b6..1377c8e73f 100644
--- a/Marlin/src/inc/Conditionals_post.h
+++ b/Marlin/src/inc/Conditionals_post.h
@@ -2212,6 +2212,14 @@
#undef TMC_UART_IS
#undef ANY_SERIAL_IS
+#if defined(__AVR_ARCH__) && defined(TMC_SPI_MISO) && defined(TMC_SPI_MOSI) && defined(TMC_SPI_SCK)
+ // Check that the pins are the solitary supported SPI hardware pins of the (AVR) platform.
+ // Otherwise we are forced to enable software SPI.
+ #if TMC_SPI_MISO != MISO || TMC_SPI_MOSI != MOSI || TMC_SPI_SCK != SCK
+ #define TMC_USE_SW_SPI
+ #endif
+#endif
+
// Clean up unused ESP_WIFI pins
#ifdef ESP_WIFI_MODULE_COM
#if !SERIAL_IN_USE(ESP_WIFI_MODULE_COM)
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index 5218cf792b..feb01e533a 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -658,6 +658,8 @@
#error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA."
#elif defined(POLAR_SEGMENTS_PER_SECOND) || defined(DELTA_SEGMENTS_PER_SECOND) || defined(SCARA_SEGMENTS_PER_SECOND) || defined(TPARA_SEGMENTS_PER_SECOND)
#error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND."
+#elif defined(TMC_SW_MOSI) || defined(TMC_SW_MISO) || defined(TMC_SW_SCK)
+ #error "TMC_SW_(MOSI|MISO|SCK) is now TMC_SPI_(MOSI|MISO|SCK)."
#elif ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) && !defined(DGUS_LCD_UI)
#error "DGUS_LCD_UI_[TYPE] is now set using DGUS_LCD_UI TYPE."
#elif defined(DELTA_PRINTABLE_RADIUS)
diff --git a/Marlin/src/module/stepper/trinamic.cpp b/Marlin/src/module/stepper/trinamic.cpp
index 7d87e5953f..02ae9cb1e4 100644
--- a/Marlin/src/module/stepper/trinamic.cpp
+++ b/Marlin/src/module/stepper/trinamic.cpp
@@ -46,7 +46,7 @@ enum StealthIndex : uint8_t {
// AI = Axis Enum Index
// SWHW = SW/SH UART selection
#if ENABLED(TMC_USE_SW_SPI)
- #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, float(ST##_RSENSE), TMC_SW_MOSI, TMC_SW_MISO, TMC_SW_SCK, ST##_CHAIN_POS)
+ #define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, float(ST##_RSENSE), TMC_SPI_MOSI, TMC_SPI_MISO, TMC_SPI_SCK, ST##_CHAIN_POS)
#else
#define __TMC_SPI_DEFINE(IC, ST, L, AI) TMCMarlin stepper##ST(ST##_CS_PIN, float(ST##_RSENSE), ST##_CHAIN_POS)
#endif
diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
index 3616b7a27c..3e8814c3ee 100644
--- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
+++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
@@ -247,18 +247,16 @@
#endif
/**
- * Default pins for TMC software SPI
+ * Default pins for TMC SPI
*/
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI 66
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO 44
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK 64
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI 66
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO 44
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK 64
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
index 10a610ff95..0c96cb42b5 100644
--- a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
+++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
@@ -77,18 +77,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P0_18 // ETH
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P0_17 // ETH
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P0_15 // ETH
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P0_18 // ETH
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P0_17 // ETH
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P0_15 // ETH
#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 d11224315b..1a8c44771a 100644
--- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h
+++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h
@@ -56,7 +56,6 @@
#define E0_DIR_PIN P2_13
#define E0_ENABLE_PIN P2_12
-
/** ------ ------
* 1.30 | 1 2 | 2.11 0.17 | 1 2 | 0.15
* 0.18 | 3 4 | 0.16 3.26 | 3 4 | 1.23
@@ -165,12 +164,12 @@
// 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_06_PIN
- #define TMC_SW_MISO EXP2_01_PIN
+ #define TMC_SPI_MOSI EXP2_06_PIN
+ #define TMC_SPI_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_02_PIN
+ #define TMC_SPI_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
+ //#define TMC_SPI_SCK P2_06
#if ENABLED(SOFTWARE_DRIVER_ENABLE)
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 03994187c8..6372623a30 100644
--- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
+++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
@@ -137,18 +137,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P4_28
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P0_05
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P0_04
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P4_28
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P0_05
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P0_04
#endif
#if HAS_TMC_UART
@@ -289,7 +287,7 @@
#define DOGLCD_A0 EXP1_06_PIN
#define DOGLCD_SCK EXP1_04_PIN
#define DOGLCD_MOSI EXP1_01_PIN
- #define LCD_BACKLIGHT_PIN -1
+ #define LCD_BACKLIGHT_PIN -1
#elif ENABLED(CR10_STOCKDISPLAY)
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 a574a9fe8d..e632d8afa6 100644
--- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
+++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
@@ -194,18 +194,16 @@
#define TEMP_BED_PIN P0_25_A2 // A2 (T2) - (69) - TEMP_BED_PIN
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P1_17
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P0_05
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P0_04
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P1_17
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P0_05
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P0_04
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
index cf12a98aef..c5c5bd3e23 100644
--- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
+++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
@@ -300,16 +300,14 @@
// Hardware SPI is on EXP2. See if you can make it work:
// https://github.com/makerbase-mks/MKS-SBASE/issues/25
#define TMC_USE_SW_SPI
- #if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P0_03 // AUX1
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P0_02 // AUX1
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P0_26 // TH4
- #endif
+ #ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P0_03 // AUX1
+ #endif
+ #ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P0_02 // AUX1
+ #endif
+ #ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P0_26 // TH4
#endif
#endif
diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
index 4e9f98c852..1f038b4aa0 100644
--- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
+++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
@@ -132,18 +132,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P4_28
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P0_05
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P0_04
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P4_28
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P0_05
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P0_04
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
index 9a210e1607..b6ce9c5c05 100644
--- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
+++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
@@ -97,18 +97,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P1_00 // ETH
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P1_08 // ETH
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P1_09 // ETH
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P1_00 // ETH
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P1_08 // ETH
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P1_09 // ETH
#endif
#if HAS_TMC_UART
@@ -119,7 +117,6 @@
* If undefined software serial is used according to the pins below
*/
-
// P2_08 E1-Step
// P2_13 E1-Dir
diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
index 237dfaec36..e0a3b03109 100644
--- a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
+++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
@@ -70,16 +70,14 @@
//
// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P1_16 // Ethernet Expansion - Pin 5
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P1_17 // Ethernet Expansion - Pin 6
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P1_08 // Ethernet Expansion - Pin 7
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P1_16 // Ethernet Expansion - Pin 5
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P1_17 // Ethernet Expansion - Pin 6
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P1_08 // Ethernet Expansion - Pin 7
#endif
//
diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
index ea2e0b7082..122c7462d2 100644
--- a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
+++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
@@ -87,16 +87,14 @@
//
// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P1_16 // Ethernet Expansion - Pin 5
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P1_17 // Ethernet Expansion - Pin 6
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P1_08 // Ethernet Expansion - Pin 7
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P1_16 // Ethernet Expansion - Pin 5
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P1_17 // Ethernet Expansion - Pin 6
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P1_08 // Ethernet Expansion - Pin 7
#endif
//
diff --git a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h
index ec0b14af90..1c0c21466e 100644
--- a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h
+++ b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h
@@ -92,18 +92,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P0_20
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P0_19
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P0_21
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P0_20
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P0_19
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P0_21
#endif
#if HAS_TMC_UART
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 2f25d8b5fd..5c1b1f5638 100644
--- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
+++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
@@ -146,18 +146,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI P1_16
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO P0_05
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK P0_04
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI P1_16
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO P0_05
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK P0_04
#endif
#if HAS_TMC_UART
@@ -342,7 +340,7 @@
#define TFT_CS_PIN EXP1_07_PIN
#define TFT_DC_PIN EXP1_08_PIN
- #define TFT_A0_PIN TFT_DC_PIN
+ #define TFT_A0_PIN TFT_DC_PIN
#define TFT_MISO_PIN EXP2_01_PIN
#define TFT_BACKLIGHT_PIN EXP1_03_PIN
#define TFT_RESET_PIN EXP1_04_PIN
diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h
index 986dd1cb04..c96431141c 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h
@@ -30,7 +30,7 @@
#define LCD_PINS_D4 21
#define LCD_PINS_D7 6
-#define SPEAKER // The speaker can produce tones
+#define SPEAKER // The speaker can produce tones
#if IS_NEWPANEL
#define BTN_EN1 16
diff --git a/Marlin/src/pins/mega/pins_GT2560_V4_A20.h b/Marlin/src/pins/mega/pins_GT2560_V4_A20.h
index 83a612e67c..c87c11e175 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V4_A20.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V4_A20.h
@@ -32,7 +32,7 @@
#define LCD_PINS_D4 21
#define LCD_PINS_D7 6
-#define SPEAKER // The speaker can produce tones
+#define SPEAKER // The speaker can produce tones
#if IS_NEWPANEL
#define BTN_EN1 16
diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
index cff3a11af1..0ef1c1d8ae 100644
--- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
+++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
@@ -158,9 +158,9 @@
// Heaters / Fans (24V)
//
-#define HEATER_0_PIN MOSFET_1_PIN // EX1
-#define HEATER_1_PIN MOSFET_3_PIN // EX2
-#define HEATER_BED_PIN MOSFET_5_PIN // HBP
+#define HEATER_0_PIN MOSFET_1_PIN // EX1
+#define HEATER_1_PIN MOSFET_3_PIN // EX2
+#define HEATER_BED_PIN MOSFET_5_PIN // HBP
// EX1 FAN (Automatic Fans are disabled by default in Configuration_adv.h - comment that out for auto fans)
#ifndef E0_AUTO_FAN_PIN
diff --git a/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h b/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h
index f2e4d3da02..88d549c8cb 100644
--- a/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h
+++ b/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h
@@ -51,16 +51,16 @@
#define Y_STEP_PIN 3
#define Y_DIR_PIN 6
-#define Y_ENABLE_PIN X_ENABLE_PIN
+#define Y_ENABLE_PIN X_ENABLE_PIN
#define Z_STEP_PIN 4
#define Z_DIR_PIN 7
-#define Z_ENABLE_PIN X_ENABLE_PIN
+#define Z_ENABLE_PIN X_ENABLE_PIN
// Designated with letter "A" on BOARD
#define E0_STEP_PIN 12
#define E0_DIR_PIN 13
-#define E0_ENABLE_PIN X_ENABLE_PIN
+#define E0_ENABLE_PIN X_ENABLE_PIN
//
// Temperature sensors - These could be any analog output not hidden by board
diff --git a/Marlin/src/pins/mega/pins_SILVER_GATE.h b/Marlin/src/pins/mega/pins_SILVER_GATE.h
index c2ca5b3103..4568ed04e2 100644
--- a/Marlin/src/pins/mega/pins_SILVER_GATE.h
+++ b/Marlin/src/pins/mega/pins_SILVER_GATE.h
@@ -73,7 +73,7 @@
#define TEMP_BED_PIN 6
#if HAS_WIRED_LCD
- #if IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920
+ #if IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920
#define LCD_PINS_RS 30
#define LCD_PINS_ENABLE 20
#define LCD_PINS_D4 25
diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index 6269eecb0b..62ddba06f5 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -530,7 +530,7 @@
#elif MB(MKS_ROBIN_E3D)
#include "stm32f1/pins_MKS_ROBIN_E3D.h" // STM32F1 env:mks_robin_e3
#elif MB(MKS_ROBIN_E3D_V1_1)
- #include "stm32f1/pins_MKS_ROBIN_E3D_V1_1.h" // STM32F1 env:mks_robin_e3
+ #include "stm32f1/pins_MKS_ROBIN_E3D_V1_1.h" // STM32F1 env:mks_robin_e3 env:mks_robin_e3_maple
#elif MB(MKS_ROBIN_E3P)
#include "stm32f1/pins_MKS_ROBIN_E3P.h" // STM32F1 env:mks_robin_e3p env:mks_robin_e3p_maple
#elif MB(BTT_EBB42_V1_1)
diff --git a/Marlin/src/pins/pinsDebug_list.h b/Marlin/src/pins/pinsDebug_list.h
index 39e07c739a..27f20b92f7 100644
--- a/Marlin/src/pins/pinsDebug_list.h
+++ b/Marlin/src/pins/pinsDebug_list.h
@@ -489,18 +489,27 @@
REPORT_NAME_DIGITAL(__LINE__, EXP3_10_PIN)
#endif
-#if _EXISTS(TMC_SW_MISO)
- REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MISO)
+#if _EXISTS(TMC_SPI_MISO)
+ REPORT_NAME_DIGITAL(__LINE__, TMC_SPI_MISO)
#endif
-#if _EXISTS(TMC_SW_MOSI)
- REPORT_NAME_DIGITAL(__LINE__, TMC_SW_MOSI)
+#if _EXISTS(TMC_SPI_MOSI)
+ REPORT_NAME_DIGITAL(__LINE__, TMC_SPI_MOSI)
#endif
-#if _EXISTS(TMC_SW_SCK)
- REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK)
+#if _EXISTS(TMC_SPI_SCK)
+ REPORT_NAME_DIGITAL(__LINE__, TMC_SPI_SCK)
#endif
#if _EXISTS(TFTGLCD_CS)
REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_CS)
#endif
+#if _EXISTS(TFTGLCD_SCK)
+ REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_SCK)
+#endif
+#if _EXISTS(TFTGLCD_MISO)
+ REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_MISO)
+#endif
+#if _EXISTS(TFTGLCD_MOSI)
+ REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_MOSI)
+#endif
//
// E Multiplexing
diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h
index 1e9d53a6cb..0f90dd5a34 100644
--- a/Marlin/src/pins/ramps/pins_3DRAG.h
+++ b/Marlin/src/pins/ramps/pins_3DRAG.h
@@ -113,7 +113,7 @@
#define SPINDLE_LASER_PWM_PIN 46 // Hardware PWM
#define SPINDLE_LASER_ENA_PIN 62 // Pullup!
#define SPINDLE_DIR_PIN 48
- #elif !BOTH(HAS_WIRED_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use
+ #elif !BOTH(HAS_WIRED_LCD, IS_NEWPANEL) // Use expansion header if no LCD in use
#define SPINDLE_LASER_ENA_PIN 16 // Pullup or pulldown!
#define SPINDLE_DIR_PIN 17
#if !NUM_SERVOS // Use servo connector if possible
diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h
index ca1f133816..dd7f8e5f86 100644
--- a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h
+++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h
@@ -35,12 +35,12 @@
// Heaters / Fans
//
// Power outputs EFBF or EFBE
-#define MOSFET_D_PIN 7
+#define MOSFET_D_PIN 7
// Hotend, Hotend, Bed + Fan on D9
#if FET_ORDER_EEB
- #define MOSFET_B_PIN 7
- #define FAN_PIN 9
+ #define MOSFET_B_PIN 7
+ #define FAN_PIN 9
#endif
//
@@ -49,11 +49,11 @@
//
#ifndef X_CS_PIN
- #define X_CS_PIN 59
+ #define X_CS_PIN 59
#endif
#ifndef Y_CS_PIN
- #define Y_CS_PIN 63
+ #define Y_CS_PIN 63
#endif
#include "pins_RAMPS.h"
diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h
index 4e4ca60583..43780d8d27 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS.h
@@ -319,16 +319,14 @@
//
// TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI 66
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO 44
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK 64
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI 66
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO 44
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK 64
#endif
#if HAS_TMC_UART
@@ -877,7 +875,7 @@
#define BEEPER_PIN EXP2_05_PIN
- #if ENABLED(PANEL_ONE) // Buttons connect directly to AUX-2
+ #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
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
index f41573b527..8d6a1d337e 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
@@ -218,16 +218,14 @@
//
// TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI 51
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO 50
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK 53
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI 51
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO 50
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK 53
#endif
//
diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h
index 71dfb8c704..6e51a8e974 100644
--- a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h
+++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h
@@ -27,17 +27,17 @@
#define BOARD_INFO_NAME "Anycubic RAMPS 1.3"
-#define MOSFET_B_PIN 44
+#define MOSFET_B_PIN 44
-#define E1_STEP_PIN -1
-#define E1_DIR_PIN -1
-#define E1_ENABLE_PIN -1
-#define E1_CS_PIN -1
+#define E1_STEP_PIN -1
+#define E1_DIR_PIN -1
+#define E1_ENABLE_PIN -1
+#define E1_CS_PIN -1
-#define FAN2_PIN 9
+#define FAN2_PIN 9
#ifndef E0_AUTO_FAN_PIN
- #define E0_AUTO_FAN_PIN 9
+ #define E0_AUTO_FAN_PIN 9
#endif
#include "pins_RAMPS_13.h" // ... RAMPS
diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
index f81cc6039a..ecc708b395 100644
--- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h
+++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
@@ -150,16 +150,14 @@
//
// Default pins for TMC software SPI
//
-//#if ENABLED(TMC_USE_SW_SPI)
-// #ifndef TMC_SW_MOSI
-// #define TMC_SW_MOSI 66
-// #endif
-// #ifndef TMC_SW_MISO
-// #define TMC_SW_MISO 44
-// #endif
-// #ifndef TMC_SW_SCK
-// #define TMC_SW_SCK 64
-// #endif
+//#ifndef TMC_SPI_MOSI
+// #define TMC_SPI_MOSI 66
+//#endif
+//#ifndef TMC_SPI_MISO
+// #define TMC_SPI_MISO 44
+//#endif
+//#ifndef TMC_SPI_SCK
+// #define TMC_SPI_SCK 64
//#endif
//
diff --git a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
index b68e3edb45..ad7b859a0c 100644
--- a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
+++ b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
@@ -182,16 +182,14 @@
//
// TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI 66
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO 44
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK 64
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI 66
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO 44
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK 64
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/sam/pins_ARCHIM2.h b/Marlin/src/pins/sam/pins_ARCHIM2.h
index 310dd8e2ac..503b29f15b 100644
--- a/Marlin/src/pins/sam/pins_ARCHIM2.h
+++ b/Marlin/src/pins/sam/pins_ARCHIM2.h
@@ -145,19 +145,17 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers.
+// SPI pins for TMC2130 stepper drivers.
// Required for the Archim2 board.
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI 28 // PD3
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO 26 // PD1
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK 27 // PD2
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI 28 // PD3
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO 26 // PD1
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK 27 // PD2
#endif
//
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 a3f98e388a..2a84d964ea 100644
--- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h
+++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h
@@ -284,7 +284,6 @@
//#define DOGLCD_SCK 23
//#define DOGLCD_A0 LCD_PINS_DC
-
#else
// Definitions for any standard Display
#define LCD_PINS_RS EXP1_04_PIN
diff --git a/Marlin/src/pins/samd/pins_MINITRONICS20.h b/Marlin/src/pins/samd/pins_MINITRONICS20.h
index 02d806b3ec..da1919cd2b 100644
--- a/Marlin/src/pins/samd/pins_MINITRONICS20.h
+++ b/Marlin/src/pins/samd/pins_MINITRONICS20.h
@@ -212,9 +212,9 @@
#if ENABLED(CR10_STOCKDISPLAY)
// TO TEST
- //#define LCD_PINS_RS EXP3_04_PIN
- //#define LCD_PINS_ENABLE EXP3_03_PIN
- //#define LCD_PINS_D4 EXP3_05_PIN
+ //#define LCD_PINS_RS EXP3_04_PIN
+ //#define LCD_PINS_ENABLE EXP3_03_PIN
+ //#define LCD_PINS_D4 EXP3_05_PIN
#if !IS_NEWPANEL
// TO TEST
@@ -278,7 +278,7 @@
#if IS_RRD_SC
- //#define BEEPER_PIN EXP1_01_PIN
+ //#define BEEPER_PIN EXP1_01_PIN
#if ENABLED(CR10_STOCKDISPLAY)
// TO TEST
@@ -297,7 +297,7 @@
#ifndef SD_DETECT_PIN
#define SD_DETECT_PIN EXP2_07_PIN
#endif
- //#define KILL_PIN EXP2_10_PIN
+ //#define KILL_PIN EXP2_10_PIN
#if ENABLED(BQ_LCD_SMART_CONTROLLER)
//#define LCD_BACKLIGHT_PIN EXP1_08_PIN // TO TEST
diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h
index 7adb2404c1..e5091e5cdc 100644
--- a/Marlin/src/pins/samd/pins_RAMPS_144.h
+++ b/Marlin/src/pins/samd/pins_RAMPS_144.h
@@ -164,18 +164,16 @@
#endif
//
-// TMC software SPI
+// TMC SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI 58 // Mega/Due:66 - AGCM4:58
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO 44
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK 56 // Mega/Due:64 - AGCM4:56
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI 58 // Mega/Due:66 - AGCM4:58
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO 44
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK 56 // Mega/Due:64 - AGCM4:56
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
index 3b6297ba4d..6444e2e040 100644
--- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
+++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
@@ -153,7 +153,7 @@
#define KILL_PIN 10
#define BEEPER_PIN 27
- #elif IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
+ #elif IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0
#if IS_MELZI
#define LCD_PINS_RS 30 // CS chip select /SS chip slave select
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 075258991d..5007de25da 100644
--- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
+++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h
@@ -94,18 +94,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB5
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB4
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB3
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB5
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB4
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB3
#endif
#if HAS_TMC_UART
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 c544e1353c..0df70d7292 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
@@ -68,30 +68,29 @@
#define E0_DIR_PIN PB0
#define E0_ENABLE_PIN PC4
-#if ENABLED(TMC_USE_SW_SPI) // Shared with EXP2
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB3
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB4
- #endif
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB5
- #endif
+// Shared with EXP2
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB3
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB4
+#endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB5
#endif
#if HAS_TMC_UART // Shared with EXP1
- #define X_SERIAL_TX_PIN PC10
- #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
+ #define X_SERIAL_TX_PIN PC10
+ #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
- #define Y_SERIAL_TX_PIN PC11
- #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
+ #define Y_SERIAL_TX_PIN PC11
+ #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
- #define Z_SERIAL_TX_PIN PC12
- #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
+ #define Z_SERIAL_TX_PIN PC12
+ #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
- #define E0_SERIAL_TX_PIN PC14
- #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
+ #define E0_SERIAL_TX_PIN PC14
+ #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
// Reduce baud rate to improve software serial reliability
#define TMC_BAUD_RATE 19200
@@ -287,4 +286,4 @@
#define ONBOARD_SPI_DEVICE 1 // SPI1
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
-#define SDSS SD_SS_PIN
+#define SDSS SD_SS_PIN
diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
index c73544bf43..ec4535982e 100644
--- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
+++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
@@ -134,7 +134,7 @@
#define EXP1_01_PIN PB5
#define EXP1_02_PIN PB6
#define EXP1_03_PIN PA2
-#define EXP1_04_PIN -1 // RESET
+#define EXP1_04_PIN -1 // RESET
#define EXP1_05_PIN PA3
#define EXP1_06_PIN PB8
#define EXP1_07_PIN PB7
diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h
index a0152a5221..b6316c01c6 100644
--- a/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h
+++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V25S1.h
@@ -49,8 +49,8 @@
#endif
#if ENABLED(IIC_BL24CXX_EEPROM)
- #define IIC_EEPROM_SDA PA11
- #define IIC_EEPROM_SCL PA12
+ #define IIC_EEPROM_SDA PA11
+ #define IIC_EEPROM_SCL PA12
#define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
#elif EITHER(SDCARD_EEPROM_EMULATION, FLASH_EEPROM_EMULATION)
#define MARLIN_EEPROM_SIZE 0x800 // 2K
diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h
index f39850f755..c139b4943c 100644
--- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h
+++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h
@@ -83,16 +83,14 @@
#define E0_CS_PIN PC2
#endif
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI EXP2_06_PIN
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO EXP2_01_PIN
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK EXP2_02_PIN
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI EXP2_06_PIN
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO EXP2_01_PIN
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK EXP2_02_PIN
#endif
#if HAS_TMC_UART
@@ -131,23 +129,23 @@
* ------ ------
* EXP1 EXP2
*/
-#define EXP1_01_PIN PC14
-#define EXP1_02_PIN PC13
-#define EXP1_03_PIN PB9
-#define EXP1_04_PIN PB8
-#define EXP1_05_PIN PB7
-#define EXP1_06_PIN PB6
-#define EXP1_07_PIN PB5
-#define EXP1_08_PIN PB4
+#define EXP1_01_PIN PC14
+#define EXP1_02_PIN PC13
+#define EXP1_03_PIN PB9
+#define EXP1_04_PIN PB8
+#define EXP1_05_PIN PB7
+#define EXP1_06_PIN PB6
+#define EXP1_07_PIN PB5
+#define EXP1_08_PIN PB4
-#define EXP2_01_PIN PB14
-#define EXP2_02_PIN PB13
-#define EXP2_03_PIN PB3
-#define EXP2_04_PIN PB12
-#define EXP2_05_PIN PD2
-#define EXP2_06_PIN PB15
-#define EXP2_07_PIN PB11
-#define EXP2_08_PIN -1 // RESET
+#define EXP2_01_PIN PB14
+#define EXP2_02_PIN PB13
+#define EXP2_03_PIN PB3
+#define EXP2_04_PIN PB12
+#define EXP2_05_PIN PD2
+#define EXP2_06_PIN PB15
+#define EXP2_07_PIN PB11
+#define EXP2_08_PIN -1 // RESET
//
// LCD / Controller
diff --git a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h
index f157c8e455..9ed3c11560 100644
--- a/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h
+++ b/Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h
@@ -64,9 +64,9 @@
// Limit Switches
//
#define X_MIN_PIN PD6
-#define X_MAX_PIN PG15 // To double check
+#define X_MAX_PIN PG15 // To double check
#define Y_MIN_PIN PG9
-#define Y_MAX_PIN PG14 // To double check
+#define Y_MAX_PIN PG14 // To double check
#define Z_MIN_PIN PG10
#define Z_MAX_PIN PG13
diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h
index 77c2b79215..6d88897332 100644
--- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h
+++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D.h
@@ -50,18 +50,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB15
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB14
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB13
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB15
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB14
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB13
#endif
#include "pins_MKS_ROBIN_E3_common.h"
diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h
index 2ad68a0140..89fda7ab67 100644
--- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h
+++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3D_V1_1.h
@@ -50,18 +50,17 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
+// Software and hardware actually, they are connected to SPI2 bus.
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB15
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB14
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB13
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB15
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB14
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB13
#endif
#include "pins_MKS_ROBIN_E3_V1_1_common.h" // ... MKS_ROBIN_E3_common
diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
index 89525d93ef..7994089619 100644
--- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
+++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
@@ -112,18 +112,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PD14
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PD1
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PD0
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PD14
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PD1
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PD0
#endif
#if HAS_TMC_UART
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 642c97bb11..74780562b6 100644
--- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
+++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h
@@ -165,13 +165,13 @@
#define EXP2_05_PIN PB0
#define EXP2_06_PIN PB15
#define EXP2_07_PIN PC10
-#define EXP2_08_PIN -1 // RESET
+#define EXP2_08_PIN -1 // RESET
// "Ender-3 EXP1"
#define EXP3_01_PIN PC1
#define EXP3_02_PIN PC3
#define EXP3_03_PIN PB11
-#define EXP3_04_PIN -1 // RESET
+#define EXP3_04_PIN -1 // RESET
#define EXP3_05_PIN PB0
#define EXP3_06_PIN PA6
#define EXP3_07_PIN PA5
diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
index 8dba943136..bfa6f45120 100644
--- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
+++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
@@ -122,18 +122,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PD14
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PD1
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PD0
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PD14
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PD1
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PD0
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
index 048570102b..7373d0d7b5 100644
--- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
+++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h
@@ -105,18 +105,16 @@
#define E2_CS_PIN PG9
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB15
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB14
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB13
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB15
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB14
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB13
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h
index ed602d8d01..56200d5096 100644
--- a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h
+++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h
@@ -88,18 +88,16 @@
#define E0_DIR_PIN PB14
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB5
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB4
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB3
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB5
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB4
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB3
#endif
#if HAS_TMC_UART
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 2147dd9b4f..d31885e73d 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h
@@ -108,18 +108,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB15
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB14
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB13
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB15
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB14
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB13
#endif
#if HAS_TMC_UART
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 fe03ec8983..fe0e1e52f3 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h
@@ -202,18 +202,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PG15
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB6
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB3
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PG15
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB6
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB3
#endif
#if HAS_TMC_UART
@@ -304,9 +302,9 @@
//#define TEMP_0_MOSI_PIN ... // For MAX31865
#define TEMP_1_CS_PIN PH2 // M5 K-TEMP
-#define TEMP_1_SCK_PIN TEMP_0_SCK_PIN
-#define TEMP_1_MISO_PIN TEMP_0_MISO_PIN
-//#define TEMP_1_MOSI_PIN TEMP_0_MOSI_PIN
+#define TEMP_1_SCK_PIN TEMP_0_SCK_PIN
+#define TEMP_1_MISO_PIN TEMP_0_MISO_PIN
+//#define TEMP_1_MOSI_PIN TEMP_0_MOSI_PIN
//
// Heaters / Fans
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 a25c2339f2..a3bffbce01 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h
@@ -260,18 +260,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PA7
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PA6
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PA5
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PA7
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PA6
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PA5
#endif
#if HAS_TMC_UART
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 78a137b35d..c535edfc1e 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h
@@ -172,18 +172,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PC12
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PC11
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PC10
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PC12
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PC11
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PC10
#endif
#if HAS_TMC_UART
@@ -487,7 +485,7 @@
#define DOGLCD_A0 EXP1_06_PIN
#define DOGLCD_SCK EXP1_04_PIN
#define DOGLCD_MOSI EXP1_02_PIN
- #define LCD_BACKLIGHT_PIN -1
+ #define LCD_BACKLIGHT_PIN -1
#else
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 7ac9156f40..76d06380b4 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
@@ -272,18 +272,16 @@
#endif // SPINDLE_FEATURE || LASER_FEATURE
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PE14
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PA14
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PE15
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PE14
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PA14
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PE15
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
index 8d5e094122..8d31130d89 100644
--- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
+++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
@@ -235,18 +235,16 @@
#endif
//
-// Trinamic Software SPI
+// Trinamic SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK EXP2_02_PIN
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO EXP2_01_PIN
- #endif
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI EXP2_06_PIN
- #endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK EXP2_02_PIN
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO EXP2_01_PIN
+#endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI EXP2_06_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 031caa1ce1..e650f2840e 100644
--- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h
+++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h
@@ -43,14 +43,14 @@
#define FLASH_ADDRESS_START 0x8004000
#endif
-#define SERVO0_PIN PB1 // BL-TOUCH/PWM
+#define SERVO0_PIN PB1 // BL-TOUCH/PWM
//
// Limit Switches
//
-#define X_STOP_PIN PB4 // X-MIN
-#define Y_STOP_PIN PC8 // Y-MIN
-#define Z_STOP_PIN PA0 // Z-MIN
+#define X_STOP_PIN PB4 // X-MIN
+#define Y_STOP_PIN PC8 // Y-MIN
+#define Z_STOP_PIN PA0 // Z-MIN
//
// Z Probe
@@ -59,7 +59,7 @@
#error "You need to set jumper to 5V for BLTouch, then comment out this line to proceed."
#endif
#ifndef Z_MIN_PROBE_PIN
- #define Z_MIN_PROBE_PIN PB1 // BL-TOUCH/PWM repurposed
+ #define Z_MIN_PROBE_PIN PB1 // BL-TOUCH/PWM repurposed
#endif
//
diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h
index a9ce1383d8..a6035c2c6f 100644
--- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h
+++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6_V2_0.h
@@ -53,19 +53,17 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
#define TMC_USE_SW_SPI
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PE14
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PE13
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PE12
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PE14
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PE13
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PE12
#endif
#include "pins_FYSETC_S6.h"
diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h
index 009bfb248d..368f464f86 100644
--- a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h
+++ b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER.h
@@ -101,19 +101,17 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
#define TMC_USE_SW_SPI
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PE14
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PE13
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PE12
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PE14
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PE13
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PE12
#endif
#if HOTENDS > 3 || E_STEPPERS > 3
diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h
index 6c6f8d25ea..0ea7255c17 100644
--- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h
+++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h
@@ -154,10 +154,10 @@
#ifndef EX_SERIAL_RX_PIN
#define EX_SERIAL_RX_PIN EX_SERIAL_TX_PIN
#endif
- //#define Z2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
- //#define Z2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
- //#define E2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
- //#define E2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
+ //#define Z2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
+ //#define Z2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
+ //#define E2_SERIAL_RX_PIN EX_SERIAL_RX_PIN
+ //#define E2_SERIAL_TX_PIN EX_SERIAL_TX_PIN
// Reduce baud rate to improve software serial reliability
#define TMC_BAUD_RATE 19200
#endif
diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V1.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V1.h
index 50fe790dc3..7d6ea8e039 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V1.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_V1.h
@@ -39,7 +39,7 @@
//
// Misc. Functions
//
-#define PW_DET PC5 // Y+
+#define PW_DET PC5 // Y+
#define PW_OFF PB12 // Z+
#define MT_DET_1_PIN PW_DET
#define MT_DET_2_PIN PW_OFF
diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h
index 1896cd5441..c8a5b428dc 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8_common.h
@@ -126,22 +126,23 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
// This board only supports SW SPI for stepper drivers
//
#if HAS_TMC_SPI
#define TMC_USE_SW_SPI
#endif
-#if ENABLED(TMC_USE_SW_SPI)
- #if !defined(TMC_SW_MOSI) || TMC_SW_MOSI == -1
- #define TMC_SW_MOSI PE14
- #endif
- #if !defined(TMC_SW_MISO) || TMC_SW_MISO == -1
- #define TMC_SW_MISO PE13
- #endif
- #if !defined(TMC_SW_SCK) || TMC_SW_SCK == -1
- #define TMC_SW_SCK PE12
- #endif
+#if !defined(TMC_SPI_MOSI) || TMC_SPI_MOSI == -1
+ #undef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PE14
+#endif
+#if !defined(TMC_SPI_MISO) || TMC_SPI_MISO == -1
+ #undef TMC_SPI_MISO
+ #define TMC_SPI_MISO PE13
+#endif
+#if !defined(TMC_SPI_SCK) || TMC_SPI_SCK == -1
+ #undef TMC_SPI_SCK
+ #define TMC_SPI_SCK PE12
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h
index 32d8a47488..96e19c987f 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h
@@ -51,22 +51,23 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
// This board only supports SW SPI for stepper drivers
//
#if HAS_TMC_SPI
#define TMC_USE_SW_SPI
#endif
-#if ENABLED(TMC_USE_SW_SPI)
- #if !defined(TMC_SW_MOSI) || TMC_SW_MOSI == -1
- #define TMC_SW_MOSI PD14
- #endif
- #if !defined(TMC_SW_MISO) || TMC_SW_MISO == -1
- #define TMC_SW_MISO PD1
- #endif
- #if !defined(TMC_SW_SCK) || TMC_SW_SCK == -1
- #define TMC_SW_SCK PD0
- #endif
+#if !defined(TMC_SPI_MOSI) || TMC_SPI_MOSI == -1
+ #undef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PD14
+#endif
+#if !defined(TMC_SPI_MISO) || TMC_SPI_MISO == -1
+ #undef TMC_SPI_MISO
+ #define TMC_SPI_MISO PD1
+#endif
+#if !defined(TMC_SPI_SCK) || TMC_SPI_SCK == -1
+ #undef TMC_SPI_SCK
+ #define TMC_SPI_SCK PD0
#endif
#include "pins_MKS_ROBIN_NANO_V3_common.h"
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 14b3d66168..daafe8dee4 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h
@@ -113,18 +113,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PD14
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PD1
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PD0
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PD14
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PD1
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PD0
#endif
#if HAS_TMC_UART
@@ -238,23 +236,23 @@
* ------ ------
* EXP1 EXP2
*/
-#define EXP1_01_PIN PC5
-#define EXP1_02_PIN PE13
-#define EXP1_03_PIN PD13
-#define EXP1_04_PIN PC6
-#define EXP1_05_PIN PE14
-#define EXP1_06_PIN PE15
-#define EXP1_07_PIN PD11
-#define EXP1_08_PIN PD10
+#define EXP1_01_PIN PC5
+#define EXP1_02_PIN PE13
+#define EXP1_03_PIN PD13
+#define EXP1_04_PIN PC6
+#define EXP1_05_PIN PE14
+#define EXP1_06_PIN PE15
+#define EXP1_07_PIN PD11
+#define EXP1_08_PIN PD10
-#define EXP2_01_PIN PA6
-#define EXP2_02_PIN PA5
-#define EXP2_03_PIN PE8
-#define EXP2_04_PIN PE10
-#define EXP2_05_PIN PE11
-#define EXP2_06_PIN PA7
-#define EXP2_07_PIN PE12
-#define EXP2_08_PIN -1 // RESET
+#define EXP2_01_PIN PA6
+#define EXP2_02_PIN PA5
+#define EXP2_03_PIN PE8
+#define EXP2_04_PIN PE10
+#define EXP2_05_PIN PE11
+#define EXP2_06_PIN PA7
+#define EXP2_07_PIN PE12
+#define EXP2_08_PIN -1 // RESET
//
// LCD SD
diff --git a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
index 3f0d4e5ee9..ac0b7679c3 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
@@ -191,14 +191,14 @@
#define FAN2_PIN PA0 // Fan2
//
-// Software SPI pins for TMC2130 stepper drivers
-// This board doesn't support hardware SPI there
+// Default pins for TMC software SPI
+// This board only supports SW SPI for stepper drivers
//
#if HAS_TMC_SPI
#define TMC_USE_SW_SPI
- #define TMC_SW_MOSI PE14
- #define TMC_SW_MISO PE13
- #define TMC_SW_SCK PE12
+ #define TMC_SPI_MOSI PE14
+ #define TMC_SPI_MISO PE13
+ #define TMC_SPI_SCK PE12
#endif
//
diff --git a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h
index 06bf09402c..cf4720a20c 100644
--- a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h
+++ b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV3.h
@@ -171,9 +171,9 @@
#define MOSI_PIN PB5
#define SCK_PIN PB3
-#define TMC_SW_MISO MISO_PIN
-#define TMC_SW_MOSI MOSI_PIN
-#define TMC_SW_SCK SCK_PIN
+#define TMC_SPI_MISO MISO_PIN
+#define TMC_SPI_MOSI MOSI_PIN
+#define TMC_SPI_SCK SCK_PIN
//
// I2C
diff --git a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h
index d16d7b200b..c8da0af894 100644
--- a/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h
+++ b/Marlin/src/pins/stm32f4/pins_OPULO_LUMEN_REV4.h
@@ -168,9 +168,9 @@
#define MOSI_PIN PB5
#define SCK_PIN PB3
-#define TMC_SW_MISO MISO_PIN
-#define TMC_SW_MOSI MOSI_PIN
-#define TMC_SW_SCK SCK_PIN
+#define TMC_SPI_MISO MISO_PIN
+#define TMC_SPI_MOSI MOSI_PIN
+#define TMC_SPI_SCK SCK_PIN
//
// I2C
diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
index 12871becbb..264bb91af4 100644
--- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
+++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
@@ -91,16 +91,14 @@
#define E2_ENABLE_PIN PD0
#define E2_CS_PIN PD1
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PA7
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PA6
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PA5
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PA7
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PA6
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PA5
#endif
//
diff --git a/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h b/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h
index 3de67ea8d5..138397fa11 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h
@@ -81,15 +81,15 @@
// Steppers
//
#define X_ENABLE_PIN -1
-#define X_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
+#define X_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
#define X_DIR_PIN -1
#define Y_ENABLE_PIN -1
-#define Y_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
+#define Y_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
#define Y_DIR_PIN -1
#define Z_ENABLE_PIN -1
-#define Z_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
+#define Z_STEP_PIN PA10 // Unused. Assigned so Marlin will compile
#define Z_DIR_PIN -1
#define E0_ENABLE_PIN PD2
diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h
index 54c2c4c77b..84bf758777 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h
@@ -143,18 +143,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PC12 // Shared with SPI header, Pin 5 (SPI3)
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PC11 // Shared with SPI header, Pin 6 (SPI3)
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PC10 // Shared with SPI header, Pin 4 (SPI3)
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PC12 // Shared with SPI header, Pin 5 (SPI3)
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PC11 // Shared with SPI header, Pin 6 (SPI3)
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PC10 // Shared with SPI header, Pin 4 (SPI3)
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h
index 876475f883..7096cfbfbd 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V1_0.h
@@ -57,7 +57,7 @@
//
#if ENABLED(PROBE_ENABLE_DISABLE)
#ifndef PROBE_ENABLE_PIN
- #define PROBE_ENABLE_PIN SERVO0_PIN
+ #define PROBE_ENABLE_PIN SERVO0_PIN
#endif
#endif
@@ -112,18 +112,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB15
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB14
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB13
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB15
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB14
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB13
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h
index f4ce5a16d3..59c2b0f97c 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M5P_V1_0.h
@@ -79,8 +79,8 @@
// Z Probe (when not Z_STOP_PIN)
//
#ifndef Z_MIN_PROBE_PIN
- #define Z_MIN_PROBE_PIN PC13 // PROBE
- //#define Z_MIN_PROBE_PIN PC15 // IND-DET (with adjustable pullup set via jumper)
+ #define Z_MIN_PROBE_PIN PC13 // PROBE
+ //#define Z_MIN_PROBE_PIN PC15 // IND-DET (with adjustable pullup set via jumper)
#endif
//
@@ -129,18 +129,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PB15 // Shared with SPI header, Pin 5 (SPI2)
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PB14 // Shared with SPI header, Pin 6 (SPI2)
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PB13 // Shared with SPI header, Pin 4 (SPI2)
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PB15 // Shared with SPI header, Pin 5 (SPI2)
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PB14 // Shared with SPI header, Pin 6 (SPI2)
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PB13 // Shared with SPI header, Pin 4 (SPI2)
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
index 6516538c44..631b50d0f2 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
@@ -179,18 +179,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PA7
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PA6
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PA5
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PA7
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PA6
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PA5
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
index 80ea354982..9ddd46d6cd 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
@@ -273,18 +273,16 @@
#endif
//
-// Software SPI pins for TMC2130 stepper drivers
+// Default pins for TMC software SPI
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PE14
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PE13
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PE12
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PE14
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PE13
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PE12
#endif
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h
index d06e27d9c0..245567c27c 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_SE_BX_common.h
@@ -91,18 +91,16 @@
#define E1_CS_PIN PC8
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PC6
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PG3
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PC7
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PC6
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PG3
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PC7
#endif
#if HAS_TMC_UART
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 809a1f3f8c..c05ae971cf 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
@@ -260,18 +260,16 @@
#endif // SPINDLE_FEATURE || LASER_FEATURE
//
-// Software SPI pins for TMC2130 stepper drivers
+// SPI pins for TMC2130 stepper drivers
//
-#if ENABLED(TMC_USE_SW_SPI)
- #ifndef TMC_SW_MOSI
- #define TMC_SW_MOSI PE13
- #endif
- #ifndef TMC_SW_MISO
- #define TMC_SW_MISO PE15
- #endif
- #ifndef TMC_SW_SCK
- #define TMC_SW_SCK PE14
- #endif
+#ifndef TMC_SPI_MOSI
+ #define TMC_SPI_MOSI PE13
+#endif
+#ifndef TMC_SPI_MISO
+ #define TMC_SPI_MISO PE15
+#endif
+#ifndef TMC_SPI_SCK
+ #define TMC_SPI_SCK PE14
#endif
#if HAS_TMC_UART
From 0914f9e0e1738e118176bc9fe2df03215f1c4456 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 24 Mar 2023 02:40:29 -0500
Subject: [PATCH 067/225] =?UTF-8?q?=F0=9F=8E=A8=20Pins=20header=20comments?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Martin Turski
---
Marlin/src/HAL/AVR/fastio/fastio_1280.h | 3 +++
Marlin/src/HAL/AVR/fastio/fastio_1281.h | 3 +++
Marlin/src/HAL/AVR/fastio/fastio_168.h | 3 +++
Marlin/src/HAL/AVR/fastio/fastio_644.h | 3 +++
Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h | 3 +++
.../src/HAL/NATIVE_SIM/u8g/LCD_I2C_routines.h | 1 -
Marlin/src/HAL/NATIVE_SIM/u8g/LCD_defines.h | 2 --
Marlin/src/HAL/SAMD21/HAL_SPI.cpp | 2 +-
Marlin/src/HAL/SAMD21/fastio.h | 1 -
Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h | 2 ++
Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h | 6 +-----
Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h | 4 ++++
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 2 ++
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 2 ++
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 2 ++
Marlin/src/pins/lpc1768/pins_EMOTRONIC.h | 2 ++
Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h | 2 ++
Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 2 ++
Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 2 ++
Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 2 ++
Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h | 2 ++
Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h | 2 ++
Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h | 4 ++++
.../pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h | 2 ++
.../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 2 ++
.../pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h | 2 ++
.../src/pins/lpc1769/pins_COHESION3D_MINI.h | 2 ++
.../src/pins/lpc1769/pins_COHESION3D_REMIX.h | 2 ++
Marlin/src/pins/lpc1769/pins_FLY_CDY.h | 2 ++
Marlin/src/pins/lpc1769/pins_MKS_SGEN.h | 2 ++
Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h | 2 ++
Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h | 2 ++
Marlin/src/pins/mega/pins_CHEAPTRONIC.h | 1 +
Marlin/src/pins/mega/pins_CHEAPTRONICv2.h | 4 +++-
Marlin/src/pins/mega/pins_CNCONTROLS_11.h | 3 +++
Marlin/src/pins/mega/pins_CNCONTROLS_12.h | 3 +++
Marlin/src/pins/mega/pins_CNCONTROLS_15.h | 1 +
Marlin/src/pins/mega/pins_EINSTART-S.h | 1 +
Marlin/src/pins/mega/pins_ELEFU_3.h | 3 +++
Marlin/src/pins/mega/pins_GT2560_REV_A.h | 3 +++
Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h | 3 +++
Marlin/src/pins/mega/pins_GT2560_REV_B.h | 3 +++
Marlin/src/pins/mega/pins_GT2560_V3.h | 3 +++
Marlin/src/pins/mega/pins_GT2560_V3_A20.h | 1 +
Marlin/src/pins/mega/pins_GT2560_V3_MC2.h | 1 +
Marlin/src/pins/mega/pins_GT2560_V4.h | 3 +++
Marlin/src/pins/mega/pins_GT2560_V4_A20.h | 1 +
Marlin/src/pins/mega/pins_HJC2560C_REV2.h | 1 +
Marlin/src/pins/mega/pins_INTAMSYS40.h | 1 +
Marlin/src/pins/mega/pins_LEAPFROG.h | 1 +
Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h | 1 +
Marlin/src/pins/mega/pins_MALYAN_M180.h | 2 ++
Marlin/src/pins/mega/pins_MEGACONTROLLER.h | 3 +++
Marlin/src/pins/mega/pins_MEGATRONICS.h | 3 +++
Marlin/src/pins/mega/pins_MEGATRONICS_2.h | 3 +++
Marlin/src/pins/mega/pins_MEGATRONICS_3.h | 2 ++
Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h | 2 ++
Marlin/src/pins/mega/pins_MINITRONICS.h | 5 +++++
Marlin/src/pins/mega/pins_OVERLORD.h | 3 +++
Marlin/src/pins/mega/pins_PICA.h | 3 +++
Marlin/src/pins/mega/pins_PICAOLD.h | 4 ++++
.../pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h | 3 +++
Marlin/src/pins/mega/pins_SILVER_GATE.h | 2 ++
Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h | 1 +
Marlin/src/pins/mega/pins_WEEDO_62A.h | 1 +
Marlin/src/pins/rambo/pins_EINSY_RAMBO.h | 2 ++
Marlin/src/pins/rambo/pins_EINSY_RETRO.h | 4 ++++
Marlin/src/pins/rambo/pins_MINIRAMBO.h | 4 ++++
Marlin/src/pins/rambo/pins_RAMBO.h | 2 ++
Marlin/src/pins/rambo/pins_SCOOVO_X9H.h | 2 +-
Marlin/src/pins/ramps/pins_3DRAG.h | 4 ++++
Marlin/src/pins/ramps/pins_AZTEEG_X3.h | 3 +++
Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h | 3 +++
Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h | 3 +++
Marlin/src/pins/ramps/pins_BIQU_KFB_2.h | 1 +
Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h | 3 +++
Marlin/src/pins/ramps/pins_COPYMASTER_3D.h | 2 ++
Marlin/src/pins/ramps/pins_DAGOMA_F5.h | 2 ++
.../src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h | 1 +
Marlin/src/pins/ramps/pins_FELIX2.h | 1 +
Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h | 1 +
Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h | 1 +
.../src/pins/ramps/pins_FORMBOT_TREX2PLUS.h | 3 ++-
Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h | 3 ++-
Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 3 +++
Marlin/src/pins/ramps/pins_FYSETC_F6_14.h | 3 +++
Marlin/src/pins/ramps/pins_K8200.h | 3 +++
Marlin/src/pins/ramps/pins_K8400.h | 3 +++
Marlin/src/pins/ramps/pins_K8600.h | 1 +
Marlin/src/pins/ramps/pins_K8800.h | 3 +++
Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h | 1 +
Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h | 2 ++
Marlin/src/pins/ramps/pins_MKS_BASE_10.h | 6 ++++++
Marlin/src/pins/ramps/pins_MKS_BASE_14.h | 1 +
Marlin/src/pins/ramps/pins_MKS_BASE_15.h | 1 +
Marlin/src/pins/ramps/pins_MKS_BASE_16.h | 3 +++
Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h | 1 +
Marlin/src/pins/ramps/pins_MKS_BASE_common.h | 1 +
Marlin/src/pins/ramps/pins_MKS_GEN_13.h | 3 +++
Marlin/src/pins/ramps/pins_MKS_GEN_L.h | 3 +++
Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h | 3 +++
Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h | 3 +++
Marlin/src/pins/ramps/pins_ORTUR_4.h | 1 +
Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h | 1 +
Marlin/src/pins/ramps/pins_RAMPS.h | 1 +
Marlin/src/pins/ramps/pins_RAMPS_13.h | 1 +
Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h | 2 ++
Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h | 2 ++
Marlin/src/pins/ramps/pins_RAMPS_OLD.h | 1 +
Marlin/src/pins/ramps/pins_RAMPS_PLUS.h | 1 +
Marlin/src/pins/ramps/pins_RAMPS_S_12.h | 1 +
Marlin/src/pins/ramps/pins_RIGIDBOARD.h | 1 +
Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h | 1 +
Marlin/src/pins/ramps/pins_RL200.h | 1 +
Marlin/src/pins/ramps/pins_RUMBA.h | 3 +++
Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h | 2 ++
Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h | 3 ++-
Marlin/src/pins/ramps/pins_TANGO.h | 3 +++
Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h | 3 ++-
Marlin/src/pins/ramps/pins_TENLOG_MB1_V23.h | 3 ++-
Marlin/src/pins/ramps/pins_TRIGORILLA_13.h | 1 +
Marlin/src/pins/ramps/pins_TRIGORILLA_14.h | 1 +
Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h | 1 +
Marlin/src/pins/ramps/pins_TT_OSCAR.h | 4 +++-
Marlin/src/pins/ramps/pins_ULTIMAIN_2.h | 19 +++++++++++++++++++
Marlin/src/pins/ramps/pins_ULTIMAKER.h | 1 +
Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h | 3 +++
Marlin/src/pins/ramps/pins_VORON.h | 1 +
Marlin/src/pins/ramps/pins_ZRIB_V20.h | 7 ++++++-
Marlin/src/pins/ramps/pins_ZRIB_V52.h | 5 ++++-
Marlin/src/pins/ramps/pins_ZRIB_V53.h | 3 ++-
Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h | 1 +
Marlin/src/pins/sanguino/pins_ANET_10.h | 2 ++
Marlin/src/pins/sanguino/pins_AZTEEG_X1.h | 2 ++
.../src/pins/sanguino/pins_GEN3_MONOLITHIC.h | 1 +
Marlin/src/pins/sanguino/pins_GEN6.h | 2 ++
Marlin/src/pins/sanguino/pins_GEN7_12.h | 10 +++++++++-
Marlin/src/pins/sanguino/pins_GEN7_14.h | 4 ++++
Marlin/src/pins/sanguino/pins_MELZI.h | 2 ++
.../src/pins/sanguino/pins_MELZI_CREALITY.h | 3 +++
Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h | 1 +
Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h | 1 +
Marlin/src/pins/sanguino/pins_MELZI_V2.h | 2 ++
.../src/pins/sanguino/pins_SANGUINOLOLU_11.h | 10 ++++++++++
.../src/pins/sanguino/pins_SANGUINOLOLU_12.h | 6 ++++++
Marlin/src/pins/sanguino/pins_STB_11.h | 3 ++-
Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 2 ++
Marlin/src/pins/teensy2/pins_5DPRINT.h | 2 ++
Marlin/src/pins/teensy2/pins_BRAINWAVE.h | 4 ++++
Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h | 2 ++
Marlin/src/pins/teensy2/pins_PRINTRBOARD.h | 9 +++++++++
.../src/pins/teensy2/pins_PRINTRBOARD_REVF.h | 13 +++++++++++++
Marlin/src/pins/teensy2/pins_SAV_MKI.h | 3 +++
Marlin/src/pins/teensy2/pins_TEENSY2.h | 1 +
Marlin/src/pins/teensy2/pins_TEENSYLU.h | 4 ++++
155 files changed, 383 insertions(+), 23 deletions(-)
diff --git a/Marlin/src/HAL/AVR/fastio/fastio_1280.h b/Marlin/src/HAL/AVR/fastio/fastio_1280.h
index f482f823e8..e6ecbabb80 100644
--- a/Marlin/src/HAL/AVR/fastio/fastio_1280.h
+++ b/Marlin/src/HAL/AVR/fastio/fastio_1280.h
@@ -27,6 +27,9 @@
* Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 | 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100
* Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 | E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx
* Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 73 75 76 77 74 xx xx xx xx xx
+ *
+ * Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
+ * AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"
diff --git a/Marlin/src/HAL/AVR/fastio/fastio_1281.h b/Marlin/src/HAL/AVR/fastio/fastio_1281.h
index e0bc5e2995..812586225d 100644
--- a/Marlin/src/HAL/AVR/fastio/fastio_1281.h
+++ b/Marlin/src/HAL/AVR/fastio/fastio_1281.h
@@ -26,6 +26,9 @@
*
* Logical Pin: 38 39 40 41 42 43 44 45 16 10 11 12 06 07 08 09 30 31 32 33 34 35 36 37 17 18 19 20 21 22 23 24 00 01 13 05 02 03 14 15 46 47 48 49 50 51 52 53 25 26 27 28 29 04
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7 G0 G1 G2 G3 G4 G5
+ *
+ * Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
+ * AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"
diff --git a/Marlin/src/HAL/AVR/fastio/fastio_168.h b/Marlin/src/HAL/AVR/fastio/fastio_168.h
index 8cfdd1e8f8..4f591b37b9 100644
--- a/Marlin/src/HAL/AVR/fastio/fastio_168.h
+++ b/Marlin/src/HAL/AVR/fastio/fastio_168.h
@@ -26,6 +26,9 @@
*
* Logical Pin: 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07
* Port: B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
+ *
+ * Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
+ * AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"
diff --git a/Marlin/src/HAL/AVR/fastio/fastio_644.h b/Marlin/src/HAL/AVR/fastio/fastio_644.h
index f4a9427e0a..16bdc6a23d 100644
--- a/Marlin/src/HAL/AVR/fastio/fastio_644.h
+++ b/Marlin/src/HAL/AVR/fastio/fastio_644.h
@@ -26,6 +26,9 @@
*
* Logical Pin: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
* Port: B0 B1 B2 B3 B4 B5 B6 B7 D0 D1 D2 D3 D4 D5 D6 D7 C0 C1 C2 C3 C4 C5 C6 C7 A7 A6 A5 A4 A3 A2 A1 A0
+ *
+ * Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
+ * AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
/** ATMega644
diff --git a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
index 51d400b705..d2a8aca6f3 100644
--- a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
+++ b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
@@ -27,6 +27,9 @@
* Logical Pin: 28 29 30 31 32 33 34 35 20 21 22 23 24 25 26 27 10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07 08 09(46*47)36 37 18 19 38 39 40 41 42 43 44 45
* Port: A0 A1 A2 A3 A4 A5 A6 A7 B0 B1 B2 B3 B4 B5 B6 B7 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 E0 E1 E2 E3 E4 E5 E6 E7 F0 F1 F2 F3 F4 F5 F6 F7
* The logical pins 46 and 47 are not supported by Teensyduino, but are supported below as E2 and E3
+ *
+ * Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
+ * AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
*/
#include "../fastio.h"
diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_I2C_routines.h b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_I2C_routines.h
index 6d5f91d3ba..ec263b6dd3 100644
--- a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_I2C_routines.h
+++ b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_I2C_routines.h
@@ -34,4 +34,3 @@ void u8g_i2c_stop();
#ifdef __cplusplus
}
#endif
-
diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_defines.h b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_defines.h
index 44ffbfeb90..2a50eddcd4 100644
--- a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_defines.h
+++ b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_defines.h
@@ -40,5 +40,3 @@ uint8_t u8g_com_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
#define U8G_COM_T6963 u8g_com_null_fn
#define U8G_COM_FAST_PARALLEL u8g_com_null_fn
#define U8G_COM_UC_I2C u8g_com_null_fn
-
-
diff --git a/Marlin/src/HAL/SAMD21/HAL_SPI.cpp b/Marlin/src/HAL/SAMD21/HAL_SPI.cpp
index 0fc530cdb2..69c6a43af8 100644
--- a/Marlin/src/HAL/SAMD21/HAL_SPI.cpp
+++ b/Marlin/src/HAL/SAMD21/HAL_SPI.cpp
@@ -64,7 +64,7 @@
}
void spiInit(uint8_t spiRate) {
- // Use datarates Marlin uses
+ // Use Marlin datarates
uint32_t clock;
switch (spiRate) {
case SPI_FULL_SPEED: clock = 8000000; break;
diff --git a/Marlin/src/HAL/SAMD21/fastio.h b/Marlin/src/HAL/SAMD21/fastio.h
index db64f2166f..df907ff7ec 100644
--- a/Marlin/src/HAL/SAMD21/fastio.h
+++ b/Marlin/src/HAL/SAMD21/fastio.h
@@ -213,4 +213,3 @@
#define DIO53_PIN PIN_PA21
#define DIO54_PIN PIN_PA06
#define DIO55_PIN PIN_PA07
-
diff --git a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h
index 4d1dbecf2e..657eb8a046 100644
--- a/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h
+++ b/Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h
@@ -23,6 +23,8 @@
/**
* AZSMZ MINI pin assignments
+ * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/AZSMZ%20MINI/AZSMZ.svg
+ * Source: https://raw.githubusercontent.com/Rose-Fish/AZSMZ-mini/master/AZSMZ.sch
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
index 0c96cb42b5..7215150d0b 100644
--- a/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
+++ b/Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
@@ -22,11 +22,7 @@
#pragma once
/**
- * BIQU BQ111-A4
- *
- * Applies to the following boards:
- *
- * BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed)
+ * BIQU Thunder B300 V1.0
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h
index 92152170a0..2c0d52ef9a 100644
--- a/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h
+++ b/Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h
@@ -23,6 +23,10 @@
/**
* BIQU BQ111-A4 pin assignments
+ *
+ * Applies to the following boards:
+ *
+ * BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed)
*/
#include "env_validate.h"
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 1a8c44771a..d1ea2c0197 100644
--- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h
+++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h
@@ -23,6 +23,8 @@
/**
* BigTreeTech SKR 1.1 pin assignments
+ * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.1/SKR-V1.1SchDoc.pdf
+ * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.1/blob/master/hardware/SKR-V1.1SchDoc.pdf
*/
#define BOARD_INFO_NAME "BTT SKR V1.1"
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 6372623a30..aafc8d3f9f 100644
--- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
+++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
@@ -23,6 +23,8 @@
/**
* BigTreeTech SKR 1.3 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.3/SKR-V1.3-SCH.pdf
+ * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.3/hardware/SKR-V1.3-SCH.pdf
*/
#define BOARD_INFO_NAME "BTT SKR V1.3"
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 e632d8afa6..b4fafbf7a4 100644
--- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
+++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
@@ -23,6 +23,8 @@
/**
* BigTreeTech SKR 1.4 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.4%20+%20Turbo/BTT%20SKR%20V1.4-SCH.pdf
+ * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-SCH.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h
index 6e1ea403b1..9e62be8edb 100644
--- a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h
+++ b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h
@@ -23,6 +23,8 @@
/**
* eMotion-Tech eMotronic pin assignments
+ * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/eMotion-Tech%20eMotronic/eMotronic_brd_sources_1.0.4/eMotronic_sch.pdf
+ * Origin: https://data.emotion-tech.com/ftp/Datasheets_et_sources/Sources/eMotronic_brd_sources_1.0.4.zip
*
* Board pins<->features assignments are based on the
* Micro-Delta Rework printer default connections.
diff --git a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h
index 39ab0bbd89..aedbd7be60 100644
--- a/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h
+++ b/Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h
@@ -23,6 +23,8 @@
/**
* GMARSH X6 Rev.1 pin assignments
+ * Schematic: http://green-candy.osdn.jp/external/MarlinFW/board_schematics/GMARSH%20X6%20Rev.1/armprinter_2208_1heater.pdf
+ * Origin: https://github.com/gmarsh/gmarsh_x6/blob/master/armprinter_2208_1heater.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
index c5c5bd3e23..14759901ac 100644
--- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
+++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
@@ -23,6 +23,8 @@
/**
* Makerbase MKS SBASE pin assignments
+ * Schematic (V1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SBASE%20V1.3/MKS%20SBASE%20V1.3_002%20SCH.pdf
+ * Origin (V1.3): http://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SBASE%20V1.3/MKS%20SBASE%20V1.3_002%20SCH.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
index 1f038b4aa0..1235e44ec9 100644
--- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
+++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
@@ -23,6 +23,8 @@
/**
* Makerbase MKS SGEN-L pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS_GEN_L_V1_0/MKS%20Gen_L%20V1.0_008%20SCH.pdf
+ * Origin: https://github.com/makerbase-mks/SGEN_L/blob/master/Hardware/MKS%20SGEN_L%20V1.0_001/MKS%20SGEN_L%20V1.0_001%20SCH.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
index b6ce9c5c05..893a8a755b 100644
--- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
+++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
@@ -23,6 +23,8 @@
/**
* Re-ARM with RAMPS v1.4 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Re-ARM%20RAMPS%201.4/Re_ARM_Schematic.pdf
+ * Origin: https://reprap.org/mediawiki/images/f/fa/Re_ARM_Schematic.pdf
*
* Applies to the following boards:
*
diff --git a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h
index 2972ac7560..30cd76b9a2 100644
--- a/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h
+++ b/Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h
@@ -23,6 +23,8 @@
/**
* Selena Compact pin assignments
+ * Pinout: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Selena%20Compact/Compact%20Pinout.pdf
+ * Origin: https://github.com/f61/Selena/blob/master/Compact%20Pinout.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
index bc7cada8da..a9c61cb8c9 100644
--- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
+++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
@@ -23,6 +23,8 @@
/**
* Azteeg X5 GT pin assignments
+ * Wiring diagram: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20GT/X5%20GT%20Wiring%20Diagram.pdf
+ * Origin: https://panucattdevices.freshdesk.com/support/solutions/articles/1000244740-support-files
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h
index c33fe6e28f..eabb338504 100644
--- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h
+++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h
@@ -23,6 +23,10 @@
/**
* Azteeg X5 MINI pin assignments
+ * Schematic (V1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI/x5mini_design_files/X5mini_design_files/V1/X5%20Mini%20PUB%20v1.0.pdf
+ * Schematic (V2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI/x5mini_design_files/X5mini_design_files/V2/X5%20Mini%20V2%20SCH%20Pub.pdf
+ * Schematic (V3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI/x5mini_design_files/X5mini_design_files/V3/X5%20Mini%20V3%20SCH%20Pub.pdf
+ * Origin: http://files.panucatt.com/datasheets/x5mini_design_files.zip
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h
index 086bacbac0..74439e4f3d 100644
--- a/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h
+++ b/Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h
@@ -23,6 +23,8 @@
/**
* Azteeg X5 MINI WIFI pin assignments
+ * Wiring diagram: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X5%20MINI%20WIFI/x5mini_wifi_wiring.pdf
+ * Origin: http://files.panucatt.com/datasheets/x5mini_wifi_wiring.pdf
*/
#include "env_validate.h"
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 dbaafb89cc..f62818dd9f 100644
--- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h
+++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h
@@ -23,6 +23,8 @@
/**
* BigTreeTech SKR E3 Turbo pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20E3%20Turbo/BTT%20SKR%20E3%20Turbo-SCH.pdf
+ * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-E3-Turbo/blob/master/Hardware/BTT%20SKR%20E3%20Turbo-SCH.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h
index 7f428fc918..1bd70d8fb5 100644
--- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h
+++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h
@@ -23,6 +23,8 @@
/**
* BigTreeTech SKR 1.4 Turbo pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BTT%20SKR%20V1.4%20+%20Turbo/BTT%20SKR%20V1.4-SCH.pdf
+ * Origin: https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/blob/master/BTT%20SKR%20V1.4/Hardware/BTT%20SKR%20V1.4-SCH.pdf
*/
#define BOARD_INFO_NAME "BTT SKR V1.4 TURBO"
diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
index e0a3b03109..5c9355de29 100644
--- a/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
+++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
@@ -23,6 +23,8 @@
/**
* Cohesion3D Mini pin assignments
+ * Pinout: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Cohesion3D%20Mini/c3d-pinout.jpg
+ * Origin: https://lasergods.com/cohesion3d-mini-pinout-diagram/
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
index 122c7462d2..5083a0ed48 100644
--- a/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
+++ b/Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
@@ -23,6 +23,8 @@
/**
* Cohesion3D ReMix pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Cohesion3D%20ReMix/C3D%20ReMix%20rev2.svg
+ * Origin: https://github.com/Cohesion3D/Cohesion3D-ReMix/blob/master/C3D%20ReMix%20rev2.sch
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h
index 1c0c21466e..ed0ce30eb3 100644
--- a/Marlin/src/pins/lpc1769/pins_FLY_CDY.h
+++ b/Marlin/src/pins/lpc1769/pins_FLY_CDY.h
@@ -23,6 +23,8 @@
/**
* FLYmaker FLY-CDY pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/FLYmaker%20FLY-CDY%20V1/FLY_CDY%20SCH.pdf
+ * Origin: https://github.com/Mellow-3D/FLY-CDY/blob/master/Motherboard%20information/FLY_CDY%20SCH.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h
index 23bcecc78d..1e71fccfe5 100644
--- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h
+++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN.h
@@ -23,6 +23,8 @@
/**
* MKS SGen pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SGEN/MKS%20SGEN%20V1.0_001%20SCH.pdf
+ * Origin: https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20SCH.pdf
*
* Pins diagram:
* https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20PIN.pdf
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 5c1b1f5638..54b771d318 100644
--- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
+++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
@@ -23,6 +23,8 @@
/**
* MKS SGen-L V2 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MKS%20SGEN_L%20V2/MKS%20SGEN_L%20V2.0_003%20SCH.pdf
+ * Origin: https://github.com/makerbase-mks/MKS-SGEN_L-V2/blob/master/Hardware/MKS%20SGEN_L%20V2.0_003/MKS%20SGEN_L%20V2.0_003%20SCH.pdf
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
index cfaca164f8..124c8f63c2 100644
--- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
+++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
@@ -23,6 +23,8 @@
/**
* Smoothieware Smoothieboard pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Smoothieware%20Smoothieboard%20V1/http.i.imgur.com.oj4zqs3.png
+ * Origin: http://smoothieware.org/_media///external/http.i.imgur.com.oj4zqs3.png
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_CHEAPTRONIC.h b/Marlin/src/pins/mega/pins_CHEAPTRONIC.h
index 8bcb263bc1..e95f6c4ade 100644
--- a/Marlin/src/pins/mega/pins_CHEAPTRONIC.h
+++ b/Marlin/src/pins/mega/pins_CHEAPTRONIC.h
@@ -23,6 +23,7 @@
/**
* Cheaptronic v1.0 pin assignments
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h
index 01438975b9..e81295a653 100644
--- a/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h
+++ b/Marlin/src/pins/mega/pins_CHEAPTRONICv2.h
@@ -24,7 +24,9 @@
/**
* Cheaptronic v2.0 pin assignments
* Built and sold by Michal Dyntar - RRO
- * www.reprapobchod.cz
+ * www.reprapobchod.cz (DOES NOT EXIST ANYMORE)
+ * https://web.archive.org/web/20190306201523/http://reprapobchod.cz/
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h
index 5f7a534d11..d996635c8c 100644
--- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h
+++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h
@@ -23,6 +23,9 @@
/**
* CartesioV11 pin assignments
+ * Comes with an Arduino Mega, see
+ * https://web.archive.org/web/20171024190029/http://mauk.cc/mediawiki/index.php/Electronical_assembly
+ * ATmega2560, ATmega1280
*/
#define ALLOW_MEGA1280
diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h
index 0aa0b59ca9..ea82fe429c 100644
--- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h
+++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h
@@ -23,6 +23,9 @@
/**
* CartesioV12 pin assignments
+ * Comes with an Arduino Mega, see
+ * https://web.archive.org/web/20171024190029/http://mauk.cc/mediawiki/index.php/Electronical_assembly
+ * ATmega2560, ATmega1280
*/
#define ALLOW_MEGA1280
diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_15.h b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h
index 6de3b7172e..c77e711f9c 100644
--- a/Marlin/src/pins/mega/pins_CNCONTROLS_15.h
+++ b/Marlin/src/pins/mega/pins_CNCONTROLS_15.h
@@ -23,6 +23,7 @@
/**
* CNControls V15 for HMS434 pin assignments
+ * ATmega2560, ATmega1280
*/
#define ALLOW_MEGA1280
diff --git a/Marlin/src/pins/mega/pins_EINSTART-S.h b/Marlin/src/pins/mega/pins_EINSTART-S.h
index c8cbee6740..274684f337 100644
--- a/Marlin/src/pins/mega/pins_EINSTART-S.h
+++ b/Marlin/src/pins/mega/pins_EINSTART-S.h
@@ -23,6 +23,7 @@
/**
* Einstart-S pin assignments
+ * ATmega2560, ATmega1280
* PCB Silkscreen: 3DPrinterCon_v3.5
*/
diff --git a/Marlin/src/pins/mega/pins_ELEFU_3.h b/Marlin/src/pins/mega/pins_ELEFU_3.h
index f5e146cff9..6cf9e1b4e1 100644
--- a/Marlin/src/pins/mega/pins_ELEFU_3.h
+++ b/Marlin/src/pins/mega/pins_ELEFU_3.h
@@ -23,6 +23,9 @@
/**
* Elefu RA Board Pin Assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Elefu%20Ra%20v3/schematic.pdf
+ * Origin: https://github.com/kiyoshigawa/Elefu-RAv3/blob/master/RA_Circuits.zip
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A.h b/Marlin/src/pins/mega/pins_GT2560_REV_A.h
index 99e8704ea5..bb251dfb4e 100644
--- a/Marlin/src/pins/mega/pins_GT2560_REV_A.h
+++ b/Marlin/src/pins/mega/pins_GT2560_REV_A.h
@@ -25,6 +25,9 @@
* Geeetech GT2560 Revision A board pin assignments, based on the work of
* George Robles (https://georges3dprinters.com) and
* Richard Smith
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20Revision%20A/GT2560_sch.pdf
+ * Origin: https://www.geeetech.com/wiki/images/9/90/GT2560_sch.pdf
+ * ATmega2560
*/
#define ALLOW_MEGA1280
diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h
index 7e2ce20c67..a982a0e00e 100644
--- a/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h
+++ b/Marlin/src/pins/mega/pins_GT2560_REV_A_PLUS.h
@@ -23,6 +23,9 @@
/**
* Geeetech GT2560 Revision A+ board pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20Revision%20A+/Hardware_GT2560_RevA+.pdf
+ * Origin: https://www.geeetech.com/wiki/images/d/d3/Hardware_GT2560_RevA%2B.pdf
+ * ATmega2560
*/
#define BOARD_INFO_NAME "GT2560 Rev.A+"
diff --git a/Marlin/src/pins/mega/pins_GT2560_REV_B.h b/Marlin/src/pins/mega/pins_GT2560_REV_B.h
index be71ec4902..0702d14eb8 100644
--- a/Marlin/src/pins/mega/pins_GT2560_REV_B.h
+++ b/Marlin/src/pins/mega/pins_GT2560_REV_B.h
@@ -23,6 +23,9 @@
/**
* Geeetech GT2560 Rev B Pins
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20Rev%20B/GT2560_REVB.pdf
+ * Origin: https://www.geeetech.com/wiki/images/7/72/GT2560_REVB.pdf
+ * ATmega2560
*/
#define BOARD_INFO_NAME "GT2560 Rev B"
diff --git a/Marlin/src/pins/mega/pins_GT2560_V3.h b/Marlin/src/pins/mega/pins_GT2560_V3.h
index 46b4ebf428..5d2436b684 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V3.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V3.h
@@ -23,6 +23,9 @@
/**
* Geeetech GT2560 3.0/3.1 pin assignments
+ * Schematic (3.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%203.0/GT2560_V3.0_SCH.pdf
+ * Origin (3.0): https://github.com/Geeetech3D/Diagram/blob/master/GT2560_V3.0_SCH.pdf
+ * ATmega2560
*
* Also GT2560 RevB and GT2560 4.0/4.1
*/
diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h
index c96431141c..628f897b0c 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V3_A20.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V3_A20.h
@@ -23,6 +23,7 @@
/**
* Geeetech A20M board pin assignments
+ * ATmega2560
*/
#define LCD_PINS_RS 5
diff --git a/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h
index e683d4dfda..70854c5716 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V3_MC2.h
@@ -23,6 +23,7 @@
/**
* Geeetech GT2560 V 3.0 board pin assignments (for Mecreator 2)
+ * ATmega2560
*/
#define BOARD_INFO_NAME "GT2560 V3.0 (MC2)"
diff --git a/Marlin/src/pins/mega/pins_GT2560_V4.h b/Marlin/src/pins/mega/pins_GT2560_V4.h
index 6ac07b70bf..98f503886f 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V4.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V4.h
@@ -23,6 +23,9 @@
/**
* Geeetech GT2560 V4.X Pins
+ * Schematic (4.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20V4.x%20+%20A20/GT2560V4.0SCHA20T.pdf
+ * Schematic (4.1B): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Geeetech%20GT2560%20V4.x%20+%20A20/GT2560V4.1BSCHA20T.pdf
+ * Origin: https://www.geeetech.com/download.html?spm=a2g0s.imconversation.0.0.22d23e5fXlQBWv&download_id=45
*/
#define BOARD_INFO_NAME "GT2560 4.x"
diff --git a/Marlin/src/pins/mega/pins_GT2560_V4_A20.h b/Marlin/src/pins/mega/pins_GT2560_V4_A20.h
index c87c11e175..8ca2d44db9 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V4_A20.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V4_A20.h
@@ -23,6 +23,7 @@
/**
* Geeetech A20 GT2560 V4.x board pin assignments
+ * ATmega2560
*/
#define BOARD_INFO_NAME "GT2560 4.x"
diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h
index 5c3b1dc9f6..1b3b7b29af 100644
--- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h
+++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h
@@ -23,6 +23,7 @@
/**
* Geeetech HJC2560-C Rev 2.x board pin assignments
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_INTAMSYS40.h b/Marlin/src/pins/mega/pins_INTAMSYS40.h
index 2e2a9b85db..ec466fb09f 100644
--- a/Marlin/src/pins/mega/pins_INTAMSYS40.h
+++ b/Marlin/src/pins/mega/pins_INTAMSYS40.h
@@ -23,6 +23,7 @@
/**
* Intamsys Funmat HT V4.0 Mainboard
+ * ATmega2560
* 4988 Drivers Tested
* 2208 version exists and may or may not work
*/
diff --git a/Marlin/src/pins/mega/pins_LEAPFROG.h b/Marlin/src/pins/mega/pins_LEAPFROG.h
index 4700fd6729..3762ea98f0 100644
--- a/Marlin/src/pins/mega/pins_LEAPFROG.h
+++ b/Marlin/src/pins/mega/pins_LEAPFROG.h
@@ -23,6 +23,7 @@
/**
* Leapfrog Driver board pin assignments
+ * ATmega2560, ATmega1280
*/
#define ALLOW_MEGA1280
diff --git a/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h b/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h
index 4a32472949..7be96c5def 100644
--- a/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h
+++ b/Marlin/src/pins/mega/pins_LEAPFROG_XEED2015.h
@@ -23,6 +23,7 @@
/**
* Leapfrog Xeed Driver board pin assignments
+ * ATmega2560
*
* This board is used by other Leapfrog printers in addition to the Xeed,
* such as the Creatr HS and Bolt. The pin assignments vary wildly between
diff --git a/Marlin/src/pins/mega/pins_MALYAN_M180.h b/Marlin/src/pins/mega/pins_MALYAN_M180.h
index 19095a5379..3ef606de77 100644
--- a/Marlin/src/pins/mega/pins_MALYAN_M180.h
+++ b/Marlin/src/pins/mega/pins_MALYAN_M180.h
@@ -24,6 +24,8 @@
/**
* Malyan M180 pin assignments
* Contributed by Timo Birnschein (timo.birnschein@microforge.de)
+ * @Timo: sind diese Pin Definitionen immernoch korrekt? (Antwort an turningtides@outlook.de bitte)
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h
index 7ebef6e281..f45da25f62 100644
--- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h
+++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h
@@ -23,6 +23,9 @@
/**
* Mega controller pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mega%20Controller/Mega_controller.pdf
+ * Origin: https://reprap.org/mediawiki/images/b/ba/Mega_controller.pdf
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS.h b/Marlin/src/pins/mega/pins_MEGATRONICS.h
index ac0ba4eea6..a51615e3d9 100644
--- a/Marlin/src/pins/mega/pins_MEGATRONICS.h
+++ b/Marlin/src/pins/mega/pins_MEGATRONICS.h
@@ -23,6 +23,9 @@
/**
* MegaTronics pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/MegaTronics/Megatronics_1_0_sch.pdf
+ * Origin: https://reprap.org/mediawiki/images/a/a3/Megatronics_1_0_sch.pdf
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h
index e527035910..3f7afe562b 100644
--- a/Marlin/src/pins/mega/pins_MEGATRONICS_2.h
+++ b/Marlin/src/pins/mega/pins_MEGATRONICS_2.h
@@ -23,6 +23,9 @@
/**
* MegaTronics v2.0 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Megatronics%20v2.0/megatronics%20-%20Project.pdf
+ * Origin: https://reprap.org/wiki/File:Megatronicsv2PDF.zip
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h
index 86aff16f92..b194c31b5d 100644
--- a/Marlin/src/pins/mega/pins_MEGATRONICS_3.h
+++ b/Marlin/src/pins/mega/pins_MEGATRONICS_3.h
@@ -23,6 +23,8 @@
/**
* MegaTronics v3.0 / v3.1 / v3.2 pin assignments
+ * Schematic Origin: https://github.com/brupje/Megatronics_3/blob/master/Design%20Files/megatronics.sch
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
index 0ef1c1d8ae..56f92f8b25 100644
--- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
+++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
@@ -23,6 +23,8 @@
/**
* Mightyboard Rev.E pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mightyboard%20Rev.E/MakerBot%20MightyBoard%20REVE%20Schematic.pdf
+ * Origin: https://github.com/sciguy14/HelioWatcher/blob/master/HelioWatcher%20Circuit/MakerBot%20MightyBoard%20REVE%20Schematic.pdf
* also works for Rev D boards. It's all rev E despite what the silk screen says
*/
diff --git a/Marlin/src/pins/mega/pins_MINITRONICS.h b/Marlin/src/pins/mega/pins_MINITRONICS.h
index ec712a3b90..ddf6d2047d 100644
--- a/Marlin/src/pins/mega/pins_MINITRONICS.h
+++ b/Marlin/src/pins/mega/pins_MINITRONICS.h
@@ -23,6 +23,11 @@
/**
* Minitronics v1.0/1.1 pin assignments
+ * Schematic (1.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Minitronics%20v1.0/minitronics%20-%20Project.pdf
+ * Origin (1.0): https://reprap.org/wiki/File:MinitronicsPDF.zip
+ * Datasheet (1.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Minitronics%20v1.1/datasheet%20minitronics%20v1.1.pdf
+ * Origin (1.1): https://reprapworld.nl/documentation/datasheet%20minitronics%20v1.1.pdf
+ * ATmega1281
*/
/**
diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h
index 49accf9f7c..01c02dafe2 100644
--- a/Marlin/src/pins/mega/pins_OVERLORD.h
+++ b/Marlin/src/pins/mega/pins_OVERLORD.h
@@ -23,6 +23,9 @@
/**
* Dreammaker Overlord v1.1 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Dreammaker%20Overlord%20v1.1/Schematic.pdf
+ * Origin: https://github.com/jdpiercy/Overlord-Pro/blob/master/Motherboard/Schematic.pdf
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/mega/pins_PICA.h b/Marlin/src/pins/mega/pins_PICA.h
index 0e29d8dffe..109859388c 100644
--- a/Marlin/src/pins/mega/pins_PICA.h
+++ b/Marlin/src/pins/mega/pins_PICA.h
@@ -23,6 +23,9 @@
/**
* Arduino Mega with PICA pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/PICA/pica_schematic.pdf
+ * Origin: https://github.com/mjrice/PICA/blob/master/pica_schematic.pdf
+ * ATmega2560
*
* PICA is Power, Interface, and Control Adapter and is open source hardware.
* See https://github.com/mjrice/PICA for schematics etc.
diff --git a/Marlin/src/pins/mega/pins_PICAOLD.h b/Marlin/src/pins/mega/pins_PICAOLD.h
index e19ea744e5..961462fc52 100644
--- a/Marlin/src/pins/mega/pins_PICAOLD.h
+++ b/Marlin/src/pins/mega/pins_PICAOLD.h
@@ -21,6 +21,10 @@
*/
#pragma once
+// Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/PICAOLD/pica_schematic.pdf
+// Origin: https://github.com/mjrice/PICA/blob/97ab9e7771a8e5eef97788f3adcc17a9fa9de9b9/pica_schematic.pdf
+// ATmega2560
+
#define HEATER_0_PIN 9 // E0
#define HEATER_1_PIN 10 // E1
#define FAN_PIN 11
diff --git a/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h b/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h
index 88d549c8cb..962fddc192 100644
--- a/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h
+++ b/Marlin/src/pins/mega/pins_PROTONEER_CNC_SHIELD_V3.h
@@ -23,6 +23,9 @@
/**
* Protoneer v3.00 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Protoneer%20CNC%20Shield%20v3.00/Arduino-CNC-Shield-Scematics-V3.XX_.webp
+ * Origin: https://i0.wp.com/blog.protoneer.co.nz/wp-content/uploads/2013/07/Arduino-CNC-Shield-Scematics-V3.XX_.jpg
+ * ATmega2560
*
* This CNC shield has an UNO pinout and fits all Arduino-compatibles.
*
diff --git a/Marlin/src/pins/mega/pins_SILVER_GATE.h b/Marlin/src/pins/mega/pins_SILVER_GATE.h
index 4568ed04e2..6dc0c3963f 100644
--- a/Marlin/src/pins/mega/pins_SILVER_GATE.h
+++ b/Marlin/src/pins/mega/pins_SILVER_GATE.h
@@ -21,6 +21,8 @@
*/
#pragma once
+// ATmega2561
+
#if NOT_TARGET(__AVR_ATmega1281__, __AVR_ATmega2561__)
#error "Oops! Select 'Silvergate' in 'Tools > Board.'"
#endif
diff --git a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h
index 503dd9ec81..6ab6c4ceb9 100644
--- a/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h
+++ b/Marlin/src/pins/mega/pins_WANHAO_ONEPLUS.h
@@ -23,6 +23,7 @@
/**
* Wanhao 0ne+ pin assignments
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/mega/pins_WEEDO_62A.h b/Marlin/src/pins/mega/pins_WEEDO_62A.h
index 4b3bf6a43b..4165d9e234 100644
--- a/Marlin/src/pins/mega/pins_WEEDO_62A.h
+++ b/Marlin/src/pins/mega/pins_WEEDO_62A.h
@@ -23,6 +23,7 @@
/**
* Based on WEEDO 62A pin configuration
* Copyright (c) 2019 WEEDO3D Perron
+ * ATmega2560
*/
#pragma once
diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h
index de9ecc5b45..c28fbd059c 100644
--- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h
+++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h
@@ -23,6 +23,8 @@
/**
* Einsy-Rambo pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Einsy-Rambo/Schematic%20Prints_Einsy%20Rambo_1.1a.PDF
+ * Origin: https://github.com/ultimachine/Einsy-Rambo/blob/1.1a/board/Project%20Outputs/Schematic%20Prints_Einsy%20Rambo_1.1a.PDF
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h
index 413eb8c98c..dc91c47e9a 100644
--- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h
+++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h
@@ -23,6 +23,10 @@
/**
* Einsy-Retro pin assignments
+ * Schematic (1.0b): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Einsy-Retro/Schematic%20Prints_EinsyRetro_1.0b.PDF
+ * Origin (1.0b): https://github.com/ultimachine/EinsyRetro/blob/master/board/Project%20Outputs/Schematic%20Prints_EinsyRetro_1.0b.PDF
+ * Schematic (1.0c): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Einsy-Retro/Schematic%20Prints_EinsyRetro_1.0c.PDF
+ * Origin (1.0c): https://github.com/ultimachine/EinsyRetro/blob/master/board/Project%20Outputs/Schematic%20Prints_EinsyRetro_1.0c.PDF
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h
index 31d44f2b34..353fbd6641 100644
--- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h
+++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h
@@ -23,6 +23,10 @@
/**
* Mini-RAMBo pin assignments
+ * Schematic (1.3a): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mini%20RAMBo/Mini-Rambo.PDF
+ * Origin (1.3a): https://github.com/ultimachine/Mini-Rambo/blob/1.3a/board/Project%20Outputs%20for%20Mini-Rambo/Mini-Rambo.PDF
+ * Schematic (1.0a): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Mini%20RAMBo%201.0a/Mini-Rambo.PDF
+ * Origin (1.0a): https://github.com/ultimachine/Mini-Rambo/blob/v1.1b/board/Project%20Outputs%20for%20Mini-Rambo/Mini-Rambo.PDF
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h
index cb7a059134..3a26811538 100644
--- a/Marlin/src/pins/rambo/pins_RAMBO.h
+++ b/Marlin/src/pins/rambo/pins_RAMBO.h
@@ -39,6 +39,8 @@
/**
* Rambo pin assignments
+ * Schematic (1.1b): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMBo/Rambo1-1-schematic.png
+ * Origin (1.1b): https://www.reprap.org/wiki/File:Rambo1-1-schematic.png
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h
index 533284a4bf..ca073f5ab9 100644
--- a/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h
+++ b/Marlin/src/pins/rambo/pins_SCOOVO_X9H.h
@@ -25,7 +25,7 @@
* Rambo pin assignments MODIFIED FOR Scoovo X9H
************************************************/
-#include "env_target.h"
+#include "env_validate.h"
#define BOARD_INFO_NAME "Scoovo X9H"
diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h
index 0f90dd5a34..c14284865b 100644
--- a/Marlin/src/pins/ramps/pins_3DRAG.h
+++ b/Marlin/src/pins/ramps/pins_3DRAG.h
@@ -23,6 +23,10 @@
/**
* 3DRAG (and K8200 / K8400) Arduino Mega with RAMPS v1.4 pin assignments
+ * This may be compatible with the standalone Controller variant.
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/3DRAG%20+%20Controller/Schema_base.jpg
+ * Origin: https://reprap.org/wiki/File:Schema_base.jpg
+ * ATmega2560, ATmega1280
*/
#ifndef BOARD_INFO_NAME
diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h
index 31adea4270..4d3722655d 100644
--- a/Marlin/src/pins/ramps/pins_AZTEEG_X3.h
+++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3.h
@@ -23,6 +23,9 @@
/**
* AZTEEG_X3 Arduino Mega with RAMPS v1.4 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/AZTEEG_X3/AZTEEG%20X3%20PUB%20v1.12.pdf
+ * Origin: http://files.panucatt.com/datasheets/azteegx3_designfiles.zip
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h
index 24266bb9d2..2c666a6f16 100644
--- a/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h
+++ b/Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h
@@ -23,6 +23,9 @@
/**
* AZTEEG_X3_PRO (Arduino Mega) pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/AZTEEG_X3_PRO/AZTEEG%20X3%20PRO%201.0%20PUB.pdf
+ * Origin: http://files.panucatt.com/datasheets/x3pro_sch_v1.0.zip
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h
index fa622ffb15..f3439aa6bb 100644
--- a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h
+++ b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h
@@ -23,6 +23,9 @@
/**
* BAM&DICE Due (Arduino Mega) pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/BAM&DICE%20Due/2PRINTBETA-BAM&DICE-DUE-V1.1-sch.pdf
+ * Origin: http://www.2printbeta.de/download/2PRINTBETA-BAM&DICE-DUE-V1.1-sch.pdf
+ * ATmega2560, ATmega1280
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h
index 58a62fb8bc..6155e9842a 100644
--- a/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h
+++ b/Marlin/src/pins/ramps/pins_BIQU_KFB_2.h
@@ -23,6 +23,7 @@
/**
* KFB 2.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h
index 4a54b85ae0..cd3ada25bf 100644
--- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h
+++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h
@@ -23,6 +23,9 @@
/**
* bq ZUM Mega 3D board definition
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/bq%20ZUM%20Mega%203D/Zum%20Mega%203D.PDF
+ * Origin: https://github.com/bq/zum/blob/master/zum-mega3d/Zum%20Mega%203D.PDF
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h b/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h
index 020941027a..1285d0244c 100644
--- a/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h
+++ b/Marlin/src/pins/ramps/pins_COPYMASTER_3D.h
@@ -21,6 +21,8 @@
*/
#pragma once
+// ATmega2560
+
#define BOARD_INFO_NAME "Copymaster 3D RAMPS"
#define Z_STEP_PIN 47
diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h
index e1bd2ec4ed..9760ccbef5 100644
--- a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h
+++ b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h
@@ -21,6 +21,8 @@
*/
#pragma once
+// ATmega2560
+
#if HOTENDS > 2 || E_STEPPERS > 2
#error "Dagoma3D F5 supports up to 2 hotends / E steppers."
#endif
diff --git a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h
index 1a4b83f02d..7e370a398b 100644
--- a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h
+++ b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h
@@ -23,6 +23,7 @@
/**
* Wanhao Duplicator i3 Plus pin assignments
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h
index 3e7849d71f..48ef896e96 100644
--- a/Marlin/src/pins/ramps/pins_FELIX2.h
+++ b/Marlin/src/pins/ramps/pins_FELIX2.h
@@ -23,6 +23,7 @@
/**
* FELIXprinters v2.0/3.0 (RAMPS v1.4) pin assignments
+ * ATmega2560, ATmega1280
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h
index a6791ff7c8..7bed4c0884 100644
--- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h
+++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR.h
@@ -23,6 +23,7 @@
/**
* Formbot Raptor pin assignments
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h
index 4fb10bfd35..f0e86ac4a7 100644
--- a/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h
+++ b/Marlin/src/pins/ramps/pins_FORMBOT_RAPTOR2.h
@@ -23,6 +23,7 @@
/**
* Formbot Raptor 2 pin assignments
+ * ATmega2560
*/
#define BOARD_INFO_NAME "Formbot Raptor2"
diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h
index 17d3abc71f..a5ca7e8607 100644
--- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h
+++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h
@@ -22,7 +22,8 @@
#pragma once
/**
- * Formbot pin assignments
+ * Formbot T-Rex 2+ pin assignments
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h
index e23a63994f..2fa3d60f67 100644
--- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h
+++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX3.h
@@ -22,7 +22,8 @@
#pragma once
/**
- * Formbot pin assignments
+ * Formbot T-Rex 3 pin assignments
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h
index b8de260909..9f23647c42 100644
--- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h
+++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h
@@ -23,6 +23,9 @@
//
// FYSETC F6 1.3 (and 1.4) pin assignments
+// Schematic (1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/FYSETC%20F6%201.3/F6_V13.pdf
+// Origin: https://github.com/FYSETC/FYSETC-F6/blob/master/Hardware/V1.3/F6_V13.pdf
+// ATmega2560
//
#if NOT_TARGET(__AVR_ATmega2560__)
diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h
index 1fc24154b7..9604d0ecbf 100644
--- a/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h
+++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_14.h
@@ -23,6 +23,9 @@
//
// FYSETC F6 v1.4 pin assignments
+// Schematic (1.4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/FYSETC%20F6%20v1.4/F6%20V1.4%20Sch.pdf
+// Origin (1.4): https://github.com/FYSETC/FYSETC-F6/blob/master/Hardware/V1.4/F6%20V1.4%20Sch.pdf
+// ATmega2560
//
#define BOARD_INFO_NAME "FYSETC F6 1.4"
diff --git a/Marlin/src/pins/ramps/pins_K8200.h b/Marlin/src/pins/ramps/pins_K8200.h
index 395e1ccca5..d2557b26c3 100644
--- a/Marlin/src/pins/ramps/pins_K8200.h
+++ b/Marlin/src/pins/ramps/pins_K8200.h
@@ -24,6 +24,9 @@
/**
* K8200 Arduino Mega with RAMPS v1.3 pin assignments
* Identical to 3DRAG
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Velleman%20K8200/K8200diagram.jpg
+ * Origin: https://www.velleman.eu/images/tmp/K8200diagram.jpg
+ * ATmega2560
*/
#define BOARD_INFO_NAME "Velleman K8200"
diff --git a/Marlin/src/pins/ramps/pins_K8400.h b/Marlin/src/pins/ramps/pins_K8400.h
index 22ac1be8ab..56ec66191b 100644
--- a/Marlin/src/pins/ramps/pins_K8400.h
+++ b/Marlin/src/pins/ramps/pins_K8400.h
@@ -24,6 +24,9 @@
/**
* Velleman K8400 (Vertex)
* 3DRAG clone
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Velleman%20K8400/k8400-schema-electronique.jpg
+ * Origin: https://filimprimante3d.fr/documents/k8400-schema-electronique.jpg
+ * ATmega2560, ATmega1280
*
* K8400 has some minor differences over a normal 3Drag:
* - No X/Y max endstops
diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h
index e4468a6098..3081b04361 100644
--- a/Marlin/src/pins/ramps/pins_K8600.h
+++ b/Marlin/src/pins/ramps/pins_K8600.h
@@ -23,6 +23,7 @@
/**
* VERTEX NANO Arduino Mega with RAMPS EFB v1.4 pin assignments.
+ * ATmega2560, ATmega1280
*/
#if HAS_MULTI_HOTEND
diff --git a/Marlin/src/pins/ramps/pins_K8800.h b/Marlin/src/pins/ramps/pins_K8800.h
index 17bb59fdc9..a9669764ce 100644
--- a/Marlin/src/pins/ramps/pins_K8800.h
+++ b/Marlin/src/pins/ramps/pins_K8800.h
@@ -23,6 +23,9 @@
/**
* Velleman K8800 (Vertex)
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Velleman%20K8800/K8800-schematic-V1.4.pdf
+ * Origin: https://www.velleman.eu/downloads/files/vertex-delta/schematics/K8800-schematic-V1.4.pdf
+ * ATmega2560, ATmega1280
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h
index 51f9cd8038..d9759153c3 100644
--- a/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h
+++ b/Marlin/src/pins/ramps/pins_LONGER3D_LKx_PRO.h
@@ -23,6 +23,7 @@
/**
* Longer3D LK1/LK4/LK5 Pro board pin assignments
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h b/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h
index a42dba874f..2ab463d681 100644
--- a/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h
+++ b/Marlin/src/pins/ramps/pins_MAKEBOARD_MINI.h
@@ -21,6 +21,8 @@
*/
#pragma once
+// ATmega2560
+
#define BOARD_INFO_NAME "MAKEboard Mini"
//
diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h
index 64efa46c05..8d46ac36fa 100644
--- a/Marlin/src/pins/ramps/pins_MKS_BASE_10.h
+++ b/Marlin/src/pins/ramps/pins_MKS_BASE_10.h
@@ -23,6 +23,12 @@
/**
* MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments
+ * Schematics:
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.0/PAGE1.pdf
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.0/PAGE2.pdf
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.0/PAGE3.pdf
+ * Origin: https://reprap.org/wiki/File:MKS_Base_V1.0_source.zip
+ * ATmega2560
*
* Rev B - Override pin definitions for CASE_LIGHT and M3/M4/M5 spindle control
*/
diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h
index 7e2a722cf2..d302def795 100644
--- a/Marlin/src/pins/ramps/pins_MKS_BASE_14.h
+++ b/Marlin/src/pins/ramps/pins_MKS_BASE_14.h
@@ -23,6 +23,7 @@
/**
* MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h
index 5fedd3f97c..1d93ec5cf9 100644
--- a/Marlin/src/pins/ramps/pins_MKS_BASE_15.h
+++ b/Marlin/src/pins/ramps/pins_MKS_BASE_15.h
@@ -23,6 +23,7 @@
/**
* MKS BASE v1.5 with A4982 stepper drivers and digital micro-stepping
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h
index 63e0b51d3c..765a601fd0 100644
--- a/Marlin/src/pins/ramps/pins_MKS_BASE_16.h
+++ b/Marlin/src/pins/ramps/pins_MKS_BASE_16.h
@@ -23,6 +23,9 @@
/**
* MKS BASE v1.6 with A4982 stepper drivers and digital micro-stepping
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20BASE%201.6/MKS%20Base%20V1.6_004%20SCH.pdf
+ * Origin: https://github.com/makerbase-mks/MKS-BASE/blob/master/hardware/MKS%20Base%20V1.6_004/MKS%20Base%20V1.6_004%20SCH.pdf
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h b/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h
index 973f924e7c..c50f28a407 100644
--- a/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h
+++ b/Marlin/src/pins/ramps/pins_MKS_BASE_HEROIC.h
@@ -23,6 +23,7 @@
/**
* MKS BASE with Heroic HR4982 stepper drivers
+ * ATmega2560
*/
#include "pins_MKS_BASE_15.h" // ... MKS_BASE_common ... RAMPS
diff --git a/Marlin/src/pins/ramps/pins_MKS_BASE_common.h b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h
index 9047a4bcf0..7608745a4b 100644
--- a/Marlin/src/pins/ramps/pins_MKS_BASE_common.h
+++ b/Marlin/src/pins/ramps/pins_MKS_BASE_common.h
@@ -23,6 +23,7 @@
/**
* MKS BASE – Arduino Mega2560 with RAMPS pin assignments
+ * ATmega2560
*/
#ifndef BOARD_INFO_NAME
diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h
index 1e354a10dc..5c13288f85 100644
--- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h
+++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h
@@ -23,6 +23,9 @@
/**
* Arduino Mega with RAMPS v1.4 adjusted pin assignments
+ * Schematic (1.4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20v1.4/MKS%20GEN%20V1.4_004%20SCH.pdf
+ * Origin (1.4): https://github.com/makerbase-mks/MKS-GEN/blob/master/hardware/MKS%20GEN%20V1.4_004/MKS%20GEN%20V1.4_004%20SCH.pdf
+ * ATmega2560, ATmega1280
*
* MKS GEN v1.3 (Extruder, Fan, Bed)
* MKS GEN v1.3 (Extruder, Extruder, Fan, Bed)
diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h
index dd7f8e5f86..c610fc6206 100644
--- a/Marlin/src/pins/ramps/pins_MKS_GEN_L.h
+++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L.h
@@ -23,6 +23,9 @@
/**
* MKS GEN L – Arduino Mega2560 with RAMPS v1.4 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20L%20v1.0/MKS%20Gen_L%20V1.0_008%20SCH.pdf
+ * Origin: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V1.0_008/MKS%20Gen_L%20V1.0_008%20SCH.pdf
+ * ATmega2560, ATmega1280
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h
index 0378b166a2..d82c4353fd 100644
--- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h
+++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V2.h
@@ -23,6 +23,9 @@
/**
* MKS GEN L V2 – Arduino Mega2560 with RAMPS v1.4 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20L%20V2.0/MKS%20Gen_L%20V2.0_001%20SCH.pdf
+ * Origin: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V2.0_001/MKS%20Gen_L%20V2.0_001%20SCH.pdf
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h
index d508cb453f..c2ab34c825 100644
--- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h
+++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h
@@ -23,6 +23,9 @@
/**
* MKS GEN L V2 – Arduino Mega2560 with RAMPS v1.4 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/MKS%20GEN%20L%20V2.1/MKS%20GEN_L%20V2.1_001%20SCH.pdf
+ * Origin: https://github.com/makerbase-mks/MKS-GEN_L/blob/master/hardware/MKS%20Gen_L%20V2.1_001/MKS%20GEN_L%20V2.1_001%20SCH.pdf
+ * ATmega2560
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_ORTUR_4.h b/Marlin/src/pins/ramps/pins_ORTUR_4.h
index e47bae1915..7f0fe93084 100644
--- a/Marlin/src/pins/ramps/pins_ORTUR_4.h
+++ b/Marlin/src/pins/ramps/pins_ORTUR_4.h
@@ -23,6 +23,7 @@
/**
* Ortur 4 Arduino Mega based on RAMPS v1.4 pin assignments
+ * ATmega2560
*/
#define BOARD_INFO_NAME "Ortur 4.3"
diff --git a/Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h b/Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h
index 12c40c7dca..ee0633992e 100644
--- a/Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h
+++ b/Marlin/src/pins/ramps/pins_PXMALION_CORE_I3.h
@@ -22,6 +22,7 @@
/**
* Pxmalion Core i3 - https://github.com/Pxmalion
+ * ATmega2560
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h
index 43780d8d27..08d6475c5e 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS.h
@@ -23,6 +23,7 @@
/**
* Arduino Mega with RAMPS v1.4 (or v1.3) pin assignments
+ * ATmega2560, ATmega1280
*
* Applies to the following boards:
*
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_13.h b/Marlin/src/pins/ramps/pins_RAMPS_13.h
index 6e7c8cbab5..026492e4a8 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_13.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_13.h
@@ -23,6 +23,7 @@
/**
* Arduino Mega with RAMPS v1.3 pin assignments
+ * ATmega2560, ATmega1280
*
* Applies to the following boards:
*
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h
index 3d5f5d6f91..5e4366e259 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_CREALITY.h
@@ -21,6 +21,8 @@
*/
#pragma once
+// ATmega2560
+
#if HOTENDS > 2 || E_STEPPERS > 2
#error "Creality RAMPS supports up to 2 hotends / E steppers."
#endif
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h
index 8f9148b732..3ffa940c48 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_ENDER_4.h
@@ -21,6 +21,8 @@
*/
#pragma once
+// ATmega2560
+
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "Ender-4 only supports 1 hotend / E stepper."
#endif
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_OLD.h b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h
index 9747666235..526045c155 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_OLD.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_OLD.h
@@ -23,6 +23,7 @@
/**
* Arduino Mega with RAMPS v1.0, v1.1, v1.2 pin assignments
+ * ATmega2560, ATmega1280
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h
index 8ccb14c866..f93c6919d9 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_PLUS.h
@@ -23,6 +23,7 @@
/**
* Arduino Mega with RAMPS v1.4Plus, also known as 3DYMY version, pin assignments
+ * ATmega2560, ATmega1280
*
* Applies to the following boards:
*
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
index 8d6a1d337e..e74480a0d4 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
@@ -24,6 +24,7 @@
/**
* Arduino Mega with RAMPS-S v1.2 by Sakul.cz pin assignments
* Written by Michal Rábek
+ * ATmega2560
*
* Applies to the following boards:
*
diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h
index 273e0274a8..d1824d3813 100644
--- a/Marlin/src/pins/ramps/pins_RIGIDBOARD.h
+++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD.h
@@ -23,6 +23,7 @@
/**
* RIGIDBOARD Arduino Mega with RAMPS v1.4 pin assignments
+ * ATmega2560, ATmega1280
*/
#ifndef BOARD_INFO_NAME
diff --git a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h
index 8242f1a772..dc27378a15 100644
--- a/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h
+++ b/Marlin/src/pins/ramps/pins_RIGIDBOARD_V2.h
@@ -23,6 +23,7 @@
/**
* RIGIDBOARD V2 Arduino Mega with RAMPS v1.4 pin assignments
+ * ATmega2560, ATmega1280
*/
#define BOARD_INFO_NAME "RigidBoard V2"
diff --git a/Marlin/src/pins/ramps/pins_RL200.h b/Marlin/src/pins/ramps/pins_RL200.h
index 00fb39a439..219a3a525d 100644
--- a/Marlin/src/pins/ramps/pins_RL200.h
+++ b/Marlin/src/pins/ramps/pins_RL200.h
@@ -24,6 +24,7 @@
/**
* Rapide Lite 200 v1 (RUMBA clone) pin assignments. Has slightly different assignment for
* extruder motors due to dual Z motors. Pinout therefore based on pins_RUMBA.h.
+ * ATmega2560
*/
#define BOARD_INFO_NAME "RL200"
diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h
index eb049c48dd..6b1f4c5691 100644
--- a/Marlin/src/pins/ramps/pins_RUMBA.h
+++ b/Marlin/src/pins/ramps/pins_RUMBA.h
@@ -23,6 +23,9 @@
/**
* RUMBA pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/RUMBA/RRD-RUMBA_SCHEMATICS.png
+ * Origin: https://reprap.org/wiki/File:RRD-RUMBA_SCHEMATICS.png
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h b/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h
index 39942613ff..57ee32ab29 100644
--- a/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h
+++ b/Marlin/src/pins/ramps/pins_RUMBA_RAISE3D.h
@@ -21,6 +21,8 @@
*/
#pragma once
+// ATmega2560
+
#define BOARD_INFO_NAME "Raise3D Rumba"
#define DEFAULT_MACHINE_NAME "Raise3D N Series"
diff --git a/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h
index d25029a7a3..6354cc7618 100644
--- a/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h
+++ b/Marlin/src/pins/ramps/pins_SAINSMART_2IN1.h
@@ -23,13 +23,14 @@
/**
* Sainsmart 2-in-1 pin assignments
+ * ATmega2560, ATmega1280
*/
#if HOTENDS > 2 || E_STEPPERS > 2
#error "Sainsmart 2-in-1 supports up to 2 hotends / E steppers."
#endif
-#define BOARD_INFO_NAME "Sainsmart"
+#define BOARD_INFO_NAME "Sainsmart 2-in-1"
//
// Heaters / Fans
diff --git a/Marlin/src/pins/ramps/pins_TANGO.h b/Marlin/src/pins/ramps/pins_TANGO.h
index 451d2f874d..936751e9eb 100644
--- a/Marlin/src/pins/ramps/pins_TANGO.h
+++ b/Marlin/src/pins/ramps/pins_TANGO.h
@@ -23,6 +23,9 @@
/**
* BIQU Tango pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/BIQU%20Tango/schematic.png
+ * Origin: https://github.com/bigtreetech/Tango-3D-Printer-Motherboard/blob/master/Schematic/Tango%20V1.0.SchDoc
+ * ATmega2560
*/
#define BOARD_INFO_NAME "Tango"
diff --git a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h
index b11487b21d..dd6fb2fa70 100644
--- a/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h
+++ b/Marlin/src/pins/ramps/pins_TENLOG_D3_HERO.h
@@ -22,7 +22,8 @@
#pragma once
/**
- * Tenlog pin assignments
+ * Tenlog D3 Hero pin assignments
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_TENLOG_MB1_V23.h b/Marlin/src/pins/ramps/pins_TENLOG_MB1_V23.h
index b3f7d5f216..780ab8daa4 100644
--- a/Marlin/src/pins/ramps/pins_TENLOG_MB1_V23.h
+++ b/Marlin/src/pins/ramps/pins_TENLOG_MB1_V23.h
@@ -22,7 +22,8 @@
#pragma once
/**
- * Tenlog pin assignments
+ * Tenlog MB1 V2.3 pin assignments
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h
index 6e51a8e974..83dac111cb 100644
--- a/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h
+++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_13.h
@@ -23,6 +23,7 @@
/**
* Arduino Mega with RAMPS v1.3 for Anycubic
+ * ATmega2560
*/
#define BOARD_INFO_NAME "Anycubic RAMPS 1.3"
diff --git a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h
index 96c3fced4c..f9856e04f5 100644
--- a/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h
+++ b/Marlin/src/pins/ramps/pins_TRIGORILLA_14.h
@@ -23,6 +23,7 @@
/**
* Arduino Mega with RAMPS v1.4 for Anycubic
+ * ATmega2560
*/
#define BOARD_INFO_NAME "Anycubic RAMPS 1.4"
diff --git a/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h b/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h
index 04c6af67b0..0104dadf7f 100644
--- a/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h
+++ b/Marlin/src/pins/ramps/pins_TRONXY_V3_1_0.h
@@ -23,6 +23,7 @@
/**
* Arduino Mega for Tronxy X5S-2E, etc.
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
index ecc708b395..c0247c7b47 100644
--- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h
+++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
@@ -21,10 +21,12 @@
*/
#pragma once
+// ATmega2560
+
#include "env_validate.h"
#if HOTENDS > 5 || E_STEPPERS > 5
- #error "TTOSCAR supports up to 5 hotends / E steppers."
+ #error "TT OSCAR supports up to 5 hotends / E steppers."
#endif
#define BOARD_INFO_NAME "TT OSCAR"
diff --git a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h
index 0b15cd35ad..4ee0a6950d 100644
--- a/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h
+++ b/Marlin/src/pins/ramps/pins_ULTIMAIN_2.h
@@ -23,6 +23,25 @@
/**
* Ultiboard v2.0 pin assignments
+ * Schematics (2.1.4):
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema1.png
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema2.png
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema3.png
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema4.png
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%202.1.4/schema5.png
+ * Origins (2.1.4):
+ * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema1.SchDoc
+ * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema2.SchDoc
+ * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema3.SchDoc
+ * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema4.SchDoc
+ * - https://github.com/Ultimaker/Ultimaker2/blob/master/1546%20ultimainboard%20V2.1.4/schema5.SchDoc
+ * Schematics (Original+):
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema1.png
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema2.png
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema3.png
+ * - https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%20Original+/Ultimainboard%20rev.%202.1.1%20altium/schema4.png
+ * Origin (Original+): https://github.com/Ultimaker/Ultimaker-Original-Plus/blob/master/1091_Main_board_v2.1.1_(x1)/Ultimainboard%20rev.%202.1.1%20altium.zip
+ * ATmega2560
*/
/**
diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h
index 0bc04d962a..e3e91428df 100644
--- a/Marlin/src/pins/ramps/pins_ULTIMAKER.h
+++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h
@@ -23,6 +23,7 @@
/**
* Ultimaker pin assignments
+ * ATmega2560, ATmega1280
*/
/**
diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
index 146c519ff9..25cc278ada 100644
--- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
+++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
@@ -23,6 +23,9 @@
/**
* Ultimaker pin assignments (Old electronics)
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%201.0/ultipanel%20rev1.1.sch.pdf
+ * Origin: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/Ultimaker%201.0/ultipanel%20rev1.1.sch.pdf
+ * ATmega2560, ATmega1280
*/
/**
diff --git a/Marlin/src/pins/ramps/pins_VORON.h b/Marlin/src/pins/ramps/pins_VORON.h
index 9390381010..f56b0cb8fc 100644
--- a/Marlin/src/pins/ramps/pins_VORON.h
+++ b/Marlin/src/pins/ramps/pins_VORON.h
@@ -24,6 +24,7 @@
/**
* VORON Design v2 pin assignments
* See https://github.com/mzbotreprap/VORON/blob/master/Firmware/Marlin/pins_RAMPS_VORON.h
+ * ATmega2560
*/
#define BOARD_INFO_NAME "VORON Design v2"
diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V20.h b/Marlin/src/pins/ramps/pins_ZRIB_V20.h
index 3e236e36ba..127fffa794 100644
--- a/Marlin/src/pins/ramps/pins_ZRIB_V20.h
+++ b/Marlin/src/pins/ramps/pins_ZRIB_V20.h
@@ -22,8 +22,13 @@
#pragma once
/**
- * ZRIB V2.0 & V3.0 pin assignments
+ * ZONESTAR ZRIB V2.0 & V3.0 pin assignments
* V2 and V3 Boards only differ in USB controller, nothing affecting the pins.
+ * Schematic (2.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/ZONESTAR%20ZRIB%20V2.0/ZRIB_V2_Schematic.pdf
+ * Origin (2.0): https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V2/ZRIB_V2_Schematic.pdf
+ * Schematic (3.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/ZONESTAR%20ZRIB%20V3.0/ZRIB_V3_Schematic.pdf
+ * Origin (3.0): https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V3/ZRIB_V3_Schematic.pdf
+ * ATmega2560, ATmega1280
*/
#ifndef FILWIDTH_PIN
diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V52.h b/Marlin/src/pins/ramps/pins_ZRIB_V52.h
index 44e0beaa9f..34eee07c95 100644
--- a/Marlin/src/pins/ramps/pins_ZRIB_V52.h
+++ b/Marlin/src/pins/ramps/pins_ZRIB_V52.h
@@ -22,7 +22,10 @@
#pragma once
/**
- * ZRIB V5.2 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping
+ * ZONESTAR ZRIB V5.2 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/RAMPS/ZONESTAR%20ZRIB%20V5.2/ZRIB_V52_Schematic.pdf
+ * Origin: https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZRIB/ZRIB_V5/ZRIB_V52_Schematic.pdf
+ * ATmega2560, ATmega1280
*/
#if HOTENDS > 2 || E_STEPPERS > 2
diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V53.h b/Marlin/src/pins/ramps/pins_ZRIB_V53.h
index 7a5cf14791..050516791e 100644
--- a/Marlin/src/pins/ramps/pins_ZRIB_V53.h
+++ b/Marlin/src/pins/ramps/pins_ZRIB_V53.h
@@ -22,7 +22,8 @@
#pragma once
/**
- * ZRIB V5.3 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping
+ * ZONESTAR ZRIB V5.3 Based on MKS BASE v1.4 with A4982 stepper drivers and digital micro-stepping
+ * ATmega2560, ATmega1280
*/
#include "env_validate.h"
diff --git a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
index ad7b859a0c..1c67903a21 100644
--- a/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
+++ b/Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h
@@ -23,6 +23,7 @@
/**
* Z-Bolt X Series board – based on Arduino Mega2560
+ * ATmega2560
*/
#define REQUIRE_MEGA2560
diff --git a/Marlin/src/pins/sanguino/pins_ANET_10.h b/Marlin/src/pins/sanguino/pins_ANET_10.h
index bd69e167dc..f6816bfb95 100644
--- a/Marlin/src/pins/sanguino/pins_ANET_10.h
+++ b/Marlin/src/pins/sanguino/pins_ANET_10.h
@@ -23,6 +23,8 @@
/**
* Anet V1.0 board pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Anet%20V1.0/ANET3D_Board_Schematic.pdf
+ * Origin: https://github.com/ralf-e/ANET-3D-Board-V1.0/blob/master/ANET3D_Board_Schematic.pdf
*/
/**
diff --git a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h
index 4c721da000..76d53c6021 100644
--- a/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h
+++ b/Marlin/src/pins/sanguino/pins_AZTEEG_X1.h
@@ -23,6 +23,8 @@
/**
* Azteeg X1 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Azteeg%20X1/Azteeg_X1_schematics.pdf
+ * Origin: https://reprap.org/mediawiki/images/0/07/Azteeg_X1_schematics.pdf
*/
#define BOARD_INFO_NAME "Azteeg X1"
diff --git a/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h b/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h
index 1343739a11..a5afc30187 100644
--- a/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h
+++ b/Marlin/src/pins/sanguino/pins_GEN3_MONOLITHIC.h
@@ -23,6 +23,7 @@
/**
* Gen3 Monolithic Electronics pin assignments
+ * https://reprap.org/wiki/Generation_3_Electronics
*/
/**
diff --git a/Marlin/src/pins/sanguino/pins_GEN6.h b/Marlin/src/pins/sanguino/pins_GEN6.h
index 51e8200b95..75138845f4 100644
--- a/Marlin/src/pins/sanguino/pins_GEN6.h
+++ b/Marlin/src/pins/sanguino/pins_GEN6.h
@@ -23,6 +23,8 @@
/**
* Gen6 pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen6/GEN6_Mendel_Circuit.pdf
+ * Origin: https://reprap.org/mediawiki/images/0/0f/GEN6_Mendel_Circuit.pdf
*/
/**
diff --git a/Marlin/src/pins/sanguino/pins_GEN7_12.h b/Marlin/src/pins/sanguino/pins_GEN7_12.h
index 0834da78c4..ade59fd807 100644
--- a/Marlin/src/pins/sanguino/pins_GEN7_12.h
+++ b/Marlin/src/pins/sanguino/pins_GEN7_12.h
@@ -23,6 +23,14 @@
/**
* Gen7 v1.1, v1.2, v1.3 pin assignments
+ * Schematic (1.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.1/Gen7Board%20Schematic.pdf
+ * Origin (1.1): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.1/release%20documents/Gen7Board%20Schematic.pdf
+ * Schematic (1.2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.2/Gen7Board%20Schematic.pdf
+ * Origin (1.2): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.2/release%20documents/Gen7Board%20Schematic.pdf
+ * Schematic (1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.3/Gen7Board%20Schematic.pdf
+ * Origin (1.3): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.3/release%20documents/Gen7Board%20Schematic.pdf
+ * Schematic (1.3.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.3.1/Gen7Board%20Schematic.pdf
+ * Origin (1.3.1): https://github.com/Traumflug/Generation_7_Electronics/blob/release-1.3.1/release%20documents/Gen7Board%20Schematic.pdf
*/
/**
@@ -54,7 +62,7 @@
#include "env_validate.h"
#ifndef BOARD_INFO_NAME
- #define BOARD_INFO_NAME "Gen7 v1.1 / 1.2"
+ #define BOARD_INFO_NAME "Gen7 v1.1 - v1.3"
#endif
#ifndef GEN7_VERSION
diff --git a/Marlin/src/pins/sanguino/pins_GEN7_14.h b/Marlin/src/pins/sanguino/pins_GEN7_14.h
index 97bfdd28a7..698bd06606 100644
--- a/Marlin/src/pins/sanguino/pins_GEN7_14.h
+++ b/Marlin/src/pins/sanguino/pins_GEN7_14.h
@@ -23,6 +23,10 @@
/**
* Gen7 v1.4 pin assignments
+ * Schematic (1.4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.4/Gen7Board%201.4%20Schematic.pdf
+ * Origin (1.4): https://github.com/Traumflug/Generation_7_Electronics/blob/Gen7Board-1.4/release%20documents/Gen7Board%201.4%20Schematic.pdf
+ * Schematic (1.4.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Gen7%20v1.4.1/Gen7Board%201.4.1%20Schematic.pdf
+ * Origin (1.4.1): https://github.com/Traumflug/Generation_7_Electronics/blob/Gen7Board-1.4.1/release%20documents/Gen7Board%201.4.1%20Schematic.pdf
*/
/**
diff --git a/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h
index d6f9288e8c..be1b7934c8 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI.h
@@ -23,6 +23,8 @@
/**
* Melzi pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Melzi/schematic.pdf
+ * Origin: https://github.com/mosfet/melzi/blob/master/melzi.sch
*/
#ifndef BOARD_INFO_NAME
diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
index acaf06ed9d..a61692c9f1 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
@@ -23,6 +23,9 @@
/**
* Melzi (Creality) pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Melzi%20(Creality)/CR-10%20Schematic.pdf
+ * Origin: https://github.com/Creality3DPrinting/CR10-Melzi-1.1.2/blob/master/Circuit%20diagram/Motherboard/CR-10%20Schematic.pdf
+ * ATmega1284P
*
* The Creality board needs a bootloader installed before Marlin can be uploaded.
* If you don't have a chip programmer you can use a spare Arduino plus a few
diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h
index d6f36cc6f5..00c9db6f81 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h
@@ -23,6 +23,7 @@
/**
* Melzi (Malyan M150) pin assignments
+ * ATmega644P, ATmega1284P
*/
#define BOARD_INFO_NAME "Melzi (Malyan)"
diff --git a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h
index aecad10dab..da010ab1a6 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h
@@ -23,6 +23,7 @@
/**
* Melzi pin assignments
+ * ATmega644P, ATmega1284P
*/
#define BOARD_INFO_NAME "Melzi (Tronxy)"
diff --git a/Marlin/src/pins/sanguino/pins_MELZI_V2.h b/Marlin/src/pins/sanguino/pins_MELZI_V2.h
index e49eb57b11..2cd949e095 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI_V2.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI_V2.h
@@ -23,6 +23,8 @@
/**
* Melzi V2.0 as found at https://www.reprap.org/wiki/Melzi
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Melzi%20V2/Melzi-circuit.png
+ * Origin: https://www.reprap.org/mediawiki/images/7/7d/Melzi-circuit.png
*/
#define BOARD_INFO_NAME "Melzi V2"
diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
index 6444e2e040..a8475fb326 100644
--- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
+++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
@@ -23,6 +23,16 @@
/**
* Sanguinololu board pin assignments
+ * Schematic (0.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v0.1/schematic.png
+ * Origin (0.1): https://github.com/mosfet/Sanguinololu/blob/master/rev0.1/sanguinololu.sch
+ * Schematic (0.6): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v0.6/schematic.jpg
+ * Origin (0.6): https://github.com/mosfet/Sanguinololu/blob/master/rev0.6/images/schematic.jpg
+ * Schematic (0.7): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v0.7/schematic.jpg
+ * Origin (0.7): https://github.com/mosfet/Sanguinololu/blob/master/rev0.7/images/schematic.jpg
+ * Schematic (1.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.0/Sanguinololu-schematic.jpg
+ * Origin (1.0): https://reprap.org/wiki/File:Sanguinololu-schematic.jpg
+ * Schematic (1.1): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.1/schematic.png
+ * Origin (1.1): https://github.com/mosfet/Sanguinololu/blob/master/rev1.1/sanguinololu.sch
*/
/**
diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h
index ec7621e28f..2209569261 100644
--- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h
+++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_12.h
@@ -23,6 +23,12 @@
/**
* Sanguinololu V1.2 pin assignments
+ * Schematic (1.2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.2/schematic.png
+ * Origin (1.2): https://github.com/mosfet/Sanguinololu/blob/master/rev1.2/sanguinololu.sch
+ * Schematic (1.3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.3/schematic.png
+ * Origin (1.3): https://github.com/mosfet/Sanguinololu/blob/master/rev1.3/sanguinololu.sch
+ * Schematic (1.3a): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Sanguinololu%20v1.3a/schematic.png
+ * Origin (1.3a): https://github.com/mosfet/Sanguinololu/blob/master/rev1.3a/sanguinololu.sch
*
* Applies to the following boards:
*
diff --git a/Marlin/src/pins/sanguino/pins_STB_11.h b/Marlin/src/pins/sanguino/pins_STB_11.h
index ad0919e99e..1bda25b3d4 100644
--- a/Marlin/src/pins/sanguino/pins_STB_11.h
+++ b/Marlin/src/pins/sanguino/pins_STB_11.h
@@ -22,7 +22,8 @@
#pragma once
/**
- * STB V1.1 pin assignments
+ * STB Electronics V1.1 pin assignments
+ * https://www.reprap.org/wiki/STB_Electronics
*/
#define BOARD_INFO_NAME "STB V1.1"
diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h
index aa3ce556d1..bd9230c32a 100644
--- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h
+++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h
@@ -31,6 +31,8 @@
/**
* ZMIB pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/ZONESTAR%20ZMIB%20V2/ZMIB_V2_Schmatic.pdf
+ * Origin: https://github.com/ZONESTAR3D/Control-Board/blob/main/8bit/ZMIB/ZMIB%20V2/ZMIB_V2_Schmatic.pdf
*
* The ZMIB board needs a bootloader installed before Marlin can be uploaded.
* If you don't have a chip programmer you can use a spare Arduino plus a few
diff --git a/Marlin/src/pins/teensy2/pins_5DPRINT.h b/Marlin/src/pins/teensy2/pins_5DPRINT.h
index 6e1f9c0217..9eb1da36f4 100644
--- a/Marlin/src/pins/teensy2/pins_5DPRINT.h
+++ b/Marlin/src/pins/teensy2/pins_5DPRINT.h
@@ -64,6 +64,8 @@
/**
* 5DPrint D8 Driver board pin assignments
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/5DPrint%20D8/5DPD8_v1.0_OS_schematics.PDF
+ * Origin: https://bitbucket.org/makible/5dprint-d8-controller-board/src/master/5DPD8_v1.0_OS_schematics.PDF
*
* https://bitbucket.org/makible/5dprint-d8-controller-board
*/
diff --git a/Marlin/src/pins/teensy2/pins_BRAINWAVE.h b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h
index cdcc249c00..bbda3730ee 100644
--- a/Marlin/src/pins/teensy2/pins_BRAINWAVE.h
+++ b/Marlin/src/pins/teensy2/pins_BRAINWAVE.h
@@ -23,9 +23,13 @@
/**
* Brainwave 1.0 pin assignments (AT90USB646)
+ * https://www.reprap.org/wiki/Brainwave
*
* Requires hardware bundle for Arduino:
* https://github.com/unrepentantgeek/brainwave-arduino
+ *
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Brainwave/schematic.pdf
+ * Origin: https://github.com/unrepentantgeek/Brainwave/blob/master/brainwave/brainwave.sch
*/
/**
diff --git a/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h b/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h
index 319130ef96..969ec84558 100644
--- a/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h
+++ b/Marlin/src/pins/teensy2/pins_BRAINWAVE_PRO.h
@@ -26,6 +26,8 @@
*
* Requires hardware bundle for Arduino:
* https://github.com/unrepentantgeek/brainwave-arduino
+ *
+ * Not to be confused with the regular Brainwave controller (https://www.reprap.org/wiki/Brainwave)
*/
/**
diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h
index ddf0d53ea6..1fb7387d16 100644
--- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h
+++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h
@@ -25,6 +25,15 @@
* Rev B 2 JUN 2017
*
* Converted to Arduino pin numbering
+ *
+ * Schematic (RevA): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.A/schematic.png
+ * Origin (RevA): https://raw.githubusercontent.com/lwalkera/printrboard/revA/Printrboard.sch
+ * Schematic (RevB): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.B/schematic.png
+ * Origin (RevB): https://raw.githubusercontent.com/lwalkera/printrboard/revB/Printrboard.sch
+ * Schematic (RevC): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.C/schematic.png
+ * Origin (RevC): https://raw.githubusercontent.com/lwalkera/printrboard/revC/Printrboard.sch
+ * Schematic (RevD): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.D/schematic.png
+ * Origin (RevD): https://raw.githubusercontent.com/lwalkera/printrboard/RevD/Printrboard.sch
*/
/**
diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h
index 1867398087..5ce106b485 100644
--- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h
+++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD_REVF.h
@@ -25,6 +25,19 @@
* Rev B 2 JUN 2017
*
* Converted to Arduino pin numbering
+ *
+ * Schematic (RevF): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F/schematic.png
+ * Origin (RevF): https://github.com/lwalkera/printrboard/raw/revF/Printrboard.sch
+ * Schematic (RevF2): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F2/schematic.png
+ * Origin (RevF2): https://raw.githubusercontent.com/lwalkera/printrboard/revF2/Printrboard.sch
+ * Schematic (RevF3): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F3/schematic.png
+ * Origin (RevF3): https://raw.githubusercontent.com/lwalkera/printrboard/revF3/Printrboard.sch
+ * Schematic (RevF4): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F4/schematic.png
+ * Origin (RevF4): https://raw.githubusercontent.com/lwalkera/printrboard/revF4/Printrboard.sch
+ * Schematic (RevF5): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F5/schematic.png
+ * Origin (RevF5): https://raw.githubusercontent.com/lwalkera/printrboard/revF5/Printrboard.sch
+ * Schematic (RevF6): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Printrboard%20Rev.F6/schematic.png
+ * Origin (RevF6): https://raw.githubusercontent.com/lwalkera/printrboard/revF6/Printrboard.sch
*/
/**
diff --git a/Marlin/src/pins/teensy2/pins_SAV_MKI.h b/Marlin/src/pins/teensy2/pins_SAV_MKI.h
index cdba535090..a469bba59b 100644
--- a/Marlin/src/pins/teensy2/pins_SAV_MKI.h
+++ b/Marlin/src/pins/teensy2/pins_SAV_MKI.h
@@ -25,6 +25,9 @@
* Rev B 2 JUN 2017
*
* Converted to Arduino pin numbering
+ *
+ * Schematic: https://green-candy.osdn.jp/external/MarlinFW/board_schematics/SAV%20MkI/SAV_MK-I.pdf
+ * Origin: https://reprap.org/mediawiki/images/3/3c/SAV_MK-I.pdf
*/
/**
diff --git a/Marlin/src/pins/teensy2/pins_TEENSY2.h b/Marlin/src/pins/teensy2/pins_TEENSY2.h
index efb409bf32..b95e9cae48 100644
--- a/Marlin/src/pins/teensy2/pins_TEENSY2.h
+++ b/Marlin/src/pins/teensy2/pins_TEENSY2.h
@@ -109,6 +109,7 @@
#include "env_validate.h"
+// https://reprap.org/wiki/Teensy_Breadboard
#define BOARD_INFO_NAME "Teensy++2.0"
//
diff --git a/Marlin/src/pins/teensy2/pins_TEENSYLU.h b/Marlin/src/pins/teensy2/pins_TEENSYLU.h
index ab722478fd..294a289cdb 100644
--- a/Marlin/src/pins/teensy2/pins_TEENSYLU.h
+++ b/Marlin/src/pins/teensy2/pins_TEENSYLU.h
@@ -24,6 +24,10 @@
* Rev C 2 JUN 2017
*
* Converted to Arduino pin numbering
+ *
+ * Schematic (1.0): https://green-candy.osdn.jp/external/MarlinFW/board_schematics/Teensylu%20v1.0/schematic.png
+ * Origin (1.0): https://raw.githubusercontent.com/StephS/Teensylu/master/working/Teensylu-1.0.sch
+ * (*) Other versions are discouraged by creator.
*/
/**
From 50b62975231fe08001c79953c796f9b371da88ad Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 24 Mar 2023 02:42:10 -0500
Subject: [PATCH 068/225] =?UTF-8?q?=F0=9F=8E=A8=20Wrap=20font=20includes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Martin Turski
---
Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Helvetica/helvetica_14.cpp | 3 ++-
.../tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp | 3 ++-
.../fontdata/NotoSans/Medium_14px/NotoSans_Medium_ASCII_14.cpp | 3 ++-
.../NotoSans/Medium_14px/NotoSans_Medium_Cyrillic_14.cpp | 3 ++-
.../fontdata/NotoSans/Medium_14px/NotoSans_Medium_Greek_14.cpp | 3 ++-
.../NotoSans/Medium_14px/NotoSans_Medium_Katakana_14.cpp | 3 ++-
.../NotoSans/Medium_14px/NotoSans_Medium_Korean_14.cpp | 3 ++-
.../Medium_14px/NotoSans_Medium_Latin_Extended_A_14.cpp | 3 ++-
.../Medium_14px/NotoSans_Medium_Simplified_Chinese_14.cpp | 3 ++-
.../NotoSans/Medium_14px/NotoSans_Medium_Symbols_14.cpp | 3 ++-
.../Medium_14px/NotoSans_Medium_Traditional_Chinese_14.cpp | 3 ++-
.../NotoSans/Medium_14px/NotoSans_Medium_Vietnamese_14.cpp | 3 ++-
.../tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp | 3 ++-
.../fontdata/NotoSans/Medium_16px/NotoSans_Medium_ASCII_16.cpp | 3 ++-
.../NotoSans/Medium_16px/NotoSans_Medium_Cyrillic_16.cpp | 3 ++-
.../fontdata/NotoSans/Medium_16px/NotoSans_Medium_Greek_16.cpp | 3 ++-
.../NotoSans/Medium_16px/NotoSans_Medium_Katakana_16.cpp | 3 ++-
.../NotoSans/Medium_16px/NotoSans_Medium_Korean_16.cpp | 3 ++-
.../Medium_16px/NotoSans_Medium_Latin_Extended_A_16.cpp | 3 ++-
.../Medium_16px/NotoSans_Medium_Simplified_Chinese_16.cpp | 3 ++-
.../NotoSans/Medium_16px/NotoSans_Medium_Symbols_16.cpp | 3 ++-
.../Medium_16px/NotoSans_Medium_Traditional_Chinese_16.cpp | 3 ++-
.../NotoSans/Medium_16px/NotoSans_Medium_Vietnamese_16.cpp | 3 ++-
.../tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp | 3 ++-
.../fontdata/NotoSans/Medium_19px/NotoSans_Medium_ASCII_19.cpp | 3 ++-
.../NotoSans/Medium_19px/NotoSans_Medium_Cyrillic_19.cpp | 3 ++-
.../fontdata/NotoSans/Medium_19px/NotoSans_Medium_Greek_19.cpp | 3 ++-
.../NotoSans/Medium_19px/NotoSans_Medium_Katakana_19.cpp | 3 ++-
.../NotoSans/Medium_19px/NotoSans_Medium_Korean_19.cpp | 3 ++-
.../Medium_19px/NotoSans_Medium_Latin_Extended_A_19.cpp | 3 ++-
.../Medium_19px/NotoSans_Medium_Simplified_Chinese_19.cpp | 3 ++-
.../NotoSans/Medium_19px/NotoSans_Medium_Symbols_19.cpp | 3 ++-
.../Medium_19px/NotoSans_Medium_Traditional_Chinese_19.cpp | 3 ++-
.../NotoSans/Medium_19px/NotoSans_Medium_Vietnamese_19.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_ASCII_10.cpp | 3 ++-
.../src/lcd/tft/fontdata/Unifont/10px/Unifont_Cyrillic_10.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Greek_10.cpp | 3 ++-
.../src/lcd/tft/fontdata/Unifont/10px/Unifont_Katakana_10.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Korean_10.cpp | 3 ++-
.../tft/fontdata/Unifont/10px/Unifont_Latin_Extended_A_10.cpp | 3 ++-
.../fontdata/Unifont/10px/Unifont_Simplified_Chinese_10.cpp | 3 ++-
.../src/lcd/tft/fontdata/Unifont/10px/Unifont_Symbols_10.cpp | 3 ++-
.../fontdata/Unifont/10px/Unifont_Traditional_Chinese_10.cpp | 3 ++-
.../lcd/tft/fontdata/Unifont/10px/Unifont_Vietnamese_10.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_ASCII_20.cpp | 3 ++-
.../src/lcd/tft/fontdata/Unifont/20px/Unifont_Cyrillic_20.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Greek_20.cpp | 3 ++-
.../src/lcd/tft/fontdata/Unifont/20px/Unifont_Katakana_20.cpp | 3 ++-
Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Korean_20.cpp | 3 ++-
.../tft/fontdata/Unifont/20px/Unifont_Latin_Extended_A_20.cpp | 3 ++-
.../fontdata/Unifont/20px/Unifont_Simplified_Chinese_20.cpp | 3 ++-
.../src/lcd/tft/fontdata/Unifont/20px/Unifont_Symbols_20.cpp | 3 ++-
.../fontdata/Unifont/20px/Unifont_Traditional_Chinese_20.cpp | 3 ++-
.../lcd/tft/fontdata/Unifont/20px/Unifont_Vietnamese_20.cpp | 3 ++-
57 files changed, 114 insertions(+), 57 deletions(-)
diff --git a/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp b/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp
index 5b4570d010..ab2f91577a 100644
--- a/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp
@@ -34,7 +34,8 @@
#include "../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define HELVETICA 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == HELVETICA
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Helvetica/helvetica_14.cpp b/Marlin/src/lcd/tft/fontdata/Helvetica/helvetica_14.cpp
index 44e7d40a27..2fbf812369 100644
--- a/Marlin/src/lcd/tft/fontdata/Helvetica/helvetica_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Helvetica/helvetica_14.cpp
@@ -34,7 +34,8 @@
#include "../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define HELVETICA 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == HELVETICA
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp
index 9a54351762..d9bdde8b2d 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_ASCII_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_ASCII_14.cpp
index 3db57d8ebe..0d452c9441 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_ASCII_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_ASCII_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Cyrillic_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Cyrillic_14.cpp
index f02086646c..7c1fc2ac4e 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Cyrillic_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Cyrillic_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Greek_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Greek_14.cpp
index cbb789870d..bb0cec7aca 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Greek_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Greek_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Katakana_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Katakana_14.cpp
index ae167c2c08..eda142fef1 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Katakana_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Katakana_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Korean_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Korean_14.cpp
index 7d69f85f4a..258ccf8799 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Korean_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Korean_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Latin_Extended_A_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Latin_Extended_A_14.cpp
index 4ff175700f..d736d12c17 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Latin_Extended_A_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Latin_Extended_A_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Simplified_Chinese_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Simplified_Chinese_14.cpp
index 01c7638e37..04825f3659 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Simplified_Chinese_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Simplified_Chinese_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Symbols_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Symbols_14.cpp
index 07f3359dc4..a806753a97 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Symbols_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Symbols_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Traditional_Chinese_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Traditional_Chinese_14.cpp
index 63ea2fc74b..863d0c2805 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Traditional_Chinese_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Traditional_Chinese_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Vietnamese_14.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Vietnamese_14.cpp
index dd6603f682..6a363582e1 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Vietnamese_14.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_14px/NotoSans_Medium_Vietnamese_14.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp
index 1369901338..08ec0bf9d0 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_ASCII_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_ASCII_16.cpp
index 0da231be38..cac0216a75 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_ASCII_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_ASCII_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Cyrillic_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Cyrillic_16.cpp
index 36ca1df547..58ecea399f 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Cyrillic_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Cyrillic_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Greek_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Greek_16.cpp
index ff3ef3f843..f20b747cc4 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Greek_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Greek_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Katakana_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Katakana_16.cpp
index a159a26947..18c9345ca3 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Katakana_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Katakana_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Korean_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Korean_16.cpp
index 26e6799a89..3839ed419e 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Korean_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Korean_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Latin_Extended_A_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Latin_Extended_A_16.cpp
index 0617ee2758..afce518424 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Latin_Extended_A_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Latin_Extended_A_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Simplified_Chinese_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Simplified_Chinese_16.cpp
index cd9c617c75..aa76df275a 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Simplified_Chinese_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Simplified_Chinese_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Symbols_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Symbols_16.cpp
index ef20a4bcc6..63a2a7d071 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Symbols_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Symbols_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Traditional_Chinese_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Traditional_Chinese_16.cpp
index 177e741825..606625646b 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Traditional_Chinese_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Traditional_Chinese_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Vietnamese_16.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Vietnamese_16.cpp
index 16cee9a7a2..3905fba3e9 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Vietnamese_16.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_16px/NotoSans_Medium_Vietnamese_16.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp
index c04f1c6d2d..925254e7f8 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_ASCII_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_ASCII_19.cpp
index 417db3946f..97ef16cf44 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_ASCII_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_ASCII_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Cyrillic_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Cyrillic_19.cpp
index 413141c3b1..dba08111ce 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Cyrillic_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Cyrillic_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Greek_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Greek_19.cpp
index f4dcd225c8..497e7fa8e8 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Greek_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Greek_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Katakana_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Katakana_19.cpp
index 3f8d4f761a..f5d92c5fd5 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Katakana_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Katakana_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Korean_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Korean_19.cpp
index 7f030d656d..14a0073211 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Korean_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Korean_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Latin_Extended_A_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Latin_Extended_A_19.cpp
index 00d90611fd..ccc23097fe 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Latin_Extended_A_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Latin_Extended_A_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Simplified_Chinese_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Simplified_Chinese_19.cpp
index b5999beb72..86621477e1 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Simplified_Chinese_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Simplified_Chinese_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Symbols_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Symbols_19.cpp
index 5d27793082..d28f2800d6 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Symbols_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Symbols_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Traditional_Chinese_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Traditional_Chinese_19.cpp
index e5fd6077cc..c34f5bb7f1 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Traditional_Chinese_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Traditional_Chinese_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Vietnamese_19.cpp b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Vietnamese_19.cpp
index 1f77fbe874..5ff24ab3b0 100644
--- a/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Vietnamese_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/NotoSans/Medium_19px/NotoSans_Medium_Vietnamese_19.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define NOTOSANS 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == NOTOSANS
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp
index d22ee15a5f..2572cc60c4 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_ASCII_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_ASCII_10.cpp
index d4965cc061..27f3dcf325 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_ASCII_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_ASCII_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Cyrillic_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Cyrillic_10.cpp
index 013a015cca..1e112a1de1 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Cyrillic_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Cyrillic_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Greek_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Greek_10.cpp
index 1febf8b5b3..71375485d2 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Greek_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Greek_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Katakana_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Katakana_10.cpp
index ae2819dba1..1e0d15629d 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Katakana_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Katakana_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Korean_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Korean_10.cpp
index e4516acac2..d1bf3ba514 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Korean_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Korean_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Latin_Extended_A_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Latin_Extended_A_10.cpp
index 6059c6ccdd..8d381d276a 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Latin_Extended_A_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Latin_Extended_A_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Simplified_Chinese_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Simplified_Chinese_10.cpp
index b971dc92a0..3ce396d098 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Simplified_Chinese_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Simplified_Chinese_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Symbols_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Symbols_10.cpp
index 9f804f7d69..8776bfba6c 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Symbols_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Symbols_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Traditional_Chinese_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Traditional_Chinese_10.cpp
index 5f820cf8fc..a9b1406441 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Traditional_Chinese_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Traditional_Chinese_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Vietnamese_10.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Vietnamese_10.cpp
index 66ee7f01f6..d61d1be71b 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Vietnamese_10.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/10px/Unifont_Vietnamese_10.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp
index 9d6847722f..023cc4f978 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_ASCII_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_ASCII_20.cpp
index 1e5d228053..e28b806b9f 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_ASCII_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_ASCII_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Cyrillic_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Cyrillic_20.cpp
index 751b60c43c..8e82a228f1 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Cyrillic_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Cyrillic_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Greek_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Greek_20.cpp
index fee79c3fae..d5c175977a 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Greek_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Greek_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Katakana_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Katakana_20.cpp
index f809a20259..3b21375016 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Katakana_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Katakana_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Korean_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Korean_20.cpp
index 7f750e7fa2..ac8dee91ef 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Korean_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Korean_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Latin_Extended_A_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Latin_Extended_A_20.cpp
index 49b8001826..9a22047c9a 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Latin_Extended_A_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Latin_Extended_A_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Simplified_Chinese_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Simplified_Chinese_20.cpp
index 970d30bec7..85e0d205d7 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Simplified_Chinese_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Simplified_Chinese_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Symbols_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Symbols_20.cpp
index 5f663efc56..a0d269e02f 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Symbols_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Symbols_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Traditional_Chinese_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Traditional_Chinese_20.cpp
index 70359bbc71..c541e1401d 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Traditional_Chinese_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Traditional_Chinese_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Vietnamese_20.cpp b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Vietnamese_20.cpp
index 21fbc29d81..8c9b29153c 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Vietnamese_20.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/20px/Unifont_Vietnamese_20.cpp
@@ -22,7 +22,8 @@
#include "../../../../../inc/MarlinConfigPre.h"
-#if HAS_GRAPHICAL_TFT
+#define UNIFONT 123
+#if HAS_GRAPHICAL_TFT && TFT_FONT == UNIFONT
#include
From 39d08d90cd1aba3fde54dc070531c28bf2dffe53 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 24 Mar 2023 02:43:20 -0500
Subject: [PATCH 069/225] =?UTF-8?q?=F0=9F=8E=A8=20LPC=5FSOFTWARE=5FSPI=20?=
=?UTF-8?q?=3D>=20SOFTWARE=5FSPI?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Martin Turski
---
Marlin/src/HAL/LINUX/spi_pins.h | 8 ++++----
Marlin/src/HAL/LPC1768/HAL_SPI.cpp | 4 ++--
Marlin/src/HAL/LPC1768/spi_pins.h | 8 ++++----
Marlin/src/HAL/NATIVE_SIM/spi_pins.h | 2 +-
Marlin/src/pins/lpc1768/pins_MKS_SBASE.h | 2 +-
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Marlin/src/HAL/LINUX/spi_pins.h b/Marlin/src/HAL/LINUX/spi_pins.h
index 33136ac9dd..9b40651873 100644
--- a/Marlin/src/HAL/LINUX/spi_pins.h
+++ b/Marlin/src/HAL/LINUX/spi_pins.h
@@ -25,10 +25,10 @@
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
- #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
- // needed due to the speed and mode required for communicating with each device being different.
- // This requirement can be removed if the SPI access to these devices is updated to use
- // spiBeginTransaction.
+ #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
+ // needed due to the speed and mode required for communicating with each device being different.
+ // This requirement can be removed if the SPI access to these devices is updated to use
+ // spiBeginTransaction.
#endif
// Onboard SD
diff --git a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp
index 257d8579e2..4d6cb55cff 100644
--- a/Marlin/src/HAL/LPC1768/HAL_SPI.cpp
+++ b/Marlin/src/HAL/LPC1768/HAL_SPI.cpp
@@ -60,7 +60,7 @@
// ------------------------
// Public functions
// ------------------------
-#if ENABLED(LPC_SOFTWARE_SPI)
+#if ENABLED(SOFTWARE_SPI)
// Software SPI
@@ -161,7 +161,7 @@
// TODO: Implement this method
}
-#endif // LPC_SOFTWARE_SPI
+#endif // SOFTWARE_SPI
/**
* @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset.
diff --git a/Marlin/src/HAL/LPC1768/spi_pins.h b/Marlin/src/HAL/LPC1768/spi_pins.h
index e7d774742f..a82b21dda9 100644
--- a/Marlin/src/HAL/LPC1768/spi_pins.h
+++ b/Marlin/src/HAL/LPC1768/spi_pins.h
@@ -24,10 +24,10 @@
#include "../../core/macros.h"
#if BOTH(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
- #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
- // needed due to the speed and mode required for communicating with each device being different.
- // This requirement can be removed if the SPI access to these devices is updated to use
- // spiBeginTransaction.
+ #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
+ // needed due to the speed and mode required for communicating with each device being different.
+ // This requirement can be removed if the SPI access to these devices is updated to use
+ // spiBeginTransaction.
#endif
/** onboard SD card */
diff --git a/Marlin/src/HAL/NATIVE_SIM/spi_pins.h b/Marlin/src/HAL/NATIVE_SIM/spi_pins.h
index a5138e0ccb..fd3378b337 100644
--- a/Marlin/src/HAL/NATIVE_SIM/spi_pins.h
+++ b/Marlin/src/HAL/NATIVE_SIM/spi_pins.h
@@ -25,7 +25,7 @@
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN || LCD_PINS_ENABLE == SD_MOSI_PIN || DOGLCD_SCK == SD_SCK_PIN || DOGLCD_MOSI == SD_MOSI_PIN)
- #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
+ #define SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
// spiBeginTransaction.
diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
index 14759901ac..9f67a01c4e 100644
--- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
+++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
@@ -186,7 +186,7 @@
#define SD_MISO_PIN P1_23 // J8-3 (moved from EXP2 P0.8)
#define SD_MOSI_PIN P2_12 // J8-4 (moved from EXP2 P0.9)
#define SD_SS_PIN P0_28
- #define LPC_SOFTWARE_SPI // With a custom cable we need software SPI because the
+ #define SOFTWARE_SPI // With a custom cable we need software SPI because the
// selected pins are not on a hardware SPI controller
#elif SD_CONNECTION_IS(LCD) || SD_CONNECTION_IS(ONBOARD)
#define SD_SCK_PIN P0_07
From 8b6155deeebd5aa12d0a335dd9087fd7db280d5b Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 24 Mar 2023 03:01:09 -0500
Subject: [PATCH 070/225] =?UTF-8?q?=F0=9F=94=A8=20INI=20Updates?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Martin Turski
---
ini/avr.ini | 7 ++++---
ini/features.ini | 1 +
ini/stm32f1-maple.ini | 25 ++++++++++++-------------
ini/stm32f4.ini | 2 --
platformio.ini | 2 +-
5 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/ini/avr.ini b/ini/avr.ini
index 5944f81583..7c5f369dc6 100644
--- a/ini/avr.ini
+++ b/ini/avr.ini
@@ -13,8 +13,9 @@
# AVR (8-bit) Common Environment values
#
[common_avr8]
-platform = atmelavr@~3.4
+platform = atmelavr@~4.0.1
build_flags = ${common.build_flags} -Wl,--relax
+build_src_flags = -std=gnu++1z
board_build.f_cpu = 16000000L
build_src_filter = ${common.default_src_filter} +
@@ -53,7 +54,7 @@ extends = common_avr8
board_build.variant = MARLIN_MEGA_EXTENDED
extra_scripts = ${env:mega2560ext.extra_scripts}
upload_speed = 57600
-build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues
+build_flags = ${common_avr8.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -mcall-prologues
#
# MightyBoard ATmega1280
@@ -103,7 +104,7 @@ board_upload.maximum_size = 126976
#
[tuned_1284p]
-build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues
+build_flags = ${common_avr8.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -mcall-prologues
[env:sanguino1284p_optimized]
extends = env:sanguino1284p
diff --git a/ini/features.ini b/ini/features.ini
index bfaca56ab3..35b6959fd9 100644
--- a/ini/features.ini
+++ b/ini/features.ini
@@ -205,6 +205,7 @@ HAS_GCODE_M876 = src_filter=+
HAS_RESUME_CONTINUE = src_filter=+
SET_PROGRESS_MANUALLY = src_filter=+
HAS_STATUS_MESSAGE = src_filter=+
+HAS_PREHEAT = src_filter=+
HAS_LCD_CONTRAST = src_filter=+
HAS_GCODE_M255 = src_filter=+
HAS_LCD_BRIGHTNESS = src_filter=+
diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini
index e223bdb4eb..d361a0d40a 100644
--- a/ini/stm32f1-maple.ini
+++ b/ini/stm32f1-maple.ini
@@ -61,7 +61,7 @@ monitor_speed = 115200
[env:STM32F103RC_meeb_maple]
extends = env:STM32F103RC_maple
board = marlin_maple_MEEB_3DP
-build_flags = ${STM32F1_maple.build_flags}
+build_flags = ${env:STM32F103RC_maple.build_flags}
-DDEBUG_LEVEL=0
-DSS_TIMER=4
-DSTM32_FLASH_SIZE=512
@@ -70,10 +70,10 @@ build_flags = ${STM32F1_maple.build_flags}
-DVECT_TAB_OFFSET=0x2000
-DGENERIC_BOOTLOADER
board_build.ldscript = STM32F103RC_MEEB_3DP.ld
-extra_scripts = ${STM32F1_maple.extra_scripts}
+extra_scripts = ${env:STM32F103RC_maple.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
-lib_deps = ${STM32F1_maple.lib_deps}
+lib_deps = ${env:STM32F103RC_maple.lib_deps}
USBComposite for STM32F1@0.91
custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel#meeb_3dp_use
debug_tool = stlink
@@ -84,9 +84,9 @@ upload_protocol = dfu
#
[env:STM32F103RC_fysetc_maple]
extends = env:STM32F103RC_maple
-extra_scripts = ${STM32F1_maple.extra_scripts}
+extra_scripts = ${env:STM32F103RC_maple.extra_scripts}
buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
-build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0
+build_flags = ${env:STM32F103RC_maple.build_flags} -DDEBUG_LEVEL=0
lib_ldf_mode = chain
debug_tool = stlink
upload_protocol = serial
@@ -101,7 +101,7 @@ upload_protocol = serial
extends = env:STM32F103RC_maple
board_build.address = 0x08007000
board_build.ldscript = STM32F103RC_SKR_MINI_256K.ld
-build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
+build_flags = ${env:STM32F103RC_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
monitor_speed = 115200
[env:STM32F103RC_btt_USB_maple]
@@ -115,10 +115,10 @@ lib_deps = ${env:STM32F103RC_btt_maple.lib_deps}
#
[env:STM32F103RE_creality_maple]
extends = env:STM32F103RE_maple
-build_flags = ${STM32F1_maple.build_flags} -DTEMP_TIMER_CHAN=4
+build_flags = ${env:STM32F103RE_maple.build_flags} -DTEMP_TIMER_CHAN=4
board_build.address = 0x08007000
board_build.ldscript = creality.ld
-extra_scripts = ${STM32F1_maple.extra_scripts}
+extra_scripts = ${env:STM32F103RE_maple.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/random-bin.py
debug_tool = jlink
upload_protocol = jlink
@@ -128,10 +128,10 @@ upload_protocol = jlink
#
[env:STM32F103RC_creality_maple]
extends = env:STM32F103RC_maple
-build_flags = ${STM32F1_maple.build_flags} -DTEMP_TIMER_CHAN=4
+build_flags = ${env:STM32F103RC_maple.build_flags} -DTEMP_TIMER_CHAN=4
board_build.address = 0x08007000
board_build.ldscript = creality.ld
-extra_scripts = ${STM32F1_maple.extra_scripts}
+extra_scripts = ${env:STM32F103RC_maple.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/random-bin.py
debug_tool = jlink
upload_protocol = jlink
@@ -154,14 +154,14 @@ board_build.ldscript = crealityPro.ld
extends = env:STM32F103RE_maple
board_build.address = 0x08007000
board_build.ldscript = STM32F103RE_SKR_MINI_512K.ld
-build_flags = ${STM32F1_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
+build_flags = ${env:STM32F103RE_maple.build_flags} -DDEBUG_LEVEL=0 -DSS_TIMER=4
debug_tool = stlink
upload_protocol = stlink
[env:STM32F103RE_btt_USB_maple]
extends = env:STM32F103RE_btt_maple
build_flags = ${env:STM32F103RE_btt_maple.build_flags} -DUSE_USB_COMPOSITE
-lib_deps = ${STM32F1_maple.lib_deps}
+lib_deps = ${env:STM32F103RE_btt_maple.lib_deps}
USBComposite for STM32F1@0.91
#
@@ -238,7 +238,6 @@ board_build.ldscript = mks_robin_pro.ld
#
[env:trigorilla_pro_maple]
extends = env:mks_robin_maple
-extra_scripts = ${STM32F1_maple.extra_scripts}
#
# MKS Robin E3D (STM32F103RCT6) and
diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini
index aa3b1dfc7c..e9b9a956de 100644
--- a/ini/stm32f4.ini
+++ b/ini/stm32f4.ini
@@ -726,12 +726,10 @@ upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE"
# STM32F446ZET6 ARM Cortex-M4
#
[env:STM32F446_tronxy]
-platform = ${common_stm32.platform}
extends = stm32_variant
board = marlin_STM32F446ZET_tronxy
board_build.offset = 0x10000
board_build.rename = fmw_tronxy.bin
-build_src_filter = ${common_stm32.build_src_filter}
build_flags = ${stm32_variant.build_flags}
-DSTM32F4xx
build_unflags = ${stm32_variant.build_unflags} -fno-rtti
diff --git a/platformio.ini b/platformio.ini
index d31f23abec..f8a8988ef8 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -224,6 +224,7 @@ default_src_filter = + - - + -
-
-
+ -
- - -
-
-
@@ -251,7 +252,6 @@ default_src_filter = + - - + -
-
- -
- - - -
-
-
-
From ec91d5a1efb56377ed784a48377521332c0a7e3e Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 24 Mar 2023 03:01:15 -0500
Subject: [PATCH 071/225] =?UTF-8?q?=F0=9F=8E=A8=20Misc.=20fixes,=20cleanup?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-Authored-By: Martin Turski
---
Marlin/Marlin.ino | 2 +-
Marlin/src/HAL/ESP32/ota.cpp | 2 +-
Marlin/src/core/serial_base.h | 2 ++
Marlin/src/lcd/tft_io/tft_orientation.h | 7 +++----
Marlin/src/libs/numtostr.cpp | 2 +-
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 4 ++--
6 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino
index 57c825445f..744e98c2e3 100644
--- a/Marlin/Marlin.ino
+++ b/Marlin/Marlin.ino
@@ -27,7 +27,7 @@ Configuration
- https://github.com/MarlinFirmware/Configurations
Example configurations for several printer models.
- - https://www.youtube.com/watch?v=3gwWVFtdg-4
+ - https://youtu.be/3gwWVFtdg-4
A good 20-minute overview of Marlin configuration by Tom Sanladerer.
(Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.)
Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin
diff --git a/Marlin/src/HAL/ESP32/ota.cpp b/Marlin/src/HAL/ESP32/ota.cpp
index 69a3e25e56..f31a78c2c5 100644
--- a/Marlin/src/HAL/ESP32/ota.cpp
+++ b/Marlin/src/HAL/ESP32/ota.cpp
@@ -50,7 +50,7 @@ void OTA_init() {
})
.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
- char *str;
+ const char *str = "unknown";
switch (error) {
case OTA_AUTH_ERROR: str = "Auth Failed"; break;
case OTA_BEGIN_ERROR: str = "Begin Failed"; break;
diff --git a/Marlin/src/core/serial_base.h b/Marlin/src/core/serial_base.h
index a5abd67d87..059b424284 100644
--- a/Marlin/src/core/serial_base.h
+++ b/Marlin/src/core/serial_base.h
@@ -23,6 +23,8 @@
#include "../inc/MarlinConfigPre.h"
+#include // for size_t
+
#if ENABLED(EMERGENCY_PARSER)
#include "../feature/e_parser.h"
#endif
diff --git a/Marlin/src/lcd/tft_io/tft_orientation.h b/Marlin/src/lcd/tft_io/tft_orientation.h
index 7822fc6b04..c2c86435b2 100644
--- a/Marlin/src/lcd/tft_io/tft_orientation.h
+++ b/Marlin/src/lcd/tft_io/tft_orientation.h
@@ -59,9 +59,9 @@
#define TFT_COLOR_BGR _BV32(4)
// Each TFT Driver is responsible for its default color mode.
-// #ifndef TFT_COLOR
-// #define TFT_COLOR TFT_COLOR_RGB
-// #endif
+//#ifndef TFT_COLOR
+// #define TFT_COLOR TFT_COLOR_RGB
+//#endif
#define TOUCH_ORIENTATION_NONE 0
#define TOUCH_LANDSCAPE 1
@@ -82,4 +82,3 @@
#ifndef TOUCH_ORIENTATION
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
#endif
-
diff --git a/Marlin/src/libs/numtostr.cpp b/Marlin/src/libs/numtostr.cpp
index c28d1246d6..4cc40a96d1 100644
--- a/Marlin/src/libs/numtostr.cpp
+++ b/Marlin/src/libs/numtostr.cpp
@@ -28,7 +28,7 @@
char conv[9] = { 0 };
#define DIGIT(n) ('0' + (n))
-#define DIGIMOD(n, f) DIGIT((n)/(f) % 10)
+#define DIGIMOD(n, f) DIGIT(((n)/(f)) % 10)
#define RJDIGIT(n, f) ((n) >= (f) ? DIGIMOD(n, f) : ' ')
#define MINUSOR(n, alt) (n >= 0 ? (alt) : (n = -n, '-'))
#define INTFLOAT(V,N) (((V) * 10 * pow(10, N) + ((V) < 0 ? -5: 5)) / 10) // pow10?
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 0df70d7292..9c5836dc74 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
@@ -93,7 +93,7 @@
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
// Reduce baud rate to improve software serial reliability
- #define TMC_BAUD_RATE 19200
+ #define TMC_BAUD_RATE 19200
#endif
//
@@ -214,7 +214,7 @@
#define FORCE_SOFT_SPI // SPI MODE3
- #define LED_PIN EXP1_06_PIN // red pwm
+ #define LED_PIN EXP1_06_PIN // red pwm
//#define LED_PIN EXP1_07_PIN // green
//#define LED_PIN EXP1_08_PIN // blue
From d74e65362f738baa746c54053c2e8fe9454beb0b Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Fri, 24 Mar 2023 18:43:53 -0500
Subject: [PATCH 072/225] =?UTF-8?q?=F0=9F=A9=B9=20Update=20TRONXY=5FV10=20?=
=?UTF-8?q?SPI=5FFLASH=20pins?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/pins/stm32f4/pins_TRONXY_V10.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h b/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h
index e3b9f7ef6e..475dc42266 100644
--- a/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h
+++ b/Marlin/src/pins/stm32f4/pins_TRONXY_V10.h
@@ -72,10 +72,10 @@
//#define SPI_FLASH
#if ENABLED(SPI_FLASH)
#define SPI_FLASH_SIZE 0x200000 // 2MB
- #define W25QXX_CS_PIN PG15 // SPI2
- #define W25QXX_MOSI_PIN PB5
- #define W25QXX_MISO_PIN PB4
- #define W25QXX_SCK_PIN PB3
+ #define SPI_FLASH_CS_PIN PG15 // SPI2
+ #define SPI_FLASH_MOSI_PIN PB5
+ #define SPI_FLASH_MISO_PIN PB4
+ #define SPI_FLASH_SCK_PIN PB3
#endif
//
From aba42052c3c85ffbe02718a49cdec9e6053b9c03 Mon Sep 17 00:00:00 2001
From: thinkyhead
Date: Sat, 25 Mar 2023 00:20:40 +0000
Subject: [PATCH 073/225] [cron] Bump distribution date (2023-03-25)
---
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 62330c57c7..bb46cc9519 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 "2023-03-24"
+//#define STRING_DISTRIBUTION_DATE "2023-03-25"
/**
* 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 d8245208b4..d2b1ff06e9 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 "2023-03-24"
+ #define STRING_DISTRIBUTION_DATE "2023-03-25"
#endif
/**
From 1b72729698085afa85e427c0578f5ba811fd05e9 Mon Sep 17 00:00:00 2001
From: ellensp <530024+ellensp@users.noreply.github.com>
Date: Sat, 25 Mar 2023 17:14:21 +1300
Subject: [PATCH 074/225] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Chitu3D=20V6=20def?=
=?UTF-8?q?ault=20probe=20pin=20(#25552)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h | 51 +++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h
index 89e07d6a21..02daab3e63 100644
--- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h
+++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h
@@ -33,4 +33,55 @@
#define FIL_RUNOUT2_PIN PF13
#endif
+#ifndef Z_MIN_PROBE_PIN
+ #define Z_MIN_PROBE_PIN PG9
+#endif
+
#include "pins_CHITU3D_common.h"
+
+/*
+ * Circuit diagram https://github.com/MarlinFirmware/Marlin/files/3401484/x5sa-main_board-2.pdf
+ *
+ * Details on the 30 pin ribbon pins. From: https://3dtoday.ru/blogs/artem-sr/tronxy-x5sa-pro-ustanovka-bfp-touch-na-board-chitu3d-v6-cxy-v6-191017
+ *
+ * JP2 Ribbon 30 on CXY-V6-191017
+ * ----------------------------------------------
+ * | 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30|
+ * | 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29|
+ * ---------------------- ----------------------
+ *
+ * --------------------------------------------------------------------------------------
+ * | Pin | Label | Function & Notes |
+ * --------------------------------------------------------------------------------------
+ * | 1 | Hotend | Hotend driver Q6 HY1403 via MCU Pin127 PG12 |
+ * | 2 | Hotend | Hotend driver Q6 HY1403 via MCU Pin127 PG12 |
+ * | 3 | Hotend | Hotend driver Q6 HY1403 via MCU Pin127 PG12 |
+ * | 4 | Hotend | Hotend driver Q6 HY1403 via MCU Pin127 PG12 |
+ * | 5 | +24v | Hotend +24v |
+ * | 6 | +24v | Hotend +24v |
+ * | 7 | +24v | Hotend +24v |
+ * | 8 | +24v | Hotend +24v |
+ * | 9 | F_2 | Extruder Fan2 driver Q8 AO3400A X07S via MCU Pin129 PG14 |
+ * | 10 | +24v | Extruder cooling Fan2 +24v |
+ * | 11 | F_1 | Part Fan1 driver Q7 AO3400A X07S via MCU Pin128 PG13 |
+ * | 12 | +24v | Part cooling Fanl +24v |
+ * | 13 | 1B | X-MOTOR Winding Drive |
+ * | 14 | 1A | X-MOTOR Winding Drive |
+ * | 15 | 2B | X-MOTOR Winding Drive |
+ * | 16 | 2A | X-MOTOR Winding Drive |
+ * | 17 | lA | El-Motor Winding Drive |
+ * | 18 | 1B | El-Motor Winding Drive |
+ * | 19 | 2B | El-Motor Winding Drive |
+ * | 20 | 2A | El-Motor Winding Drive |
+ * | 21 | PROXIMITY | 10kΩ Pullup to +5V and 100nF to GND, then 20kΩ to MCU Pin124 PG9 |
+ * | 22 | +24v | Proximity sensor +24v |
+ * | 23 | +5V | Filament sensor +5V XSTOP sensor +5V |
+ * | 24 | GND | Proximity sensor GND |
+ * | 25 | FILAMENT1 | 10kΩ Pullup to +5V and 100nF to GND, then 47kΩ to MCU Pin110 PA15|
+ * | 26 | GND | Filament Sensor GND |
+ * | 27 | XSTOP | 10kΩ Pullup to +5V and 100nF to GND, then 47kΩ to MCU Pin125 PG10|
+ * | 28 | GND | XSTOP sensor GND |
+ * | 29 | GND | Extruder temperature NTC sensor return GND |
+ * | 30 | ETEMP | 4k7Ω Pullup to +3V3 and 100nF to GND, then 4k7Ω to MCU Pin35 PA1 |
+ * --------------------------------------------------------------------------------------
+ */
From de4452fda6b3f1a0d74865bc364fb362ccc38ff4 Mon Sep 17 00:00:00 2001
From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com>
Date: Fri, 24 Mar 2023 21:15:33 -0700
Subject: [PATCH 075/225] =?UTF-8?q?=F0=9F=94=A7=20Remove=20TVPM=20warning?=
=?UTF-8?q?=20(#25551)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/inc/Warnings.cpp | 5 -----
1 file changed, 5 deletions(-)
diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp
index 01246596c3..405e7a351e 100644
--- a/Marlin/src/inc/Warnings.cpp
+++ b/Marlin/src/inc/Warnings.cpp
@@ -63,11 +63,6 @@
#warning "Warning! Don't use dummy thermistors (998/999) for final build!"
#endif
-#if ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_COOLER) \
- && NONE(THERMAL_PROTECTION_VARIANCE_MONITOR, NO_VARIANCE_MONITOR_WARNING)
- #warning "THERMAL_PROTECTION_VARIANCE_MONITOR is recommended. See Configuration_adv.h for details. (Define NO_VARIANCE_MONITOR_WARNING to suppress this.)"
-#endif
-
#if NONE(HAS_RESUME_CONTINUE, HOST_PROMPT_SUPPORT)
#warning "Your Configuration provides no method to acquire user feedback!"
#endif
From 8d3142911c017b542f1b55e9d2c09b68beacadd9 Mon Sep 17 00:00:00 2001
From: ellensp <530024+ellensp@users.noreply.github.com>
Date: Sat, 25 Mar 2023 17:17:47 +1300
Subject: [PATCH 076/225] =?UTF-8?q?=F0=9F=90=9B=20Fix=20MKS=20Gen=20L=202.?=
=?UTF-8?q?1=20MOSFET=20pins=20(#25542)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h
index c2ab34c825..d2c3c37f07 100644
--- a/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h
+++ b/Marlin/src/pins/ramps/pins_MKS_GEN_L_V21.h
@@ -38,7 +38,8 @@
// Heaters / Fans
//
// Power outputs EFBF or EFBE
-#define MOSFET_D_PIN 7
+#define MOSFET_B_PIN 7
+#define FAN_PIN 9
//
// CS Pins wired to avoid conflict with the LCD
From 01296788dcde14b29ebdf2c7b2e4895be66d75f3 Mon Sep 17 00:00:00 2001
From: Scott Lahteine