diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino
index 81652000a8a6..066cc1717d35 100644
--- a/Marlin/Marlin.ino
+++ b/Marlin/Marlin.ino
@@ -2,7 +2,7 @@
Marlin Firmware
- (c) 2011-2023 MarlinFirmware
+ (c) 2011-2024 MarlinFirmware
Portions of Marlin are (c) by their respective authors.
All code complies with GPLv2 and/or GPLv3
diff --git a/Marlin/Version.h b/Marlin/Version.h
index 2a3912a4cb28..6b3eac583b4c 100644
--- a/Marlin/Version.h
+++ b/Marlin/Version.h
@@ -41,7 +41,7 @@
* here we define this default string as the date where the latest release
* version was tagged.
*/
-//#define STRING_DISTRIBUTION_DATE "2024-01-25"
+//#define STRING_DISTRIBUTION_DATE "2024-01-30"
/**
* Defines a generic printer name to be output to the LCD after booting Marlin.
diff --git a/Marlin/src/HAL/AVR/HAL_SPI.cpp b/Marlin/src/HAL/AVR/HAL_SPI.cpp
index 32c0361d0352..db6a12734d4d 100644
--- a/Marlin/src/HAL/AVR/HAL_SPI.cpp
+++ b/Marlin/src/HAL/AVR/HAL_SPI.cpp
@@ -119,7 +119,6 @@ void spiBegin() {
while (!TEST(SPSR, SPIF)) { /* Intentionally left empty */ }
}
-
/** begin spi transaction */
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
// Based on Arduino SPI library
@@ -175,7 +174,6 @@ void spiBegin() {
SPSR = clockDiv | 0x01;
}
-
#else // SOFTWARE_SPI || FORCE_SOFT_SPI
// ------------------------
diff --git a/Marlin/src/HAL/AVR/Servo.cpp b/Marlin/src/HAL/AVR/Servo.cpp
index 0a1ef5337ae9..8ce9bc11b8cc 100644
--- a/Marlin/src/HAL/AVR/Servo.cpp
+++ b/Marlin/src/HAL/AVR/Servo.cpp
@@ -63,7 +63,6 @@
static volatile int8_t Channel[_Nbr_16timers]; // counter for the servo being pulsed for each timer (or -1 if refresh interval)
-
/************ static functions common to all instances ***********************/
static inline void handle_interrupts(const timer16_Sequence_t timer, volatile uint16_t* TCNTn, volatile uint16_t* OCRnA) {
diff --git a/Marlin/src/HAL/AVR/eeprom.cpp b/Marlin/src/HAL/AVR/eeprom.cpp
index 6465e4702544..45c7abd1db2c 100644
--- a/Marlin/src/HAL/AVR/eeprom.cpp
+++ b/Marlin/src/HAL/AVR/eeprom.cpp
@@ -35,14 +35,14 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
@@ -61,7 +61,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/AVR/endstop_interrupts.h b/Marlin/src/HAL/AVR/endstop_interrupts.h
index 2532624d39cb..91cb336e2462 100644
--- a/Marlin/src/HAL/AVR/endstop_interrupts.h
+++ b/Marlin/src/HAL/AVR/endstop_interrupts.h
@@ -91,7 +91,6 @@ void endstop_ISR() { endstops.update(); }
#endif
-
// Install Pin change interrupt for a pin. Can be called multiple times.
void pciSetup(const int8_t pin) {
if (digitalPinHasPCICR(pin)) {
diff --git a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
index 0c434b157c78..51c5e096586e 100644
--- a/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
+++ b/Marlin/src/HAL/AVR/fastio/fastio_AT90USB.h
@@ -679,7 +679,6 @@
#define PF7_PWM 0
#define PF7_DDR DDRF
-
/**
* Some of the pin mapping functions of the Teensduino extension to the Arduino IDE
* do not function the same as the other Arduino extensions.
diff --git a/Marlin/src/HAL/AVR/inc/Conditionals_type.h b/Marlin/src/HAL/AVR/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/AVR/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/AVR/pinsDebug.h b/Marlin/src/HAL/AVR/pinsDebug.h
index fc51f41ef81e..15db63b4d7f8 100644
--- a/Marlin/src/HAL/AVR/pinsDebug.h
+++ b/Marlin/src/HAL/AVR/pinsDebug.h
@@ -163,7 +163,6 @@ bool pwm_status(uint8_t pin) {
SERIAL_ECHO_SP(2);
} // pwm_status
-
const volatile uint8_t* const PWM_other[][3] PROGMEM = {
{ &TCCR0A, &TCCR0B, &TIMSK0 },
{ &TCCR1A, &TCCR1B, &TIMSK1 },
@@ -181,7 +180,6 @@ const volatile uint8_t* const PWM_other[][3] PROGMEM = {
#endif
};
-
const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
#ifdef TIMER0A
@@ -217,7 +215,6 @@ const volatile uint8_t* const PWM_OCR[][3] PROGMEM = {
#endif
};
-
#define TCCR_A(T) pgm_read_word(&PWM_other[T][0])
#define TCCR_B(T) pgm_read_word(&PWM_other[T][1])
#define TIMSK(T) pgm_read_word(&PWM_other[T][2])
diff --git a/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp b/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
index 79bafe293967..131174b06c41 100644
--- a/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
+++ b/Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
@@ -120,7 +120,6 @@ void u8g_spiSend_sw_AVR_mode_3(uint8_t val) {
U8G_ATOMIC_END();
}
-
#if ENABLED(FYSETC_MINI_12864)
#define SPISEND_SW_AVR u8g_spiSend_sw_AVR_mode_3
#else
diff --git a/Marlin/src/HAL/DUE/MarlinSerial.cpp b/Marlin/src/HAL/DUE/MarlinSerial.cpp
index 638f7a100722..90efe55fc23d 100644
--- a/Marlin/src/HAL/DUE/MarlinSerial.cpp
+++ b/Marlin/src/HAL/DUE/MarlinSerial.cpp
@@ -474,7 +474,6 @@ void MarlinSerial::flushTX() {
}
}
-
// If not using the USB port as serial port
#if defined(SERIAL_PORT) && SERIAL_PORT >= 0
template class MarlinSerial< MarlinSerialCfg >;
diff --git a/Marlin/src/HAL/DUE/eeprom_flash.cpp b/Marlin/src/HAL/DUE/eeprom_flash.cpp
index a0ed6cc84347..a5c7ab836dbf 100644
--- a/Marlin/src/HAL/DUE/eeprom_flash.cpp
+++ b/Marlin/src/HAL/DUE/eeprom_flash.cpp
@@ -958,14 +958,14 @@ static void ee_Init() {
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { ee_Init(); return true; }
bool PersistentStore::access_finish() { ee_Flush(); return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != ee_Read(uint32_t(p))) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
ee_Write(uint32_t(p), v);
@@ -984,7 +984,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t c = ee_Read(uint32_t(pos));
+ uint8_t c = ee_Read(uint32_t(REAL_EEPROM_ADDR(pos)));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/DUE/eeprom_wired.cpp b/Marlin/src/HAL/DUE/eeprom_wired.cpp
index 24f8c06d2e1b..84338ccb4bf5 100644
--- a/Marlin/src/HAL/DUE/eeprom_wired.cpp
+++ b/Marlin/src/HAL/DUE/eeprom_wired.cpp
@@ -36,14 +36,14 @@
#ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
@@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/DUE/fastio/G2_PWM.h b/Marlin/src/HAL/DUE/fastio/G2_PWM.h
index 2afe246ceaea..054eb2cf8039 100644
--- a/Marlin/src/HAL/DUE/fastio/G2_PWM.h
+++ b/Marlin/src/HAL/DUE/fastio/G2_PWM.h
@@ -49,7 +49,6 @@ extern volatile uint32_t *SODR_A, *SODR_B, *CODR_A, *CODR_B;
#define PWM_MAP_INIT_ROW(IO,ZZ) { ZZ == 'A' ? SODR_A : SODR_B, ZZ == 'A' ? CODR_A : CODR_B, 1 << _PIN(IO) }
-
#define PWM_MAP_INIT { PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_X_PIN, 'B'), \
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Y_PIN, 'B'), \
PWM_MAP_INIT_ROW(MOTOR_CURRENT_PWM_Z_PIN, 'B'), \
diff --git a/Marlin/src/HAL/DUE/fastio/G2_pins.h b/Marlin/src/HAL/DUE/fastio/G2_pins.h
index 80c87bd39296..38fcc5e5df0b 100644
--- a/Marlin/src/HAL/DUE/fastio/G2_pins.h
+++ b/Marlin/src/HAL/DUE/fastio/G2_pins.h
@@ -168,7 +168,6 @@ const G2_PinDescription G2_g_APinDescription[] = {
{ PIOB, PIO_PB21, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 52
{ PIOB, PIO_PB14, ID_PIOB, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PIN 53
-
// 54 .. 65 - Analog pins
// ----------------------
{ PIOA, PIO_PA16X1_AD7, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_ANALOG, ADC0, ADC7, NOT_ON_PWM, NOT_ON_TIMER }, // AD0
diff --git a/Marlin/src/HAL/DUE/inc/Conditionals_type.h b/Marlin/src/HAL/DUE/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/DUE/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/DUE/usb/compiler.h b/Marlin/src/HAL/DUE/usb/compiler.h
index 633197914eef..27c554cdb7e1 100644
--- a/Marlin/src/HAL/DUE/usb/compiler.h
+++ b/Marlin/src/HAL/DUE/usb/compiler.h
@@ -142,7 +142,6 @@
*/
#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack())
-
/**
* \brief Set aligned boundary.
*/
@@ -283,7 +282,6 @@ typedef double F64; //!< 64-bit floating-point number.
typedef uint32_t iram_size_t;
//! @}
-
/*! \name Status Types
*/
//! @{
@@ -291,7 +289,6 @@ typedef bool Status_bool_t; //!< Boolean status.
typedef U8 Status_t; //!< 8-bit-coded status.
//! @}
-
/*! \name Aliasing Aggregate Types
*/
//! @{
@@ -462,7 +459,6 @@ typedef struct
#endif
//! @}
-
#ifndef __ASSEMBLY__ // not for assembling.
//! \name Optimization Control
@@ -581,7 +577,6 @@ typedef struct
//! @}
-
/*! \name Zero-Bit Counting
*
* Under GCC, __builtin_clz and __builtin_ctz behave like macros when
@@ -692,7 +687,6 @@ typedef struct
//! @}
-
/*! \name Bit Reversing
*/
//! @{
@@ -732,7 +726,6 @@ typedef struct
//! @}
-
/*! \name Alignment
*/
//! @{
@@ -798,7 +791,6 @@ typedef struct
*/
#define Long_call(addr) ((*(void (*)(void))(addr))())
-
/*! \name MCU Endianism Handling
* ARM is MCU little endianism.
*/
@@ -868,7 +860,6 @@ typedef struct
#define CPU_TO_BE32(x) swap32(x)
//! @}
-
/*! \name Endianism Conversion
*
* The same considerations as for clz and ctz apply here but GCC's
@@ -955,7 +946,6 @@ typedef struct
//! @}
-
/*! \name Target Abstraction
*/
//! @{
@@ -997,7 +987,6 @@ typedef U8 Byte; //!< 8-bit unsigned integer.
#endif // #ifndef __ASSEMBLY__
-
#ifdef __ICCARM__
#define SHORTENUM __packed
#elif defined(__GNUC__)
diff --git a/Marlin/src/HAL/DUE/usb/conf_access.h b/Marlin/src/HAL/DUE/usb/conf_access.h
index f401685223cb..0ea5fe228782 100644
--- a/Marlin/src/HAL/DUE/usb/conf_access.h
+++ b/Marlin/src/HAL/DUE/usb/conf_access.h
@@ -81,7 +81,6 @@
#define LUN_0_NAME "\"SD/MMC Card\""
//! @}
-
/*! \name Actions Associated with Memory Accesses
*
* Write here the action to associate with each memory access.
@@ -112,5 +111,4 @@
#define GLOBAL_WR_PROTECT false //!< Management of a global write protection.
//! @}
-
#endif // _CONF_ACCESS_H_
diff --git a/Marlin/src/HAL/DUE/usb/conf_clock.h b/Marlin/src/HAL/DUE/usb/conf_clock.h
index 97e70e99a5b9..0c7815ee4d72 100644
--- a/Marlin/src/HAL/DUE/usb/conf_clock.h
+++ b/Marlin/src/HAL/DUE/usb/conf_clock.h
@@ -96,5 +96,4 @@
// - UPLL frequency: 480MHz
// - USB clock: 480 / 1 = 480MHz
-
#endif /* CONF_CLOCK_H_INCLUDED */
diff --git a/Marlin/src/HAL/DUE/usb/conf_usb.h b/Marlin/src/HAL/DUE/usb/conf_usb.h
index f66194c6e6f9..fb4ef3424110 100644
--- a/Marlin/src/HAL/DUE/usb/conf_usb.h
+++ b/Marlin/src/HAL/DUE/usb/conf_usb.h
@@ -88,7 +88,6 @@
#endif
//@}
-
/**
* USB Device Callbacks definitions (Optional)
* @{
@@ -150,7 +149,6 @@
//@}
-
/**
* USB Interface Configuration
* @{
@@ -210,7 +208,6 @@
//@}
//@}
-
/**
* Configuration of MSC interface
* @{
@@ -245,7 +242,6 @@
//@}
-
/**
* Description of Composite Device
* @{
diff --git a/Marlin/src/HAL/DUE/usb/ctrl_access.c b/Marlin/src/HAL/DUE/usb/ctrl_access.c
index 99f97f62cb80..b766ed12732b 100644
--- a/Marlin/src/HAL/DUE/usb/ctrl_access.c
+++ b/Marlin/src/HAL/DUE/usb/ctrl_access.c
@@ -68,7 +68,6 @@
#endif
#include "ctrl_access.h"
-
//_____ D E F I N I T I O N S ______________________________________________
#ifdef FREERTOS_USED
@@ -112,7 +111,6 @@ static xSemaphoreHandle ctrl_access_semphr = NULL;
#endif // FREERTOS_USED
-
#if MAX_LUN
/*! \brief Initializes an entry of the LUN descriptor table.
@@ -242,17 +240,14 @@ static const struct
#endif
-
#if GLOBAL_WR_PROTECT == true
bool g_wr_protect;
#endif
-
/*! \name Control Interface
*/
//! @{
-
#ifdef FREERTOS_USED
bool ctrl_access_init(void)
@@ -270,7 +265,6 @@ bool ctrl_access_init(void)
return true;
}
-
/*! \brief Locks accesses to LUNs.
*
* \return \c true if the access was successfully locked, else \c false.
@@ -288,7 +282,6 @@ static bool ctrl_access_lock(void)
#endif // FREERTOS_USED
-
U8 get_nb_lun(void)
{
#if MEM_USB == ENABLE
@@ -309,13 +302,11 @@ U8 get_nb_lun(void)
#endif
}
-
U8 get_cur_lun(void)
{
return LUN_ID_0;
}
-
Ctrl_status mem_test_unit_ready(U8 lun)
{
Ctrl_status status;
@@ -337,7 +328,6 @@ Ctrl_status mem_test_unit_ready(U8 lun)
return status;
}
-
Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector)
{
Ctrl_status status;
@@ -359,7 +349,6 @@ Ctrl_status mem_read_capacity(U8 lun, U32 *u32_nb_sector)
return status;
}
-
U8 mem_sector_size(U8 lun)
{
U8 sector_size;
@@ -381,7 +370,6 @@ U8 mem_sector_size(U8 lun)
return sector_size;
}
-
bool mem_unload(U8 lun, bool unload)
{
bool unloaded;
@@ -433,7 +421,6 @@ bool mem_wr_protect(U8 lun)
return wr_protect;
}
-
bool mem_removal(U8 lun)
{
bool removal;
@@ -458,7 +445,6 @@ bool mem_removal(U8 lun)
return removal;
}
-
const char *mem_name(U8 lun)
{
#if MAX_LUN==0
@@ -475,17 +461,14 @@ const char *mem_name(U8 lun)
#endif
}
-
//! @}
-
#if ACCESS_USB == true
/*! \name MEM <-> USB Interface
*/
//! @{
-
Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector)
{
Ctrl_status status;
@@ -505,7 +488,6 @@ Ctrl_status memory_2_usb(U8 lun, U32 addr, U16 nb_sector)
return status;
}
-
Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector)
{
Ctrl_status status;
@@ -525,19 +507,16 @@ Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector)
return status;
}
-
//! @}
#endif // ACCESS_USB == true
-
#if ACCESS_MEM_TO_RAM == true
/*! \name MEM <-> RAM Interface
*/
//! @{
-
Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram)
{
Ctrl_status status;
@@ -564,7 +543,6 @@ Ctrl_status memory_2_ram(U8 lun, U32 addr, void *ram)
return status;
}
-
Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram)
{
Ctrl_status status;
@@ -591,19 +569,16 @@ Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram)
return status;
}
-
//! @}
#endif // ACCESS_MEM_TO_RAM == true
-
#if ACCESS_STREAM == true
/*! \name Streaming MEM <-> MEM Interface
*/
//! @{
-
#if ACCESS_MEM_TO_MEM == true
#include "fat.h"
@@ -625,21 +600,18 @@ Ctrl_status stream_mem_to_mem(U8 src_lun, U32 src_addr, U8 dest_lun, U32 dest_ad
#endif // ACCESS_MEM_TO_MEM == true
-
Ctrl_status stream_state(U8 id)
{
UNUSED(id);
return CTRL_GOOD;
}
-
U16 stream_stop(U8 id)
{
UNUSED(id);
return 0;
}
-
//! @}
#endif // ACCESS_STREAM
diff --git a/Marlin/src/HAL/DUE/usb/ctrl_access.h b/Marlin/src/HAL/DUE/usb/ctrl_access.h
index b33839076eae..d9cb05da7472 100644
--- a/Marlin/src/HAL/DUE/usb/ctrl_access.h
+++ b/Marlin/src/HAL/DUE/usb/ctrl_access.h
@@ -56,7 +56,6 @@
* Support and FAQ: visit Atmel Support
*/
-
#ifndef _CTRL_ACCESS_H_
#define _CTRL_ACCESS_H_
@@ -89,7 +88,6 @@ typedef enum
CTRL_BUSY = FAIL + 2 //!< Memory not initialized or changed.
} Ctrl_status;
-
// FYI: Each Logical Unit Number (LUN) corresponds to a memory.
// Check LUN defines.
@@ -136,7 +134,6 @@ typedef enum
#define LUN_ID_USB (MAX_LUN) //!< First dynamic LUN (USB host mass storage).
//! @}
-
// Include LUN header files.
#if LUN_0 == ENABLE
#include LUN_0_INCLUDE
@@ -166,13 +163,11 @@ typedef enum
#include LUN_USB_INCLUDE
#endif
-
// Check the configuration of write protection in conf_access.h.
#ifndef GLOBAL_WR_PROTECT
#error GLOBAL_WR_PROTECT must be defined as true or false in conf_access.h
#endif
-
#if GLOBAL_WR_PROTECT == true
//! Write protect.
@@ -180,7 +175,6 @@ extern bool g_wr_protect;
#endif
-
/*! \name Control Interface
*/
//! @{
@@ -279,7 +273,6 @@ extern const char *mem_name(U8 lun);
//! @}
-
#if ACCESS_USB == true
/*! \name MEM <-> USB Interface
@@ -310,7 +303,6 @@ extern Ctrl_status usb_2_memory(U8 lun, U32 addr, U16 nb_sector);
#endif // ACCESS_USB == true
-
#if ACCESS_MEM_TO_RAM == true
/*! \name MEM <-> RAM Interface
@@ -341,7 +333,6 @@ extern Ctrl_status ram_2_memory(U8 lun, U32 addr, const void *ram);
#endif // ACCESS_MEM_TO_RAM == true
-
#if ACCESS_STREAM == true
/*! \name Streaming MEM <-> MEM Interface
diff --git a/Marlin/src/HAL/DUE/usb/mrepeat.h b/Marlin/src/HAL/DUE/usb/mrepeat.h
index 8363d9cde380..10a8237545de 100644
--- a/Marlin/src/HAL/DUE/usb/mrepeat.h
+++ b/Marlin/src/HAL/DUE/usb/mrepeat.h
@@ -57,7 +57,6 @@
#include "preprocessor.h"
-
//! Maximal number of repetitions supported by MREPEAT.
#define MREPEAT_LIMIT 256
diff --git a/Marlin/src/HAL/DUE/usb/osc.h b/Marlin/src/HAL/DUE/usb/osc.h
index c0ae24381a39..1585018ed851 100644
--- a/Marlin/src/HAL/DUE/usb/osc.h
+++ b/Marlin/src/HAL/DUE/usb/osc.h
@@ -128,7 +128,6 @@ static inline void osc_enable(uint32_t ul_id) {
pmc_switch_sclk_to_32kxtal(PMC_OSC_BYPASS);
break;
-
case OSC_MAINCK_4M_RC:
pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_4_MHz);
break;
@@ -141,7 +140,6 @@ static inline void osc_enable(uint32_t ul_id) {
pmc_switch_mainck_to_fastrc(CKGR_MOR_MOSCRCF_12_MHz);
break;
-
case OSC_MAINCK_XTAL:
pmc_switch_mainck_to_xtal(PMC_OSC_XTAL/*,
pmc_us_to_moscxtst(BOARD_OSC_STARTUP_US,
diff --git a/Marlin/src/HAL/DUE/usb/preprocessor.h b/Marlin/src/HAL/DUE/usb/preprocessor.h
index c12d01cb642f..fe796c4fb83e 100644
--- a/Marlin/src/HAL/DUE/usb/preprocessor.h
+++ b/Marlin/src/HAL/DUE/usb/preprocessor.h
@@ -51,5 +51,4 @@
#include "stringz.h"
#include "mrepeat.h"
-
#endif // _PREPROCESSOR_H_
diff --git a/Marlin/src/HAL/DUE/usb/sbc_protocol.h b/Marlin/src/HAL/DUE/usb/sbc_protocol.h
index 983ec7adca1c..cdd4caa3cd50 100644
--- a/Marlin/src/HAL/DUE/usb/sbc_protocol.h
+++ b/Marlin/src/HAL/DUE/usb/sbc_protocol.h
@@ -86,7 +86,6 @@ enum scsi_sbc_mode {
SCSI_MS_MODE_CACHING = 0x08, //!< Caching mode page
};
-
//! \name SBC-2 Device-Specific Parameter
//@{
#define SCSI_MS_SBC_WP 0x80 //!< Write Protected
diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h
index 553fd3c29a88..c0d3c925e80a 100644
--- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h
+++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.h
@@ -45,7 +45,6 @@
* Support and FAQ: visit Atmel Support
*/
-
#ifndef _SD_MMC_SPI_MEM_H_
#define _SD_MMC_SPI_MEM_H_
@@ -63,17 +62,14 @@
#error sd_mmc_spi_mem.h is #included although SD_MMC_SPI_MEM is disabled
#endif
-
#include "ctrl_access.h"
-
//_____ D E F I N I T I O N S ______________________________________________
#define SD_MMC_REMOVED 0
#define SD_MMC_INSERTED 1
#define SD_MMC_REMOVING 2
-
//---- CONTROL FUNCTIONS ----
//!
//! @brief This function initializes the hw/sw resources required to drive the SD_MMC_SPI.
@@ -133,7 +129,6 @@ extern bool sd_mmc_spi_wr_protect(void);
//!
extern bool sd_mmc_spi_removal(void);
-
//---- ACCESS DATA FUNCTIONS ----
#if ACCESS_USB == true
diff --git a/Marlin/src/HAL/DUE/usb/sysclk.h b/Marlin/src/HAL/DUE/usb/sysclk.h
index 062337861502..4001366868a0 100644
--- a/Marlin/src/HAL/DUE/usb/sysclk.h
+++ b/Marlin/src/HAL/DUE/usb/sysclk.h
@@ -212,7 +212,6 @@ extern "C" {
#define CONFIG_USBCLK_DIV
#endif
-
extern void sysclk_enable_usb(void);
extern void sysclk_disable_usb(void);
diff --git a/Marlin/src/HAL/DUE/usb/udc.c b/Marlin/src/HAL/DUE/usb/udc.c
index 60bf0cfff35c..f6a4243d1d94 100644
--- a/Marlin/src/HAL/DUE/usb/udc.c
+++ b/Marlin/src/HAL/DUE/usb/udc.c
@@ -83,7 +83,6 @@ static usb_iface_desc_t UDC_DESC_STORAGE *udc_ptr_iface;
//! @}
-
//! \name Internal structure to store the USB device main strings
//! @{
diff --git a/Marlin/src/HAL/DUE/usb/udc.h b/Marlin/src/HAL/DUE/usb/udc.h
index 6230a81b359c..aba08d956e84 100644
--- a/Marlin/src/HAL/DUE/usb/udc.h
+++ b/Marlin/src/HAL/DUE/usb/udc.h
@@ -685,6 +685,4 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void);
} \endcode
*/
-
-
#endif // _UDC_H_
diff --git a/Marlin/src/HAL/DUE/usb/udd.h b/Marlin/src/HAL/DUE/usb/udd.h
index 6eda465e54a4..4e482784e163 100644
--- a/Marlin/src/HAL/DUE/usb/udd.h
+++ b/Marlin/src/HAL/DUE/usb/udd.h
@@ -213,7 +213,6 @@ void udd_send_remotewakeup(void);
*/
void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size );
-
/**
* \name Endpoint Management
*
diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc.c b/Marlin/src/HAL/DUE/usb/udi_cdc.c
index 89debe57f130..26788570c619 100644
--- a/Marlin/src/HAL/DUE/usb/udi_cdc.c
+++ b/Marlin/src/HAL/DUE/usb/udi_cdc.c
@@ -457,7 +457,6 @@ void udi_cdc_data_sof_notify(void)
#endif
}
-
// ------------------------
//------- Internal routines to control serial line
@@ -520,7 +519,6 @@ static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask)
udi_cdc_ctrl_state_notify(port, ep_comm);
}
-
static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep)
{
#if UDI_CDC_PORT_NB == 1 // To optimize code
@@ -542,7 +540,6 @@ static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep)
}
}
-
static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
{
uint8_t port;
@@ -578,11 +575,9 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n,
udi_cdc_ctrl_state_notify(port, ep);
}
-
// ------------------------
//------- Internal routines to process data transfer
-
static bool udi_cdc_rx_start(uint8_t port)
{
irqflags_t flags;
@@ -632,7 +627,6 @@ static bool udi_cdc_rx_start(uint8_t port)
udi_cdc_data_received);
}
-
static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
{
uint8_t buf_sel_trans;
@@ -668,7 +662,6 @@ static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_
udi_cdc_rx_start(port);
}
-
static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep)
{
uint8_t port;
@@ -700,7 +693,6 @@ static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t
udi_cdc_tx_send(port);
}
-
static void udi_cdc_tx_send(uint8_t port)
{
irqflags_t flags;
@@ -780,11 +772,9 @@ static void udi_cdc_tx_send(uint8_t port)
udi_cdc_data_sent);
}
-
// ------------------------
//------- Application interface
-
//------- Application interface
void udi_cdc_ctrl_signal_dcd(bool b_set)
diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc.h b/Marlin/src/HAL/DUE/usb/udi_cdc.h
index 2bc5fff18716..e9c6abbbb2f2 100644
--- a/Marlin/src/HAL/DUE/usb/udi_cdc.h
+++ b/Marlin/src/HAL/DUE/usb/udi_cdc.h
@@ -106,7 +106,6 @@ typedef struct {
usb_ep_desc_t ep_notify;
} udi_cdc_comm_desc_t;
-
/**
* \brief Data Class interface descriptor
*
@@ -121,7 +120,6 @@ typedef struct {
usb_ep_desc_t ep_out;
} udi_cdc_data_desc_t;
-
//! CDC communication endpoints size for all speeds
#define UDI_CDC_COMM_EP_SIZE 64
//! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B)
diff --git a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c
index 4c79e8df1309..bcae362cef8f 100644
--- a/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c
+++ b/Marlin/src/HAL/DUE/usb/udi_cdc_desc.c
@@ -109,7 +109,6 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {
.bNumConfigurations = 1
};
-
#ifdef USB_DEVICE_HS_SUPPORT
//! USB Device Qualifier Descriptor for HS
COMPILER_WORD_ALIGNED
diff --git a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c
index b10d043b9f12..8fa5acbb3f72 100644
--- a/Marlin/src/HAL/DUE/usb/udi_composite_desc.c
+++ b/Marlin/src/HAL/DUE/usb/udi_composite_desc.c
@@ -93,7 +93,6 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {
.bNumConfigurations = 1
};
-
#ifdef USB_DEVICE_HS_SUPPORT
//! USB Device Qualifier Descriptor for HS
COMPILER_WORD_ALIGNED
@@ -147,7 +146,6 @@ UDC_DESC_STORAGE udc_desc_t udc_desc_hs = {
};
#endif
-
/**
* \name UDC structures which contains all USB Device definitions
*/
diff --git a/Marlin/src/HAL/DUE/usb/udi_msc.c b/Marlin/src/HAL/DUE/usb/udi_msc.c
index 3f70a8fb18bc..56664f4bf7c6 100644
--- a/Marlin/src/HAL/DUE/usb/udi_msc.c
+++ b/Marlin/src/HAL/DUE/usb/udi_msc.c
@@ -86,7 +86,6 @@ UDC_DESC_STORAGE udi_api_t udi_api_msc = {
};
//@}
-
/**
* \ingroup udi_msc_group
* \defgroup udi_msc_group_internal Implementation of UDI MSC
@@ -137,7 +136,6 @@ volatile bool udi_msc_b_reset_trans = true;
//@}
-
/**
* \name Internal routines
*/
@@ -190,7 +188,6 @@ static void udi_msc_cbw_received(udd_ep_status_t status,
static bool udi_msc_cbw_validate(uint32_t alloc_len, uint8_t dir_flag);
//@}
-
/**
* \name Routines to process small data packet
*/
@@ -217,7 +214,6 @@ static void udi_msc_data_sent(udd_ep_status_t status, iram_size_t nb_sent,
udd_ep_id_t ep);
//@}
-
/**
* \name Routines to process CSW packet
*/
@@ -250,7 +246,6 @@ static void udi_msc_csw_sent(udd_ep_status_t status, iram_size_t nb_sent,
udd_ep_id_t ep);
//@}
-
/**
* \name Routines manage sense data
*/
@@ -307,7 +302,6 @@ static void udi_msc_sense_fail_cdb_invalid(void);
static void udi_msc_sense_command_invalid(void);
//@}
-
/**
* \name Routines manage SCSI Commands
*/
diff --git a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c
index 5a988b7421d1..01dda7e7fec8 100644
--- a/Marlin/src/HAL/DUE/usb/uotghs_device_due.c
+++ b/Marlin/src/HAL/DUE/usb/uotghs_device_due.c
@@ -293,7 +293,6 @@ do { \
# endif
#endif
-
/**
* \name Power management routine.
*/
@@ -310,7 +309,6 @@ static bool udd_b_idle;
//! State of sleep manager
static bool udd_b_sleep_initialized = false;
-
/*! \brief Authorize or not the CPU powerdown mode
*
* \param b_enable true to authorize idle mode
@@ -338,7 +336,6 @@ static void udd_sleep_mode(bool b_idle)
//@}
-
/**
* \name Control endpoint low level management routine.
*
@@ -410,7 +407,6 @@ static void udd_ctrl_send_zlp_out(void);
//! \brief Call callback associated to setup request
static void udd_ctrl_endofrequest(void);
-
/**
* \brief Main interrupt routine for control endpoint
*
@@ -422,7 +418,6 @@ static bool udd_ctrl_interrupt(void);
//@}
-
/**
* \name Management of bulk/interrupt/isochronous endpoints
*
@@ -460,7 +455,6 @@ typedef struct {
uint8_t stall_requested:1;
} udd_ep_job_t;
-
//! Array to register a job on bulk/interrupt/isochronous endpoint
static udd_ep_job_t udd_ep_job[USB_DEVICE_MAX_EP];
@@ -522,7 +516,6 @@ static bool udd_ep_interrupt(void);
#endif // (0!=USB_DEVICE_MAX_EP)
//@}
-
// ------------------------
//--- INTERNAL ROUTINES TO MANAGED GLOBAL EVENTS
@@ -671,13 +664,11 @@ ISR(UDD_USB_INT_FUN)
return;
}
-
bool udd_include_vbus_monitoring(void)
{
return true;
}
-
void udd_enable(void)
{
irqflags_t flags;
@@ -764,7 +755,6 @@ void udd_enable(void)
cpu_irq_restore(flags);
}
-
void udd_disable(void)
{
irqflags_t flags;
@@ -866,7 +856,6 @@ void udd_attach(void)
cpu_irq_restore(flags);
}
-
void udd_detach(void)
{
otg_unfreeze_clock();
@@ -883,7 +872,6 @@ void udd_detach(void)
udd_sleep_mode(false);
}
-
bool udd_is_high_speed(void)
{
#ifdef USB_DEVICE_HS_SUPPORT
@@ -893,7 +881,6 @@ bool udd_is_high_speed(void)
#endif
}
-
void udd_set_address(uint8_t address)
{
udd_disable_address();
@@ -901,13 +888,11 @@ void udd_set_address(uint8_t address)
udd_enable_address();
}
-
uint8_t udd_getaddress(void)
{
return udd_get_configured_address();
}
-
uint16_t udd_get_frame_number(void)
{
return udd_frame_number();
@@ -930,14 +915,12 @@ void udd_send_remotewakeup(void)
}
}
-
void udd_set_setup_payload(uint8_t *payload, uint16_t payload_size)
{
udd_g_ctrlreq.payload = payload;
udd_g_ctrlreq.payload_size = payload_size;
}
-
#if (0 != USB_DEVICE_MAX_EP)
bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes,
uint16_t MaxEndpointSize)
@@ -1061,7 +1044,6 @@ bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes,
return true;
}
-
void udd_ep_free(udd_ep_id_t ep)
{
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1074,14 +1056,12 @@ void udd_ep_free(udd_ep_id_t ep)
udd_ep_job[ep_index - 1].stall_requested = false;
}
-
bool udd_ep_is_halted(udd_ep_id_t ep)
{
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
return Is_udd_endpoint_stall_requested(ep_index);
}
-
bool udd_ep_set_halt(udd_ep_id_t ep)
{
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1122,7 +1102,6 @@ bool udd_ep_set_halt(udd_ep_id_t ep)
return true;
}
-
bool udd_ep_clear_halt(udd_ep_id_t ep)
{
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1163,7 +1142,6 @@ bool udd_ep_clear_halt(udd_ep_id_t ep)
return true;
}
-
bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket,
uint8_t * buf, iram_size_t buf_size,
udd_callback_trans_t callback)
@@ -1230,7 +1208,6 @@ bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket,
#endif
}
-
void udd_ep_abort(udd_ep_id_t ep)
{
uint8_t ep_index = ep & USB_EP_ADDR_MASK;
@@ -1259,7 +1236,6 @@ void udd_ep_abort(udd_ep_id_t ep)
udd_ep_abort_job(ep);
}
-
bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
udd_callback_halt_cleared_t callback)
{
@@ -1294,7 +1270,6 @@ bool udd_ep_wait_stall_clear(udd_ep_id_t ep,
}
#endif // (0 != USB_DEVICE_MAX_EP)
-
#ifdef USB_DEVICE_HS_SUPPORT
void udd_test_mode_j(void)
@@ -1303,20 +1278,17 @@ void udd_test_mode_j(void)
udd_enable_hs_test_mode_j();
}
-
void udd_test_mode_k(void)
{
udd_enable_hs_test_mode();
udd_enable_hs_test_mode_k();
}
-
void udd_test_mode_se0_nak(void)
{
udd_enable_hs_test_mode();
}
-
void udd_test_mode_packet(void)
{
uint8_t i;
@@ -1360,8 +1332,6 @@ void udd_test_mode_packet(void)
}
#endif // USB_DEVICE_HS_SUPPORT
-
-
// ------------------------
//--- INTERNAL ROUTINES TO MANAGED THE CONTROL ENDPOINT
@@ -1411,7 +1381,6 @@ static void udd_ctrl_init(void)
udd_ep_control_state = UDD_EPCTRL_SETUP;
}
-
static void udd_ctrl_setup_received(void)
{
irqflags_t flags;
@@ -1473,7 +1442,6 @@ static void udd_ctrl_setup_received(void)
}
}
-
static void udd_ctrl_in_sent(void)
{
static bool b_shortpacket = false;
@@ -1557,7 +1525,6 @@ static void udd_ctrl_in_sent(void)
cpu_irq_restore(flags);
}
-
static void udd_ctrl_out_received(void)
{
irqflags_t flags;
@@ -1648,7 +1615,6 @@ static void udd_ctrl_out_received(void)
cpu_irq_restore(flags);
}
-
static void udd_ctrl_underflow(void)
{
if (Is_udd_out_received(0))
@@ -1665,7 +1631,6 @@ static void udd_ctrl_underflow(void)
}
}
-
static void udd_ctrl_overflow(void)
{
if (Is_udd_in_send(0))
@@ -1681,7 +1646,6 @@ static void udd_ctrl_overflow(void)
}
}
-
static void udd_ctrl_stall_data(void)
{
// Stall all packets on IN & OUT control endpoint
@@ -1689,7 +1653,6 @@ static void udd_ctrl_stall_data(void)
udd_enable_stall_handshake(0);
}
-
static void udd_ctrl_send_zlp_in(void)
{
irqflags_t flags;
@@ -1707,7 +1670,6 @@ static void udd_ctrl_send_zlp_in(void)
cpu_irq_restore(flags);
}
-
static void udd_ctrl_send_zlp_out(void)
{
irqflags_t flags;
@@ -1723,7 +1685,6 @@ static void udd_ctrl_send_zlp_out(void)
cpu_irq_restore(flags);
}
-
static void udd_ctrl_endofrequest(void)
{
// If a callback is registered then call it
@@ -1732,7 +1693,6 @@ static void udd_ctrl_endofrequest(void)
}
}
-
static bool udd_ctrl_interrupt(void)
{
@@ -1783,7 +1743,6 @@ static bool udd_ctrl_interrupt(void)
return false;
}
-
// ------------------------
//--- INTERNAL ROUTINES TO MANAGED THE BULK/INTERRUPT/ISOCHRONOUS ENDPOINTS
@@ -1798,7 +1757,6 @@ static void udd_ep_job_table_reset(void)
}
}
-
static void udd_ep_job_table_kill(void)
{
uint8_t i;
@@ -1809,7 +1767,6 @@ static void udd_ep_job_table_kill(void)
}
}
-
static void udd_ep_abort_job(udd_ep_id_t ep)
{
ep &= USB_EP_ADDR_MASK;
@@ -1818,7 +1775,6 @@ static void udd_ep_abort_job(udd_ep_id_t ep)
udd_ep_finish_job(&udd_ep_job[ep - 1], true, ep);
}
-
static void udd_ep_finish_job(udd_ep_job_t * ptr_job, bool b_abort, uint8_t ep_num)
{
if (ptr_job->busy == false) {
@@ -1889,7 +1845,6 @@ static void udd_ep_trans_done(udd_ep_id_t ep)
udd_dma_ctrl |= UOTGHS_DEVDMACONTROL_END_BUFFIT |
UOTGHS_DEVDMACONTROL_CHANN_ENB;
-
// Disable IRQs to have a short sequence
// between read of EOT_STA and DMA enable
flags = cpu_irq_save();
diff --git a/Marlin/src/HAL/DUE/usb/uotghs_device_due.h b/Marlin/src/HAL/DUE/usb/uotghs_device_due.h
index 6df26d63dfd4..99ad492c1f55 100644
--- a/Marlin/src/HAL/DUE/usb/uotghs_device_due.h
+++ b/Marlin/src/HAL/DUE/usb/uotghs_device_due.h
@@ -129,7 +129,6 @@ extern "C" {
#define Is_udd_vbus_transition() (Tst_bits(UOTGHS->UOTGHS_SR, UOTGHS_SR_VBUSTI))
//! @}
-
//! @name UOTGHS device attach control
//! These macros manage the UOTGHS Device attach.
//! @{
@@ -141,7 +140,6 @@ extern "C" {
#define Is_udd_detached() (Tst_bits(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_DETACH))
//! @}
-
//! @name UOTGHS device bus events control
//! These macros manage the UOTGHS Device bus events.
//! @{
@@ -246,7 +244,6 @@ extern "C" {
#define udd_get_configured_address() (Rd_bitfield(UOTGHS->UOTGHS_DEVCTRL, UOTGHS_DEVCTRL_UADD_Msk))
//! @}
-
//! @name UOTGHS Device endpoint drivers
//! These macros manage the common features of the endpoints.
//! @{
@@ -330,7 +327,6 @@ extern "C" {
#define udd_data_toggle(ep) (Rd_bitfield(UOTGHS_ARRAY(UOTGHS_DEVEPTISR[0], ep), UOTGHS_DEVEPTISR_DTSEQ_Msk))
//! @}
-
//! @name UOTGHS Device control endpoint
//! These macros control the endpoints.
//! @{
@@ -530,7 +526,6 @@ extern "C" {
//! Tests if IN sending interrupt is enabled
#define Is_udd_in_send_interrupt_enabled(ep) (Tst_bits(UOTGHS_ARRAY(UOTGHS_DEVEPTIMR[0], ep), UOTGHS_DEVEPTIMR_TXINE))
-
//! Get 64-, 32-, 16- or 8-bit access to FIFO data register of selected endpoint.
//! @param ep Endpoint of which to access FIFO data register
//! @param scale Data scale in bits: 64, 32, 16 or 8
@@ -652,7 +647,6 @@ typedef struct {
//! @}
//! @}
-
/// @cond 0
/**INDENT-OFF**/
#ifdef __cplusplus
diff --git a/Marlin/src/HAL/DUE/usb/uotghs_otg.h b/Marlin/src/HAL/DUE/usb/uotghs_otg.h
index f0e55c896fac..8c12a3e29199 100644
--- a/Marlin/src/HAL/DUE/usb/uotghs_otg.h
+++ b/Marlin/src/HAL/DUE/usb/uotghs_otg.h
@@ -53,7 +53,6 @@
extern "C" {
#endif
-
//! \ingroup usb_group
//! \defgroup otg_group UOTGHS OTG Driver
//! UOTGHS low-level driver for OTG features
@@ -74,7 +73,6 @@ bool otg_dual_enable(void);
*/
void otg_dual_disable(void);
-
//! @name UOTGHS OTG ID pin management
//! The ID pin come from the USB OTG connector (A and B receptable) and
//! allows to select the USB mode host or device.
diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol.h b/Marlin/src/HAL/DUE/usb/usb_protocol.h
index 4540247df826..9bf0a1ba60c1 100644
--- a/Marlin/src/HAL/DUE/usb/usb_protocol.h
+++ b/Marlin/src/HAL/DUE/usb/usb_protocol.h
@@ -374,7 +374,6 @@ typedef struct {
uint8_t bNumDeviceCaps;
} usb_dev_bos_desc_t;
-
/**
* \brief USB Device Capabilities - USB 2.0 Extension Descriptor structure
*
@@ -411,7 +410,6 @@ typedef struct {
uint8_t iFunction; //!< Index of string descriptor
} usb_association_desc_t;
-
/**
* \brief Standard USB configuration descriptor structure
*/
@@ -426,7 +424,6 @@ typedef struct {
uint8_t bMaxPower;
} usb_conf_desc_t;
-
#define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set
#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered
#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered
@@ -475,7 +472,6 @@ typedef struct {
uint8_t bInterval;
} usb_ep_desc_t;
-
/**
* \brief A standard USB string descriptor structure
*/
diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h b/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h
index 9b82afc6242b..769e7589bcc8 100644
--- a/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h
+++ b/Marlin/src/HAL/DUE/usb/usb_protocol_cdc.h
@@ -168,7 +168,6 @@ COMPILER_PACK_SET(1)
//! \name USB CDC Descriptors
//@{
-
//! CDC Header Functional Descriptor
typedef struct {
uint8_t bFunctionLength;
@@ -203,7 +202,6 @@ typedef struct {
uint8_t bSlaveInterface0;
} usb_cdc_union_desc_t;
-
//! \name USB CDC Call Management Capabilities
//@{
//! Device handles call management itself
@@ -278,7 +276,6 @@ typedef struct {
//@}
//@}
-
//! \name USB CDC notification message
//@{
diff --git a/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h b/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h
index cc30a94e4fc8..227a13dc533c 100644
--- a/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h
+++ b/Marlin/src/HAL/DUE/usb/usb_protocol_msc.h
@@ -47,7 +47,6 @@
#ifndef _USB_PROTOCOL_MSC_H_
#define _USB_PROTOCOL_MSC_H_
-
/**
* \ingroup usb_protocol_group
* \defgroup usb_msc_protocol USB Mass Storage Class (MSC) protocol definitions
@@ -89,7 +88,6 @@
#define MSC_PROTOCOL_BULK 0x50 //!< Bulk-only
//@}
-
/**
* \brief MSC USB requests (bRequest)
*/
@@ -98,7 +96,6 @@ enum usb_reqid_msc {
USB_REQ_MSC_GET_MAX_LUN = 0xFE //!< Get Max LUN
};
-
COMPILER_PACK_SET(1)
/**
@@ -122,7 +119,6 @@ struct usb_msc_cbw {
#define USB_CBW_LEN_MASK 0x1F //!< Valid bits in bCBWCBLength
//@}
-
/**
* \name A Command Status Wrapper (CSW).
*/
diff --git a/Marlin/src/HAL/ESP32/eeprom.cpp b/Marlin/src/HAL/ESP32/eeprom.cpp
index cb5f881284ec..ca4a80636141 100644
--- a/Marlin/src/HAL/ESP32/eeprom.cpp
+++ b/Marlin/src/HAL/ESP32/eeprom.cpp
@@ -31,24 +31,28 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { return EEPROM.begin(MARLIN_EEPROM_SIZE); }
bool PersistentStore::access_finish() { EEPROM.end(); return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
for (size_t i = 0; i < size; i++) {
- EEPROM.write(pos++, value[i]);
+ const int p = REAL_EEPROM_ADDR(pos);
+ EEPROM.write(p, value[i]);
crc16(crc, &value[i], 1);
+ ++pos;
}
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
for (size_t i = 0; i < size; i++) {
- uint8_t c = EEPROM.read(pos++);
+ const int p = REAL_EEPROM_ADDR(pos);
+ uint8_t c = EEPROM.read(p);
if (writing) value[i] = c;
crc16(crc, &c, 1);
+ ++pos;
}
return false;
}
diff --git a/Marlin/src/HAL/ESP32/inc/Conditionals_type.h b/Marlin/src/HAL/ESP32/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/ESP32/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp b/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp
index fe4a91384a28..59da99b3f56d 100644
--- a/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp
+++ b/Marlin/src/HAL/HC32/eeprom_bl24cxx.cpp
@@ -37,7 +37,7 @@
#error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() {
eeprom_init();
@@ -49,7 +49,7 @@ bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
uint8_t v = *value;
- uint8_t *const p = (uint8_t *const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
// EEPROM has only ~100,000 write cycles,
// so only write bytes that have changed!
@@ -70,16 +70,10 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
return false;
}
-bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size,
- uint16_t *crc, const bool writing /*=true*/) {
+bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing /*=true*/) {
do {
- uint8_t *const p = (uint8_t *const)pos;
- uint8_t c = eeprom_read_byte(p);
- if (writing)
- {
- *value = c;
- }
-
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
+ if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
value++;
diff --git a/Marlin/src/HAL/HC32/eeprom_sdcard.cpp b/Marlin/src/HAL/HC32/eeprom_sdcard.cpp
index ec77c441a0b2..601e86dd3054 100644
--- a/Marlin/src/HAL/HC32/eeprom_sdcard.cpp
+++ b/Marlin/src/HAL/HC32/eeprom_sdcard.cpp
@@ -38,9 +38,7 @@
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
-size_t PersistentStore::capacity() {
- return MARLIN_EEPROM_SIZE;
-}
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
#define _ALIGN(x) __attribute__((aligned(x)))
static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
@@ -85,11 +83,10 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, const size_t size, uint16_t *crc, const bool writing /*=true*/) {
for (size_t i = 0; i < size; i++) {
- uint8_t c = HAL_eeprom_data[pos + i];
+ const uint8_t c = HAL_eeprom_data[pos + i];
if (writing) value[i] = c;
crc16(crc, &c, 1);
}
-
pos += size;
return false;
}
diff --git a/Marlin/src/HAL/HC32/eeprom_wired.cpp b/Marlin/src/HAL/HC32/eeprom_wired.cpp
index 42c25635884d..d9be65b4c07c 100644
--- a/Marlin/src/HAL/HC32/eeprom_wired.cpp
+++ b/Marlin/src/HAL/HC32/eeprom_wired.cpp
@@ -35,7 +35,7 @@
#ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_finish() { return true; }
@@ -56,7 +56,7 @@ bool PersistentStore::access_start() {
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
- uint8_t *const p = (uint8_t *const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
// EEPROM has only ~100,000 write cycles,
// so only write bytes that have changed!
@@ -77,10 +77,8 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing /*=true*/) {
do {
- uint8_t c = eeprom_read_byte((uint8_t *)pos);
- if (writing && value) {
- *value = c;
- }
+ const uint8_t c = eeprom_read_byte((uint8_t *)REAL_EEPROM_ADDR(pos));
+ if (writing && value) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/HC32/inc/Conditionals_type.h b/Marlin/src/HAL/HC32/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/HC32/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/HC32/inc/SanityCheck.h b/Marlin/src/HAL/HC32/inc/SanityCheck.h
index d7c6894039cb..ef8d9a997583 100644
--- a/Marlin/src/HAL/HC32/inc/SanityCheck.h
+++ b/Marlin/src/HAL/HC32/inc/SanityCheck.h
@@ -58,11 +58,9 @@
#endif
#if TEMP_SENSOR_SOC
- #if !defined(TEMP_SOC_PIN)
+ #ifndef TEMP_SOC_PIN
#error "TEMP_SOC_PIN must be defined to use TEMP_SENSOR_SOC."
- #endif
-
- #if defined(TEMP_SOC_PIN) && IS_GPIO_PIN(TEMP_SOC_PIN)
+ #elif IS_GPIO_PIN(TEMP_SOC_PIN)
#error "TEMP_SOC_PIN must not be a valid GPIO pin to avoid conflicts."
#endif
#endif
diff --git a/Marlin/src/HAL/HC32/printf_retarget.cpp b/Marlin/src/HAL/HC32/printf_retarget.cpp
index 2c98415dff96..8a48aca3d44a 100644
--- a/Marlin/src/HAL/HC32/printf_retarget.cpp
+++ b/Marlin/src/HAL/HC32/printf_retarget.cpp
@@ -23,7 +23,7 @@
#ifdef ARDUINO_ARCH_HC32
#ifdef REDIRECT_PRINTF_TO_SERIAL
-#if !defined(__GNUC__)
+#ifndef __GNUC__
#error "only GCC is supported"
#endif
diff --git a/Marlin/src/HAL/LINUX/eeprom.cpp b/Marlin/src/HAL/LINUX/eeprom.cpp
index f878bba6a51b..2b9b37e66d2c 100644
--- a/Marlin/src/HAL/LINUX/eeprom.cpp
+++ b/Marlin/src/HAL/LINUX/eeprom.cpp
@@ -35,7 +35,7 @@
uint8_t buffer[MARLIN_EEPROM_SIZE];
char filename[] = "eeprom.dat";
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() {
const char eeprom_erase_value = 0xFF;
diff --git a/Marlin/src/HAL/LINUX/inc/Conditionals_type.h b/Marlin/src/HAL/LINUX/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/LINUX/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/LINUX/servo_private.h b/Marlin/src/HAL/LINUX/servo_private.h
index bcc8d2037f90..11e1c2b93c62 100644
--- a/Marlin/src/HAL/LINUX/servo_private.h
+++ b/Marlin/src/HAL/LINUX/servo_private.h
@@ -60,7 +60,6 @@
#define INVALID_SERVO 255 // flag indicating an invalid servo index
-
// Types
typedef struct {
diff --git a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp
index 38d2705d519a..9f873d5774a3 100644
--- a/Marlin/src/HAL/LPC1768/eeprom_flash.cpp
+++ b/Marlin/src/HAL/LPC1768/eeprom_flash.cpp
@@ -61,7 +61,7 @@ static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0};
static bool eeprom_dirty = false;
static int current_slot = 0;
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() {
uint32_t first_nblank_loc, first_nblank_val;
@@ -112,7 +112,8 @@ bool PersistentStore::access_finish() {
}
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
- for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i];
+ const int p = REAL_EEPROM_ADDR(pos);
+ for (size_t i = 0; i < size; i++) ram_eeprom[p + i] = value[i];
eeprom_dirty = true;
crc16(crc, value, size);
pos += size;
@@ -120,8 +121,9 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
}
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
+ const int p = REAL_EEPROM_ADDR(pos);
const uint8_t * const buff = writing ? &value[0] : &ram_eeprom[pos];
- if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[pos + i];
+ if (writing) for (size_t i = 0; i < size; i++) value[i] = ram_eeprom[p + i];
crc16(crc, buff, size);
pos += size;
return false; // return true for any error
diff --git a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
index 4f1797dc6a7d..30ecb01a0915 100644
--- a/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
+++ b/Marlin/src/HAL/LPC1768/eeprom_sdcard.cpp
@@ -49,7 +49,7 @@ bool eeprom_file_open = false;
#define MARLIN_EEPROM_SIZE size_t(0x1000) // 4KiB of Emulated EEPROM
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() {
const char eeprom_erase_value = 0xFF;
diff --git a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp
index 1bbc39d4a242..3230e29afcd1 100644
--- a/Marlin/src/HAL/LPC1768/eeprom_wired.cpp
+++ b/Marlin/src/HAL/LPC1768/eeprom_wired.cpp
@@ -36,7 +36,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x8000 // 32K
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
@@ -45,7 +45,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
uint16_t written = 0;
while (size--) {
uint8_t v = *value;
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
@@ -64,7 +64,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
// Read from external EEPROM
- const uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/LPC1768/inc/Conditionals_type.h b/Marlin/src/HAL/LPC1768/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/LPC1768/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf b/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf
index 4732eb855242..37d9a617dbb5 100644
--- a/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf
+++ b/Marlin/src/HAL/LPC1768/win_usb_driver/lpc176x_usb_driver.inf
@@ -8,14 +8,12 @@ DriverVer =04/14/2008, 5.1.2600.5512
[Manufacturer]
%PROVIDER%=DeviceList,ntamd64
-
[DeviceList]
%DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00
[DeviceList.ntamd64]
%DESCRIPTION%=LPC1768USB, USB\VID_1D50&PID_6029&MI_00
-
[LPC1768USB]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
@@ -28,9 +26,8 @@ AddService=usbser, 0x00000002, LowerFilter_Service_Inst
[SerialPropPageAddReg]
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
-
[Strings]
PROVIDER = "marlinfw.org"
DRIVER.SVC = "Marlin USB Driver"
DESCRIPTION= "Marlin USB Serial"
-COMPOSITE = "Marlin USB VCOM"
\ No newline at end of file
+COMPOSITE = "Marlin USB VCOM"
diff --git a/Marlin/src/HAL/NATIVE_SIM/inc/Conditionals_type.h b/Marlin/src/HAL/NATIVE_SIM/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/NATIVE_SIM/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/NATIVE_SIM/servo_private.h b/Marlin/src/HAL/NATIVE_SIM/servo_private.h
index 06be1893f6eb..e0eb30ab2846 100644
--- a/Marlin/src/HAL/NATIVE_SIM/servo_private.h
+++ b/Marlin/src/HAL/NATIVE_SIM/servo_private.h
@@ -61,7 +61,6 @@
#define INVALID_SERVO 255 // flag indicating an invalid servo index
-
// Types
typedef struct {
diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h
index c27c84e8c398..39af4d7e6844 100644
--- a/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h
+++ b/Marlin/src/HAL/NATIVE_SIM/u8g/LCD_pin_routines.h
@@ -31,7 +31,6 @@
* resulted in using about about 25% of the CPU's time.
*/
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/Marlin/src/HAL/SAMD21/HAL.cpp b/Marlin/src/HAL/SAMD21/HAL.cpp
index 1bc0406ab3f0..3656d97190e6 100644
--- a/Marlin/src/HAL/SAMD21/HAL.cpp
+++ b/Marlin/src/HAL/SAMD21/HAL.cpp
@@ -40,8 +40,6 @@
DefaultSerial3 MSerial2(false, Serial2);
#endif
-
-
#define WDT_CONFIG_PER_7_Val 0x9u
#define WDT_CONFIG_PER_Pos 0
#define WDT_CONFIG_PER_7 (WDT_CONFIG_PER_7_Val << WDT_CONFIG_PER_Pos)
@@ -165,7 +163,6 @@ void MarlinHAL::adc_init() {
ADC->REFCTRL.reg = ADC_REFCTRL_REFSEL_INTVCC1;
ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_32| ADC_AVGCTRL_ADJRES(4);;
-
ADC->CTRLB.reg = ADC_CTRLB_PRESCALER_DIV128 |
ADC_CTRLB_RESSEL_16BIT |
ADC_CTRLB_FREERUN;
diff --git a/Marlin/src/HAL/SAMD21/HAL.h b/Marlin/src/HAL/SAMD21/HAL.h
index fe7285954938..95f391fa8678 100644
--- a/Marlin/src/HAL/SAMD21/HAL.h
+++ b/Marlin/src/HAL/SAMD21/HAL.h
@@ -47,7 +47,6 @@ typedef ForwardSerial1Class< decltype(Serial2) > DefaultSerial3;
extern DefaultSerial2 MSerial0;
extern DefaultSerial3 MSerial1;
-
#define __MSERIAL(X) MSerial##X
#define _MSERIAL(X) __MSERIAL(X)
#define MSERIAL(X) _MSERIAL(INCREMENT(X))
diff --git a/Marlin/src/HAL/SAMD21/SAMD21.h b/Marlin/src/HAL/SAMD21/SAMD21.h
index 8e9d17fc5026..b64c5ce72555 100644
--- a/Marlin/src/HAL/SAMD21/SAMD21.h
+++ b/Marlin/src/HAL/SAMD21/SAMD21.h
@@ -57,8 +57,6 @@
: (P == 3 && WITHIN(B, 20, 21)) ? 10 + (B) - 20 \
: -1)
-
-
#define A2_AIN 3
#define A3_AIN 4
#define A4_AIN 5
diff --git a/Marlin/src/HAL/SAMD21/Servo.cpp b/Marlin/src/HAL/SAMD21/Servo.cpp
index 38b995fc9a05..704d0a2904ce 100644
--- a/Marlin/src/HAL/SAMD21/Servo.cpp
+++ b/Marlin/src/HAL/SAMD21/Servo.cpp
@@ -55,7 +55,6 @@
#define TIMER_TCCHANNEL(t) ((t) & 1)
#define TC_COUNTER_START_VAL 0xFFFF
-
static volatile int8_t currentServoIndex[_Nbr_16timers]; // index for the servo being pulsed for each timer (or -1 if refresh interval)
FORCE_INLINE static uint16_t getTimerCount() {
diff --git a/Marlin/src/HAL/SAMD21/eeprom_flash.cpp b/Marlin/src/HAL/SAMD21/eeprom_flash.cpp
index 4a4e328d1a00..66329bff19c8 100644
--- a/Marlin/src/HAL/SAMD21/eeprom_flash.cpp
+++ b/Marlin/src/HAL/SAMD21/eeprom_flash.cpp
@@ -37,19 +37,24 @@ static const uint8_t flashdata[TOTAL_FLASH_SIZE] __attribute__((__aligned__(256
#include "../shared/eeprom_api.h"
-size_t PersistentStore::capacity() {
- return MARLIN_EEPROM_SIZE;
- /* const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
+
+/*
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
+ const uint8_t psz = NVMCTRL->SEESTAT.bit.PSZ,
sblk = NVMCTRL->SEESTAT.bit.SBLK;
- return (!psz && !sblk) ? 0
- : (psz <= 2) ? (0x200 << psz)
- : (sblk == 1 || psz == 3) ? 4096
- : (sblk == 2 || psz == 4) ? 8192
- : (sblk <= 4 || psz == 5) ? 16384
- : (sblk >= 9 && psz == 7) ? 65536
- : 32768;*/
+ return (
+ (!psz && !sblk) ? 0
+ : (psz <= 2) ? (0x200 << psz)
+ : (sblk == 1 || psz == 3) ? 4096
+ : (sblk == 2 || psz == 4) ? 8192
+ : (sblk <= 4 || psz == 5) ? 16384
+ : (sblk >= 9 && psz == 7) ? 65536
+ : 32768
+ ) - eeprom_exclude_size;
}
+*/
uint32_t PAGE_SIZE;
uint32_t ROW_SIZE;
@@ -99,8 +104,7 @@ bool PersistentStore::access_finish() {
volatile uint32_t *dst_addr = (volatile uint32_t *) &flashdata;
uint32_t *pointer = (uint32_t *) buffer;
- for (uint32_t i = 0; i < TOTAL_FLASH_SIZE; i+=4) {
-
+ for (uint32_t i = 0; i < TOTAL_FLASH_SIZE; i += 4) {
*dst_addr = (uint32_t) *pointer;
pointer++;
dst_addr ++;
@@ -120,19 +124,19 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
if (!hasWritten) {
// init temp buffer
buffer = (uint8_t *) malloc(MARLIN_EEPROM_SIZE);
- hasWritten=true;
+ hasWritten = true;
}
- memcpy(buffer+pos,value,size);
+ memcpy(buffer + REAL_EEPROM_ADDR(pos), value, size);
pos += size;
return false;
}
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
- volatile uint8_t *dst_addr = (volatile uint8_t *) &flashdata;
- dst_addr += pos;
+ volatile uint8_t *dst_addr = (volatile uint8_t *) &flashdata;
+ dst_addr += REAL_EEPROM_ADDR(pos);
- memcpy(value,(const void *) dst_addr,size);
+ memcpy(value, (const void *)dst_addr, size);
pos += size;
return false;
}
diff --git a/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp b/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp
index 587dcb0b1416..12977a178c57 100644
--- a/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp
+++ b/Marlin/src/HAL/SAMD21/eeprom_qspi.cpp
@@ -38,7 +38,7 @@
static bool initialized;
-size_t PersistentStore::capacity() { return qspi.size(); }
+size_t PersistentStore::capacity() { return qspi.size() - eeprom_exclude_size; }
bool PersistentStore::access_start() {
if (!initialized) {
@@ -56,7 +56,7 @@ bool PersistentStore::access_finish() {
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
const uint8_t v = *value;
- qspi.writeByte(pos, v);
+ qspi.writeByte(REAL_EEPROM_ADDR(pos), v);
crc16(crc, &v, 1);
pos++;
value++;
@@ -66,7 +66,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
while (size--) {
- uint8_t c = qspi.readByte(pos);
+ const uint8_t c = qspi.readByte(REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/SAMD21/eeprom_wired.cpp b/Marlin/src/HAL/SAMD21/eeprom_wired.cpp
index ab71e616fc7b..da0eb1b0c81b 100644
--- a/Marlin/src/HAL/SAMD21/eeprom_wired.cpp
+++ b/Marlin/src/HAL/SAMD21/eeprom_wired.cpp
@@ -42,7 +42,7 @@
#ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
@@ -51,7 +51,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
uint16_t written = 0;
while (size--) {
const uint8_t v = *value;
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
@@ -69,7 +69,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
while (size--) {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/SAMD21/inc/Conditionals_type.h b/Marlin/src/HAL/SAMD21/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/SAMD21/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp
index 42630a6ce5ca..2e2b0d8f8d22 100644
--- a/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp
+++ b/Marlin/src/HAL/SAMD21/u8g/u8g_com_HAL_samd21_shared_hw_spi.cpp
@@ -85,7 +85,6 @@ void u8g_SetPILevel(u8g_t *u8g, uint8_t pin_index, uint8_t level) {
uint8_t u8g_com_samd21_st7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {
-
switch (msg) {
case U8G_COM_MSG_STOP:
break;
diff --git a/Marlin/src/HAL/SAMD51/Servo.cpp b/Marlin/src/HAL/SAMD51/Servo.cpp
index e533eee30155..059955e11aac 100644
--- a/Marlin/src/HAL/SAMD51/Servo.cpp
+++ b/Marlin/src/HAL/SAMD51/Servo.cpp
@@ -54,7 +54,6 @@
#define TIMER_TCCHANNEL(t) ((t) & 1)
#define TC_COUNTER_START_VAL 0xFFFF
-
static volatile int8_t currentServoIndex[_Nbr_16timers]; // index for the servo being pulsed for each timer (or -1 if refresh interval)
FORCE_INLINE static uint16_t getTimerCount() {
diff --git a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp
index 1c82ede04032..a39e4c4fa31f 100644
--- a/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp
+++ b/Marlin/src/HAL/SAMD51/eeprom_qspi.cpp
@@ -35,7 +35,7 @@
static bool initialized;
-size_t PersistentStore::capacity() { return qspi.size(); }
+size_t PersistentStore::capacity() { return qspi.size() - eeprom_exclude_size; }
bool PersistentStore::access_start() {
if (!initialized) {
@@ -53,7 +53,7 @@ bool PersistentStore::access_finish() {
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
const uint8_t v = *value;
- qspi.writeByte(pos, v);
+ qspi.writeByte(REAL_EEPROM_ADDR(pos), v);
crc16(crc, &v, 1);
pos++;
value++;
@@ -63,7 +63,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
while (size--) {
- uint8_t c = qspi.readByte(pos);
+ const uint8_t c = qspi.readByte(REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/SAMD51/eeprom_wired.cpp b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp
index 7a03d4eaa34c..00a739a5872b 100644
--- a/Marlin/src/HAL/SAMD51/eeprom_wired.cpp
+++ b/Marlin/src/HAL/SAMD51/eeprom_wired.cpp
@@ -40,7 +40,7 @@
#ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
@@ -49,7 +49,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
uint16_t written = 0;
while (size--) {
const uint8_t v = *value;
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
@@ -67,7 +67,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
while (size--) {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/SAMD51/inc/Conditionals_type.h b/Marlin/src/HAL/SAMD51/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/SAMD51/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp
index f30b3dedb203..3e0bb58dad14 100644
--- a/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp
+++ b/Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp
@@ -44,7 +44,7 @@
#error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
@@ -53,7 +53,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
uint16_t written = 0;
while (size--) {
uint8_t v = *value;
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
@@ -71,8 +71,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t * const p = (uint8_t * const)pos;
- uint8_t c = eeprom_read_byte(p);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/STM32/eeprom_flash.cpp b/Marlin/src/HAL/STM32/eeprom_flash.cpp
index 69511c6de40c..37963ad50154 100644
--- a/Marlin/src/HAL/STM32/eeprom_flash.cpp
+++ b/Marlin/src/HAL/STM32/eeprom_flash.cpp
@@ -101,7 +101,7 @@ static bool eeprom_data_written = false;
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() {
@@ -245,14 +245,15 @@ bool PersistentStore::access_finish() {
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
while (size--) {
uint8_t v = *value;
+ const int p = REAL_EEPROM_ADDR(pos);
#if ENABLED(FLASH_EEPROM_LEVELING)
- if (v != ram_eeprom[pos]) {
- ram_eeprom[pos] = v;
+ if (v != ram_eeprom[p]) {
+ ram_eeprom[p] = v;
eeprom_data_written = true;
}
#else
- if (v != eeprom_buffered_read_byte(pos)) {
- eeprom_buffered_write_byte(pos, v);
+ if (v != eeprom_buffered_read_byte(p)) {
+ eeprom_buffered_write_byte(p, v);
eeprom_data_written = true;
}
#endif
@@ -265,7 +266,8 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[pos], eeprom_buffered_read_byte(pos));
+ const int p = REAL_EEPROM_ADDR(pos);
+ const uint8_t c = TERN(FLASH_EEPROM_LEVELING, ram_eeprom[p], eeprom_buffered_read_byte(p));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp
index 1b5c0ae5b2c0..071d0bac0008 100644
--- a/Marlin/src/HAL/STM32/eeprom_sdcard.cpp
+++ b/Marlin/src/HAL/STM32/eeprom_sdcard.cpp
@@ -40,7 +40,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
#define _ALIGN(x) __attribute__ ((aligned(x)))
static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
diff --git a/Marlin/src/HAL/STM32/eeprom_sram.cpp b/Marlin/src/HAL/STM32/eeprom_sram.cpp
index 9bd84ff4fe27..58a67f1759ab 100644
--- a/Marlin/src/HAL/STM32/eeprom_sram.cpp
+++ b/Marlin/src/HAL/STM32/eeprom_sram.cpp
@@ -33,7 +33,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
diff --git a/Marlin/src/HAL/STM32/eeprom_wired.cpp b/Marlin/src/HAL/STM32/eeprom_wired.cpp
index 6fb9d9b51b7b..5440030bd4c4 100644
--- a/Marlin/src/HAL/STM32/eeprom_wired.cpp
+++ b/Marlin/src/HAL/STM32/eeprom_wired.cpp
@@ -38,7 +38,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
@@ -47,7 +47,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
uint16_t written = 0;
while (size--) {
uint8_t v = *value;
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
@@ -66,7 +66,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
// Read from either external EEPROM, program flash or Backup SRAM
- const uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/STM32/inc/Conditionals_type.h b/Marlin/src/HAL/STM32/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/STM32/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32/inc/SanityCheck.h b/Marlin/src/HAL/STM32/inc/SanityCheck.h
index 80d0314dbbd4..8bff51874eb5 100644
--- a/Marlin/src/HAL/STM32/inc/SanityCheck.h
+++ b/Marlin/src/HAL/STM32/inc/SanityCheck.h
@@ -28,7 +28,6 @@
// #error "SPINDLE_LASER_PWM_PIN must use SERVO0, SERVO1 or SERVO3 connector"
//#endif
-
#if ENABLED(SDCARD_EEPROM_EMULATION) && !HAS_MEDIA
#undef SDCARD_EEPROM_EMULATION // Avoid additional error noise
#if USE_FALLBACK_EEPROM
diff --git a/Marlin/src/HAL/STM32F1/HAL_N32.h b/Marlin/src/HAL/STM32F1/HAL_N32.h
index 46ec7ba6db9c..7162e2b97147 100644
--- a/Marlin/src/HAL/STM32F1/HAL_N32.h
+++ b/Marlin/src/HAL/STM32F1/HAL_N32.h
@@ -850,7 +850,6 @@ typedef struct {
__IO uint32_t BDCR; /* compatible */
__IO uint32_t CSR; /* compatible */
-
__IO uint32_t AHBRSTR; /* Not compatible, ADC reset here settings */
__IO uint32_t CFGR2; /* Not compatible, ADC clock settings here */
__IO uint32_t CFGR3; /* Not compatible, add a new register */
diff --git a/Marlin/src/HAL/STM32F1/SPI.cpp b/Marlin/src/HAL/STM32F1/SPI.cpp
index a180684757ee..ab111ddbf01b 100644
--- a/Marlin/src/HAL/STM32F1/SPI.cpp
+++ b/Marlin/src/HAL/STM32F1/SPI.cpp
@@ -517,7 +517,6 @@ uint8_t SPIClass::dmaSendAsync(const void * transmitBuf, uint16_t length, bool m
return b;
}
-
/**
* New functions added to manage callbacks.
* Victor Perez 2017
diff --git a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp
index 4e25bc69da4e..1252e77b0b3a 100644
--- a/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp
+++ b/Marlin/src/HAL/STM32F1/eeprom_bl24cxx.cpp
@@ -41,7 +41,7 @@
#error "MARLIN_EEPROM_SIZE is required for IIC_BL24CXX_EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { eeprom_init(); return true; }
bool PersistentStore::access_finish() { return true; }
@@ -50,7 +50,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
uint16_t written = 0;
while (size--) {
uint8_t v = *value;
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
if (++written & 0x7F) delay(2); else safe_delay(2); // Avoid triggering watchdog during long EEPROM writes
@@ -68,8 +68,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t * const p = (uint8_t * const)pos;
- uint8_t c = eeprom_read_byte(p);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp
index 48fb2d286cc6..afdfefd5f076 100644
--- a/Marlin/src/HAL/STM32F1/eeprom_flash.cpp
+++ b/Marlin/src/HAL/STM32F1/eeprom_flash.cpp
@@ -41,7 +41,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE ((EEPROM_PAGE_SIZE) * 2)
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
static uint8_t ram_eeprom[MARLIN_EEPROM_SIZE] __attribute__((aligned(4))) = {0};
static bool eeprom_dirty = false;
diff --git a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp
index 9cfa97c1ab6e..6b7219342219 100644
--- a/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp
+++ b/Marlin/src/HAL/STM32F1/eeprom_sdcard.cpp
@@ -39,7 +39,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE 0x1000 // 4KB
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
#define _ALIGN(x) __attribute__ ((aligned(x))) // SDIO uint32_t* compat.
static char _ALIGN(4) HAL_eeprom_data[MARLIN_EEPROM_SIZE];
diff --git a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp
index bc48eef34fa3..bfb771809443 100644
--- a/Marlin/src/HAL/STM32F1/eeprom_wired.cpp
+++ b/Marlin/src/HAL/STM32F1/eeprom_wired.cpp
@@ -36,7 +36,7 @@
#ifndef MARLIN_EEPROM_SIZE
#error "MARLIN_EEPROM_SIZE is required for I2C / SPI EEPROM."
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_finish() { return true; }
@@ -57,7 +57,7 @@ bool PersistentStore::access_start() {
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
@@ -76,7 +76,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing && value) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/STM32F1/inc/Conditionals_type.h b/Marlin/src/HAL/STM32F1/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/STM32F1/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf b/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf
index c39f4ce0ed5d..0df30d2c42a4 100644
--- a/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf
+++ b/Marlin/src/HAL/STM32F1/maple_win_usb_driver/maple_serial.inf
@@ -48,7 +48,6 @@ ServiceBinary=%12%\usbser.sys
; String Definitions
;------------------------------------------------------------------------------
-
[Strings]
STM = "LeafLabs"
MFGNAME = "LeafLabs"
diff --git a/Marlin/src/HAL/STM32F1/onboard_sd.h b/Marlin/src/HAL/STM32F1/onboard_sd.h
index f8846e95bcaa..be1d1d0a6bdc 100644
--- a/Marlin/src/HAL/STM32F1/onboard_sd.h
+++ b/Marlin/src/HAL/STM32F1/onboard_sd.h
@@ -47,7 +47,6 @@ typedef enum {
RES_PARERR /* 4: Invalid Parameter */
} DRESULT;
-
#if _DISKIO_ISDIO
/* Command structure for iSDIO ioctl command */
typedef struct {
diff --git a/Marlin/src/HAL/STM32F1/sdio.h b/Marlin/src/HAL/STM32F1/sdio.h
index 2371601e9920..08c884666d8c 100644
--- a/Marlin/src/HAL/STM32F1/sdio.h
+++ b/Marlin/src/HAL/STM32F1/sdio.h
@@ -60,7 +60,6 @@
#define ACMD41_SD_APP_OP_COND (uint16_t)(SDMMC_ACMD_SD_APP_OP_COND | SDIO_CMD_WAIT_SHORT_RESP)
#define ACMD42_SD_APP_SET_CLR_CARD_DETECT (uint16_t)(SDMMC_ACMD_SD_APP_SET_CLR_CARD_DETECT | SDIO_CMD_WAIT_SHORT_RESP)
-
#define SDMMC_ALLZERO 0x00000000U
#define SDMMC_OCR_ERRORBITS 0xFDFFE008U
diff --git a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp
index 415c69222986..cda7e7d16cdf 100644
--- a/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp
+++ b/Marlin/src/HAL/TEENSY31_32/HAL_SPI.cpp
@@ -120,7 +120,6 @@ void spiSendBlock(uint8_t token, const uint8_t *buf) {
SPI.endTransaction();
}
-
// Begin SPI transaction, set clock, bit order, data mode
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode) {
spiConfig = SPISettings(spiClock, bitOrder, dataMode);
diff --git a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp
index d1ff9408229f..a7e5e590a36a 100644
--- a/Marlin/src/HAL/TEENSY31_32/eeprom.cpp
+++ b/Marlin/src/HAL/TEENSY31_32/eeprom.cpp
@@ -36,7 +36,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
@@ -44,7 +44,7 @@ bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
@@ -63,7 +63,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_type.h b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/TEENSY31_32/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp
index a2afa4534345..977cd70ee853 100644
--- a/Marlin/src/HAL/TEENSY35_36/eeprom.cpp
+++ b/Marlin/src/HAL/TEENSY35_36/eeprom.cpp
@@ -35,7 +35,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
@@ -43,7 +43,7 @@ bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
@@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_type.h b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/TEENSY35_36/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp
index 87f7dd3cfce5..357fed47b085 100644
--- a/Marlin/src/HAL/TEENSY40_41/eeprom.cpp
+++ b/Marlin/src/HAL/TEENSY40_41/eeprom.cpp
@@ -35,7 +35,7 @@
#ifndef MARLIN_EEPROM_SIZE
#define MARLIN_EEPROM_SIZE size_t(E2END + 1)
#endif
-size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE; }
+size_t PersistentStore::capacity() { return MARLIN_EEPROM_SIZE - eeprom_exclude_size; }
bool PersistentStore::access_start() { return true; }
bool PersistentStore::access_finish() { return true; }
@@ -43,7 +43,7 @@ bool PersistentStore::access_finish() { return true; }
bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
uint16_t written = 0;
while (size--) {
- uint8_t * const p = (uint8_t * const)pos;
+ uint8_t * const p = (uint8_t * const)REAL_EEPROM_ADDR(pos);
uint8_t v = *value;
if (v != eeprom_read_byte(p)) { // EEPROM has only ~100,000 write cycles, so only write bytes that have changed!
eeprom_write_byte(p, v);
@@ -62,7 +62,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, ui
bool PersistentStore::read_data(int &pos, uint8_t *value, size_t size, uint16_t *crc, const bool writing/*=true*/) {
do {
- uint8_t c = eeprom_read_byte((uint8_t*)pos);
+ const uint8_t c = eeprom_read_byte((uint8_t*)REAL_EEPROM_ADDR(pos));
if (writing) *value = c;
crc16(crc, &c, 1);
pos++;
diff --git a/Marlin/src/HAL/TEENSY40_41/inc/Conditionals_type.h b/Marlin/src/HAL/TEENSY40_41/inc/Conditionals_type.h
new file mode 100644
index 000000000000..82f95a10357f
--- /dev/null
+++ b/Marlin/src/HAL/TEENSY40_41/inc/Conditionals_type.h
@@ -0,0 +1,22 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
diff --git a/Marlin/src/HAL/shared/Delay.cpp b/Marlin/src/HAL/shared/Delay.cpp
index fd52eb2c6a39..bfcf6bcc42ef 100644
--- a/Marlin/src/HAL/shared/Delay.cpp
+++ b/Marlin/src/HAL/shared/Delay.cpp
@@ -161,7 +161,6 @@
}
#endif // MARLIN_DEV_MODE
-
#else
void calibrate_delay_loop() {}
diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.cpp b/Marlin/src/HAL/shared/backtrace/unwarm.cpp
index e72a02e487cd..823f54c157b4 100644
--- a/Marlin/src/HAL/shared/backtrace/unwarm.cpp
+++ b/Marlin/src/HAL/shared/backtrace/unwarm.cpp
@@ -50,7 +50,6 @@ void UnwInvalidateRegisterFile(RegData *regFile) {
} while (t < 13);
}
-
/**
* Initialize the data used for unwinding.
*/
@@ -129,7 +128,6 @@ bool UnwReportRetAddr(UnwState * const state, uint32_t addr) {
return state->cb->report((void *)state->reportData, &entry);
}
-
/**
* Write some register to memory.
* This will store some register and meta data onto the virtual stack.
diff --git a/Marlin/src/HAL/shared/backtrace/unwarm.h b/Marlin/src/HAL/shared/backtrace/unwarm.h
index edae90650e29..72ea0b062767 100644
--- a/Marlin/src/HAL/shared/backtrace/unwarm.h
+++ b/Marlin/src/HAL/shared/backtrace/unwarm.h
@@ -41,7 +41,6 @@ typedef enum {
REG_VAL_ARITHMETIC = 0x80
} RegValOrigin;
-
/** Type for tracking information about a register.
* This stores the register value, as well as other data that helps unwinding.
*/
@@ -56,7 +55,6 @@ typedef struct {
int o; /* (RegValOrigin) */
} RegData;
-
/** Structure used to track reads and writes to memory.
* This structure is used as a hash to store a small number of writes
* to memory.
@@ -81,7 +79,6 @@ typedef struct {
uint8_t tracked[(MEM_HASH_SIZE + 7) / 8];
} MemData;
-
/** Structure that is used to keep track of unwinding meta-data.
* This data is passed between all the unwinding functions.
*/
diff --git a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp
index d478255678cf..f4435c733e06 100644
--- a/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp
+++ b/Marlin/src/HAL/shared/cpu_exception/exception_arm.cpp
@@ -26,7 +26,6 @@
#if defined(__arm__) || defined(__thumb__)
-
/*
On ARM CPUs exception handling is quite powerful.
diff --git a/Marlin/src/HAL/shared/eeprom_api.h b/Marlin/src/HAL/shared/eeprom_api.h
index 7be1e72f7ab5..33d80695db52 100644
--- a/Marlin/src/HAL/shared/eeprom_api.h
+++ b/Marlin/src/HAL/shared/eeprom_api.h
@@ -26,6 +26,19 @@
#include "../../libs/crc16.h"
+// For testing. Define with -DEEPROM_EXCL_ZONE=916,926 in INI files.
+//#define EEPROM_EXCL_ZONE 916,926 // Test a range
+//#define EEPROM_EXCL_ZONE 333 // Test a single byte
+
+#ifdef EEPROM_EXCL_ZONE
+ static constexpr int eeprom_exclude_zone[] = { EEPROM_EXCL_ZONE },
+ eeprom_exclude_size = eeprom_exclude_zone[COUNT(eeprom_exclude_zone) - 1] - eeprom_exclude_zone[0] + 1;
+ #define REAL_EEPROM_ADDR(A) (A < eeprom_exclude_zone[0] ? (A) : (A) + eeprom_exclude_size)
+#else
+ #define REAL_EEPROM_ADDR(A) (A)
+ static constexpr int eeprom_exclude_size = 0;
+#endif
+
class PersistentStore {
public:
diff --git a/Marlin/src/core/boards.h b/Marlin/src/core/boards.h
index 91141b23f99f..0895bb46a08f 100644
--- a/Marlin/src/core/boards.h
+++ b/Marlin/src/core/boards.h
@@ -519,7 +519,9 @@
//
// HC32 ARM Cortex-M4
//
+
#define BOARD_AQUILA_V101 7200 // Voxelab Aquila V1.0.0/V1.0.1/V1.0.2/V1.0.3 as found in the Voxelab Aquila X2 and C2
+#define BOARD_CREALITY_ENDER2P_V24S4 7201 // Creality Ender 2 Pro v2.4.S4_170 (HC32f460kcta)
//
// Custom board
diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
index 560ff71e8493..2e7ea743273f 100644
--- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
+++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
@@ -615,7 +615,6 @@ void unified_bed_leveling::G29() {
#endif // UBL_DEVEL_DEBUGGING
-
//
// Load a Mesh from the EEPROM
//
@@ -1817,7 +1816,8 @@ void unified_bed_leveling::smart_fill_mesh() {
print_hex_word(i);
SERIAL_ECHOPGM(": ");
for (uint16_t j = 0; j < 16; j++) {
- persistentStore.read_data(i + j, &cccc, sizeof(uint8_t));
+ int pos = i + j;
+ persistentStore.read_data(pos, &cccc, sizeof(uint8_t));
print_hex_byte(cccc);
SERIAL_CHAR(' ');
}
diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp
index 9a8e369c6a39..135178456b73 100644
--- a/Marlin/src/feature/encoder_i2c.cpp
+++ b/Marlin/src/feature/encoder_i2c.cpp
@@ -27,7 +27,6 @@
//todo: try faster I2C speed; tweak TWI_FREQ (400000L, or faster?); or just TWBR = ((CPU_FREQ / 400000L) - 16) / 2;
//todo: consider Marlin-optimized Wire library; i.e. MarlinWire, like MarlinSerial
-
#include "../inc/MarlinConfig.h"
#if ENABLED(I2C_POSITION_ENCODERS)
@@ -462,7 +461,6 @@ void I2CPositionEncoder::reset() {
TERN_(I2CPE_ERR_ROLLING_AVERAGE, ZERO(err));
}
-
bool I2CPositionEncodersMgr::I2CPE_anyaxis;
uint8_t I2CPositionEncodersMgr::I2CPE_addr,
I2CPositionEncodersMgr::I2CPE_idx;
diff --git a/Marlin/src/feature/fwretract.cpp b/Marlin/src/feature/fwretract.cpp
index b4ef18a9b980..8f2edad158dd 100644
--- a/Marlin/src/feature/fwretract.cpp
+++ b/Marlin/src/feature/fwretract.cpp
@@ -263,5 +263,4 @@ void FWRetract::M208_report() {
#endif // FWRETRACT_AUTORETRACT
-
#endif // FWRETRACT
diff --git a/Marlin/src/feature/meatpack.h b/Marlin/src/feature/meatpack.h
index 37039c3056ed..0de1f792c139 100644
--- a/Marlin/src/feature/meatpack.h
+++ b/Marlin/src/feature/meatpack.h
@@ -144,7 +144,6 @@ struct MeatpackSerial : public SerialBase > {
void flushTX() { CALL_IF_EXISTS(void, &out, flushTX); }
SerialFeature features(serial_index_t index) const { return SerialFeature::MeatPack | CALL_IF_EXISTS(SerialFeature, &out, features, index); }
-
int available(serial_index_t index) {
if (charCount) return charCount; // The buffer still has data
if (out.available(index) <= 0) return 0; // No data to read
diff --git a/Marlin/src/feature/mmu/mmu2-serial-protocol.md b/Marlin/src/feature/mmu/mmu2-serial-protocol.md
index 42f30e418d1d..088d41b44693 100644
--- a/Marlin/src/feature/mmu/mmu2-serial-protocol.md
+++ b/Marlin/src/feature/mmu/mmu2-serial-protocol.md
@@ -28,11 +28,8 @@ Now we are sure MMU is available and ready. If there was a timeout or other comm
- *Build number* is an integer value and has to be >=126, or =>132 if 12V mode is enabled
- *FINDA status* is 1 if the filament is loaded to the extruder, 0 otherwise
-
*Build number* is checked against the required value, if it does not match, printer is halted.
-
-
Toolchange
==========
@@ -54,7 +51,6 @@ When done, the MMU sends
We don't wait for a response here but immediately continue with the next G-code which should
be one or more extruder moves to feed the filament into the hotend.
-
FINDA status
============
@@ -63,8 +59,6 @@ FINDA status
*FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise. This could be used as filament runout sensor if probed regularly.
-
-
Load filament
=============
@@ -74,7 +68,6 @@ MMU will feed filament down to the extruder, when done
- MMU => 'ok\n'
-
Unload filament
=============
@@ -84,8 +77,6 @@ MMU will retract current filament from the extruder, when done
- MMU => 'ok\n'
-
-
Eject filament
==============
diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h
index 43c034020ad3..c95c39f27387 100644
--- a/Marlin/src/feature/runout.h
+++ b/Marlin/src/feature/runout.h
@@ -341,7 +341,6 @@ class FilamentSensorBase {
}
};
-
/********************************* RESPONSE TYPE *********************************/
#if HAS_FILAMENT_RUNOUT_DISTANCE
diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h
index 8908ae6df524..681df2f081e7 100644
--- a/Marlin/src/feature/spindle_laser.h
+++ b/Marlin/src/feature/spindle_laser.h
@@ -38,7 +38,6 @@
#define PCT_TO_PWM(X) ((X) * 255 / 100)
#define PCT_TO_SERVO(X) ((X) * 180 / 100)
-
// Laser/Cutter operation mode
enum CutterMode : int8_t {
CUTTER_MODE_ERROR = -1,
diff --git a/Marlin/src/feature/stepper_driver_safety.h b/Marlin/src/feature/stepper_driver_safety.h
index 46edf3390d77..ac3d8b64f9f4 100644
--- a/Marlin/src/feature/stepper_driver_safety.h
+++ b/Marlin/src/feature/stepper_driver_safety.h
@@ -21,7 +21,6 @@
*/
#pragma once
-
#include "../inc/MarlinConfigPre.h"
void stepper_driver_backward_check();
diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h
index 806e2a147a7d..de23abbed53c 100644
--- a/Marlin/src/feature/twibus.h
+++ b/Marlin/src/feature/twibus.h
@@ -74,7 +74,6 @@ class TWIBus {
*/
uint8_t buffer[TWIBUS_BUFFER_SIZE];
-
public:
/**
* @brief Target device address
diff --git a/Marlin/src/gcode/feature/leds/M150.cpp b/Marlin/src/gcode/feature/leds/M150.cpp
index 43062c3f752a..dd5752ee4ceb 100644
--- a/Marlin/src/gcode/feature/leds/M150.cpp
+++ b/Marlin/src/gcode/feature/leds/M150.cpp
@@ -60,6 +60,7 @@ void GcodeSuite::M150() {
#if ENABLED(NEOPIXEL_LED)
const pixel_index_t index = parser.intval('I', -1);
+ const bool seenK = parser.seen_test('K');
#if ENABLED(NEOPIXEL2_SEPARATE)
#ifndef NEOPIXEL_M150_DEFAULT
#define NEOPIXEL_M150_DEFAULT -1
@@ -69,12 +70,13 @@ void GcodeSuite::M150() {
int8_t brightness = neo.brightness(), unit = parser.intval('S', NEOPIXEL_M150_DEFAULT);
switch (unit) {
case -1: neo2.neoindex = index; // fall-thru
- case 0: neo.neoindex = index; old_color = parser.seen('K') ? neo.pixel_color(index >= 0 ? index : 0) : 0; break;
- case 1: neo2.neoindex = index; brightness = neo2.brightness(); old_color = parser.seen('K') ? neo2.pixel_color(index >= 0 ? index : 0) : 0; break;
+ case 0: neo.neoindex = index; old_color = seenK ? neo.pixel_color(_MAX(index, 0)) : 0; break;
+ case 1: neo2.neoindex = index; brightness = neo2.brightness(); old_color = seenK ? neo2.pixel_color(_MAX(index, 0)) : 0; break;
}
#else
const uint8_t brightness = neo.brightness();
neo.neoindex = index;
+ old_color = seenK ? neo.pixel_color(_MAX(index, 0)) : 0;
#endif
#endif
diff --git a/Marlin/src/inc/Conditionals_type.h b/Marlin/src/inc/Conditionals_type.h
new file mode 100644
index 000000000000..1f9cfcae16fb
--- /dev/null
+++ b/Marlin/src/inc/Conditionals_type.h
@@ -0,0 +1,32 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+/**
+ * Conditionals_type.h
+ * Internal defines that depend on Configurations and Pins but are not user-editable.
+ * Define conditionals in this file if they depend on core/types.h.
+ */
+
+#ifdef GITHUB_ACTIONS
+ // Extras for CI testing
+#endif
diff --git a/Marlin/src/inc/MarlinConfig.h b/Marlin/src/inc/MarlinConfig.h
index 8f6519dbafd4..4058761b9f7c 100644
--- a/Marlin/src/inc/MarlinConfig.h
+++ b/Marlin/src/inc/MarlinConfig.h
@@ -48,6 +48,9 @@
#include "../core/types.h" // Ahead of sanity-checks
+ #include "Conditionals_type.h"
+ #include HAL_PATH(.., inc/Conditionals_type.h)
+
#include "Changes.h"
#include "SanityCheck.h"
#include HAL_PATH(.., inc/SanityCheck.h)
diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h
index 5a22accc6da6..27629c5a7da0 100644
--- a/Marlin/src/inc/SanityCheck.h
+++ b/Marlin/src/inc/SanityCheck.h
@@ -1508,9 +1508,7 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#endif
#endif
- #if Z_PROBE_LOW_POINT > 0
- #error "Z_PROBE_LOW_POINT must be less than or equal to 0."
- #endif
+ static_assert(Z_PROBE_LOW_POINT <= 0, "Z_PROBE_LOW_POINT must be less than or equal to 0.");
#if ENABLED(PROBE_ACTIVATION_SWITCH)
#ifndef PROBE_ACTIVATION_SWITCH_STATE
@@ -3350,10 +3348,59 @@ static_assert(NUM_SERVOS <= NUM_SERVO_PLUGS, "NUM_SERVOS (or some servo index) i
#error "MARKFORGED requires both X and Y to use sensorless homing if either one does."
#endif
+// TMC Hybrid Threshold
+#if ENABLED(HYBRID_THRESHOLD)
+ #if !STEALTHCHOP_ENABLED
+ #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
+ #elif defined(X_HYBRID_THRESHOLD) && X_HYBRID_THRESHOLD == 0
+ #error "X_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(X2_HYBRID_THRESHOLD) && X2_HYBRID_THRESHOLD == 0
+ #error "X2_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(Y_HYBRID_THRESHOLD) && Y_HYBRID_THRESHOLD == 0
+ #error "Y_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(Y2_HYBRID_THRESHOLD) && Y2_HYBRID_THRESHOLD == 0
+ #error "Y2_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(Z_HYBRID_THRESHOLD) && Z_HYBRID_THRESHOLD == 0
+ #error "Z_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(Z2_HYBRID_THRESHOLD) && Z2_HYBRID_THRESHOLD == 0
+ #error "Z2_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(Z3_HYBRID_THRESHOLD) && Z3_HYBRID_THRESHOLD == 0
+ #error "Z3_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(Z4_HYBRID_THRESHOLD) && Z4_HYBRID_THRESHOLD == 0
+ #error "Z4_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(I_HYBRID_THRESHOLD) && I_HYBRID_THRESHOLD == 0
+ #error "I_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(J_HYBRID_THRESHOLD) && J_HYBRID_THRESHOLD == 0
+ #error "J_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(K_HYBRID_THRESHOLD) && K_HYBRID_THRESHOLD == 0
+ #error "K_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(U_HYBRID_THRESHOLD) && U_HYBRID_THRESHOLD == 0
+ #error "U_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(V_HYBRID_THRESHOLD) && V_HYBRID_THRESHOLD == 0
+ #error "V_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(W_HYBRID_THRESHOLD) && W_HYBRID_THRESHOLD == 0
+ #error "W_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E0_HYBRID_THRESHOLD) && E0_HYBRID_THRESHOLD == 0
+ #error "E0_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E1_HYBRID_THRESHOLD) && E1_HYBRID_THRESHOLD == 0
+ #error "E1_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E2_HYBRID_THRESHOLD) && E2_HYBRID_THRESHOLD == 0
+ #error "E2_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E3_HYBRID_THRESHOLD) && E3_HYBRID_THRESHOLD == 0
+ #error "E3_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E4_HYBRID_THRESHOLD) && E4_HYBRID_THRESHOLD == 0
+ #error "E4_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E5_HYBRID_THRESHOLD) && E5_HYBRID_THRESHOLD == 0
+ #error "E5_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E6_HYBRID_THRESHOLD) && E6_HYBRID_THRESHOLD == 0
+ #error "E6_HYBRID_THRESHOLD must be greater than 0."
+ #elif defined(E7_HYBRID_THRESHOLD) && E7_HYBRID_THRESHOLD == 0
+ #error "E7_HYBRID_THRESHOLD must be greater than 0."
+ #endif
+#endif // HYBRID_THRESHOLD
+
// Other TMC feature requirements
-#if ENABLED(HYBRID_THRESHOLD) && !STEALTHCHOP_ENABLED
- #error "Enable STEALTHCHOP_(XY|Z|E) to use HYBRID_THRESHOLD."
-#elif ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
+#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
#error "SENSORLESS_HOMING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
#elif ENABLED(SENSORLESS_PROBING) && !HAS_STALLGUARD
#error "SENSORLESS_PROBING requires TMC2130, TMC2160, TMC2209, TMC2660, or TMC5160 stepper drivers."
diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h
index 6b1ffe11a7b4..e878c24631e7 100644
--- a/Marlin/src/inc/Version.h
+++ b/Marlin/src/inc/Version.h
@@ -42,7 +42,7 @@
* version was tagged.
*/
#ifndef STRING_DISTRIBUTION_DATE
- #define STRING_DISTRIBUTION_DATE "2024-01-25"
+ #define STRING_DISTRIBUTION_DATE "2024-01-30"
#endif
/**
diff --git a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp
index b05a8e81d9e9..dd1ba06a7832 100644
--- a/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp
+++ b/Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp
@@ -449,7 +449,6 @@ static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = {
{IV('⭢'), 0xC7, 0},
{IV('⭣'), 0xC6, 0},
-
{IV('⯆'), 0xF5, 0},
{IV('⯇'), 0xF7, 0}, // ⯅
{IV('⯈'), 0xF6, 0},
@@ -500,7 +499,6 @@ static const hd44780_charmap_t g_hd44780_charmap_device[] PROGMEM = {
//{IV(''), 0x9E, 0},
//{IV(''), 0x9F, 0},
-
{IV('¼'), 0xF0, 0}, // 00BC
{IV('⅓'), 0xF1, 0},
{IV('½'), 0xF2, 0}, // 00BD
diff --git a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp
index 666ad2bbc166..c0b9975014d1 100644
--- a/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp
+++ b/Marlin/src/lcd/TFTGLCD/lcdprint_TFTGLCD.cpp
@@ -446,7 +446,6 @@ static const TFTGLCD_charmap_t g_TFTGLCD_charmap_device[] PROGMEM = {
{IV('⭢'), 0xC7, 0},
{IV('⭣'), 0xC6, 0},
-
{IV('⯆'), 0xF5, 0},
{IV('⯇'), 0xF7, 0}, // ⯅
{IV('⯈'), 0xF6, 0},
diff --git a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h
index dc40aba04628..f07064ea7165 100644
--- a/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h
+++ b/Marlin/src/lcd/dogm/HAL_LCD_class_defines.h
@@ -103,7 +103,6 @@ class U8GLIB_TFT_320X240_UPSCALE_FROM_128X64 : public U8GLIB {
void init(uint8_t cs, uint8_t rs, uint8_t reset=U8G_PIN_NONE) { U8GLIB::init(&u8g_dev_tft_320x240_upscale_from_128x64, cs, rs, reset); }
};
-
extern u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi, u8g_dev_uc1701_mini12864_HAL_2x_hw_spi;
class U8GLIB_MINI12864_2X_HAL : public U8GLIB {
diff --git a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp
index 5d1a3363fb1d..24165019b473 100644
--- a/Marlin/src/lcd/dogm/status_screen_DOGM.cpp
+++ b/Marlin/src/lcd/dogm/status_screen_DOGM.cpp
@@ -376,7 +376,6 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
#define BAR_TALL (STATUS_HEATERS_HEIGHT - 2)
-
// Draw a heating progress bar, if specified
#if ANY(STATUS_HEAT_PERCENT, STATUS_HEAT_POWER)
uint8_t tall = 0;
diff --git a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp
index b3e579e6a44a..5865bb11873b 100644
--- a/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp
+++ b/Marlin/src/lcd/dogm/u8g_dev_ssd1306_sh1106_128x64_I2C.cpp
@@ -230,12 +230,10 @@ uint8_t u8g_dev_ssd1306_128x64_2x_2_wire_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t
return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg);
}
-
uint8_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf[WIDTH*2] U8G_NOCOMMON ;
u8g_pb_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_ssd1306_128x64_2x_i2c_2_wire_buf};
u8g_dev_t u8g_dev_ssd1306_128x64_2x_i2c_2_wire = { u8g_dev_ssd1306_128x64_2x_2_wire_fn, &u8g_dev_ssd1306_128x64_2x_i2c_2_wire_pb, U8G_COM_SSD_I2C_HAL };
-
/////////////////////////////////////////////////////////////////////////////////////////////
// This routine adds the instruction byte in between the command bytes. This makes the init
diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp
index 63e7b2e2b8b5..6c7066179eb0 100644
--- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp
+++ b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp
@@ -234,7 +234,6 @@ uint8_t u8g_dev_st7565_64128n_HAL_2x_buf[WIDTH*2] U8G_NOCOMMON ;
u8g_pb_t u8g_dev_st7565_64128n_HAL_2x_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u8g_dev_st7565_64128n_HAL_2x_buf};
u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_SW_SPI_FN };
-
U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN);
u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN };
diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp
index ae1531e9f8df..d5f1be18ec95 100644
--- a/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp
+++ b/Marlin/src/lcd/dogm/u8g_dev_st7920_128x64_HAL.cpp
@@ -84,19 +84,19 @@ static const uint8_t u8g_dev_st7920_128x64_HAL_init_seq[] PROGMEM = {
void clear_graphics_DRAM(u8g_t *u8g, u8g_dev_t *dev) {
u8g_SetChipSelect(u8g, dev, 1);
u8g_Delay(1);
- u8g_SetAddress(u8g, dev, 0); // cmd mode
- u8g_WriteByte(u8g, dev, 0x08); //display off, cursor+blink off
- u8g_WriteByte(u8g, dev, 0x3E); //extended mode + GDRAM active
- for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; ++y) { //clear GDRAM
- u8g_WriteByte(u8g, dev, 0x80 | y); //set y
- u8g_WriteByte(u8g, dev, 0x80); //set x = 0
- u8g_SetAddress(u8g, dev, 1); /* data mode */
- for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; ++i) //2x width clears both segments
+ u8g_SetAddress(u8g, dev, 0); // Cmd mode
+ u8g_WriteByte(u8g, dev, 0x08); // Display off, cursor+blink off
+ u8g_WriteByte(u8g, dev, 0x3E); // Extended mode + GDRAM active
+ for (uint8_t y = 0; y < (LCD_PIXEL_HEIGHT) / 2; ++y) { // Clear GDRAM
+ u8g_WriteByte(u8g, dev, 0x80 | y); // Set y
+ u8g_WriteByte(u8g, dev, 0x80); // Set x = 0
+ u8g_SetAddress(u8g, dev, 1); // Data mode
+ for (uint8_t i = 0; i < 2 * (LCD_PIXEL_WIDTH) / 8; ++i) // 2x width clears both segments
u8g_WriteByte(u8g, dev, 0);
- u8g_SetAddress(u8g, dev, 0); /* cmd mode */
+ u8g_SetAddress(u8g, dev, 0); // Cmd mode
}
- u8g_WriteByte(u8g, dev, 0x0C); //display on, cursor+blink off
+ u8g_WriteByte(u8g, dev, 0x0C); // Display on, cursor+blink off
u8g_SetChipSelect(u8g, dev, 0);
}
diff --git a/Marlin/src/lcd/e3v2/common/dwin_api.h b/Marlin/src/lcd/e3v2/common/dwin_api.h
index f2392af55cdb..fe2105baea07 100644
--- a/Marlin/src/lcd/e3v2/common/dwin_api.h
+++ b/Marlin/src/lcd/e3v2/common/dwin_api.h
@@ -162,7 +162,6 @@ inline void dwinDrawBox(uint8_t mode, uint16_t color, uint16_t xStart, uint16_t
void dwinFrameAreaMove(uint8_t mode, uint8_t dir, uint16_t dis,
uint16_t color, uint16_t xStart, uint16_t yStart, uint16_t xEnd, uint16_t yEnd);
-
/*---------------------------------------- Text related functions ----------------------------------------*/
// Draw a string
diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h
index 5d3813101455..03f55233e251 100644
--- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h
+++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h
@@ -525,7 +525,6 @@ const dwin_charmap_t g_dwin_charmap_device[] PROGMEM = {
{IV('⭢'), 0xC7, 0},
{IV('⭣'), 0xC6, 0},
-
{IV('⯆'), 0xF5, 0},
{IV('⯇'), 0xF7, 0}, // ⯅
{IV('⯈'), 0xF6, 0},
@@ -576,7 +575,6 @@ const dwin_charmap_t g_dwin_charmap_device[] PROGMEM = {
//{IV(''), 0x9E, 0},
//{IV(''), 0x9F, 0},
-
{IV('¼'), 0xF0, 0}, // 00BC
{IV('⅓'), 0xF1, 0},
{IV('½'), 0xF2, 0}, // 00BD
diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp
index ed4f8c73673a..9fc9156f296c 100644
--- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp
+++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp
@@ -39,6 +39,7 @@
#include "../../../core/serial.h"
#include "../../../module/stepper.h"
#include "../../../module/probe.h"
+#include "../../../module/temperature.h"
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../../feature/powerloss.h"
diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h
index 371066a56900..514e8c7303d6 100644
--- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h
+++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.h
@@ -281,7 +281,6 @@
#define KEY_LEVEL_DEC 2
#define KEY_LEVEL_ENSURE 4
-
#define KEY_PREPARE_TO_PREHEAT 3
#define KEY_PREHEAT_TO_PREPARE 1
#define KEY_PREHEAT_PLA 2
diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h
index 53e57e1c65bb..da2cf96a8725 100644
--- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h
+++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.h
@@ -241,7 +241,6 @@ enum DGUS_ScreenID : uint8_t {
DGUS_SCREEN_UNUSED = 255
};
-
// Place for status messages.
constexpr uint16_t VP_M117 = 0x7020;
constexpr uint8_t VP_M117_LEN = 0x20;
@@ -299,7 +298,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
constexpr uint16_t VP_MARLIN_VERSION = 0x1A00;
constexpr uint8_t VP_MARLIN_VERSION_LEN = 16; // there is more space on the display, if needed.
-
constexpr uint16_t VP_SCREENCHANGE_ASK = 0x1500;
constexpr uint16_t VP_SCREENCHANGE = 0x1501; // Key-Return button to new menu pressed. Data contains target screen in low byte and info in high byte.
constexpr uint16_t VP_TEMP_ALL_OFF = 0x1502; // Turn all heaters off. Value arbitrary ;)=
@@ -515,7 +513,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
constexpr uint16_t VP_TMC_E1_Current = 0x3442;
constexpr uint16_t VP_TMC_Z1_Current = 0x3444;
-
constexpr uint16_t VP_PrintTime_H = 0x3500;
constexpr uint16_t VP_PrintTime_M = 0x3502;
constexpr uint16_t VP_PrintTime_S = 0x3504;
@@ -591,7 +588,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
constexpr uint16_t VP_Level_Point_Five_X = 0x4110;
constexpr uint16_t VP_Level_Point_Five_Y = 0x4112;
-
/* H43 Version */
constexpr uint16_t VP_MKS_H43_VERSION = 0x4A00; // MKS H43 V1.0.0
constexpr uint16_t VP_MKS_H43_VERSION_LEN = 16;
@@ -630,7 +626,6 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
constexpr uint16_t VP_E0_Max_Acc_Speed_Dis = 0x5210;
constexpr uint16_t VP_E1_Max_Acc_Speed_Dis = 0x5220;
-
constexpr uint16_t VP_PrintTime_Dis = 0x5470;
constexpr uint16_t VP_E0_Temp_Dis = 0x5310;
constexpr uint16_t VP_E1_Temp_Dis = 0x5320;
@@ -641,12 +636,10 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
constexpr uint16_t VP_Min_Ex_Temp_Dis = 0x5380;
-
constexpr uint16_t VP_X_PARK_POS_Dis = 0x53E0;
constexpr uint16_t VP_Y_PARK_POS_Dis = 0x53F0;
constexpr uint16_t VP_Z_PARK_POS_Dis = 0x5400;
-
constexpr uint16_t VP_TravelAcc_Dis = 0x5440;
constexpr uint16_t VP_FeedRateMin_Dis = 0x5450;
constexpr uint16_t VP_TravelFeeRateMin_Dis = 0x5460;
diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp
index 00083ced8cce..7f2697513ae8 100644
--- a/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp
+++ b/Marlin/src/lcd/extui/dgus_e3s1pro/definition/DGUS_ScreenAddrList.cpp
@@ -153,7 +153,6 @@ constexpr DGUS_Addr LIST_CONTROL[] PROGMEM = {
DGUS_Addr::END
};
-
constexpr DGUS_Addr LIST_ADJUST[] PROGMEM = {
DGUS_Addr::ADJUST_Icon_Adjust,
DGUS_Addr::IO_Icon_ExtruderTemp,
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h
index 3e2b5546e918..162c32b9562b 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/screens.h
@@ -22,7 +22,6 @@
#pragma once
-
/********************************* DL CACHE SLOTS ******************************/
// In order to reduce SPI traffic, we cache display lists (DL) in RAMG. This
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp
index fd73ca0a4bf1..df29ac4d2309 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/cocoa_press/statistics_screen.cpp
@@ -38,7 +38,6 @@ void StatisticsScreen::onRedraw(draw_mode_t what) {
if (what & BACKGROUND) {
char buffer[21];
-
cmd.cmd(CLEAR_COLOR_RGB(Theme::bg_color))
.cmd(CLEAR(true,true,true))
.cmd(COLOR_RGB(bg_text_enabled))
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h
index 5168ef76af4a..b219bd88e166 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/basic/boards.h
@@ -248,7 +248,6 @@
#endif
-
/* this data is used to patch FT813 displays that use a GT911 as a touch-controller */
#ifdef PATCH_GT911
constexpr PROGMEM unsigned char GT911_data[] = {
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp
index 7fccb309f56b..dd2e477d9f2c 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/event_loop.cpp
@@ -71,7 +71,6 @@ void UIData::set_persistent_data(uint8_t value) {
flags.value = value & get_persistent_data_mask();
}
-
void UIData::enable_touch_sounds(bool enabled) {
UIData::flags.bits.touch_start_sound = enabled;
UIData::flags.bits.touch_end_sound = enabled;
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h
index 30b1f8439955..6a1a703e45a3 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/cyrillic_char_set_bitmap_31.h
@@ -100,7 +100,6 @@ const uint8_t cyrillic_font_widths[] PROGMEM = {
21, // ё
};
-
/* This is a dump of "font_bitmaps/cyrillic_char_set_bitmap_31.png"
* using the tool "bitmap2cpp.py". The tool converts the image into
* 16-level grayscale and packs two pixels per byte. The resulting
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.cpp
index 9ff738e45c19..c087bf41b58c 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.cpp
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/language/language.cpp
@@ -19,7 +19,6 @@
* location: . *
****************************************************************************/
-
#include "../../../../MarlinCore.h"
#if ENABLED(TOUCH_UI_FTDI_EVE)
#include "language.h"
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp
index c7607f71d071..b17ac9c7cbaa 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/screens.cpp
@@ -26,7 +26,6 @@
#include "screens.h"
tiny_timer_t refresh_timer;
-
/**
* DECL_SCREEN_IF_INCLUDED allows for a concise
* definition of SCREEN_TABLE:
diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp
index d8407406a1eb..49967be086e9 100644
--- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp
+++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/theme/sounds.cpp
@@ -165,7 +165,6 @@ namespace Theme {
{ORGAN, NOTE_A4, 4},
{SILENCE, REST, 36},
-
{ORGAN, NOTE_C5S, 4},
{ORGAN, NOTE_D5, 2},
{ORGAN, NOTE_E5, 2},
diff --git a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
index f16bdde29aae..3254da3a3762 100644
--- a/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
+++ b/Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
@@ -91,7 +91,6 @@ void FileNavigator::getFiles(uint16_t index) {
}
lastindex = index;
-
// Clear currently drawn screen
for (int i = 0; i < DISPLAY_FILES; i++) {
for (int j = 0; j < 20; j++)
diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp
index 8ff9fd9f7144..15810b67a570 100644
--- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp
+++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp
@@ -459,12 +459,13 @@ int16_t RTS::receiveData() {
}
/* AutoUpload, (and answer to) Command 0x83 :
- | tmp[0 1 2 3 4 ... ]
- | Example 5A A5 06 83 20 01 01 78 01 ……
- | / / | | \ / | \ \
- | Header | | | | \_____\_ DATA (Words!)
- | DatagramLen / VPAdr |
- | Command DataLen (in Words) */
+ * tmp[0 1 2 3 4 ... ]
+ * Example 5A A5 06 83 20 01 01 78 01 ……
+ * / / | | \ / | \ \
+ * Header | | | | \_____\_ DATA (Words!)
+ * DatagramLen / VPAdr |
+ * Command DataLen (in Words)
+ */
if (command == VarAddr_R) {
const uint16_t vp = tmp[0] << 8 | tmp[1];
@@ -478,7 +479,6 @@ int16_t RTS::receiveData() {
rx_datagram_state = DGUS_IDLE;
return 2;
- break;
}
// discard anything else
@@ -637,7 +637,7 @@ void RTS::handleData() {
recdat.head[1] = FHTWO;
return;
}
- for (int16_t i = 0; Addrbuf[i] != 0; i++)
+ for (int16_t i = 0; Addrbuf[i] != 0; i++) {
if (recdat.addr == Addrbuf[i]) {
if (Addrbuf[i] == NzBdSet || Addrbuf[i] == NozzlePreheat || Addrbuf[i] == BedPreheat || Addrbuf[i] == Flowrate)
Checkkey = ManualSetTemp;
@@ -651,6 +651,7 @@ void RTS::handleData() {
Checkkey = i;
break;
}
+ }
switch (recdat.addr) {
case Flowrate:
@@ -662,7 +663,7 @@ void RTS::handleData() {
case HotendPID_P ... HotendPID_D:
case BedPID_P ... BedPID_D:
#if ENABLED(DUAL_X_CARRIAGE)
- case T2Offset_X ... T2Offset_Z
+ case T2Offset_X ... T2Offset_Z:
#if ENABLED(EDITABLE_STEPS_PER_UNIT)
case T2StepMM_E:
#endif
@@ -700,7 +701,8 @@ void RTS::handleData() {
#endif
switch (Checkkey) {
- case Printfile:
+
+ case Printfile: {
if (recdat.data[0] == 1) { // card
show_status = false;
filenavigator.getFiles(0);
@@ -734,9 +736,9 @@ void RTS::handleData() {
else if (recdat.data[0] == 4) { // Settings
show_status = false;
}
- break;
+ } break;
- case Adjust:
+ case Adjust: {
if (recdat.data[0] == 1) {
show_status = false;
}
@@ -752,13 +754,13 @@ void RTS::handleData() {
else if (recdat.data[0] == 3)
setTargetFan_percent(getTargetFan_percent((fan_t)getActiveTool()) != 0 ? 100 : 0, FAN0);
- break;
+ } break;
- case Feedrate:
+ case Feedrate: {
setFeedrate_percent(recdat.data[0]);
- break;
+ } break;
- case PrintChoice:
+ case PrintChoice: {
if (recdat.addr == Stopprint) {
if (recdat.data[0] == 240) { // no
sendData(ExchangePageBase + 53, ExchangepageAddr);
@@ -792,11 +794,11 @@ void RTS::handleData() {
show_status = true;
sendData(ExchangePageBase + 82, ExchangepageAddr);
}
- break;
+ } break;
#if HAS_BED_PROBE
- case Zoffset:
+ case Zoffset: {
float tmp_zprobe_offset;
if (recdat.data[0] >= 32768)
tmp_zprobe_offset = (float(recdat.data[0]) - 65536) / 100;
@@ -815,11 +817,11 @@ void RTS::handleData() {
}
sendData(getZOffset_mm() * 100, ProbeOffset_Z);
- break;
+ } break;
#endif // HAS_BED_PROBE
- case TempControl:
+ case TempControl: {
if (recdat.data[0] == 0) {
show_status = true;
tpShowStatus = false;
@@ -868,9 +870,9 @@ void RTS::handleData() {
sendData(ExchangePageBase + 57, ExchangepageAddr);
printerStatusKey[1] = 2;
}
- break;
+ } break;
- case ManualSetTemp:
+ case ManualSetTemp: {
if (recdat.addr == NzBdSet) {
if (recdat.data[0] == 0) {
if (getTargetFan_percent((fan_t)getActiveTool()) == 0)
@@ -942,11 +944,9 @@ void RTS::handleData() {
setTargetFan_percent(uint16_t(recdat.data[0]), (fan_t)getActiveTool());
}
else {
- float tmp_float_handling;
- if (recdat.data[0] >= 32768)
- tmp_float_handling = (float(recdat.data[0]) - 65536) / 100;
- else
- tmp_float_handling = float(recdat.data[0]) / 100;
+ float tmp_float_handling = float(recdat.data[0]);
+ if (tmp_float_handling >= 32768) tmp_float_handling -= 65536;
+ tmp_float_handling /= 100;
if (false) {}
@@ -1053,9 +1053,9 @@ void RTS::handleData() {
#endif
#endif // HAS_PID_HEATING
}
- break;
+ } break;
- case Setting:
+ case Setting: {
if (recdat.data[0] == 0) { // return to main page
show_status = true;
tpShowStatus = false;
@@ -1108,29 +1108,27 @@ void RTS::handleData() {
injectCommands(F("M84"));
sendData(11, FilenameIcon);
}
- break;
+ } break;
- case ReturnBack:
+ case ReturnBack: {
if (recdat.data[0] == 1) { // return to the tool page
show_status = false;
sendData(ExchangePageBase + 63, ExchangepageAddr);
}
- if (recdat.data[0] == 2) // return to the Level mode page
+ else if (recdat.data[0] == 2) // return to the Level mode page
sendData(ExchangePageBase + 64, ExchangepageAddr);
- break;
+ } break;
- case Bedlevel:
+ case Bedlevel: {
switch (recdat.data[0]) {
- case 1: { // Z-axis to home
+ case 1: // Z-axis to home
// Disallow Z homing if X or Y are unknown
injectCommands(isAxisPositionKnown(axis_t(X)) && isAxisPositionKnown(axis_t(Y)) ? F("G28Z\nG1F1500Z0.0") : F("G28\nG1F1500Z0.0"));
sendData(getZOffset_mm() * 100, ProbeOffset_Z);
break;
- }
#if HAS_BED_PROBE
-
- case 2: { // Z-axis to Up
+ case 2: // Z-axis to Up
if (WITHIN((getZOffset_mm() + 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
smartAdjustAxis_steps(getAxisSteps_per_mm(Z) / 10, axis_t(Z), false);
//setZOffset_mm(getZOffset_mm() + 0.1);
@@ -1138,8 +1136,8 @@ void RTS::handleData() {
onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3)));
}
break;
- }
- case 3: { // Z-axis to Down
+
+ case 3: // Z-axis to Down
if (WITHIN((getZOffset_mm() - 0.1), PROBE_OFFSET_ZMIN, PROBE_OFFSET_ZMAX)) {
smartAdjustAxis_steps(-getAxisSteps_per_mm(Z) / 10, axis_t(Z), false);
//babystepAxis_steps(int16_t(-getAxisSteps_per_mm(Z)) / 10, axis_t(Z));
@@ -1148,17 +1146,15 @@ void RTS::handleData() {
onStatusChanged(MString<20>(GET_TEXT_F(MSG_UBL_Z_OFFSET), p_float_t(getZOffset_mm(), 3)));
}
break;
- }
-
#endif // HAS_BED_PROBE
- case 4: { // Assistant Level
+ case 4: // Assistant Level
TERN_(HAS_MESH, setLevelingActive(false));
injectCommands(isPositionKnown() ? F("G1 F1000 Z0.0") : F("G28\nG1 F1000 Z0.0"));
waitway = 2;
sendData(ExchangePageBase + 84, ExchangepageAddr);
break;
- }
+
case 5: { // AutoLevel "Measuring" Button
#if ENABLED(MESH_BED_LEVELING)
sendData(ExchangePageBase + 93, ExchangepageAddr);
@@ -1173,45 +1169,44 @@ void RTS::handleData() {
sendData(ExchangePageBase + 64, ExchangepageAddr);
injectCommands(F(MEASURING_GCODE));
#endif
- break;
- }
+ } break;
#if ENABLED(LCD_BED_TRAMMING)
- case 6: { // Bed Tramming, Centre 1
+ case 6: // Bed Tramming, Centre 1
setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z));
setAxisPosition_mm(X_CENTER, axis_t(X));
setAxisPosition_mm(Y_CENTER, axis_t(Y));
waitway = 6;
break;
- }
- case 7: { // Bed Tramming, Front Left 2
+
+ case 7: // Bed Tramming, Front Left 2
setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z));
setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X));
setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y));
waitway = 6;
break;
- }
- case 8: { // Bed Tramming, Front Right 3
+
+ case 8: // Bed Tramming, Front Right 3
setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z));
setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X));
setAxisPosition_mm(Y_MIN_BED + lfrb[1], axis_t(Y));
waitway = 6;
break;
- }
- case 9: { // Bed Tramming, Back Right 4
+
+ case 9: // Bed Tramming, Back Right 4
setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z));
setAxisPosition_mm(X_MAX_BED - lfrb[2], axis_t(X));
setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y));
waitway = 6;
break;
- }
- case 10: { // Bed Tramming, Back Left 5
+
+ case 10: // Bed Tramming, Back Left 5
setAxisPosition_mm(BED_TRAMMING_Z_HOP, axis_t(Z));
setAxisPosition_mm(X_MIN_BED + lfrb[0], axis_t(X));
setAxisPosition_mm(Y_MAX_BED - lfrb[3], axis_t(Y));
waitway = 6;
break;
- }
+
#endif // LCD_BED_TRAMMING
case 11: { // Autolevel switch
@@ -1223,113 +1218,92 @@ void RTS::handleData() {
#if HAS_BED_PROBE
sendData(getZOffset_mm() * 100, ProbeOffset_Z);
#endif
- break;
- }
+ } break;
+
#if ENABLED(G26_MESH_VALIDATION)
- case 12: {
+ case 12:
injectCommands(F("G26R255"));
onStatusChanged(F("Beginning G26.. Heating"));
break;
- }
#endif
#if ENABLED(MESH_BED_LEVELING)
- case 13: {
+ case 13:
injectCommands(F("G29S1"));
onStatusChanged(F("Begin Manual Mesh"));
break;
- }
- case 14: {
+ case 14:
injectCommands(F("G29S2"));
onStatusChanged(F("Moving to Next Mesh Point"));
break;
- }
#endif
- case 15: {
+ case 15:
injectCommands(F("M211S0\nG91\nG1Z-0.025\nG90\nM211S1"));
onStatusChanged(F("Moved down 0.025"));
break;
- }
- case 16: {
+ case 16:
injectCommands(F("M211S0\nG91\nG1Z0.025\nG90\nM211S1"));
onStatusChanged(F("Moved up 0.025"));
break;
- }
- case 17: {
+ case 17:
dwin_settings.display_volume = 0;
dwin_settings.display_sound = false;
setTouchScreenConfiguration();
break;
- }
- case 18: {
+ case 18:
dwin_settings.display_volume = 255;
dwin_settings.display_sound = true;
setTouchScreenConfiguration();
break;
- }
- case 19: {
+ case 19:
dwin_settings.screen_brightness = 10;
setTouchScreenConfiguration();
break;
- }
- case 20: {
+ case 20:
dwin_settings.screen_brightness = 100;
setTouchScreenConfiguration();
break;
- }
- case 21: {
+ case 21:
dwin_settings.display_standby ^= true;
setTouchScreenConfiguration();
break;
- }
- case 22: {
- dwin_settings.screen_rotation = dwin_settings.screen_rotation == 10 ? 0 : 10;
+ case 22:
+ dwin_settings.screen_rotation = 10 - dwin_settings.screen_rotation == 10 ? 0 : 10;
setTouchScreenConfiguration();
break;
- }
- case 23: { // Set IDEX Autopark
+ case 23: // Set IDEX Autopark
injectCommands(F("M605S1\nG28X\nG1X0"));
break;
- }
- case 24: { // Set IDEX Duplication
+ case 24: // Set IDEX Duplication
injectCommands(F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0"));
break;
- }
- case 25: { // Set IDEX Mirrored Duplication
+ case 25: // Set IDEX Mirrored Duplication
injectCommands(F("M605S1\nT0\nG28\nM605S2\nG28X\nG1X0\nM605S3"));
break;
- }
- case 26: { // Set IDEX Full Control
+ case 26: // Set IDEX Full Control
injectCommands(F("M605S0\nG28X"));
break;
- }
- case 27: { // Change Tool
+ case 27: // Change Tool
setActiveTool(getActiveTool() == E0 ? E1 : E0, !isAxisPositionKnown(X));
break;
- }
+
default: break;
}
sendData(10, FilenameIcon);
- break;
+ } break;
case XYZEaxis: {
axis_t axis = X;
float min = 0.0f, max = 0.0f;
waitway = 4;
if (recdat.addr == DisplayXaxis) {
- axis = X;
- min = X_MIN_POS;
- max = X_MAX_POS;
+ axis = X; min = X_MIN_POS; max = X_MAX_POS;
}
else if (recdat.addr == DisplayYaxis) {
- axis = Y;
- min = Y_MIN_POS;
- max = Y_MAX_POS;
+ axis = Y; min = Y_MIN_POS; max = Y_MAX_POS;
}
else if (recdat.addr == DisplayZaxis) {
- axis = Z;
- min = Z_MIN_POS;
- max = Z_MAX_POS;
+ axis = Z; min = Z_MIN_POS; max = Z_MAX_POS;
}
else if (recdat.addr == AutoZero) {
if (recdat.data[0] == 3) { // autohome
@@ -1343,19 +1317,16 @@ void RTS::handleData() {
axisPageNum = recdat.data[0];
waitway = 0;
}
- break;
- }
+ } break;
float targetPos = float(recdat.data[0]) / 10;
LIMIT(targetPos, min, max);
setAxisPosition_mm(targetPos, axis);
waitway = 0;
sendData(10, FilenameIcon);
- break;
- }
-
- case Filament:
+ } break;
+ case Filament: {
uint16_t IconTemp;
if (recdat.addr == Exchfilament) {
if (getActualTemp_celsius(getActiveTool()) < EXTRUDE_MINTEMP && recdat.data[0] < 5) {
@@ -1366,23 +1337,23 @@ void RTS::handleData() {
}
switch (recdat.data[0]) {
- case 1: { // Unload filament1
+ case 1: // Unload filament1
setAxisPosition_mm(getAxisPosition_mm(E0) - changeMaterialBuf[0], E0);
break;
- }
- case 2: { // Load filament1
+
+ case 2: // Load filament1
setAxisPosition_mm(getAxisPosition_mm(E0) + changeMaterialBuf[0], E0);
break;
- }
- case 3: { // Unload filament2
+
+ case 3: // Unload filament2
setAxisPosition_mm(getAxisPosition_mm(E1) - changeMaterialBuf[1], E1);
break;
- }
- case 4: { // Load filament2
+
+ case 4: // Load filament2
setAxisPosition_mm(getAxisPosition_mm(E1) + changeMaterialBuf[1], E1);
break;
- }
- case 5: { // sure to heat
+
+ case 5: // sure to heat
nozzleTempStatus[0] = 1;
setTargetTemp_celsius((PREHEAT_1_TEMP_HOTEND + 10), getActiveTool());
@@ -1397,17 +1368,17 @@ void RTS::handleData() {
delay_ms(5);
sendData(ExchangePageBase + 68, ExchangepageAddr);
break;
- }
- case 6: { // cancel to heat
+
+ case 6: // cancel to heat
sendData(ExchangePageBase + 65, ExchangepageAddr);
break;
- }
- case 0xF1: { // Sure to cancel heating
+
+ case 0xF1: // Sure to cancel heating
nozzleTempStatus[0] = 0;
delay_ms(1);
sendData(ExchangePageBase + 65, ExchangepageAddr);
break;
- }
+
case 0xF0: // not to cancel heating
break;
}
@@ -1420,57 +1391,53 @@ void RTS::handleData() {
else if (recdat.addr == FilamentUnit2) {
changeMaterialBuf[1] = float(recdat.data[0]) / 10;
}
- break;
+ } break;
- case LanguageChoice:
+ case LanguageChoice: {
//if (recdat.data[0] == 1) settings.save(); else injectCommands(F("M300"));
// may at some point use language change screens to save eeprom explicitly
switch (recdat.data[0]) {
- case 0: {
+ case 0:
injectCommands(F("M500"));
break;
- }
- case 1: {
+
+ case 1:
sendData(ExchangePageBase + 94, ExchangepageAddr);
break;
- }
#if ENABLED(PIDTEMP)
- case 2: {
+ case 2:
onStatusChanged(F("Hotend PID Started"));
startPIDTune(static_cast(pid_hotendAutoTemp), getActiveTool());
break;
- }
#endif
- case 3: {
+ case 3:
injectCommands(F("M502\nM500"));
break;
- }
- case 4: {
+
+ case 4:
injectCommands(F("M999\nM280P0S160"));
break;
- }
#if ENABLED(PIDTEMPBED)
- case 5: {
+ case 5:
onStatusChanged(F("Bed PID Started"));
startBedPIDTune(static_cast(pid_bedAutoTemp));
break;
- }
#endif
- case 6: {
+ case 6:
injectCommands(F("M500"));
break;
- }
+
default: break;
}
- break;
+ } break;
- case No_Filament:
+ case No_Filament: {
if (recdat.data[0] == 1) { // Filament is out, resume / resume selected on screen
if (ExtUI::pauseModeStatus != PAUSE_MESSAGE_PURGE && ExtUI::pauseModeStatus != PAUSE_MESSAGE_OPTION) {
// setPauseMenuResponse(PAUSE_RESPONSE_RESUME_PRINT);
@@ -1507,7 +1474,7 @@ void RTS::handleData() {
setUserConfirmed();
}
}
- break;
+ } break;
#if ENABLED(POWER_LOSS_RECOVERY)
case PwrOffNoF:
@@ -1518,14 +1485,8 @@ void RTS::handleData() {
break;
#endif
- case Volume:
- if (recdat.data[0] < 0)
- dwin_settings.display_volume = 0;
- else if (recdat.data[0] > 255)
- dwin_settings.display_volume = 0xFF;
- else
- dwin_settings.display_volume = recdat.data[0];
-
+ case Volume: {
+ dwin_settings.display_volume = constrain(recdat.data[0], 0, 255);
if (dwin_settings.display_volume == 0) {
sendData(0, VolumeIcon);
sendData(9, SoundIcon);
@@ -1535,9 +1496,9 @@ void RTS::handleData() {
sendData(8, SoundIcon);
}
sendData(dwin_settings.display_volume << 8, SoundAddr + 1);
- break;
+ } break;
- case Filename:
+ case Filename: {
if (isMediaInserted() && recdat.addr == FilenameChs) {
recordcount = recdat.data[0] - 1;
@@ -1616,7 +1577,7 @@ void RTS::handleData() {
tpShowStatus = false;
}
}
- break;
+ } break;
case VolumeDisplay: {
if (recdat.data[0] == 0) {
@@ -1632,8 +1593,7 @@ void RTS::handleData() {
dwin_settings.display_sound = true;
}
setTouchScreenConfiguration();
- break;
- }
+ } break;
case DisplayBrightness: {
if (recdat.data[0] < 10)
@@ -1643,8 +1603,7 @@ void RTS::handleData() {
else
dwin_settings.screen_brightness = (uint8_t)recdat.data[0];
setTouchScreenConfiguration();
- break;
- }
+ } break;
case DisplayStandbyBrightness: {
if (recdat.data[0] < 10)
@@ -1654,8 +1613,7 @@ void RTS::handleData() {
else
dwin_settings.standby_brightness = (uint8_t)recdat.data[0];
setTouchScreenConfiguration();
- break;
- }
+ } break;
case DisplayStandbySeconds: {
if (recdat.data[0] < 5)
@@ -1665,8 +1623,7 @@ void RTS::handleData() {
else
dwin_settings.standby_time_seconds = (uint8_t)recdat.data[0];
setTouchScreenConfiguration();
- break;
- }
+ } break;
case AutolevelVal: {
uint8_t meshPoint = (recdat.addr - AutolevelVal) / 2,
@@ -1680,8 +1637,7 @@ void RTS::handleData() {
xy_uint8_t point = { xPnt, yPnt };
setMeshPoint(point, meshVal);
sendData(meshVal * 1000, recdat.addr);
- break;
- }
+ } break;
default: break;
}
diff --git a/Marlin/src/lcd/extui/malyan/malyan.cpp b/Marlin/src/lcd/extui/malyan/malyan.cpp
index c2e6bcdb7dd1..4eb5ceaf5f05 100644
--- a/Marlin/src/lcd/extui/malyan/malyan.cpp
+++ b/Marlin/src/lcd/extui/malyan/malyan.cpp
@@ -106,7 +106,6 @@ void set_lcd_error(FSTR_P const error, FSTR_P const component/*=nullptr*/) {
write_to_lcd(F("}"));
}
-
/**
* Process an LCD 'C' command.
* These are currently all temperature commands
diff --git a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp
index 2c6dda512167..0554c34a19ac 100644
--- a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp
+++ b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.cpp
@@ -158,7 +158,6 @@ void SPIFlashStorage::beginWrite(const uint32_t startAddress) {
#endif
}
-
void SPIFlashStorage::endWrite() {
// Flush remaining data
#if HAS_SPI_FLASH_COMPRESSION
diff --git a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp
index 1f703f365291..32eb7e77d73b 100644
--- a/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp
+++ b/Marlin/src/lcd/extui/mks_ui/draw_dialog.cpp
@@ -396,7 +396,7 @@ void lv_draw_dialog(uint8_t type) {
F(DIALOG_UPLOAD_FINISH_EN), '\n',
F(DIALOG_UPLOAD_SIZE_EN), F(": "), int(upload_size / 1024), F(" KBytes\n"),
F(DIALOG_UPLOAD_TIME_EN), F(": "), int(upload_time_sec), F(" s\n"),
- F(DIALOG_UPLOAD_SPEED_EN), F(": "), int(upload_size / upload_time_sec / 1024), F(" KBytes/s\n"),
+ F(DIALOG_UPLOAD_SPEED_EN), F(": "), int(upload_size / upload_time_sec / 1024), F(" KBytes/s\n")
);
lv_label_set_text(labelDialog, buf);
lv_obj_align(labelDialog, nullptr, LV_ALIGN_CENTER, 0, -20);
diff --git a/Marlin/src/lcd/extui/mks_ui/draw_wifi.h b/Marlin/src/lcd/extui/mks_ui/draw_wifi.h
index a89bbd67d8c2..18cfd0755c1f 100644
--- a/Marlin/src/lcd/extui/mks_ui/draw_wifi.h
+++ b/Marlin/src/lcd/extui/mks_ui/draw_wifi.h
@@ -25,7 +25,6 @@
extern "C" {
#endif
-
void lv_draw_wifi();
void lv_clear_wifi();
void disp_wifi_state();
diff --git a/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h b/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h
index a289a80dc773..6f1499a06833 100644
--- a/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h
+++ b/Marlin/src/lcd/extui/mks_ui/draw_wifi_tips.h
@@ -25,7 +25,6 @@
extern "C" {
#endif
-
void lv_draw_wifi_tips();
void lv_clear_wifi_tips();
diff --git a/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h b/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h
index f0b19d4e0275..35c753ad1ac3 100644
--- a/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h
+++ b/Marlin/src/lcd/extui/mks_ui/tft_Language_fr.h
@@ -154,7 +154,6 @@
#define FILAMENT_DIALOG_LOAD_COMPLETE_TIPS_FR "Chargement terminé,\n pour revenir!"
#define FILAMENT_DIALOG_UNLOAD_COMPLETE_TIPS_FR "Déchargement terminé,\n pour revenir!"
-
#define PRE_HEAT_EXT_TEXT_FR "E"
#define PRE_HEAT_BED_TEXT_FR "Bed"
diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h
index 80335b7370f7..d847cfb1933b 100644
--- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h
+++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h
@@ -40,11 +40,7 @@ void my_disp_flush(lv_disp_drv_t * disp, const lv_area_t * area, lv_color_t * co
bool my_touchpad_read(lv_indev_drv_t * indev_driver, lv_indev_data_t * data);
bool my_mousewheel_read(lv_indev_drv_t * indev_drv, lv_indev_data_t * data);
-void LCD_Clear(uint16_t color);
-void tft_set_point(uint16_t x, uint16_t y, uint16_t point);
-void LCD_setWindowArea(uint16_t StartX, uint16_t StartY, uint16_t width, uint16_t height);
-void LCD_WriteRAM_Prepare();
-void lcd_draw_logo();
+void lcdClear(uint16_t color);
void lv_encoder_pin_init();
void lv_update_encoder();
diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h
index 2cb9aa2288ae..c96da22b60d0 100644
--- a/Marlin/src/lcd/language/language_pl.h
+++ b/Marlin/src/lcd/language/language_pl.h
@@ -467,7 +467,6 @@ namespace LanguageNarrow_pl {
LSTR MSG_GAMES = _UxGT("Gry");
-
LSTR MSG_EDIT_PASSWORD = _UxGT("Zmień hasło");
LSTR MSG_LOGIN_REQUIRED = _UxGT("Wymagane zalogowanie");
LSTR MSG_PASSWORD_SETTINGS = _UxGT("Ustawienia hasła");
diff --git a/Marlin/src/lcd/language/language_test.h b/Marlin/src/lcd/language/language_test.h
index 6e160a6b02f7..fa022ef6ee7e 100644
--- a/Marlin/src/lcd/language/language_test.h
+++ b/Marlin/src/lcd/language/language_test.h
@@ -44,22 +44,18 @@
// Kanji (an other Japanese symbol set) uses far more than two codepages. So currently I don't see a chance to map the Unicodes. Its not
// impossible to have a close to direct mapping but will need giant conversion tables and fonts (we don't want to have in a embedded system).
-
// Select the better font for full graphic displays.
//#define DISPLAY_CHARSET_ISO10646_1
//#define DISPLAY_CHARSET_ISO10646_5
//#define DISPLAY_CHARSET_ISO10646_GREEK
//#define DISPLAY_CHARSET_ISO10646_KANA
-
-
// next 5 lines select variants in this file only
#define DISPLAYTEST
//#define WEST
//#define CYRIL
//#define KANA
-
// TESTSTRINGS
#define STRG_ASCII_2 _UxGT(" !\"#$%&'()*+,-./")
diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h
index cc20c8955f24..150739b1748a 100644
--- a/Marlin/src/lcd/language/language_uk.h
+++ b/Marlin/src/lcd/language/language_uk.h
@@ -638,7 +638,6 @@ namespace LanguageNarrow_uk {
LSTR MSG_REMINDER_SAVE_SETTINGS = _UxGT("Не забудь зберегти!");
LSTR MSG_PASSWORD_REMOVED = _UxGT("Пароль видалений");
-
//
// Filament Change screens show up to 2 lines on a 3-line display
//
diff --git a/Marlin/src/lcd/menu/game/invaders.cpp b/Marlin/src/lcd/menu/game/invaders.cpp
index 1cb3e5bf3fcb..588523854f94 100644
--- a/Marlin/src/lcd/menu/game/invaders.cpp
+++ b/Marlin/src/lcd/menu/game/invaders.cpp
@@ -193,7 +193,6 @@ inline void reset_invaders() {
reset_bullets();
}
-
inline void spawn_ufo() {
idat.ufov = random(0, 2) ? 1 : -1;
idat.ufox = idat.ufov > 0 ? -(UFO_W) : LCD_PIXEL_WIDTH - 1;
diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp
index 44021ce35ad0..6a992b8f2fd6 100644
--- a/Marlin/src/lcd/menu/menu_configuration.cpp
+++ b/Marlin/src/lcd/menu/menu_configuration.cpp
@@ -31,6 +31,7 @@
#include "menu_item.h"
#include "../../MarlinCore.h"
+#include "../../module/temperature.h"
#if ENABLED(LCD_ENDSTOP_TEST)
#include "../../module/endstops.h"
diff --git a/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp b/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp
index 40012d7501fe..1c2c7fd21a0a 100644
--- a/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp
+++ b/Marlin/src/lcd/tft/fontdata/Helvetica/Helvetica_19.cpp
@@ -45,7 +45,6 @@ extern const uint8_t Helvetica_Symbols_19[45] = {
8,7,7,9,0,11,60,102,195,195,195,102,60,
};
-
// Helvetica, capital 'A' height: 19px
extern const uint8_t Helvetica_19[7298] = {
129,19,32,0,255,0,24,251, // unifont_t
diff --git a/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1 b/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1
index 84a393463d81..6f3809cc48e6 100644
--- a/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1
+++ b/Marlin/src/lcd/tft/fontdata/Unifont/LICENSE-OFL-1.1
@@ -1,7 +1,6 @@
The SIL Open Font License version 1.1 is copied below, and is also
available with a FAQ at http://scripts.sil.org/OFL.
-
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
diff --git a/Marlin/src/lcd/tft/tft_string.cpp b/Marlin/src/lcd/tft/tft_string.cpp
index ad1a53c4556f..edf326cb979e 100644
--- a/Marlin/src/lcd/tft/tft_string.cpp
+++ b/Marlin/src/lcd/tft/tft_string.cpp
@@ -40,7 +40,6 @@ unifont_t *TFT_String::font_header;
uint16_t TFT_String::extra_count;
#endif
-
uint16_t TFT_String::data[];
uint16_t TFT_String::span;
uint8_t TFT_String::length;
diff --git a/Marlin/src/lcd/tft/ui_color_ui.cpp b/Marlin/src/lcd/tft/ui_color_ui.cpp
index d6f3d2eff7fa..4febd29865d4 100644
--- a/Marlin/src/lcd/tft/ui_color_ui.cpp
+++ b/Marlin/src/lcd/tft/ui_color_ui.cpp
@@ -279,7 +279,6 @@ void MarlinUI::draw_status_screen() {
tft.add_text(Z_VALUE_X - offset, Z_VALUE_Y, nhz ? COLOR_AXIS_NOT_HOMED : COLOR_AXIS_HOMED, tft_string);
#endif
-
#if ENABLED(LCD_SHOW_E_TOTAL) && defined(E_MARK_X) && defined(E_MARK_Y) && defined(E_VALUE_X) && defined(E_VALUE_Y)
tft.add_text(E_MARK_X, E_MARK_Y, COLOR_AXIS_HOMED, "E");
if (printingIsActive()) {
diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp
index 13c8d60d1c83..a1766b067605 100644
--- a/Marlin/src/lcd/tft/ui_common.cpp
+++ b/Marlin/src/lcd/tft/ui_common.cpp
@@ -265,7 +265,6 @@ void drawBtn(const int x, const int y, const char *label, intptr_t data, const M
TERN_(TOUCH_SCREEN, if (enabled) touch.add_control(BUTTON, x, y, width, height, data));
}
-
//
// lcdprint.h functions
//
diff --git a/Marlin/src/lcd/tft_io/ili9328.h b/Marlin/src/lcd/tft_io/ili9328.h
index 823835f4483c..591a4ec2edf0 100644
--- a/Marlin/src/lcd/tft_io/ili9328.h
+++ b/Marlin/src/lcd/tft_io/ili9328.h
@@ -65,7 +65,6 @@
#define ILI9328_ETMOD_DATA (ILI9328_ETMOD_ORIENTATION) | (ILI9328_ETMOD_COLOR)
-
#define ILI9328_RDDID 0x00 // ID code - 0x9328
#define ILI9328_DRVCTL 0x01 // Driver Output Control
#define ILI9328_LCDCTL 0x02 // LCD Driving Wave Control
@@ -128,7 +127,6 @@
#define ILI9328_RDOTP 0xA2 // OTP VCM Status and Enable
#define ILI9328_OTPPKEY 0xA5 // OTP Programming ID Key
-
static const uint16_t ili9328_init[] = {
DATASIZE_16BIT,
ESC_REG(ILI9328_DRVCTL), ILI9328_DRVCTL_DATA,
diff --git a/Marlin/src/lcd/tft_io/ili9341.h b/Marlin/src/lcd/tft_io/ili9341.h
index 4488287430bd..d3a3483e9cad 100644
--- a/Marlin/src/lcd/tft_io/ili9341.h
+++ b/Marlin/src/lcd/tft_io/ili9341.h
@@ -136,7 +136,6 @@
#define ILI9341_IFCTL 0xF6 // Interface Control
#define ILI9341_PUMPRCTL 0xF7 // Pump ratio control
-
static const uint16_t ili9341_init[] = {
DATASIZE_8BIT,
ESC_REG(ILI9341_SWRESET), ESC_DELAY(100),
diff --git a/Marlin/src/lcd/tft_io/r65105.h b/Marlin/src/lcd/tft_io/r65105.h
index 4cc8c999426e..70443a0e045b 100644
--- a/Marlin/src/lcd/tft_io/r65105.h
+++ b/Marlin/src/lcd/tft_io/r65105.h
@@ -67,7 +67,6 @@
#define R61505_ETMOD_DATA (R61505_ETMOD_ORIENTATION) | (R61505_ETMOD_COLOR)
-
#define R61505_RDDID 0x00 // ID code - 0x1505
#define R61505_DRVCTL 0x01 // Driver Output Control
#define R61505_LCDCTL 0x02 // LCD Driving Wave Control
@@ -129,7 +128,6 @@
#define R61505_OSC_CTRL 0xA4 // Oscillation Control
-
static const uint16_t r61505_init[] = {
DATASIZE_16BIT,
ESC_REG(R61505_DRVCTL), R61505_DRVCTL_DATA,
diff --git a/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp
index 073a7ed0b6ec..3d4d3fcd3fdb 100644
--- a/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp
+++ b/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp
@@ -142,7 +142,6 @@ HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd,
return HSDR_SINK_OK;
}
-
/*****************
* Decompression *
*****************/
diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp
index 9c6a3c011cca..490d6bc2cefb 100644
--- a/Marlin/src/module/endstops.cpp
+++ b/Marlin/src/module/endstops.cpp
@@ -788,7 +788,7 @@ void Endstops::update() {
G38_did_trigger = true;
#define _G38_SET(Q) | (stepper.axis_is_moving(_AXIS(Q)) << _AXIS(Q))
#define _G38_RESP(Q) if (moving[_AXIS(Q)]) { _ENDSTOP_HIT(Q, ENDSTOP); planner.endstop_triggered(_AXIS(Q)); }
- const Flags moving = { value_t(NUM_AXES)(0 MAIN_AXIS_MAP(_G38_SET)) };
+ const Flags moving = { uvalue_t(NUM_AXES)(0 MAIN_AXIS_MAP(_G38_SET)) };
MAIN_AXIS_MAP(_G38_RESP);
}
#endif
diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp
index b76f11b9849c..c6b093644755 100644
--- a/Marlin/src/module/motion.cpp
+++ b/Marlin/src/module/motion.cpp
@@ -380,7 +380,6 @@ void report_current_position_projected() {
#endif // CARTESIAN
-
void home_if_needed(const bool keeplev/*=false*/) {
if (!all_axes_trusted()) gcode.home_all_axes(keeplev);
}
diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h
index 42eee677cbc6..856e70e5821a 100644
--- a/Marlin/src/module/planner.h
+++ b/Marlin/src/module/planner.h
@@ -125,7 +125,6 @@ enum BlockFlagBit {
// Direct stepping page
OPTARG(DIRECT_STEPPING, BLOCK_BIT_PAGE)
-
// Sync the fan speeds from the block
OPTARG(LASER_SYNCHRONOUS_M106_M107, BLOCK_BIT_SYNC_FANS)
@@ -454,7 +453,6 @@ class Planner {
static uint16_t cleaning_buffer_counter; // A counter to disable queuing of blocks
static uint8_t delay_before_delivering; // This counter delays delivery of blocks when queue becomes empty to allow the opportunity of merging blocks
-
#if ENABLED(DISTINCT_E_FACTORS)
static uint8_t last_extruder; // Respond to extruder change
#endif
diff --git a/Marlin/src/module/probe.cpp b/Marlin/src/module/probe.cpp
index ee9e9b34acef..2fec098b8aaa 100644
--- a/Marlin/src/module/probe.cpp
+++ b/Marlin/src/module/probe.cpp
@@ -1010,6 +1010,10 @@ float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRai
// If any error occurred stow the probe and set an alert
if (isnan(measured_z)) {
+ // TODO: Disable steppers (unless G29_RETRY_AND_RECOVER or G29_HALT_ON_FAILURE are set).
+ // Something definitely went wrong at this point, so it might be a good idea to release the steppers.
+ // The user may want to quickly move the carriage or bed by hand to avoid bed damage from the (hot) nozzle.
+ // This would also benefit from the contemplated "Audio Alerts" feature.
stow();
LCD_MESSAGE(MSG_LCD_PROBING_FAILED);
#if DISABLED(G29_RETRY_AND_RECOVER)
diff --git a/Marlin/src/module/scara.cpp b/Marlin/src/module/scara.cpp
index 9c149670e92e..0f00ab564338 100644
--- a/Marlin/src/module/scara.cpp
+++ b/Marlin/src/module/scara.cpp
@@ -229,9 +229,7 @@ float segments_per_second = DEFAULT_SEGMENTS_PER_SECOND;
// Move all carriages together linearly until an endstop is hit.
//do_blocking_move_to_xy_z(pos, mlz, homing_feedrate(Z_AXIS));
- current_position.x = 0 ;
- current_position.y = 0 ;
- current_position.z = max_length(Z_AXIS) ;
+ current_position.set(0, 0, max_length(Z_AXIS));
line_to_current_position(homing_feedrate(Z_AXIS));
planner.synchronize();
diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp
index 34f840e8e3b4..2dc48ebbf0ad 100644
--- a/Marlin/src/module/settings.cpp
+++ b/Marlin/src/module/settings.cpp
@@ -729,7 +729,8 @@ void MarlinSettings::postprocess() {
bool MarlinSettings::sd_update_status() {
uint8_t val;
- persistentStore.read_data(SD_FIRMWARE_UPDATE_EEPROM_ADDR, &val);
+ int pos = SD_FIRMWARE_UPDATE_EEPROM_ADDR;
+ persistentStore.read_data(pos, &val);
return (val == SD_FIRMWARE_UPDATE_ACTIVE_VALUE);
}
@@ -1861,8 +1862,10 @@ void MarlinSettings::postprocess() {
EEPROM_READ(planner.settings.min_segment_time_us);
- float tmp2[NUM_AXES + e_factors];
- EEPROM_READ((uint8_t *)tmp2, sizeof(tmp2)); // axis_steps_per_mm
+ #if ENABLED(EDITABLE_STEPS_PER_UNIT)
+ float tmp2[NUM_AXES + e_factors];
+ EEPROM_READ((uint8_t *)tmp2, sizeof(tmp2)); // axis_steps_per_mm
+ #endif
feedRate_t tmp3[NUM_AXES + e_factors];
EEPROM_READ((uint8_t *)tmp3, sizeof(tmp3)); // max_feedrate_mm_s
diff --git a/Marlin/src/pins/esp32/pins_MM_JOKER.h b/Marlin/src/pins/esp32/pins_MM_JOKER.h
index b992fe89c3c8..b74321dbfcef 100644
--- a/Marlin/src/pins/esp32/pins_MM_JOKER.h
+++ b/Marlin/src/pins/esp32/pins_MM_JOKER.h
@@ -219,6 +219,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
//#define LCD_PINS_RS 13
diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h
index 90ff78487f33..bcdb8c4faa75 100644
--- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h
+++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h
@@ -121,9 +121,9 @@
#define SDSS 5
#define USES_SHARED_SPI // SPI is shared by SD card with TMC SPI drivers
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
+//
+// LCD / Controller
+//
#if HAS_WIRED_LCD
diff --git a/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h b/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h
new file mode 100644
index 000000000000..64b013d9993e
--- /dev/null
+++ b/Marlin/src/pins/hc32f4/pins_CREALITY_ENDER2P_V24S4.h
@@ -0,0 +1,222 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+//
+// Creality Ender 2 Pro v2.4.S4_170 (HC32f460kcta)
+// Derived from https://github.com/Klipper3d/klipper/blob/master/config/printer-creality-ender2pro-hc32-2022.cfg
+//
+#include "env_validate.h"
+
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
+ #error "Creality v2.4.S4 only supports one hotend and E-stepper"
+#endif
+
+#ifndef BOARD_INFO_NAME
+ #define BOARD_INFO_NAME "Creality v2.4.S4"
+#endif
+#ifndef DEFAULT_MACHINE_NAME
+ #define DEFAULT_MACHINE_NAME "Ender 2 Pro"
+#endif
+
+//
+// Onboard crystal oscillator
+//
+#ifndef BOARD_XTAL_FREQUENCY
+ #define BOARD_XTAL_FREQUENCY 8000000 // 8 MHz XTAL
+#endif
+
+//
+// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
+//
+//#define DISABLE_DEBUG
+//#define DISABLE_JTAG
+
+//
+// EEPROM
+//
+#if NO_EEPROM_SELECTED
+ #define IIC_BL24CXX_EEPROM
+ //#define SDCARD_EEPROM_EMULATION
+ #undef NO_EEPROM_SELECTED
+#endif
+
+#if ENABLED(IIC_BL24CXX_EEPROM)
+ #define IIC_EEPROM_SDA PA12
+ #define IIC_EEPROM_SCL PA11
+ #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
+#elif ENABLED(SDCARD_EEPROM_EMULATION)
+ #define MARLIN_EEPROM_SIZE 0x800 // 2K
+#endif
+
+//
+// Servos
+//
+#ifndef SERVO0_PIN
+ #define SERVO0_PIN PB0 // BLTouch OUT *
+#endif
+
+//
+// Limit Switches
+//
+#define X_STOP_PIN PA5
+#define Y_STOP_PIN PA6
+#define Z_STOP_PIN PB0 // BLTOUCH *
+
+#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 PC15 // "Pulled-high" *
+#endif
+
+//
+// Steppers
+//
+#define X_ENABLE_PIN PC2
+#define X_STEP_PIN PC1
+#define X_DIR_PIN PC0
+
+#define Y_ENABLE_PIN PH2
+#define Y_STEP_PIN PB9
+#define Y_DIR_PIN PB8
+
+#define Z_ENABLE_PIN PB7
+#define Z_STEP_PIN PB6
+#define Z_DIR_PIN PB5
+
+#define E0_ENABLE_PIN PB4
+#define E0_STEP_PIN PB3
+#define E0_DIR_PIN PA15
+
+//
+// Temperature Sensors
+//
+#define TEMP_0_PIN PC5 // HEATER1 ADC1_IN15
+#define TEMP_BED_PIN PC4 // HOT BED ADC1_IN14
+
+//
+// Heaters / Fans
+//
+#define HEATER_0_PIN PA1 // HEATER1
+#define HEATER_BED_PIN PB10 // HOT BED
+
+#define FAN0_PIN PA0 // FAN0
+
+//
+// SD Card
+//
+#define SD_DETECT_PIN PA10
+#define ONBOARD_SPI_DEVICE 1
+#define ONBOARD_SD_CS_PIN PC3 // SDSS
+#define ONBOARD_SDIO
+#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
+
+#ifndef LCD_SERIAL_PORT
+ #define LCD_SERIAL_PORT 1
+#endif
+
+//
+// SDIO Pins
+//
+#define BOARD_SDIO_D0 PC8
+#define BOARD_SDIO_D1 PC9
+#define BOARD_SDIO_D2 PC10
+#define BOARD_SDIO_D3 PC11
+#define BOARD_SDIO_CLK PC12
+#define BOARD_SDIO_CMD PD2
+#define BOARD_SDIO_DET PA10
+
+//
+// USART Pins
+//
+
+// Display
+#define BOARD_USART1_TX_PIN PA2 // LCD
+#define BOARD_USART1_RX_PIN PA3
+
+// Host
+#define BOARD_USART2_TX_PIN PA8 // USB
+#define BOARD_USART2_RX_PIN PA7
+
+// Onboard LED (HIGH = off, LOW = on)
+#ifndef LED_BUILTIN
+ #define LED_BUILTIN PC3
+#endif
+
+#define BOARD_NO_NATIVE_USB
+
+//
+// SPI3 Pins (LCD)
+//
+#define SPI_NSS PB15 // SPI3_NSS
+#define SPI_SCK PB14 // SPI3_CLK
+#define SPI_MISO PB13 // SPI3_MISO
+#define SPI_MOSI PB12 // SPI3_MOSI
+
+//
+// LCD / Controller
+//
+
+/** ------
+ * PC6 | 1 2 | PC7
+ * PA2 | 3 4 | PC1
+ * PB13 5 6 | PB14
+ * PB15 | 7 8 | PB12
+ * GND | 9 10 | 5V
+ * ------
+ * EXP1
+ */
+#define EXP1_01_PIN PC6
+#define EXP1_02_PIN PC7
+#define EXP1_03_PIN PA2
+#define EXP1_04_PIN PC1
+#define EXP1_05_PIN PB13
+#define EXP1_06_PIN PB14
+#define EXP1_07_PIN PB15
+#define EXP1_08_PIN PB12
+
+#if ENABLED(CR10_STOCKDISPLAY) // LCD used for C2
+ /** ------
+ * BEEPER | 1 2 | ENC
+ * EN1 | 3 4 | KILL
+ * EN2 5 6 | LCD_D4
+ * LCD_RS | 7 8 | LCD_EN
+ * GND | 9 10 | 5V
+ * ------
+ */
+ #define BEEPER_PIN EXP1_01_PIN
+
+ #define BTN_ENC EXP1_02_PIN
+ #define BTN_EN1 EXP1_03_PIN
+ #define BTN_EN2 EXP1_05_PIN
+
+ #define LCD_PINS_RS EXP1_07_PIN
+ #define LCD_PINS_EN EXP1_08_PIN
+ #define LCD_PINS_D4 EXP1_06_PIN
+
+ #define KILL_PIN EXP1_04_PIN
+#endif
diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
index ea6e4a4bee68..0704145d7407 100644
--- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
+++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h
@@ -399,9 +399,9 @@
#define EXP2_07_PIN 49 // SD_DET
#define EXP2_08_PIN 41 // KILL
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
+//
+// LCD / Controller
+//
#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
index 94ce0b097b7b..e6a2abc0f0f0 100644
--- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
+++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
@@ -111,6 +111,7 @@
//
// LCD / Controller
//
+
#if !defined(BEEPER_PIN) && HAS_WIRED_LCD && DISABLED(LCD_USE_I2C_BUZZER)
#define BEEPER_PIN P1_30 // (EXP1-1) Not 5V-tolerant
#endif
diff --git a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h
index 43a9b786eb7d..5c4e8d40e85b 100644
--- a/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h
+++ b/Marlin/src/pins/lpc1768/pins_EMOTRONIC.h
@@ -138,6 +138,7 @@
//
// LCD / Controller
//
+
#if ENABLED(EMOTION_TECH_LCD)
#define BEEPER_PIN EXP2_01_PIN
#define DOGLCD_A0 EXP2_06_PIN
diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
index 335d6b9d23e7..039d906efcad 100644
--- a/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
+++ b/Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
@@ -230,6 +230,7 @@
//
// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
index 3db18e4acfea..0134e936319d 100644
--- a/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
+++ b/Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
@@ -93,6 +93,7 @@
//
// LCD / Controller
//
+
#if ANY(VIKI2, miniVIKI)
#define BEEPER_PIN P1_31
diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h
index 60d68a8607ba..1c0623aea866 100644
--- a/Marlin/src/pins/mega/pins_CNCONTROLS_11.h
+++ b/Marlin/src/pins/mega/pins_CNCONTROLS_11.h
@@ -138,6 +138,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN 6
diff --git a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h
index 5c92f92e29d6..4864a6d83c78 100644
--- a/Marlin/src/pins/mega/pins_CNCONTROLS_12.h
+++ b/Marlin/src/pins/mega/pins_CNCONTROLS_12.h
@@ -143,6 +143,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN 16
diff --git a/Marlin/src/pins/mega/pins_EINSTART-S.h b/Marlin/src/pins/mega/pins_EINSTART-S.h
index 813cbf7dc42f..92c85c12110f 100644
--- a/Marlin/src/pins/mega/pins_EINSTART-S.h
+++ b/Marlin/src/pins/mega/pins_EINSTART-S.h
@@ -78,12 +78,8 @@
#define SDSS 53
#define LED_PIN 4
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
-
//
-// LCD Display output pins
+// LCD / Controller
//
// Requires #define U8GLIB_SH1106_EINSTART in Configuration.h
diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h
index 512da028348b..638465f3b9eb 100644
--- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h
+++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h
@@ -122,6 +122,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN 18
diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h
index 3868f11c11b0..688c147a6890 100644
--- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h
+++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h
@@ -167,6 +167,7 @@
//
// LCD / Controller
//
+
#if ENABLED(MINIPANEL)
#define BEEPER_PIN MINI_15
diff --git a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
index e9a0ddc09dfc..22c14fc5e89e 100644
--- a/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
+++ b/Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h
@@ -187,6 +187,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if IS_RRD_FG_SC
diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h
index 1ae9e69af073..332d7d4cb4dc 100644
--- a/Marlin/src/pins/mega/pins_OVERLORD.h
+++ b/Marlin/src/pins/mega/pins_OVERLORD.h
@@ -122,6 +122,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
// OVERLORD OLED pins
#define LCD_PINS_RS 20
diff --git a/Marlin/src/pins/mega/pins_WEEDO_62A.h b/Marlin/src/pins/mega/pins_WEEDO_62A.h
index f3adf5eab8b8..436529cb3510 100644
--- a/Marlin/src/pins/mega/pins_WEEDO_62A.h
+++ b/Marlin/src/pins/mega/pins_WEEDO_62A.h
@@ -92,6 +92,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN 37
diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index 71d663d1eaf3..af32d8c11968 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -900,8 +900,11 @@
//
// HC32 ARM Cortex-M4
//
+
#elif MB(AQUILA_V101)
#include "hc32f4/pins_AQUILA_101.h" // HC32F460 env:HC32F460C_aquila_101
+#elif MB(CREALITY_ENDER2P_V24S4)
+ #include "hc32f4/pins_CREALITY_ENDER2P_V24S4.h" // HC32F460 env:HC32F460C_e2p24s4
//
// Custom board (with custom PIO env)
diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h
index 9181a5b9da29..c2735d27b8db 100644
--- a/Marlin/src/pins/pinsDebug.h
+++ b/Marlin/src/pins/pinsDebug.h
@@ -81,7 +81,6 @@
#define REPORT_NAME_DIGITAL(COUNTER, NAME) _ADD_PIN(NAME, COUNTER, true)
#define REPORT_NAME_ANALOG(COUNTER, NAME) _ADD_PIN(analogInputToDigitalPin(NAME), COUNTER, false)
-
typedef struct {
PGM_P const name;
pin_t pin;
diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h
index d73092c2f68a..ada4885752a3 100644
--- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h
+++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h
@@ -208,6 +208,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL
#define KILL_PIN 32
diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h
index 6d37fcf7df77..75d0974b0a36 100644
--- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h
+++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h
@@ -202,6 +202,7 @@
//
// LCD / Controller
//
+
#if ANY(HAS_WIRED_LCD, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE)
#define KILL_PIN 32
diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h
index a7b8c8466bbc..f176efcc7111 100644
--- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h
+++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h
@@ -147,6 +147,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL
#if !MB(MINIRAMBO_10A)
diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h
index 494ea547f27f..8ea3c15b4620 100644
--- a/Marlin/src/pins/rambo/pins_RAMBO.h
+++ b/Marlin/src/pins/rambo/pins_RAMBO.h
@@ -199,6 +199,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL
#define KILL_PIN 80
diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h
index 2d419e132179..3a2d7ea19561 100644
--- a/Marlin/src/pins/ramps/pins_3DRAG.h
+++ b/Marlin/src/pins/ramps/pins_3DRAG.h
@@ -131,6 +131,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD && IS_NEWPANEL
#undef BEEPER_PIN
diff --git a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h
index 90f46fe3861e..83045bdfe02d 100644
--- a/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h
+++ b/Marlin/src/pins/ramps/pins_DUPLICATOR_I3_PLUS.h
@@ -85,8 +85,9 @@
#define SD_SCK_PIN 52 // PB1
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if ENABLED(ZONESTAR_LCD)
#define LCD_PINS_RS 2
diff --git a/Marlin/src/pins/ramps/pins_FELIX2.h b/Marlin/src/pins/ramps/pins_FELIX2.h
index 34bd29d19fe7..746de8581a67 100644
--- a/Marlin/src/pins/ramps/pins_FELIX2.h
+++ b/Marlin/src/pins/ramps/pins_FELIX2.h
@@ -49,6 +49,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD && IS_NEWPANEL
#define SD_DETECT_PIN 6
diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h
index 08c40822fc76..102595363377 100644
--- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h
+++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h
@@ -192,7 +192,6 @@
//
// Misc. Functions
//
-#define SDSS EXP2_04_PIN
#define LED_PIN 13
#define KILL_PIN 41
@@ -230,10 +229,16 @@
#define EXP2_08_PIN -1 // RESET
//
-// LCDs and Controllers
+// SD Card
//
+
+#define SDSS EXP2_04_PIN
#define SD_DETECT_PIN EXP2_07_PIN
+//
+// LCD / Controller
+//
+
#if ENABLED(FYSETC_242_OLED_12864)
#define BTN_EN1 EXP1_01_PIN
#define BTN_EN2 EXP1_08_PIN
diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h
index eacaf95b3801..170401bf1c21 100644
--- a/Marlin/src/pins/ramps/pins_K8600.h
+++ b/Marlin/src/pins/ramps/pins_K8600.h
@@ -60,6 +60,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD && IS_NEWPANEL
#define LCD_PINS_RS 27
diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h
index 9afdc62a53a8..6ef77909d163 100644
--- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h
+++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h
@@ -63,6 +63,7 @@
//
// LCD / Controller
//
+
#if ANY(VIKI2, miniVIKI)
/**
* VIKI2 Has two groups of wires with...
diff --git a/Marlin/src/pins/ramps/pins_ORTUR_4.h b/Marlin/src/pins/ramps/pins_ORTUR_4.h
index d2adf9971c84..e8a87911d1b7 100644
--- a/Marlin/src/pins/ramps/pins_ORTUR_4.h
+++ b/Marlin/src/pins/ramps/pins_ORTUR_4.h
@@ -79,6 +79,7 @@
//
// LCD / Controller
//
+
#if IS_RRD_FG_SC
#define BEEPER_PIN 35
diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h
index 25b17f016b8f..0195f3a1bc9a 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS.h
@@ -585,9 +585,9 @@
#endif
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
+//
+// LCD / Controller
+//
#ifdef LCD_PINS_DEFINED
diff --git a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
index 542b3cb81642..9565adad2f3b 100644
--- a/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
+++ b/Marlin/src/pins/ramps/pins_RAMPS_S_12.h
@@ -244,13 +244,10 @@
#endif
#endif
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
-
//
-// LCD Display output pins
+// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN 45
#define LCD_PINS_RS 19
diff --git a/Marlin/src/pins/ramps/pins_RUMBA.h b/Marlin/src/pins/ramps/pins_RUMBA.h
index 1d2aeb4f0f88..9a4a384e4ab5 100644
--- a/Marlin/src/pins/ramps/pins_RUMBA.h
+++ b/Marlin/src/pins/ramps/pins_RUMBA.h
@@ -190,6 +190,7 @@
//
// LCD / Controller
//
+
#if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306)
#define LCD_PINS_DC 38 // Set as output on init
#define LCD_PINS_RS 41 // Pull low for 1s to init
diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
index 64f595f31232..ed4f373c541d 100644
--- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h
+++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h
@@ -304,9 +304,9 @@
#define EXP2_07_PIN 49 // SD_DET
#define EXP2_08_PIN 41 // KILL / RESET
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
+//
+// LCD / Controller
+//
#if HAS_WIRED_LCD
diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER.h b/Marlin/src/pins/ramps/pins_ULTIMAKER.h
index 4e1fb487b5d3..b4eea9d4885c 100644
--- a/Marlin/src/pins/ramps/pins_ULTIMAKER.h
+++ b/Marlin/src/pins/ramps/pins_ULTIMAKER.h
@@ -118,6 +118,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN 18
diff --git a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
index 01fc6b416d16..5cf143a09cf6 100644
--- a/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
+++ b/Marlin/src/pins/ramps/pins_ULTIMAKER_OLD.h
@@ -166,6 +166,7 @@
//
// LCD / Controller
//
+
#if ANY(BOARD_REV_1_0, BOARD_REV_1_1_TO_1_3)
#define LCD_PINS_RS 24
diff --git a/Marlin/src/pins/ramps/pins_VORON.h b/Marlin/src/pins/ramps/pins_VORON.h
index 4aee2ab1424a..ee3d7f0185bf 100644
--- a/Marlin/src/pins/ramps/pins_VORON.h
+++ b/Marlin/src/pins/ramps/pins_VORON.h
@@ -49,6 +49,6 @@
#include "pins_RAMPS.h"
//
-// LCDs and Controllers
+// LCD / Controller
//
#undef BEEPER_PIN
diff --git a/Marlin/src/pins/ramps/pins_ZRIB_V53.h b/Marlin/src/pins/ramps/pins_ZRIB_V53.h
index beea40ab20f0..85420bdec3f2 100644
--- a/Marlin/src/pins/ramps/pins_ZRIB_V53.h
+++ b/Marlin/src/pins/ramps/pins_ZRIB_V53.h
@@ -329,9 +329,9 @@
#define EXP2_08_PIN 41
#endif
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
+//
+// LCD / Controller
+//
#if ENABLED(ZONESTAR_12864LCD)
#define LCDSCREEN_NAME "ZONESTAR LCD12864"
diff --git a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h
index 312745f11d10..ceaeb8a587b5 100644
--- a/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h
+++ b/Marlin/src/pins/sam/pins_ALLIGATOR_R2.h
@@ -148,6 +148,7 @@
//
// LCD / Controller
//
+
#if IS_RRD_FG_SC
#define LCD_PINS_RS 18
#define LCD_PINS_EN 15
diff --git a/Marlin/src/pins/sam/pins_ARCHIM1.h b/Marlin/src/pins/sam/pins_ARCHIM1.h
index a6ac53e5ece1..e7530f981ba6 100644
--- a/Marlin/src/pins/sam/pins_ARCHIM1.h
+++ b/Marlin/src/pins/sam/pins_ARCHIM1.h
@@ -180,6 +180,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN 23 // D24 PA15_CTS1
#define LCD_PINS_RS 17 // D17 PA12_RXD1
diff --git a/Marlin/src/pins/sam/pins_ARCHIM2.h b/Marlin/src/pins/sam/pins_ARCHIM2.h
index 56202cc18868..31ed50194cc2 100644
--- a/Marlin/src/pins/sam/pins_ARCHIM2.h
+++ b/Marlin/src/pins/sam/pins_ARCHIM2.h
@@ -235,6 +235,7 @@
//
// LCD / Controller
//
+
#if ANY(HAS_WIRED_LCD, TOUCH_UI_ULTIPANEL, TOUCH_UI_FTDI_EVE)
#define BEEPER_PIN 23 // D24 PA15_CTS1
#define LCD_PINS_RS 17 // D17 PA12_RXD1
diff --git a/Marlin/src/pins/sam/pins_DUE3DOM.h b/Marlin/src/pins/sam/pins_DUE3DOM.h
index bd6cb7a6cd79..66aa581271a2 100644
--- a/Marlin/src/pins/sam/pins_DUE3DOM.h
+++ b/Marlin/src/pins/sam/pins_DUE3DOM.h
@@ -111,6 +111,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define LCD_PINS_RS 42
diff --git a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h
index 8ad5e2229cfd..b9f73adfe9c1 100644
--- a/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h
+++ b/Marlin/src/pins/sam/pins_DUE3DOM_MINI.h
@@ -103,6 +103,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define LCD_PINS_RS 42
diff --git a/Marlin/src/pins/sam/pins_KRATOS32.h b/Marlin/src/pins/sam/pins_KRATOS32.h
index 74da7a78f625..bebe2b82a35d 100644
--- a/Marlin/src/pins/sam/pins_KRATOS32.h
+++ b/Marlin/src/pins/sam/pins_KRATOS32.h
@@ -145,6 +145,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BTN_EN1 48
diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h
index 9a3edff0c989..4f713391fc96 100644
--- a/Marlin/src/pins/sam/pins_RADDS.h
+++ b/Marlin/src/pins/sam/pins_RADDS.h
@@ -224,6 +224,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if ENABLED(RADDS_DISPLAY)
diff --git a/Marlin/src/pins/sam/pins_RAMPS_DUO.h b/Marlin/src/pins/sam/pins_RAMPS_DUO.h
index b00d215cc7fb..6b7bf514669e 100644
--- a/Marlin/src/pins/sam/pins_RAMPS_DUO.h
+++ b/Marlin/src/pins/sam/pins_RAMPS_DUO.h
@@ -66,6 +66,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if ALL(IS_NEWPANEL, PANEL_ONE)
diff --git a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h
index 1ae96ebe6d86..2b9c8fd7eb79 100644
--- a/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h
+++ b/Marlin/src/pins/sam/pins_RAMPS_FD_V1.h
@@ -166,6 +166,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN EXP1_01_PIN
diff --git a/Marlin/src/pins/sam/pins_RAMPS_SMART.h b/Marlin/src/pins/sam/pins_RAMPS_SMART.h
index 2a0733c601f8..90e9b9969790 100644
--- a/Marlin/src/pins/sam/pins_RAMPS_SMART.h
+++ b/Marlin/src/pins/sam/pins_RAMPS_SMART.h
@@ -95,6 +95,7 @@
//
// LCD / Controller
//
+
#if ENABLED(AZSMZ_12864)
// Support for AZSMZ 12864 LCD with SD Card 3D printer smart controller control panel
diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h
index b28971c19211..f083f01d4f12 100644
--- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h
+++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h
@@ -216,6 +216,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC)
diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h
index 1b66b766db2c..fa27868ff940 100644
--- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h
+++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h
@@ -206,6 +206,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC)
diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h
index da3af2a0ab3e..39061efb2d6f 100644
--- a/Marlin/src/pins/samd/pins_RAMPS_144.h
+++ b/Marlin/src/pins/samd/pins_RAMPS_144.h
@@ -417,9 +417,9 @@
#endif
-//////////////////////////
-// LCDs and Controllers //
-//////////////////////////
+//
+// LCD / Controller
+//
#ifdef LCD_PINS_DEFINED
diff --git a/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h
index 9c635706202c..476375203c6b 100644
--- a/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h
+++ b/Marlin/src/pins/sanguino/pins_GEN6_DELUXE.h
@@ -48,7 +48,6 @@
* Once installed select the SANGUINO board and then select the CPU.
*/
-
#define BOARD_INFO_NAME "Gen6 Deluxe"
#include "pins_GEN6.h"
diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
index df9fb0f86493..f441523322e3 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
@@ -59,6 +59,7 @@
//
// LCD / Controller
//
+
#if ANY(MKS_MINI_12864, CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
#if ANY(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
#define LCD_PINS_RS EXP1_07_PIN // ST9720 CS
diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h
index b36c7140c45b..dd557265c464 100644
--- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h
+++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY_E2.h
@@ -56,6 +56,7 @@
//
// LCD / Controller
//
+
#if ANY(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
#if ENABLED(CR10_STOCKDISPLAY)
#if HAS_MEDIA
diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
index 6b502ee5307e..bee2a30e44ab 100644
--- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
+++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
@@ -159,6 +159,7 @@
//
// LCD / Controller
//
+
#ifdef LCD_PINS_DEFINED
// LCD pins already defined by including header
diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h
index 7e24afde26e5..b6a3c4141fac 100644
--- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h
+++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h
@@ -120,6 +120,7 @@
//
// LCD / Controller
//
+
#if ENABLED(CR10_STOCKDISPLAY)
#define BTN_ENC PA15
#define BTN_EN1 PA9
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 fad09daf7964..d0bd2944bc03 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
@@ -142,6 +142,7 @@
//
// LCD / Controller
//
+
#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI)
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN
diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
index d5b52a35a8f4..e8f9cf023581 100644
--- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
+++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h
@@ -145,6 +145,7 @@
//
// LCD / Controller
//
+
#if ENABLED(CR10_STOCKDISPLAY)
#define BEEPER_PIN EXP1_01_PIN
#define BTN_EN1 EXP1_03_PIN
diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
index e1c7175584e7..28537967381a 100644
--- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
+++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h
@@ -272,6 +272,7 @@
//
// LCD / Controller
//
+
#ifndef BEEPER_PIN
#define BEEPER_PIN PC5
#endif
diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h
index 69e11be20cf5..e31d11f40827 100644
--- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h
+++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h
@@ -150,6 +150,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define SPI_DEVICE 2 // Maple
diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h
index b97ccc8ec738..94c6dc2bfa6b 100644
--- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h
+++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h
@@ -134,6 +134,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if IS_RRD_SC
diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h
index 4bb8c5dee627..5f66f9bc3bb9 100644
--- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h
+++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h
@@ -134,6 +134,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if IS_RRD_SC
diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h
index 57abf7aca79e..9f7efa99c427 100644
--- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h
+++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h
@@ -139,6 +139,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if IS_RRD_SC
diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h
index 34f7dba91f9c..3f6ae1414bc8 100644
--- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h
+++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h
@@ -134,6 +134,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if IS_RRD_SC
diff --git a/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h b/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h
index 4ac0a24d1c4d..000548ee5351 100644
--- a/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h
+++ b/Marlin/src/pins/stm32f1/pins_KEDI_CONTROLLER_V1_2.h
@@ -180,6 +180,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN EXP1_10_PIN
#define BTN_ENC EXP1_09_PIN
diff --git a/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h b/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h
index 13e32145c62e..a376feb93a74 100644
--- a/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h
+++ b/Marlin/src/pins/stm32f1/pins_ORCA_3D_SPRINGER.h
@@ -251,6 +251,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN EXP1_01_PIN // NC
#define BTN_ENC EXP1_02_PIN
diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h
index 4c65ce9f6456..33440e30dd1d 100644
--- a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h
+++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h
@@ -168,6 +168,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BTN_ENC PA0
#define BTN_EN1 PC4
diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h
index 06f697e27020..c1e5a46f70db 100644
--- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h
+++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h
@@ -278,6 +278,7 @@
//
// LCD / Controller
//
+
#if ENABLED(ZONESTAR_12864LCD)
#define LCDSCREEN_NAME "ZONESTAR LCD12864"
#define LCD_PINS_RS EXP1_03_PIN // 7 CS make sure for zonestar zm3e4!
diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h
index edfee05166c3..c2b2512f4ab8 100644
--- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h
+++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h
@@ -133,6 +133,7 @@
//
// LCD / Controller
//
+
#if HAS_SPI_TFT || HAS_FSMC_TFT
#define TFT_RESET_PIN PE6
#define TFT_CS_PIN PD7
diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
index 02ad9bb4ad76..502ec19bed03 100644
--- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
+++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
@@ -125,6 +125,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#if ANY(MKS_12864OLED, MKS_12864OLED_SSD1306)
#define LCD_PINS_DC PB8 // Set as output on init
diff --git a/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h b/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h
index 33b2219655ea..886dd092fb84 100644
--- a/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h
+++ b/Marlin/src/pins/stm32f4/pins_BLACKBEEZMINI.h
@@ -140,6 +140,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN EXP1_01_PIN
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 d7196b75fc34..2abbf3452bed 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h
@@ -238,8 +238,9 @@
#define SDSS EXP2_04_PIN
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN
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 5444842aa229..2830fc3b74dc 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h
@@ -410,8 +410,9 @@
#define EXP2_07_PIN PB10
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI)
#define TFT_CS_PIN EXP2_04_PIN
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 76596a6dde25..169cc9d8322a 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h
@@ -412,8 +412,9 @@
#endif // BTT_MOTOR_EXPANSION
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
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 e80344c2e25a..0e1d2a32d8ac 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h
@@ -432,8 +432,9 @@
#endif // BTT_MOTOR_EXPANSION
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
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 a20002dfc520..41514181f5a9 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
@@ -437,8 +437,9 @@
#endif // BTT_MOTOR_EXPANSION
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h b/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h
index 32f70a371540..fa524464e386 100644
--- a/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h
+++ b/Marlin/src/pins/stm32f4/pins_CREALITY_V24S1_301F4.h
@@ -35,4 +35,6 @@
#define DISABLE_DEBUG false // DISABLE_(DEBUG|JTAG) is not supported for STM32F4.
#define ALLOW_STM32F4
+#define EEPROM_EXCL_ZONE 916,926 // Ender-3S1 STM32F401 Bootloader EEPROM exclusion zone
+
#include "../stm32f1/pins_CREALITY_V24S1_301.h"
diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
index 725d326ec2fe..d41a6eac754a 100644
--- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
+++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h
@@ -283,6 +283,7 @@
//
// LCD / Controller
//
+
#if IS_RRD_SC
#define BEEPER_PIN EXP1_01_PIN
#define LCD_PINS_RS EXP1_04_PIN
diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h
index 92a1545f8a28..8658191dbe22 100644
--- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h
+++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h
@@ -238,6 +238,7 @@
//
// LCD / Controller
//
+
#if ENABLED(FYSETC_242_OLED_12864)
#define BTN_EN1 EXP1_01_PIN
diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h
index bfe4469084f0..4a1960367cff 100644
--- a/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h
+++ b/Marlin/src/pins/stm32f4/pins_FYSETC_SPIDER_KING407.h
@@ -278,6 +278,7 @@
//
// LCD / Controller
//
+
#if ENABLED(FYSETC_242_OLED_12864)
#define BEEPER_PIN EXP2_08_PIN
diff --git a/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h b/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h
index f63f4adeec1e..98a54ffb0df5 100644
--- a/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h
+++ b/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h
@@ -480,8 +480,9 @@
#endif
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h b/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h
index 4aced54b10db..248fc514ac40 100644
--- a/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h
+++ b/Marlin/src/pins/stm32f4/pins_MELLOW_FLY_E3_V2.h
@@ -334,8 +334,9 @@
#endif // BTT_MOTOR_EXPANSION
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h
index b4e9cabd905c..0b3673046797 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h
@@ -285,6 +285,7 @@
//
// LCD / Controller
//
+
#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI)
#define TFT_CS_PIN EXP1_07_PIN
#define TFT_SCK_PIN EXP2_02_PIN
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 ecc5e60d3b35..5af3cf53dd49 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_PRO_V2.h
@@ -291,6 +291,7 @@
//
// LCD / Controller
//
+
#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI)
#ifndef TOUCH_CALIBRATION_X
#define TOUCH_CALIBRATION_X -17253
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 7ec2f1263072..b20477a15db5 100644
--- a/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
+++ b/Marlin/src/pins/stm32f4/pins_MKS_SKIPR_V1_0.h
@@ -284,8 +284,9 @@
#endif
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
index ca663039e887..4574df53ac11 100644
--- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
+++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h
@@ -170,6 +170,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BTN_ENC EXP1_02_PIN
diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h
index bf45f94ab80b..d9c542c6a281 100644
--- a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h
+++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h
@@ -181,6 +181,7 @@
//
// LCD / Controller
//
+
#if IS_RRD_FG_SC
#define BEEPER_PIN PC7 // LCD_BEEPER
#define BTN_ENC PE11 // BTN_ENC
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 912d69e62803..103a14891103 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h
@@ -140,6 +140,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD
#define BTN_EN1 PB7
#define BTN_EN2 PB5
diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h
index 0131c50ebfbc..b7c5a8c470f8 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M4P_V2_1.h
@@ -208,8 +208,9 @@
#endif
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
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 2a9157688f7c..8d75638ee578 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
@@ -236,8 +236,9 @@
#endif
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
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 796527b364d5..327c5f1970ca 100644
--- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
+++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_M8P_common.h
@@ -286,8 +286,9 @@
#endif
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h
index d55e0a3f84f8..1840e441f8e6 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h
@@ -454,8 +454,9 @@
#endif // BTT_MOTOR_EXPANSION
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h b/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h
index bc6118228ff8..2c5c4bc05e8b 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_MANTA_M8P_V2_0.h
@@ -418,8 +418,9 @@
#endif
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if ENABLED(BTT_MINI_12864) // BTT Mini 12864 V2.0 connected via 18-pin FPC cable
#define BEEPER_PIN EXP1_01_PIN
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 3ef00286670d..f51dbac93b14 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_MAX_EZ.h
@@ -410,7 +410,7 @@
#endif
//
-// LCDs and Controllers
+// LCD / Controller
//
#if ENABLED(BTT_MINI_12864) // BTT Mini 12864 V2.0 connected via 18-pin FPC cable
diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h
index 820dc449c187..ba24722e15d4 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h
@@ -423,8 +423,9 @@
#endif // BTT_MOTOR_EXPANSION
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
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 fe0e1a02cef9..1d63f40e4cd6 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
@@ -431,8 +431,9 @@
#endif // BTT_MOTOR_EXPANSION
//
-// LCDs and Controllers
+// LCD / Controller
//
+
#if IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
diff --git a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h
index c1eee00c2dd3..ab4427a8892d 100644
--- a/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h
+++ b/Marlin/src/pins/teensy2/pins_PRINTRBOARD.h
@@ -130,6 +130,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD && IS_NEWPANEL
#define LCD_PINS_RS 9 // E1 JP11-11
diff --git a/Marlin/src/pins/teensy2/pins_TEENSY2.h b/Marlin/src/pins/teensy2/pins_TEENSY2.h
index 9c8c6ce628b6..dac4c6c94006 100644
--- a/Marlin/src/pins/teensy2/pins_TEENSY2.h
+++ b/Marlin/src/pins/teensy2/pins_TEENSY2.h
@@ -167,6 +167,7 @@
//
// LCD / Controller
//
+
#if IS_ULTIPANEL
#define LCD_PINS_RS 8 // E0
#define LCD_PINS_EN 9 // E1
diff --git a/Marlin/src/pins/teensy2/pins_TEENSYLU.h b/Marlin/src/pins/teensy2/pins_TEENSYLU.h
index deeffe9038cf..a6a16f2be158 100644
--- a/Marlin/src/pins/teensy2/pins_TEENSYLU.h
+++ b/Marlin/src/pins/teensy2/pins_TEENSYLU.h
@@ -149,6 +149,7 @@
//
// LCD / Controller
//
+
#if HAS_WIRED_LCD && IS_NEWPANEL
#define BEEPER_PIN -1
diff --git a/Marlin/src/sd/SdBaseFile.cpp b/Marlin/src/sd/SdBaseFile.cpp
index 94c1b02e0e58..f878118d2f0d 100644
--- a/Marlin/src/sd/SdBaseFile.cpp
+++ b/Marlin/src/sd/SdBaseFile.cpp
@@ -1295,7 +1295,6 @@ static void print2u(const uint8_t v) {
* \param[in] fatDate The date field from a directory entry.
*/
-
/**
* %Print a directory date field.
*
@@ -1312,7 +1311,6 @@ void SdBaseFile::printFatDate(const uint16_t fatDate) {
print2u(FAT_DAY(fatDate));
}
-
/**
* %Print a directory time field.
*
diff --git a/Marlin/src/sd/SdBaseFile.h b/Marlin/src/sd/SdBaseFile.h
index b806a3cd7021..dc31e8492d2c 100644
--- a/Marlin/src/sd/SdBaseFile.h
+++ b/Marlin/src/sd/SdBaseFile.h
@@ -67,7 +67,6 @@ uint8_t const LS_DATE = 1, // ls() flag to print modify date
LS_SIZE = 2, // ls() flag to print file size
LS_R = 4; // ls() flag for recursive list of subdirectories
-
// flags for timestamp
uint8_t const T_ACCESS = 1, // Set the file's last access date
T_CREATE = 2, // Set the file's creation date and time
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h
index 2b6e1be52274..16b8c092cc67 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/UsbCore.h
@@ -201,8 +201,6 @@ typedef struct {
uint16_t wLength; // 6 Depends on bRequest
} __attribute__((packed)) SETUP_PKT, *PSETUP_PKT;
-
-
// Base class for incoming data parser
class USBReadParser {
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp
index 1aeef1703fec..551fb274d781 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp
@@ -796,7 +796,6 @@ uint8_t BulkOnly::RequestSense(uint8_t lun, uint16_t size, uint8_t *buf) {
return Transaction(&cbw, size, buf);
}
-
////////////////////////////////////////////////////////////////////////////////
// USB code
////////////////////////////////////////////////////////////////////////////////
@@ -1148,7 +1147,6 @@ uint8_t BulkOnly::HandleSCSIError(uint8_t status) {
} // switch
}
-
////////////////////////////////////////////////////////////////////////////////
// Debugging code
////////////////////////////////////////////////////////////////////////////////
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h
index 99c628f888d3..f4d2af517655 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h
@@ -79,7 +79,6 @@
#define HID_DESCRIPTOR_HID 0x21
-
/* OTG SET FEATURE Constants */
#define OTG_FEATURE_B_HNP_ENABLE 3 // SET FEATURE OTG - Enable B device to perform HNP
#define OTG_FEATURE_A_HNP_SUPPORT 4 // SET FEATURE OTG - A device supports HNP
@@ -92,7 +91,6 @@
#define USB_TRANSFER_TYPE_INTERRUPT 0x03 // Endpoint is an interrupt endpoint.
#define bmUSB_TRANSFER_TYPE 0x03 // bit mask to separate transfer type from ISO attributes
-
/* Standard Feature Selectors for CLEAR_FEATURE Requests */
#define USB_FEATURE_ENDPOINT_STALL 0 // Endpoint recipient
#define USB_FEATURE_DEVICE_REMOTE_WAKEUP 1 // Device recipient
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt b/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt
index 378786f940f3..f543bbaa6421 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/README.txt
@@ -5,14 +5,12 @@ The lib-uhs3/ folder contains a subset of the files from the USB Host Shield
https://github.com/felis/UHS30
-
==== LICENSE SUMMARY ====
Source Path: Repository: License:
------------ ----------- --------
usb_flashdrive/lib github.com/felis/UHS30 GPLv2 or later
-
==== MARLIN INTEGRATION WORK ====
All additional work done to integrate USB into Marlin was performed by
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h
index b35e53686e8a..c94e7ab990d9 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h
@@ -27,7 +27,6 @@ e-mail : support@circuitsathome.com
#ifndef __UHS_BULK_STORAGE_H__
#define __UHS_BULK_STORAGE_H__
-
////////////////////////////////////////////////////////////////////////////////
// Define any of these options at the top of your sketch to override
// the defaults contained herewith. Do NOT do modifications here.
@@ -201,7 +200,6 @@ class UHS_Bulk_Storage : public UHS_USBInterface {
uint8_t SCSITransaction6(SCSI_CDB6_t *cdb, uint16_t buf_size, void *buf, uint8_t dir);
uint8_t SCSITransaction10(SCSI_CDB10_t *cdb, uint16_t buf_size, void *buf, uint8_t dir);
-
// Configure and internal methods, these should never be called by a user's sketch.
uint8_t Start();
bool OKtoEnumerate(ENUMERATION_INFO *ei);
@@ -211,12 +209,10 @@ class UHS_Bulk_Storage : public UHS_USBInterface {
return bAddress;
};
-
void Poll();
void DriverDefaults();
-
private:
void Reset();
void CheckMedia();
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h
index 37ba681c5c7b..06deb7a0ae8b 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h
@@ -41,9 +41,7 @@ e-mail : support@circuitsathome.com
#endif
////////////////////////////////////////////////////////////////////////////////
-
// Interface code
-
////////////////////////////////////////////////////////////////////////////////
/**
@@ -298,9 +296,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::Write(uint8_t lun, uint32_t addr, uint16_t bsiz
// Only developer serviceable parts below!
////////////////////////////////////////////////////////////////////////////////
-
// Main driver code
-
////////////////////////////////////////////////////////////////////////////////
UHS_NI UHS_Bulk_Storage::UHS_Bulk_Storage(UHS_USB_HOST_BASE *p) {
@@ -637,11 +633,7 @@ void UHS_NI UHS_Bulk_Storage::Poll() {
}
////////////////////////////////////////////////////////////////////////////////
-
-
// SCSI code
-
-
////////////////////////////////////////////////////////////////////////////////
/**
@@ -794,13 +786,8 @@ uint8_t UHS_NI UHS_Bulk_Storage::RequestSense(uint8_t lun, uint16_t size, uint8_
return v;
}
-
////////////////////////////////////////////////////////////////////////////////
-
-
// USB code
-
-
////////////////////////////////////////////////////////////////////////////////
/**
@@ -954,7 +941,6 @@ uint8_t UHS_NI UHS_Bulk_Storage::HandleUsbError(uint8_t error, uint8_t index) {
if(index != epDataInIndex) return UHS_BULK_ERR_WRITE_STALL;
return UHS_BULK_ERR_STALL;
-
case UHS_HOST_ERROR_TOGERR:
// Handle a very super rare corner case, where toggles become de-synched.
// I have only ran into one device that has this firmware bug, and this is
@@ -1171,13 +1157,8 @@ uint8_t UHS_NI UHS_Bulk_Storage::HandleSCSIError(uint8_t status) {
} // switch
}
-
////////////////////////////////////////////////////////////////////////////////
-
-
// Debugging code
-
-
////////////////////////////////////////////////////////////////////////////////
/**
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h
index 58d7ba200cb5..9ec18fbf4122 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_UsbCore.h
@@ -59,7 +59,6 @@ e-mail : support@circuitsathome.com
// D6-5 Type (0- standard, 1 - class, 2 - vendor, 3 - reserved)
// D4-0 Recipient (0 - device, 1 - interface, 2 - endpoint, 3 - other, 4..31 - reserved)
-
// TO-DO: Use the python script to generate these.
// TO-DO: Add _all_ subclasses here.
// USB Device Classes, Subclasses and Protocols
@@ -165,7 +164,6 @@ e-mail : support@circuitsathome.com
////////////////////////////////////////////////////////////////////////////////
-
/* USB state machine states */
#define UHS_USB_HOST_STATE_MASK 0xF0U
@@ -324,7 +322,6 @@ typedef struct {
// 8 bytes total
} __attribute__((packed)) SETUP_PKT, *PSETUP_PKT;
-
// little endian :-) 8 8 8 8 16 16
#define mkSETUP_PKT8(bmReqType, bRequest, wValLo, wValHi, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wValLo))<<16)|(((uint64_t)(wValHi))<<24)|(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48)))
#define mkSETUP_PKT16(bmReqType, bRequest, wVal, wInd, total) ((uint64_t)(((uint64_t)(bmReqType)))|(((uint64_t)(bRequest))<<8)|(((uint64_t)(wVal ))<<16) |(((uint64_t)(wInd))<<32)|(((uint64_t)(total)<<48)))
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h
index 4d9d35bd6da0..3b47bbd892eb 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_address.h
@@ -29,8 +29,6 @@ e-mail : support@circuitsathome.com
#else
#define __ADDRESS_H__
-
-
/* NAK powers. To save space in endpoint data structure, amount of retries before giving up and returning 0x4 is stored in */
/* bmNakPower as a power of 2. The actual nak_limit is then calculated as nak_limit = ( 2^bmNakPower - 1) */
#define UHS_USB_NAK_MAX_POWER 14 // NAK binary order maximum value
@@ -192,7 +190,6 @@ class AddressPool {
return (!index) ? NULL : &thePool[index];
};
-
// Allocates new address
uint8_t UHS_NI AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 1) {
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h
index f78a3bb8f0fa..d87b40fea299 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h
@@ -47,7 +47,6 @@ UHS_EpInfo* UHS_USB_HOST_BASE::getEpInfoEntry(uint8_t addr, uint8_t ep) {
if(!p || !p->epinfo)
return NULL;
-
UHS_EpInfo *pep;
for(uint8_t j = 0; j < UHS_HOST_MAX_INTERFACE_DRIVERS; j++) {
pep = (UHS_EpInfo *)(p->epinfo[j]);
@@ -311,7 +310,6 @@ uint8_t UHS_USB_HOST_BASE::Configuring(uint8_t parent, uint8_t port, uint8_t spe
return rcode;
}
-
#if UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE
ei.address = addrPool.AllocAddress(parent, false, port);
@@ -1111,7 +1109,6 @@ uint8_t UHS_USB_HOST_BASE::enumerateInterface(ENUMERATION_INFO *ei) {
return devConfigIndex;
};
-
////////////////////////////////////////////////////////////////////////////////
// Vendor Specific Interface Class
////////////////////////////////////////////////////////////////////////////////
@@ -1168,7 +1165,6 @@ uint8_t UHS_NI UHS_VSI::SetInterface(ENUMERATION_INFO *ei) {
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
-
#if 0
/* TO-DO: Move this silliness to a NONE driver.
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h
index bb2a87cf0382..6e9bb8b7835b 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_macros.h
@@ -31,7 +31,6 @@ e-mail : support@circuitsathome.com
* Universal Arduino(tm) "IDE" fixups.
*/
-
// Just in case...
#ifndef SERIAL_PORT_MONITOR
#define SERIAL_PORT_MONITOR Serial
@@ -57,7 +56,6 @@ e-mail : support@circuitsathome.com
#endif
#endif
-
#ifndef UHS_DEVICE_WINDOWS_USB_SPEC_VIOLATION_DESCRIPTOR_DEVICE
#ifndef UHS_BIG_FLASH
@@ -160,7 +158,6 @@ e-mail : support@circuitsathome.com
#define UHS_KIO_SETBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 1
#define UHS_KIO_CLRBIT_ATOMIC(r, m) (*(uint32_t *)UHS_KIO_BITBAND_ADDR((r), BITNR((m)))) = 0
-
#define VALUE_BETWEEN(v,l,h) (((v)>(l)) && ((v)<(h)))
#define VALUE_WITHIN(v,l,h) (((v)>=(l)) && ((v)<=(h)))
#define output_pgm_message(wa,fp,mp,el) wa = &mp, fp((char *)pgm_read_pointer(wa), el)
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h
index 4fc9b94079ab..bb464d7adf82 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printf_HELPER.h
@@ -167,8 +167,6 @@ extern "C" {
#error no STDIO
#endif // defined(ARDUINO_ARCH_PIC32)
-
-
#ifdef __AVR__
// The only wierdo in the bunch...
void UHS_AVR_printf_HELPER_init() {
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h
index edf673a4fbe7..af8917e14dbb 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_printhex.h
@@ -91,6 +91,4 @@ template void D_PrintBin(NOTUSED(T val), NOTUSED(int lvl)) {
#endif
}
-
-
#endif // __PRINTHEX_H__
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h
index c516599d6b3f..03bf1c1c07ec 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_settings.h
@@ -55,7 +55,6 @@ e-mail : support@circuitsathome.com
//
////////////////////////////////////////////////////////////////////////////////
-
////////////////////////////////////////////////////////////////////////////////
// DEBUGGING
////////////////////////////////////////////////////////////////////////////////
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h
index 6486482d961a..013be2a9d46f 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h
@@ -97,7 +97,6 @@ e-mail : support@circuitsathome.com
#define USB_SETUP_RECIPIENT_PORT 0x04 // Wireless USB 1.0
#define USB_SETUP_RECIPIENT_RPIPE 0x05 // Wireless USB 1.0
-
/* USB descriptors */
#define USB_DESCRIPTOR_DEVICE 0x01 // bDescriptorType for a Device Descriptor.
#define USB_DESCRIPTOR_CONFIGURATION 0x02 // bDescriptorType for a Configuration Descriptor.
@@ -123,7 +122,6 @@ e-mail : support@circuitsathome.com
#define USB_HID_DESCRIPTOR 0x21
-
// Conventional codes for class-specific descriptors. "Common Class" Spec (3.11)
#define USB_DESCRIPTOR_CS_DEVICE 0x21
#define USB_DESCRIPTOR_CS_CONFIG 0x22
@@ -131,8 +129,6 @@ e-mail : support@circuitsathome.com
#define USB_DESCRIPTOR_CS_INTERFACE 0x24
#define USB_DESCRIPTOR_CS_ENDPOINT 0x25
-
-
/* USB Endpoint Transfer Types */
#define USB_TRANSFER_TYPE_CONTROL 0x00 // Endpoint is a control endpoint.
#define USB_TRANSFER_TYPE_ISOCHRONOUS 0x01 // Endpoint is an isochronous endpoint.
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h
index 79c06a492b97..eb4f35eb136f 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD.h
@@ -27,7 +27,6 @@ e-mail : support@circuitsathome.com
#include "UHS_max3421e.h"
#include
-
#ifndef SPI_HAS_TRANSACTION
#error "Your SPI library installation is too old."
#else
@@ -58,8 +57,6 @@ e-mail : support@circuitsathome.com
#define USB_HOST_SHIELD_USE_ISR 1
#endif
-
-
#if !USB_HOST_SHIELD_USE_ISR
#error NOISR Polled mode _NOT SUPPORTED YET_
@@ -180,8 +177,6 @@ e-mail : support@circuitsathome.com
#endif
#endif
-
-
#ifdef NO_AUTO_SPEED
// Ugly details section...
// MAX3421E characteristics
@@ -466,7 +461,6 @@ public UHS_USB_HOST_BASE
interrupts();
};
-
int16_t UHS_NI Init(int16_t mseconds);
int16_t UHS_NI Init() {
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h
index 57352a351873..f126a6fcef74 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/USB_HOST_SHIELD/USB_HOST_SHIELD_INLINE.h
@@ -28,7 +28,6 @@
#error digitalPinToInterrupt not defined, complain to your board maintainer.
#endif
-
#if USB_HOST_SHIELD_USE_ISR
// allow two slots. this makes the maximum allowed shield count TWO
@@ -47,7 +46,6 @@
}
#endif
-
void UHS_NI MAX3421E_HOST::resume_host() {
// Used on MCU that lack control of IRQ priority (AVR).
// Resumes ISRs.
@@ -875,7 +873,6 @@ void UHS_NI MAX3421E_HOST::ISRbottom() {
DDSB();
}
-
/* USB main task. Services the MAX3421e */
#if !USB_HOST_SHIELD_USE_ISR
void UHS_NI MAX3421E_HOST::ISRTask() {}
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h
index eeaa4f81d9fe..1318ea8b287f 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/macro_logic.h
@@ -126,12 +126,10 @@ AJK_IIF(AJK_BITAND(AJK_IS_COMPARABLE(x))(AJK_IS_COMPARABLE(y)) ) \
#define AJK_EQUAL(x, y) AJK_COMPL(AJK_NOT_EQUAL(x, y))
-
#define AJK_COMMA() ,
#define AJK_COMMA_IF(n) AJK_IF(n)(AJK_COMMA, AJK_EAT)()
-
#define AJK_COMMA_VAR(AJK_count, AJK_v) AJK_COMMA_IF(AJK_count) AJK_v ## AJK_count
#define AJK_MAKE_LIST(AJK_v, AJK_count) AJK_EVAL(AJK_REPEAT(AJK_count, AJK_COMMA_VAR, AJK_v))
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h
index f86054cad8a4..f50b3bd4c1e8 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/SWI_INLINE.h
@@ -29,8 +29,6 @@
#define SWI_MAXIMUM_ALLOWED 4
#endif
-
-
#if defined(__arm__) || defined(ARDUINO_ARCH_PIC32)
static char dyn_SWI_initied = 0;
static dyn_SWI* dyn_SWI_LIST[SWI_MAXIMUM_ALLOWED];
@@ -79,7 +77,6 @@ void softISR() {
// TO-DO: Perhaps limit to 8, and inline this?
//
-
// Make a working copy, while clearing the queue.
noInterrupts();
#ifdef ARDUINO_ARCH_PIC32
@@ -117,7 +114,6 @@ void softISR() {
#define DDSB() __DSB()
#endif
-
#ifdef __arm__
#ifndef interruptsStatus
#define interruptsStatus() __interruptsStatus()
diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h
index 07f4ae054dcf..652b43fd2e36 100644
--- a/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h
+++ b/Marlin/src/sd/usb_flashdrive/lib-uhs3/dyn_SWI/dyn_SWI.h
@@ -22,7 +22,6 @@
#ifndef DYN_SWI_H
#define DYN_SWI_H
-
#if defined(__arm__) || defined(ARDUINO_ARCH_PIC32)
#ifdef ARDUINO_ARCH_PIC32
#include
@@ -135,7 +134,6 @@ extern "C"
#error Do not know how to relocate IRQ vectors or perform SWI
#endif // SWI_IRQ_NUM
-
#ifndef SWI_IRQ_NUM
#error SWI_IRQ_NUM not defined
#else
diff --git a/buildroot/tests/LPC1769 b/buildroot/tests/LPC1769
index 9987d155adeb..dd4f5f28eada 100755
--- a/buildroot/tests/LPC1769
+++ b/buildroot/tests/LPC1769
@@ -33,7 +33,7 @@ exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI and many features" "$3"
# REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT BABYSTEPPING \
# AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS \
# FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR FAN_SOFT_PWM \
-# SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER FAN_KICKSTART_TIME \
+# SHOW_TEMP_ADC_VALUES HOME_Y_BEFORE_X EMERGENCY_PARSER \
# SD_ABORT_ON_ENDSTOP_HIT ADVANCED_OK GCODE_MACROS \
# VOLUMETRIC_DEFAULT_ON NO_WORKSPACE_OFFSETS \
# EXTRA_FAN_SPEED FWRETRACT MENU_ADDAUTOSTART SDCARD_SORT_ALPHA
diff --git a/buildroot/tests/mega2560 b/buildroot/tests/mega2560
index c41e73640d44..97d12090c2a0 100755
--- a/buildroot/tests/mega2560
+++ b/buildroot/tests/mega2560
@@ -60,8 +60,8 @@ exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sle
#
restore_configs
opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO NUM_SERVOS 1 \
- EXTRUDERS 5 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 \
- NUM_RUNOUT_SENSORS 5 FIL_RUNOUT2_PIN 44 FIL_RUNOUT3_PIN 45 FIL_RUNOUT4_PIN 46 FIL_RUNOUT5_PIN 47 \
+ EXTRUDERS 4 TEMP_SENSOR_1 1 TEMP_SENSOR_2 1 TEMP_SENSOR_3 1 TEMP_SENSOR_4 1 FAN_KICKSTART_TIME 500 \
+ NUM_RUNOUT_SENSORS 4 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 Z_SERVO_MEASURE_ANGLE DEACTIVATE_SERVOS_AFTER_MOVE Z_SERVO_DEACTIVATE_AFTER_STOW \
@@ -70,7 +70,7 @@ opt_enable VIKI2 BOOT_MARLIN_LOGO_ANIMATED SDSUPPORT AUTO_REPORT_SD_STATUS \
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 "Z Servo Probe | Multiple runout sensors (x5)" "$3"
+exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 4 | VIKI2 | Servo Probe | Multiple runout sensors (x4)" "$3"
#
# Extruder Only. No XYZ axes at all.
diff --git a/ini/hc32.ini b/ini/hc32.ini
index d25ef4e7be07..9bf15447e2cd 100644
--- a/ini/hc32.ini
+++ b/ini/hc32.ini
@@ -85,3 +85,10 @@ board_build.ld_args.flash_size = 512K
extends = HC32F460C_base
board_build.ld_args.flash_start = 0xC000 # Bootloader start address, as logged by the bootloader on boot
board_build.ld_args.boot_mode = secondary # Save ~1.4k of flash by compiling as secondary firmware
+
+#
+# Creality Ender 2 Pro v2.4.S4_170 (HC32f460kcta) (256K Flash, 192K RAM).
+#
+[env:HC32F460C_e2p24s4]
+extends = HC32F460C_base
+board_build.ld_args.flash_start = 0x8000