diff --git a/.gitignore b/.gitignore index 72fd117bd2..0b852d7673 100755 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,6 @@ applet/ *.rej *.bak *.idea -*.s *.i *.ii *.swp @@ -141,11 +140,8 @@ __vm/ vc-fileutils.settings # Visual Studio Code -.vscode -.vscode/.browse.c_cpp.db* -.vscode/c_cpp_properties.json -.vscode/launch.json -.vscode/*.db +.vscode/* +!.vscode/extensions.json #Simulation imgui.ini diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..7226831cb1 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "marlinfirmware.auto-build", + "platformio.platformio-ide" + ] +} diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 42928a8b2c..578c314134 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -2977,6 +2977,9 @@ //#define CHOPPER_TIMING_Z2 CHOPPER_TIMING_Z //#define CHOPPER_TIMING_Z3 CHOPPER_TIMING_Z //#define CHOPPER_TIMING_Z4 CHOPPER_TIMING_Z + //#define CHOPPER_TIMING_I CHOPPER_TIMING + //#define CHOPPER_TIMING_J CHOPPER_TIMING + //#define CHOPPER_TIMING_K CHOPPER_TIMING //#define CHOPPER_TIMING_E CHOPPER_TIMING // For Extruders (override below) //#define CHOPPER_TIMING_E1 CHOPPER_TIMING_E //#define CHOPPER_TIMING_E2 CHOPPER_TIMING_E diff --git a/Marlin/src/HAL/AVR/MarlinSerial.h b/Marlin/src/HAL/AVR/MarlinSerial.h index 0565c7b9db..84c5ddd297 100644 --- a/Marlin/src/HAL/AVR/MarlinSerial.h +++ b/Marlin/src/HAL/AVR/MarlinSerial.h @@ -217,7 +217,7 @@ #endif enum { HasEmergencyParser = Cfg::EMERGENCYPARSER }; - static inline bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } + static bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } diff --git a/Marlin/src/HAL/DUE/MarlinSerial.h b/Marlin/src/HAL/DUE/MarlinSerial.h index 4a62e2834f..5a61bffee0 100644 --- a/Marlin/src/HAL/DUE/MarlinSerial.h +++ b/Marlin/src/HAL/DUE/MarlinSerial.h @@ -118,7 +118,7 @@ public: static size_t write(const uint8_t c); static void flushTX(); - static inline bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } + static bool emergency_parser_enabled() { return Cfg::EMERGENCYPARSER; } FORCE_INLINE static uint8_t dropped() { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; } FORCE_INLINE static uint8_t buffer_overruns() { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; } diff --git a/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp b/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp index 67c597da80..8de2dc7924 100644 --- a/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp +++ b/Marlin/src/HAL/DUE/MarlinSerialUSB.cpp @@ -41,7 +41,7 @@ extern "C" { int udi_cdc_getc(); bool udi_cdc_is_tx_ready(); int udi_cdc_putc(int value); -}; +} // Pending character static int pending_char = -1; diff --git a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp index 3dcbbaecd2..34cc256b30 100644 --- a/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp +++ b/Marlin/src/HAL/DUE/usb/sd_mmc_spi_mem.cpp @@ -10,7 +10,7 @@ #include "../../../sd/cardreader.h" extern "C" { -#include "sd_mmc_spi_mem.h" + #include "sd_mmc_spi_mem.h" } #define SD_MMC_BLOCK_SIZE 512 diff --git a/Marlin/src/HAL/LPC1768/include/SPI.h b/Marlin/src/HAL/LPC1768/include/SPI.h index ecd91f6a3b..24f4759315 100644 --- a/Marlin/src/HAL/LPC1768/include/SPI.h +++ b/Marlin/src/HAL/LPC1768/include/SPI.h @@ -77,7 +77,7 @@ public: //uint32_t spiRate() const { return spi_speed; } - static inline uint32_t spiRate2Clock(uint32_t spiRate) { + static uint32_t spiRate2Clock(uint32_t spiRate) { uint32_t Marlin_speed[7]; // CPSR is always 2 Marlin_speed[0] = 8333333; //(SCR: 2) desired: 8,000,000 actual: 8,333,333 +4.2% SPI_FULL_SPEED Marlin_speed[1] = 4166667; //(SCR: 5) desired: 4,000,000 actual: 4,166,667 +4.2% SPI_HALF_SPEED diff --git a/Marlin/src/HAL/LPC1768/tft/xpt2046.h b/Marlin/src/HAL/LPC1768/tft/xpt2046.h index aba0799e44..7c456cf00e 100644 --- a/Marlin/src/HAL/LPC1768/tft/xpt2046.h +++ b/Marlin/src/HAL/LPC1768/tft/xpt2046.h @@ -65,8 +65,8 @@ private: static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; - static inline void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; + static void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; + static void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; #if ENABLED(TOUCH_BUTTONS_HW_SPI) static uint16_t HardwareIO(uint16_t data); #endif diff --git a/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h b/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h index 9ef1816c7b..b131853643 100644 --- a/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h +++ b/Marlin/src/HAL/NATIVE_SIM/tft/xpt2046.h @@ -62,8 +62,8 @@ private: static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin(); - static inline void DataTransferEnd(); + static void DataTransferBegin(); + static void DataTransferEnd(); #if ENABLED(TOUCH_BUTTONS_HW_SPI) static uint16_t HardwareIO(uint16_t data); #endif diff --git a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp b/Marlin/src/HAL/STM32/sdio.cpp similarity index 98% rename from Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp rename to Marlin/src/HAL/STM32/sdio.cpp index 54e1820c78..18b4434dfa 100644 --- a/Marlin/src/HAL/STM32/Sd2Card_sdio_stm32duino.cpp +++ b/Marlin/src/HAL/STM32/sdio.cpp @@ -28,6 +28,8 @@ #if ENABLED(SDIO_SUPPORT) +#include "sdio.h" + #include #include @@ -49,14 +51,6 @@ #error "SDIO only supported with STM32F103xE, STM32F103xG, STM32F4xx, or STM32F7xx." #endif -// Fixed -#define SDIO_D0_PIN PC8 -#define SDIO_D1_PIN PC9 -#define SDIO_D2_PIN PC10 -#define SDIO_D3_PIN PC11 -#define SDIO_CK_PIN PC12 -#define SDIO_CMD_PIN PD2 - SD_HandleTypeDef hsd; // create SDIO structure // F4 supports one DMA for RX and another for TX, but Marlin will never // do read and write at same time, so we use the same DMA for both. diff --git a/Marlin/src/HAL/STM32/sdio.h b/Marlin/src/HAL/STM32/sdio.h new file mode 100644 index 0000000000..cf5539c3c7 --- /dev/null +++ b/Marlin/src/HAL/STM32/sdio.h @@ -0,0 +1,29 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 + +#define SDIO_D0_PIN PC8 +#define SDIO_D1_PIN PC9 +#define SDIO_D2_PIN PC10 +#define SDIO_D3_PIN PC11 +#define SDIO_CK_PIN PC12 +#define SDIO_CMD_PIN PD2 diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.h b/Marlin/src/HAL/STM32/tft/xpt2046.h index 2cff3e29d0..71de6b0025 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32/tft/xpt2046.h @@ -69,8 +69,8 @@ private: static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin() { if (SPIx.Instance) { HAL_SPI_Init(&SPIx); } WRITE(TOUCH_CS_PIN, LOW); }; - static inline void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; + static void DataTransferBegin() { if (SPIx.Instance) { HAL_SPI_Init(&SPIx); } WRITE(TOUCH_CS_PIN, LOW); }; + static void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; static uint16_t HardwareIO(uint16_t data); static uint16_t SoftwareIO(uint16_t data); static uint16_t IO(uint16_t data = 0) { return SPIx.Instance ? HardwareIO(data) : SoftwareIO(data); } diff --git a/Marlin/src/HAL/STM32F1/SPI.h b/Marlin/src/HAL/STM32F1/SPI.h index 2467432e07..92f4226301 100644 --- a/Marlin/src/HAL/STM32F1/SPI.h +++ b/Marlin/src/HAL/STM32F1/SPI.h @@ -417,7 +417,7 @@ private: /** * @brief Wait until TXE (tx empty) flag is set and BSY (busy) flag unset. */ -static inline void waitSpiTxEnd(spi_dev *spi_d) { +static void waitSpiTxEnd(spi_dev *spi_d) { while (spi_is_tx_empty(spi_d) == 0) { /* nada */ } // wait until TXE=1 while (spi_is_busy(spi_d) != 0) { /* nada */ } // wait until BSY=0 } diff --git a/Marlin/src/HAL/STM32F1/pinsDebug.h b/Marlin/src/HAL/STM32F1/pinsDebug.h index 27f4b6732b..7828479658 100644 --- a/Marlin/src/HAL/STM32F1/pinsDebug.h +++ b/Marlin/src/HAL/STM32F1/pinsDebug.h @@ -54,11 +54,11 @@ extern const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]; #define M43_NEVER_TOUCH(Q) (Q >= 9 && Q <= 12) // SERIAL/USB pins PA9(TX) PA10(RX) #endif -static inline int8_t get_pin_mode(pin_t pin) { +static int8_t get_pin_mode(pin_t pin) { return VALID_PIN(pin) ? _GET_MODE(pin) : -1; } -static inline pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { +static pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { if (!VALID_PIN(pin)) return -1; int8_t adc_channel = int8_t(PIN_MAP[pin].adc_channel); #ifdef NUM_ANALOG_INPUTS @@ -67,7 +67,7 @@ static inline pin_t DIGITAL_PIN_TO_ANALOG_PIN(pin_t pin) { return pin_t(adc_channel); } -static inline bool IS_ANALOG(pin_t pin) { +static bool IS_ANALOG(pin_t pin) { if (!VALID_PIN(pin)) return false; if (PIN_MAP[pin].adc_channel != ADCx) { #ifdef NUM_ANALOG_INPUTS @@ -78,11 +78,11 @@ static inline bool IS_ANALOG(pin_t pin) { return false; } -static inline bool GET_PINMODE(const pin_t pin) { +static bool GET_PINMODE(const pin_t pin) { return VALID_PIN(pin) && !IS_INPUT(pin); } -static inline bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { +static bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { const pin_t pin = GET_ARRAY_PIN(array_pin); return (!IS_ANALOG(pin) #ifdef NUM_ANALOG_INPUTS @@ -93,7 +93,7 @@ static inline bool GET_ARRAY_IS_DIGITAL(const int16_t array_pin) { #include "../../inc/MarlinConfig.h" // Allow pins/pins.h to set density -static inline void pwm_details(const pin_t pin) { +static void pwm_details(const pin_t pin) { if (PWM_PIN(pin)) { timer_dev * const tdev = PIN_MAP[pin].timer_device; const uint8_t channel = PIN_MAP[pin].timer_channel; @@ -113,7 +113,7 @@ static inline void pwm_details(const pin_t pin) { } } -static inline void print_port(pin_t pin) { +static void print_port(pin_t pin) { const char port = 'A' + char(pin >> 4); // pin div 16 const int16_t gbit = PIN_MAP[pin].gpio_bit; char buffer[8]; diff --git a/Marlin/src/HAL/STM32F1/tft/xpt2046.h b/Marlin/src/HAL/STM32F1/tft/xpt2046.h index aba0799e44..7c456cf00e 100644 --- a/Marlin/src/HAL/STM32F1/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32F1/tft/xpt2046.h @@ -65,8 +65,8 @@ private: static uint16_t getRawData(const XPTCoordinate coordinate); static bool isTouched(); - static inline void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; - static inline void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; + static void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); }; + static void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); }; #if ENABLED(TOUCH_BUTTONS_HW_SPI) static uint16_t HardwareIO(uint16_t data); #endif diff --git a/Marlin/src/HAL/shared/eeprom_api.h b/Marlin/src/HAL/shared/eeprom_api.h index 1f38639930..cd744f82dc 100644 --- a/Marlin/src/HAL/shared/eeprom_api.h +++ b/Marlin/src/HAL/shared/eeprom_api.h @@ -49,7 +49,7 @@ public: // Write one or more bytes of data // Return 'true' on write error - static inline bool write_data(const int pos, const uint8_t *value, const size_t size=sizeof(uint8_t)) { + static bool write_data(const int pos, const uint8_t *value, const size_t size=sizeof(uint8_t)) { int data_pos = pos; uint16_t crc = 0; return write_data(data_pos, value, size, &crc); @@ -57,11 +57,11 @@ public: // Write a single byte of data // Return 'true' on write error - static inline bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); } + static bool write_data(const int pos, const uint8_t value) { return write_data(pos, &value); } // Read one or more bytes of data // Return 'true' on read error - static inline bool read_data(const int pos, uint8_t *value, const size_t size=1) { + static bool read_data(const int pos, uint8_t *value, const size_t size=1) { int data_pos = pos; uint16_t crc = 0; return read_data(data_pos, value, size, &crc); diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 186b273a98..294fd927d8 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -1615,6 +1615,10 @@ void setup() { SETUP_RUN(ui.check_touch_calibration()); #endif + #if ENABLED(EASYTHREED_UI) + SETUP_RUN(easythreed_ui.init()); + #endif + #if ENABLED(EASYTHREED_UI) SETUP_RUN(easythreed_ui.init()); #endif diff --git a/Marlin/src/core/language.h b/Marlin/src/core/language.h index 0a6870af26..02f314254b 100644 --- a/Marlin/src/core/language.h +++ b/Marlin/src/core/language.h @@ -368,7 +368,7 @@ #define LCD_STR_E STR_E // Extra Axis and Endstop Names -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #if AXIS4_NAME == 'A' #define AXIS4_STR "A" #define STR_I_MIN "a_min" @@ -402,7 +402,7 @@ #define AXIS4_STR "" #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #if AXIS5_NAME == 'A' #define AXIS5_STR "A" #define STR_J_MIN "a_min" @@ -436,7 +436,7 @@ #define AXIS5_STR "" #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #if AXIS6_NAME == 'A' #define AXIS6_STR "A" #define STR_K_MIN "a_min" diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 62675d1319..34fc3bc410 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -131,13 +131,13 @@ #ifdef __cplusplus // C++11 solution that is standards compliant. - template static inline constexpr void NOLESS(V& v, const N n) { + template static constexpr void NOLESS(V& v, const N n) { if (n > v) v = n; } - template static inline constexpr void NOMORE(V& v, const N n) { + template static constexpr void NOMORE(V& v, const N n) { if (n < v) v = n; } - template static inline constexpr void LIMIT(V& v, const N1 n1, const N2 n2) { + template static constexpr void LIMIT(V& v, const N1 n1, const N2 n2) { if (n1 > v) v = n1; else if (n2 < v) v = n2; } @@ -366,7 +366,7 @@ #undef ABS #ifdef __cplusplus - template static inline constexpr const T ABS(const T v) { return v >= 0 ? v : -v; } + template static constexpr const T ABS(const T v) { return v >= 0 ? v : -v; } #else #define ABS(a) ({__typeof__(a) _a = (a); _a >= 0 ? _a : -_a;}) #endif @@ -409,14 +409,14 @@ extern "C++" { // C++11 solution that is standards compliant. Return type is deduced automatically - template static inline constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { + template static constexpr auto _MIN(const L lhs, const R rhs) -> decltype(lhs + rhs) { return lhs < rhs ? lhs : rhs; } - template static inline constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { + template static constexpr auto _MAX(const L lhs, const R rhs) -> decltype(lhs + rhs) { return lhs > rhs ? lhs : rhs; } - template static inline constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } - template static inline constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } + template static constexpr const T _MIN(T V, Ts... Vs) { return _MIN(V, _MIN(Vs...)); } + template static constexpr const T _MAX(T V, Ts... Vs) { return _MAX(V, _MAX(Vs...)); } } diff --git a/Marlin/src/core/serial_hook.h b/Marlin/src/core/serial_hook.h index 86d6dd3f24..1150fba07b 100644 --- a/Marlin/src/core/serial_hook.h +++ b/Marlin/src/core/serial_hook.h @@ -38,7 +38,7 @@ public: inline constexpr bool enabled(const SerialMask PortMask) const { return mask & PortMask.mask; } inline constexpr SerialMask combine(const SerialMask other) const { return SerialMask(mask | other.mask); } inline constexpr SerialMask operator<< (const int offset) const { return SerialMask(mask << offset); } - static inline SerialMask from(const serial_index_t index) { + static SerialMask from(const serial_index_t index) { if (index.valid()) return SerialMask(_BV(index.index)); return SerialMask(0); // A invalid index mean no output } diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 9a5b64c22e..e5d95d81ec 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -64,6 +64,8 @@ struct IF { typedef L type; }; #define GANG_ITEM_E(N) #endif +#define AXIS_COLLISION(L) (AXIS4_NAME == L || AXIS5_NAME == L || AXIS6_NAME == L) + // // Enumerated axis indices // @@ -96,10 +98,10 @@ enum AxisEnum : uint8_t { // A, B, and C are for DELTA, SCARA, etc. , A_AXIS = X_AXIS - #if LINEAR_AXES >= 2 + #if HAS_Y_AXIS , B_AXIS = Y_AXIS #endif - #if LINEAR_AXES >= 3 + #if HAS_Z_AXIS , C_AXIS = Z_AXIS #endif @@ -406,13 +408,13 @@ struct XYZval { FI void set(const T (&arr)[DISTINCT_AXES]) { LINEAR_AXIS_CODE(x = arr[0], y = arr[1], z = arr[2], i = arr[3], j = arr[4], k = arr[5]); } #endif #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS FI void set(const T px, const T py, const T pz, const T pi) { x = px; y = py; z = pz; i = pi; } #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; } #endif @@ -547,13 +549,13 @@ struct XYZEval { FI void set(const XYZval pxyz, const T pe) { set(pxyz); e = pe; } FI void set(LOGICAL_AXIS_ARGS(const T)) { LOGICAL_AXIS_CODE(_e = e, a = x, b = y, c = z, u = i, v = j, w = k); } #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS FI void set(const T px, const T py, const T pz) { x = px; y = py; z = pz; } #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS FI void set(const T px, const T py, const T pz, const T pi) { x = px; y = py; z = pz; i = pi; } #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS FI void set(const T px, const T py, const T pz, const T pi, const T pj) { x = px; y = py; z = pz; i = pi; j = pj; } #endif diff --git a/Marlin/src/feature/babystep.h b/Marlin/src/feature/babystep.h index f8037678ca..5693afb4fc 100644 --- a/Marlin/src/feature/babystep.h +++ b/Marlin/src/feature/babystep.h @@ -54,7 +54,7 @@ public: #if ENABLED(BABYSTEP_DISPLAY_TOTAL) static int16_t axis_total[BS_TOTAL_IND(Z_AXIS) + 1]; // Total babysteps since G28 - static inline void reset_total(const AxisEnum axis) { + static void reset_total(const AxisEnum axis) { if (TERN1(BABYSTEP_XY, axis == Z_AXIS)) axis_total[BS_TOTAL_IND(axis)] = 0; } @@ -63,7 +63,7 @@ public: static void add_steps(const AxisEnum axis, const int16_t distance); static void add_mm(const AxisEnum axis, const_float_t mm); - static inline bool has_steps() { + static bool has_steps() { return steps[BS_AXIS_IND(X_AXIS)] || steps[BS_AXIS_IND(Y_AXIS)] || steps[BS_AXIS_IND(Z_AXIS)]; } @@ -71,7 +71,7 @@ public: // Called by the Temperature or Stepper ISR to // apply accumulated babysteps to the axes. // - static inline void task() { + static void task() { LOOP_LE_N(i, BS_AXIS_IND(Z_AXIS)) step_axis(BS_AXIS(i)); } diff --git a/Marlin/src/feature/backlash.h b/Marlin/src/feature/backlash.h index 4d4e294038..17504cc781 100644 --- a/Marlin/src/feature/backlash.h +++ b/Marlin/src/feature/backlash.h @@ -35,8 +35,8 @@ public: static float smoothing_mm; #endif - static inline void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; } - static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } + static void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; } + static float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; } #else static constexpr uint8_t correction = (BACKLASH_CORRECTION) * 0xFF; static const xyz_float_t distance_mm; @@ -53,7 +53,7 @@ public: static void measure_with_probe(); #endif - static inline float get_measurement(const AxisEnum a) { + static float get_measurement(const AxisEnum a) { UNUSED(a); // Return the measurement averaged over all readings return TERN(MEASURE_BACKLASH_WHEN_PROBING @@ -62,12 +62,12 @@ public: ); } - static inline bool has_measurement(const AxisEnum a) { + static bool has_measurement(const AxisEnum a) { UNUSED(a); return TERN0(MEASURE_BACKLASH_WHEN_PROBING, measured_count[a] > 0); } - static inline bool has_any_measurement() { + static bool has_any_measurement() { return has_measurement(X_AXIS) || has_measurement(Y_AXIS) || has_measurement(Z_AXIS); } diff --git a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h index cc54695771..06fae16c21 100644 --- a/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h +++ b/Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h @@ -58,7 +58,7 @@ public: static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; } - static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) { + static void zigzag(const int8_t index, int8_t &px, int8_t &py) { px = index % (GRID_MAX_POINTS_X); py = index / (GRID_MAX_POINTS_X); if (py & 1) px = (GRID_MAX_POINTS_X) - 1 - px; // Zig zag @@ -78,10 +78,10 @@ public: int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST); return constrain(cy, 0, GRID_MAX_CELLS_Y - 1); } - static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) { + static xy_int8_t cell_indexes(const_float_t x, const_float_t y) { return { cell_index_x(x), cell_index_y(y) }; } - static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } + static xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } static int8_t probe_index_x(const_float_t x) { int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST); @@ -91,10 +91,10 @@ public: int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1; } - static inline xy_int8_t probe_indexes(const_float_t x, const_float_t y) { + static xy_int8_t probe_indexes(const_float_t x, const_float_t y) { return { probe_index_x(x), probe_index_y(y) }; } - static inline xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); } + static xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); } static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) { const float delta_z = (z2 - z1) / (a2 - a1), diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.h b/Marlin/src/feature/bedlevel/ubl/ubl.h index ffabadd990..73581504b7 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.h +++ b/Marlin/src/feature/bedlevel/ubl/ubl.h @@ -80,7 +80,7 @@ private: static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3); static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map); static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir); - static inline bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) { + static bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) { return smart_fill_one(pos.x, pos.y, dir.x, dir.y); } static void smart_fill_mesh(); @@ -124,7 +124,7 @@ public: static bool lcd_map_control; static void steppers_were_disabled(); #else - static inline void steppers_were_disabled() {} + static void steppers_were_disabled() {} #endif static volatile int16_t encoder_diff; // Volatile because buttons may change it at interrupt time @@ -157,10 +157,10 @@ public: return constrain(cell_index_y_raw(y), 0, GRID_MAX_CELLS_Y - 1); } - static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) { + static xy_int8_t cell_indexes(const_float_t x, const_float_t y) { return { cell_index_x(x), cell_index_y(y) }; } - static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } + static xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); } static int8_t closest_x_index(const_float_t x) { const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST); @@ -170,7 +170,7 @@ public: const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST); return WITHIN(py, 0, (GRID_MAX_POINTS_Y) - 1) ? py : -1; } - static inline xy_int8_t closest_indexes(const xy_pos_t &xy) { + static xy_int8_t closest_indexes(const xy_pos_t &xy) { return { closest_x_index(xy.x), closest_y_index(xy.y) }; } @@ -203,7 +203,7 @@ public: * z_correction_for_x_on_horizontal_mesh_line is an optimization for * the case where the printer is making a vertical line that only crosses horizontal mesh lines. */ - static inline float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) { + static float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) { if (!WITHIN(x1_i, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(yi, 0, (GRID_MAX_POINTS_Y) - 1)) { if (DEBUGGING(LEVELING)) { @@ -226,7 +226,7 @@ public: // // See comments above for z_correction_for_x_on_horizontal_mesh_line // - static inline float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) { + static float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) { if (!WITHIN(xi, 0, (GRID_MAX_POINTS_X) - 1) || !WITHIN(y1_i, 0, (GRID_MAX_POINTS_Y) - 1)) { if (DEBUGGING(LEVELING)) { @@ -285,12 +285,12 @@ public: return z0; } - static inline float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); } + static float get_z_correction(const xy_pos_t &pos) { return get_z_correction(pos.x, pos.y); } - static inline float mesh_index_to_xpos(const uint8_t i) { + static float mesh_index_to_xpos(const uint8_t i) { return i < (GRID_MAX_POINTS_X) ? pgm_read_float(&_mesh_index_to_xpos[i]) : MESH_MIN_X + i * (MESH_X_DIST); } - static inline float mesh_index_to_ypos(const uint8_t i) { + static float mesh_index_to_ypos(const uint8_t i) { return i < (GRID_MAX_POINTS_Y) ? pgm_read_float(&_mesh_index_to_ypos[i]) : MESH_MIN_Y + i * (MESH_Y_DIST); } @@ -300,7 +300,7 @@ public: static void line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t e); #endif - static inline bool mesh_is_valid() { + static bool mesh_is_valid() { GRID_LOOP(x, y) if (isnan(z_values[x][y])) return false; return true; } diff --git a/Marlin/src/feature/bltouch.h b/Marlin/src/feature/bltouch.h index ae3ab66300..fa857bb96a 100644 --- a/Marlin/src/feature/bltouch.h +++ b/Marlin/src/feature/bltouch.h @@ -76,7 +76,7 @@ public: static constexpr bool high_speed_mode = false; #endif - static inline float z_extra_clearance() { return high_speed_mode ? 7 : 0; } + static float z_extra_clearance() { return high_speed_mode ? 7 : 0; } // DEPLOY and STOW are wrapped for error handling - these are used by homing and by probing static bool deploy() { return deploy_proc(); } diff --git a/Marlin/src/feature/cancel_object.h b/Marlin/src/feature/cancel_object.h index 1d2d77f203..62548a3719 100644 --- a/Marlin/src/feature/cancel_object.h +++ b/Marlin/src/feature/cancel_object.h @@ -32,10 +32,10 @@ public: static void cancel_object(const int8_t obj); static void uncancel_object(const int8_t obj); static void report(); - static inline bool is_canceled(const int8_t obj) { return TEST(canceled, obj); } - static inline void clear_active_object() { set_active_object(-1); } - static inline void cancel_active_object() { cancel_object(active_object); } - static inline void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); } + static bool is_canceled(const int8_t obj) { return TEST(canceled, obj); } + static void clear_active_object() { set_active_object(-1); } + static void cancel_active_object() { cancel_object(active_object); } + static void reset() { canceled = 0x0000; object_count = 0; clear_active_object(); } }; extern CancelObject cancelable; diff --git a/Marlin/src/feature/caselight.h b/Marlin/src/feature/caselight.h index b2e82f9b83..2e85b59ef9 100644 --- a/Marlin/src/feature/caselight.h +++ b/Marlin/src/feature/caselight.h @@ -49,8 +49,8 @@ public: } static void update(const bool sflag); - static inline void update_brightness() { update(false); } - static inline void update_enabled() { update(true); } + static void update_brightness() { update(false); } + static void update_enabled() { update(true); } #if ENABLED(CASE_LIGHT_IS_COLOR_LED) private: diff --git a/Marlin/src/feature/controllerfan.h b/Marlin/src/feature/controllerfan.h index 55f2d5cfc7..55eb2359b0 100644 --- a/Marlin/src/feature/controllerfan.h +++ b/Marlin/src/feature/controllerfan.h @@ -60,9 +60,9 @@ class ControllerFan { #else static const controllerFan_settings_t &settings; #endif - static inline bool state() { return speed > 0; } - static inline void init() { reset(); } - static inline void reset() { TERN_(CONTROLLER_FAN_EDITABLE, settings = controllerFan_defaults); } + static bool state() { return speed > 0; } + static void init() { reset(); } + static void reset() { TERN_(CONTROLLER_FAN_EDITABLE, settings = controllerFan_defaults); } static void setup(); static void update(); }; diff --git a/Marlin/src/feature/encoder_i2c.cpp b/Marlin/src/feature/encoder_i2c.cpp index 87e611f86c..2ccd686a99 100644 --- a/Marlin/src/feature/encoder_i2c.cpp +++ b/Marlin/src/feature/encoder_i2c.cpp @@ -756,7 +756,7 @@ int8_t I2CPositionEncodersMgr::parse() { if (!parser.has_value()) { SERIAL_ECHOLNPGM("?A seen, but no address specified! [30-200]"); return I2CPE_PARSE_ERR; - }; + } I2CPE_addr = parser.value_byte(); if (!WITHIN(I2CPE_addr, 30, 200)) { // reserve the first 30 and last 55 @@ -775,7 +775,7 @@ int8_t I2CPositionEncodersMgr::parse() { if (!parser.has_value()) { SERIAL_ECHOLNPGM("?I seen, but no index specified! [0-", I2CPE_ENCODER_CNT - 1, "]"); return I2CPE_PARSE_ERR; - }; + } I2CPE_idx = parser.value_byte(); if (I2CPE_idx >= I2CPE_ENCODER_CNT) { @@ -791,7 +791,7 @@ int8_t I2CPositionEncodersMgr::parse() { I2CPE_anyaxis = parser.seen_axis(); return I2CPE_PARSE_OK; -}; +} /** * M860: Report the position(s) of position encoder module(s). @@ -934,7 +934,7 @@ void I2CPositionEncodersMgr::M864() { if (!parser.has_value()) { SERIAL_ECHOLNPGM("?S seen, but no address specified! [30-200]"); return; - }; + } newAddress = parser.value_byte(); if (!WITHIN(newAddress, 30, 200)) { diff --git a/Marlin/src/feature/fancheck.h b/Marlin/src/feature/fancheck.h index 6e8038b498..c8665a0e96 100644 --- a/Marlin/src/feature/fancheck.h +++ b/Marlin/src/feature/fancheck.h @@ -56,7 +56,7 @@ class FanCheck { static uint8_t rps[TACHO_COUNT]; static TachoError error; - static inline void report_speed_error(uint8_t fan); + static void report_speed_error(uint8_t fan); public: @@ -67,11 +67,11 @@ class FanCheck { static void compute_speed(uint16_t elapsedTime); static void print_fan_states(); #if HAS_PWMFANCHECK - static inline void toggle_measuring() { measuring = !measuring; } - static inline bool is_measuring() { return measuring; } + static void toggle_measuring() { measuring = !measuring; } + static bool is_measuring() { return measuring; } #endif - static inline void check_deferred_error() { + static void check_deferred_error() { if (error == TachoError::DETECTED) { error = TachoError::REPORTED; TERN(PARK_HEAD_ON_PAUSE, queue.inject(F("M125")), kill(GET_TEXT_F(MSG_FAN_SPEED_FAULT))); diff --git a/Marlin/src/feature/filwidth.h b/Marlin/src/feature/filwidth.h index e63d3d719f..e234380e98 100644 --- a/Marlin/src/feature/filwidth.h +++ b/Marlin/src/feature/filwidth.h @@ -41,9 +41,9 @@ public: FilamentWidthSensor() { init(); } static void init(); - static inline void enable(const bool ena) { enabled = ena; } + static void enable(const bool ena) { enabled = ena; } - static inline void set_delay_cm(const uint8_t cm) { + static void set_delay_cm(const uint8_t cm) { meas_delay_cm = _MIN(cm, MAX_MEASUREMENT_DELAY); } @@ -67,18 +67,18 @@ public: } // Convert raw measurement to mm - static inline float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } - static inline float raw_to_mm() { return raw_to_mm(raw); } + static float raw_to_mm(const uint16_t v) { return v * 5.0f * RECIPROCAL(float(MAX_RAW_THERMISTOR_VALUE)); } + static float raw_to_mm() { return raw_to_mm(raw); } // A scaled reading is ready // Divide to get to 0-16384 range since we used 1/128 IIR filter approach - static inline void reading_ready() { raw = accum >> 10; } + static void reading_ready() { raw = accum >> 10; } // Update mm from the raw measurement - static inline void update_measured_mm() { measured_mm = raw_to_mm(); } + static void update_measured_mm() { measured_mm = raw_to_mm(); } // Update ring buffer used to delay filament measurements - static inline void advance_e(const_float_t e_move) { + static void advance_e(const_float_t e_move) { // Increment counters with the E distance e_count += e_move; @@ -106,7 +106,7 @@ public: } // Dynamically set the volumetric multiplier based on the delayed width measurement. - static inline void update_volumetric() { + static void update_volumetric() { if (enabled) { int8_t read_index = index_r - meas_delay_cm; if (read_index < 0) read_index += MMD_CM; // Loop around buffer if needed diff --git a/Marlin/src/feature/host_actions.h b/Marlin/src/feature/host_actions.h index 45379afc29..78a7821eba 100644 --- a/Marlin/src/feature/host_actions.h +++ b/Marlin/src/feature/host_actions.h @@ -97,7 +97,7 @@ class HostUI { static void handle_response(const uint8_t response); static void notify_P(PGM_P const message); - static inline void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); } + static void notify(FSTR_P const fmsg) { notify_P(FTOP(fmsg)); } static void notify(const char * const message); static void prompt_begin(const PromptReason reason, FSTR_P const fstr, const char extra_char='\0'); @@ -105,7 +105,7 @@ class HostUI { static void prompt_end(); static void prompt_do(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr); static void prompt_do(const PromptReason reason, FSTR_P const pstr, const char extra_char, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr); - static inline void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) { + static void prompt_open(const PromptReason reason, FSTR_P const pstr, FSTR_P const btn1=nullptr, FSTR_P const btn2=nullptr) { if (host_prompt_reason == PROMPT_NOT_DEFINED) prompt_do(reason, pstr, btn1, btn2); } diff --git a/Marlin/src/feature/leds/leds.h b/Marlin/src/feature/leds/leds.h index 74964b51a8..7110a9ba82 100644 --- a/Marlin/src/feature/leds/leds.h +++ b/Marlin/src/feature/leds/leds.h @@ -118,7 +118,7 @@ public: OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false) ); - static inline void set_color(uint8_t r, uint8_t g, uint8_t b + static void set_color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS) OPTARG(NEOPIXEL_IS_SEQUENTIAL, bool isSequence=false) @@ -126,23 +126,23 @@ public: set_color(LEDColor(r, g, b OPTARG(HAS_WHITE_LED, w) OPTARG(NEOPIXEL_LED, i)) OPTARG(NEOPIXEL_IS_SEQUENTIAL, isSequence)); } - static inline void set_off() { set_color(LEDColorOff()); } - static inline void set_green() { set_color(LEDColorGreen()); } - static inline void set_white() { set_color(LEDColorWhite()); } + static void set_off() { set_color(LEDColorOff()); } + static void set_green() { set_color(LEDColorGreen()); } + static void set_white() { set_color(LEDColorWhite()); } #if ENABLED(LED_COLOR_PRESETS) static const LEDColor defaultLEDColor; - static inline void set_default() { set_color(defaultLEDColor); } - static inline void set_red() { set_color(LEDColorRed()); } - static inline void set_orange() { set_color(LEDColorOrange()); } - static inline void set_yellow() { set_color(LEDColorYellow()); } - static inline void set_blue() { set_color(LEDColorBlue()); } - static inline void set_indigo() { set_color(LEDColorIndigo()); } - static inline void set_violet() { set_color(LEDColorViolet()); } + static void set_default() { set_color(defaultLEDColor); } + static void set_red() { set_color(LEDColorRed()); } + static void set_orange() { set_color(LEDColorOrange()); } + static void set_yellow() { set_color(LEDColorYellow()); } + static void set_blue() { set_color(LEDColorBlue()); } + static void set_indigo() { set_color(LEDColorIndigo()); } + static void set_violet() { set_color(LEDColorViolet()); } #endif #if ENABLED(PRINTER_EVENT_LEDS) - static inline LEDColor get_color() { return lights_on ? color : LEDColorOff(); } + static LEDColor get_color() { return lights_on ? color : LEDColorOff(); } #endif #if ANY(LED_CONTROL_MENU, PRINTER_EVENT_LEDS, CASE_LIGHT_IS_COLOR_LED) @@ -154,14 +154,14 @@ public: static void toggle(); // swap "off" with color #endif #if EITHER(LED_CONTROL_MENU, CASE_LIGHT_USE_RGB_LED) - static inline void update() { set_color(color); } + static void update() { set_color(color); } #endif #ifdef LED_BACKLIGHT_TIMEOUT private: static millis_t led_off_time; public: - static inline void reset_timeout(const millis_t &ms) { + static void reset_timeout(const millis_t &ms) { led_off_time = ms + LED_BACKLIGHT_TIMEOUT; if (!lights_on) update(); } @@ -181,7 +181,7 @@ extern LEDLights leds; static void set_color(const LEDColor &color); - static inline void set_color(uint8_t r, uint8_t g, uint8_t b + static void set_color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w=0) OPTARG(NEOPIXEL_LED, uint8_t i=NEOPIXEL_BRIGHTNESS) ) { @@ -191,26 +191,26 @@ extern LEDLights leds; )); } - static inline void set_off() { set_color(LEDColorOff()); } - static inline void set_green() { set_color(LEDColorGreen()); } - static inline void set_white() { set_color(LEDColorWhite()); } + static void set_off() { set_color(LEDColorOff()); } + static void set_green() { set_color(LEDColorGreen()); } + static void set_white() { set_color(LEDColorWhite()); } #if ENABLED(NEO2_COLOR_PRESETS) static const LEDColor defaultLEDColor; - static inline void set_default() { set_color(defaultLEDColor); } - static inline void set_red() { set_color(LEDColorRed()); } - static inline void set_orange() { set_color(LEDColorOrange()); } - static inline void set_yellow() { set_color(LEDColorYellow()); } - static inline void set_blue() { set_color(LEDColorBlue()); } - static inline void set_indigo() { set_color(LEDColorIndigo()); } - static inline void set_violet() { set_color(LEDColorViolet()); } + static void set_default() { set_color(defaultLEDColor); } + static void set_red() { set_color(LEDColorRed()); } + static void set_orange() { set_color(LEDColorOrange()); } + static void set_yellow() { set_color(LEDColorYellow()); } + static void set_blue() { set_color(LEDColorBlue()); } + static void set_indigo() { set_color(LEDColorIndigo()); } + static void set_violet() { set_color(LEDColorViolet()); } #endif #if ENABLED(NEOPIXEL2_SEPARATE) static LEDColor color; // last non-off color static bool lights_on; // the last set color was "on" static void toggle(); // swap "off" with color - static inline void update() { set_color(color); } + static void update() { set_color(color); } #endif }; diff --git a/Marlin/src/feature/leds/neopixel.h b/Marlin/src/feature/leds/neopixel.h index 814ae9c8d8..ae75316b8f 100644 --- a/Marlin/src/feature/leds/neopixel.h +++ b/Marlin/src/feature/leds/neopixel.h @@ -94,12 +94,12 @@ public: static void reset_background_color(); #endif - static inline void begin() { + static void begin() { adaneo1.begin(); TERN_(CONJOINED_NEOPIXEL, adaneo2.begin()); } - static inline void set_pixel_color(const uint16_t n, const uint32_t c) { + static void set_pixel_color(const uint16_t n, const uint32_t c) { #if ENABLED(NEOPIXEL2_INSERIES) if (n >= NEOPIXEL_PIXELS) adaneo2.setPixelColor(n - (NEOPIXEL_PIXELS), c); else adaneo1.setPixelColor(n, c); @@ -109,12 +109,12 @@ public: #endif } - static inline void set_brightness(const uint8_t b) { + static void set_brightness(const uint8_t b) { adaneo1.setBrightness(b); TERN_(CONJOINED_NEOPIXEL, adaneo2.setBrightness(b)); } - static inline void show() { + static void show() { // Some platforms cannot maintain PWM output when NeoPixel disables interrupts for long durations. TERN_(HAS_PAUSE_SERVO_OUTPUT, PAUSE_SERVO_OUTPUT()); adaneo1.show(); @@ -130,11 +130,11 @@ public: } // Accessors - static inline uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); } + static uint16_t pixels() { return adaneo1.numPixels() * TERN1(NEOPIXEL2_INSERIES, 2); } - static inline uint8_t brightness() { return adaneo1.getBrightness(); } + static uint8_t brightness() { return adaneo1.getBrightness(); } - static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) { + static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED, uint8_t w)) { return adaneo1.Color(r, g, b OPTARG(HAS_WHITE_LED, w)); } }; @@ -165,18 +165,18 @@ extern Marlin_NeoPixel neo; static void set_color(const uint32_t c); - static inline void begin() { adaneo.begin(); } - static inline void set_pixel_color(const uint16_t n, const uint32_t c) { adaneo.setPixelColor(n, c); } - static inline void set_brightness(const uint8_t b) { adaneo.setBrightness(b); } - static inline void show() { + static void begin() { adaneo.begin(); } + static void set_pixel_color(const uint16_t n, const uint32_t c) { adaneo.setPixelColor(n, c); } + static void set_brightness(const uint8_t b) { adaneo.setBrightness(b); } + static void show() { adaneo.show(); adaneo.setPin(NEOPIXEL2_PIN); } // Accessors - static inline uint16_t pixels() { return adaneo.numPixels();} - static inline uint8_t brightness() { return adaneo.getBrightness(); } - static inline uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) { + static uint16_t pixels() { return adaneo.numPixels();} + static uint8_t brightness() { return adaneo.getBrightness(); } + static uint32_t Color(uint8_t r, uint8_t g, uint8_t b OPTARG(HAS_WHITE_LED2, uint8_t w)) { return adaneo.Color(r, g, b OPTARG(HAS_WHITE_LED2, w)); } }; diff --git a/Marlin/src/feature/leds/printer_event_leds.h b/Marlin/src/feature/leds/printer_event_leds.h index b2201433d8..2a4342e8f5 100644 --- a/Marlin/src/feature/leds/printer_event_leds.h +++ b/Marlin/src/feature/leds/printer_event_leds.h @@ -36,32 +36,32 @@ private: static bool leds_off_after_print; #endif - static inline void set_done() { TERN(LED_COLOR_PRESETS, leds.set_default(), leds.set_off()); } + static void set_done() { TERN(LED_COLOR_PRESETS, leds.set_default(), leds.set_off()); } public: #if HAS_TEMP_HOTEND - static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } + static LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); } static void onHotendHeating(const celsius_t start, const celsius_t current, const celsius_t target); #endif #if HAS_HEATED_BED - static inline LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); } + static LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); } static void onBedHeating(const celsius_t start, const celsius_t current, const celsius_t target); #endif #if HAS_HEATED_CHAMBER - static inline LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); } + static LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); } static void onChamberHeating(const celsius_t start, const celsius_t current, const celsius_t target); #endif #if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER - static inline void onHeatingDone() { leds.set_white(); } - static inline void onPidTuningDone(LEDColor c) { leds.set_color(c); } + static void onHeatingDone() { leds.set_white(); } + static void onPidTuningDone(LEDColor c) { leds.set_color(c); } #endif #if ENABLED(SDSUPPORT) - static inline void onPrintCompleted() { + static void onPrintCompleted() { leds.set_green(); #if HAS_LEDS_OFF_FLAG leds_off_after_print = true; @@ -71,7 +71,7 @@ public: #endif } - static inline void onResumeAfterWait() { + static void onResumeAfterWait() { #if HAS_LEDS_OFF_FLAG if (leds_off_after_print) { set_done(); diff --git a/Marlin/src/feature/max7219.h b/Marlin/src/feature/max7219.h index c25fef1730..809bda6d4b 100644 --- a/Marlin/src/feature/max7219.h +++ b/Marlin/src/feature/max7219.h @@ -88,13 +88,13 @@ public: static void send(const uint8_t reg, const uint8_t data); // Refresh all units - static inline void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } + static void refresh() { for (uint8_t i = 0; i < 8; i++) refresh_line(i); } // Suspend / resume updates to the LED unit // Use these methods to speed up multiple changes // or to apply updates from interrupt context. - static inline void suspend() { suspended++; } - static inline void resume() { suspended--; suspended |= 0x80; } + static void suspend() { suspended++; } + static void resume() { suspended--; suspended |= 0x80; } // Update a single native line on all units static void refresh_line(const uint8_t line); diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index f700c7b65b..85d52d69c8 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -126,7 +126,7 @@ class Mixer { static mixer_perc_t mix[MIXING_STEPPERS]; // Scratch array for the Mix in proportion to 100 - static inline void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) { + static void copy_mix_to_color(mixer_comp_t (&tcolor)[MIXING_STEPPERS]) { // Scale each component to the largest one in terms of COLOR_A_MASK // So the largest component will be COLOR_A_MASK and the other will be in proportion to it const float scale = (COLOR_A_MASK) * RECIPROCAL(_MAX( @@ -145,7 +145,7 @@ class Mixer { #endif } - static inline void update_mix_from_vtool(const uint8_t j=selected_vtool) { + static void update_mix_from_vtool(const uint8_t j=selected_vtool) { float ctot = 0; MIXER_STEPPER_LOOP(i) ctot += color[j][i]; //MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot; @@ -165,7 +165,7 @@ class Mixer { #if HAS_DUAL_MIXING // Update the virtual tool from an edited mix - static inline void update_vtool_from_mix() { + static void update_vtool_from_mix() { copy_mix_to_color(color[selected_vtool]); TERN_(GRADIENT_MIX, refresh_gradient()); // MIXER_STEPPER_LOOP(i) collector[i] = mix[i]; @@ -182,7 +182,7 @@ class Mixer { // Update the current mix from the gradient for a given Z static void update_gradient_for_z(const_float_t z); static void update_gradient_for_planner_z(); - static inline void gradient_control(const_float_t z) { + static void gradient_control(const_float_t z) { if (gradient.enabled) { if (z >= gradient.end_z) T(gradient.end_vtool); @@ -191,7 +191,7 @@ class Mixer { } } - static inline void update_mix_from_gradient() { + static void update_mix_from_gradient() { float ctot = 0; MIXER_STEPPER_LOOP(i) ctot += gradient.color[i]; MIXER_STEPPER_LOOP(i) mix[i] = (mixer_perc_t)CEIL(100.0f * gradient.color[i] / ctot); diff --git a/Marlin/src/feature/mmu/mmu2.h b/Marlin/src/feature/mmu/mmu2.h index 9574e2217f..7d3d9ec4df 100644 --- a/Marlin/src/feature/mmu/mmu2.h +++ b/Marlin/src/feature/mmu/mmu2.h @@ -43,7 +43,7 @@ public: static void init(); static void reset(); - static inline bool enabled() { return _enabled; } + static bool enabled() { return _enabled; } static void mmu_loop(); static void tool_change(const uint8_t index); static void tool_change(const char *special); @@ -57,10 +57,10 @@ public: static bool eject_filament(const uint8_t index, const bool recover); private: - static inline bool rx_str(FSTR_P fstr); - static inline void tx_str(FSTR_P fstr); - static inline void tx_printf(FSTR_P ffmt, const int argument); - static inline void tx_printf(FSTR_P ffmt, const int argument1, const int argument2); + static bool rx_str(FSTR_P fstr); + static void tx_str(FSTR_P fstr); + static void tx_printf(FSTR_P ffmt, const int argument); + static void tx_printf(FSTR_P ffmt, const int argument1, const int argument2); static void clear_rx_buffer(); static bool rx_ok(); @@ -99,7 +99,7 @@ private: static millis_t prev_request, prev_P0_request; static char rx_buffer[MMU_RX_SIZE], tx_buffer[MMU_TX_SIZE]; - static inline void set_runout_valid(const bool valid) { + static void set_runout_valid(const bool valid) { finda_runout_valid = valid; #if HAS_FILAMENT_SENSOR if (valid) runout.reset(); diff --git a/Marlin/src/feature/power.h b/Marlin/src/feature/power.h index 7f5a97e6df..42c2c84942 100644 --- a/Marlin/src/feature/power.h +++ b/Marlin/src/feature/power.h @@ -40,7 +40,7 @@ class Power { #if ENABLED(AUTO_POWER_CONTROL) && POWER_OFF_DELAY > 0 static void power_off_soon(); #else - static inline void power_off_soon() { power_off(); } + static void power_off_soon() { power_off(); } #endif #if ENABLED(AUTO_POWER_CONTROL) diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index 76cb398af2..50abad9222 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -152,7 +152,7 @@ class PrintJobRecovery { static void init(); static void prepare(); - static inline void setup() { + static void setup() { #if PIN_EXISTS(POWER_LOSS) #if ENABLED(POWER_LOSS_PULLUP) SET_INPUT_PULLUP(POWER_LOSS_PIN); @@ -165,28 +165,28 @@ class PrintJobRecovery { } // Track each command's file offsets - static inline uint32_t command_sdpos() { return sdpos[queue_index_r]; } - static inline void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; } + static uint32_t command_sdpos() { return sdpos[queue_index_r]; } + static void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; } static bool enabled; static void enable(const bool onoff); static void changed(); - static inline bool exists() { return card.jobRecoverFileExists(); } - static inline void open(const bool read) { card.openJobRecoveryFile(read); } - static inline void close() { file.close(); } + static bool exists() { return card.jobRecoverFileExists(); } + static void open(const bool read) { card.openJobRecoveryFile(read); } + static void close() { file.close(); } static void check(); static void resume(); static void purge(); - static inline void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); } + static void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); } static void load(); static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=POWER_LOSS_ZRAISE, const bool raised=false); #if PIN_EXISTS(POWER_LOSS) - static inline void outage() { + static void outage() { static constexpr uint8_t OUTAGE_THRESHOLD = 3; static uint8_t outage_counter = 0; if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) { @@ -199,14 +199,14 @@ class PrintJobRecovery { #endif // The referenced file exists - static inline bool interrupted_file_exists() { return card.fileExists(info.sd_filename); } + static bool interrupted_file_exists() { return card.fileExists(info.sd_filename); } - static inline bool valid() { return info.valid() && interrupted_file_exists(); } + static bool valid() { return info.valid() && interrupted_file_exists(); } #if ENABLED(DEBUG_POWER_LOSS_RECOVERY) static void debug(FSTR_P const prefix); #else - static inline void debug(FSTR_P const) {} + static void debug(FSTR_P const) {} #endif private: diff --git a/Marlin/src/feature/probe_temp_comp.h b/Marlin/src/feature/probe_temp_comp.h index 4579f2187c..1db7d04e89 100644 --- a/Marlin/src/feature/probe_temp_comp.h +++ b/Marlin/src/feature/probe_temp_comp.h @@ -74,11 +74,11 @@ class ProbeTempComp { static int16_t z_offsets_hotend[PTC_HOTEND_COUNT]; // (µm) #endif - static inline void reset_index() { calib_idx = 0; }; - static inline uint8_t get_index() { return calib_idx; } + static void reset_index() { calib_idx = 0; }; + static uint8_t get_index() { return calib_idx; } static void reset(); static void clear_offsets(const TempSensorID tsi); - static inline void clear_all_offsets() { + static void clear_all_offsets() { TERN_(PTC_PROBE, clear_offsets(TSI_PROBE)); TERN_(PTC_BED, clear_offsets(TSI_BED)); TERN_(PTC_HOTEND, clear_offsets(TSI_EXT)); diff --git a/Marlin/src/feature/repeat.h b/Marlin/src/feature/repeat.h index 0f4d9425b7..fc11e4a9e2 100644 --- a/Marlin/src/feature/repeat.h +++ b/Marlin/src/feature/repeat.h @@ -38,8 +38,8 @@ private: static repeat_marker_t marker[MAX_REPEAT_NESTING]; static uint8_t index; public: - static inline void reset() { index = 0; } - static inline bool is_active() { + static void reset() { index = 0; } + static bool is_active() { LOOP_L_N(i, index) if (marker[i].counter) return true; return false; } diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 8065e51555..e74d857a79 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -83,30 +83,30 @@ class TFilamentMonitor : public FilamentMonitorBase { static sensor_t sensor; public: - static inline void setup() { + static void setup() { sensor.setup(); reset(); } - static inline void reset() { + static void reset() { filament_ran_out = false; response.reset(); } // Call this method when filament is present, // so the response can reset its counter. - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { response.filament_present(extruder); } #if HAS_FILAMENT_RUNOUT_DISTANCE - static inline float& runout_distance() { return response.runout_distance_mm; } - static inline void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; } + static float& runout_distance() { return response.runout_distance_mm; } + static void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; } #endif // Handle a block completion. RunoutResponseDelayed uses this to // add up the length of filament moved while the filament is out. - static inline void block_completed(const block_t * const b) { + static void block_completed(const block_t * const b) { if (enabled) { response.block_completed(b); sensor.block_completed(b); @@ -114,7 +114,7 @@ class TFilamentMonitor : public FilamentMonitorBase { } // Give the response a chance to update its counter. - static inline void run() { + static void run() { if (enabled && !filament_ran_out && (printingIsActive() || did_pause_print)) { TERN_(HAS_FILAMENT_RUNOUT_DISTANCE, cli()); // Prevent RunoutResponseDelayed::block_completed from accumulating here response.run(); @@ -168,12 +168,12 @@ class FilamentSensorBase { * Called by FilamentSensorSwitch::run when filament is detected. * Called by FilamentSensorEncoder::block_completed when motion is detected. */ - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { runout.filament_present(extruder); // ...which calls response.filament_present(extruder) } public: - static inline void setup() { + static void setup() { #define _INIT_RUNOUT_PIN(P,S,U,D) do{ if (ENABLED(U)) SET_INPUT_PULLUP(P); else if (ENABLED(D)) SET_INPUT_PULLDOWN(P); else SET_INPUT(P); }while(0) #define INIT_RUNOUT_PIN(N) _INIT_RUNOUT_PIN(FIL_RUNOUT##N##_PIN, FIL_RUNOUT##N##_STATE, FIL_RUNOUT##N##_PULLUP, FIL_RUNOUT##N##_PULLDOWN) #if NUM_RUNOUT_SENSORS >= 1 @@ -205,14 +205,14 @@ class FilamentSensorBase { } // Return a bitmask of runout pin states - static inline uint8_t poll_runout_pins() { + static uint8_t poll_runout_pins() { #define _OR_RUNOUT(N) | (READ(FIL_RUNOUT##N##_PIN) ? _BV((N) - 1) : 0) return (0 REPEAT_1(NUM_RUNOUT_SENSORS, _OR_RUNOUT)); #undef _OR_RUNOUT } // Return a bitmask of runout flag states (1 bits always indicates runout) - static inline uint8_t poll_runout_states() { + static uint8_t poll_runout_states() { return poll_runout_pins() ^ uint8_t(0 #if NUM_RUNOUT_SENSORS >= 1 | (FIL_RUNOUT1_STATE ? 0 : _BV(1 - 1)) @@ -254,7 +254,7 @@ class FilamentSensorBase { private: static uint8_t motion_detected; - static inline void poll_motion_sensor() { + static void poll_motion_sensor() { static uint8_t old_state; const uint8_t new_state = poll_runout_pins(), change = old_state ^ new_state; @@ -273,7 +273,7 @@ class FilamentSensorBase { } public: - static inline void block_completed(const block_t * const b) { + static void block_completed(const block_t * const b) { // If the sensor wheel has moved since the last call to // this method reset the runout counter for the extruder. if (TEST(motion_detected, b->extruder)) @@ -283,7 +283,7 @@ class FilamentSensorBase { motion_detected = 0; } - static inline void run() { poll_motion_sensor(); } + static void run() { poll_motion_sensor(); } }; #else @@ -294,7 +294,7 @@ class FilamentSensorBase { */ class FilamentSensorSwitch : public FilamentSensorBase { private: - static inline bool poll_runout_state(const uint8_t extruder) { + static bool poll_runout_state(const uint8_t extruder) { const uint8_t runout_states = poll_runout_states(); #if MULTI_FILAMENT_SENSOR if ( !TERN0(DUAL_X_CARRIAGE, idex_is_duplicating()) @@ -307,9 +307,9 @@ class FilamentSensorBase { } public: - static inline void block_completed(const block_t * const) {} + static void block_completed(const block_t * const) {} - static inline void run() { + static void run() { LOOP_L_N(s, NUM_RUNOUT_SENSORS) { const bool out = poll_runout_state(s); if (!out) filament_present(s); @@ -341,11 +341,11 @@ class FilamentSensorBase { public: static float runout_distance_mm; - static inline void reset() { + static void reset() { LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i); } - static inline void run() { + static void run() { #if ENABLED(FILAMENT_RUNOUT_SENSOR_DEBUG) static millis_t t = 0; const millis_t ms = millis(); @@ -358,17 +358,17 @@ class FilamentSensorBase { #endif } - static inline uint8_t has_run_out() { + static uint8_t has_run_out() { uint8_t runout_flags = 0; LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_mm_countdown[i] < 0) SBI(runout_flags, i); return runout_flags; } - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { runout_mm_countdown[extruder] = runout_distance_mm; } - static inline void block_completed(const block_t * const b) { + static void block_completed(const block_t * const b) { if (b->steps.x || b->steps.y || b->steps.z || did_pause_print) { // Allow pause purge move to re-trigger runout state // Only trigger on extrusion with XYZ movement to allow filament change and retract/recover. const uint8_t e = b->extruder; @@ -389,23 +389,23 @@ class FilamentSensorBase { static int8_t runout_count[NUM_RUNOUT_SENSORS]; public: - static inline void reset() { + static void reset() { LOOP_L_N(i, NUM_RUNOUT_SENSORS) filament_present(i); } - static inline void run() { + static void run() { LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] >= 0) runout_count[i]--; } - static inline uint8_t has_run_out() { + static uint8_t has_run_out() { uint8_t runout_flags = 0; LOOP_L_N(i, NUM_RUNOUT_SENSORS) if (runout_count[i] < 0) SBI(runout_flags, i); return runout_flags; } - static inline void block_completed(const block_t * const) { } + static void block_completed(const block_t * const) { } - static inline void filament_present(const uint8_t extruder) { + static void filament_present(const uint8_t extruder) { runout_count[extruder] = runout_threshold; } }; diff --git a/Marlin/src/feature/spindle_laser.h b/Marlin/src/feature/spindle_laser.h index 95d60ae486..7a8cd2c830 100644 --- a/Marlin/src/feature/spindle_laser.h +++ b/Marlin/src/feature/spindle_laser.h @@ -103,12 +103,12 @@ public: static void init(); #if ENABLED(MARLIN_DEV_MODE) - static inline void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); } + static void refresh_frequency() { set_pwm_frequency(pin_t(SPINDLE_LASER_PWM_PIN), frequency); } #endif // Modifying this function should update everywhere - static inline bool enabled(const cutter_power_t opwr) { return opwr > 0; } - static inline bool enabled() { return enabled(power); } + static bool enabled(const cutter_power_t opwr) { return opwr > 0; } + static bool enabled() { return enabled(power); } static void apply_power(const uint8_t inpow); @@ -124,13 +124,13 @@ public: public: static void set_ocr(const uint8_t ocr); - static inline void ocr_set_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); } + static void ocr_set_power(const uint8_t ocr) { power = ocr; set_ocr(ocr); } static void ocr_off(); /** * Update output for power->OCR translation */ - static inline uint8_t upower_to_ocr(const cutter_power_t upwr) { + static uint8_t upower_to_ocr(const cutter_power_t upwr) { return uint8_t( #if CUTTER_UNIT_IS(PWM255) upwr @@ -145,11 +145,11 @@ public: /** * Correct power to configured range */ - static inline cutter_power_t power_to_range(const cutter_power_t pwr) { + static cutter_power_t power_to_range(const cutter_power_t pwr) { return power_to_range(pwr, _CUTTER_POWER(CUTTER_POWER_UNIT)); } - static inline cutter_power_t power_to_range(const cutter_power_t pwr, const uint8_t pwrUnit) { + static cutter_power_t power_to_range(const cutter_power_t pwr, const uint8_t pwrUnit) { static constexpr float min_pct = TERN(CUTTER_POWER_RELATIVE, 0, TERN(SPINDLE_FEATURE, round(100.0f * (SPEED_POWER_MIN) / (SPEED_POWER_MAX)), SPEED_POWER_MIN)), max_pct = TERN(SPINDLE_FEATURE, 100, SPEED_POWER_MAX); @@ -188,7 +188,7 @@ public: * Enable/Disable spindle/laser * @param enable true = enable; false = disable */ - static inline void set_enabled(const bool enable) { + static void set_enabled(const bool enable) { uint8_t value = 0; if (enable) { #if ENABLED(SPINDLE_LASER_USE_PWM) @@ -203,14 +203,14 @@ public: set_power(value); } - static inline void disable() { isReady = false; set_enabled(false); } + static void disable() { isReady = false; set_enabled(false); } /** * Wait for spindle to spin up or spin down * * @param on true = state to on; false = state to off. */ - static inline void power_delay(const bool on) { + static void power_delay(const bool on) { #if DISABLED(LASER_POWER_INLINE) safe_delay(on ? SPINDLE_LASER_POWERUP_DELAY : SPINDLE_LASER_POWERDOWN_DELAY); #endif @@ -220,7 +220,7 @@ public: static void set_reverse(const bool reverse); static bool is_reverse() { return READ(SPINDLE_DIR_PIN) == SPINDLE_INVERT_DIR; } #else - static inline void set_reverse(const bool) {} + static void set_reverse(const bool) {} static bool is_reverse() { return false; } #endif @@ -228,7 +228,7 @@ public: static void air_evac_enable(); // Turn On Cutter Vacuum or Laser Blower motor static void air_evac_disable(); // Turn Off Cutter Vacuum or Laser Blower motor static void air_evac_toggle(); // Toggle Cutter Vacuum or Laser Blower motor - static inline bool air_evac_state() { // Get current state + static bool air_evac_state() { // Get current state return (READ(AIR_EVACUATION_PIN) == AIR_EVACUATION_ACTIVE); } #endif @@ -237,13 +237,13 @@ public: static void air_assist_enable(); // Turn on air assist static void air_assist_disable(); // Turn off air assist static void air_assist_toggle(); // Toggle air assist - static inline bool air_assist_state() { // Get current state + static bool air_assist_state() { // Get current state return (READ(AIR_ASSIST_PIN) == AIR_ASSIST_ACTIVE); } #endif #if HAS_LCD_MENU - static inline void enable_with_dir(const bool reverse) { + static void enable_with_dir(const bool reverse) { isReady = true; const uint8_t ocr = TERN(SPINDLE_LASER_USE_PWM, upower_to_ocr(menuPower), 255); if (menuPower) @@ -259,7 +259,7 @@ public: FORCE_INLINE static void enable_same_dir() { enable_with_dir(is_reverse()); } #if ENABLED(SPINDLE_LASER_USE_PWM) - static inline void update_from_mpower() { + static void update_from_mpower() { if (isReady) power = upower_to_ocr(menuPower); unitPower = menuPower; } @@ -271,7 +271,7 @@ public: * Also fires with any PWM power that was previous set * If not set defaults to 80% power */ - static inline void test_fire_pulse() { + static void test_fire_pulse() { TERN_(USE_BEEPER, buzzer.tone(30, 3000)); enable_forward(); // Turn Laser on (Spindle speak but same funct) delay(testPulse); // Delay for time set by user in pulse ms menu screen. @@ -288,7 +288,7 @@ public: */ // Force disengage planner power control - static inline void inline_disable() { + static void inline_disable() { isReady = false; unitPower = 0; planner.laser_inline.status.isPlanned = false; @@ -297,7 +297,7 @@ public: } // Inline modes of all other functions; all enable planner inline power control - static inline void set_inline_enabled(const bool enable) { + static void set_inline_enabled(const bool enable) { if (enable) inline_power(255); else { @@ -326,10 +326,10 @@ public: #endif } - static inline void inline_direction(const bool) { /* never */ } + static void inline_direction(const bool) { /* never */ } #if ENABLED(SPINDLE_LASER_USE_PWM) - static inline void inline_ocr_power(const uint8_t ocrpwr) { + static void inline_ocr_power(const uint8_t ocrpwr) { isReady = ocrpwr > 0; planner.laser_inline.status.isEnabled = ocrpwr > 0; planner.laser_inline.power = ocrpwr; @@ -337,7 +337,7 @@ public: #endif #endif // LASER_POWER_INLINE - static inline void kill() { + static void kill() { TERN_(LASER_POWER_INLINE, inline_disable()); disable(); } diff --git a/Marlin/src/feature/tmc_util.cpp b/Marlin/src/feature/tmc_util.cpp index 82c10e6e8e..e793b4cf22 100644 --- a/Marlin/src/feature/tmc_util.cpp +++ b/Marlin/src/feature/tmc_util.cpp @@ -472,12 +472,8 @@ void tmc_set_report_interval(const uint16_t update_interval) { if ((report_tmc_status_interval = update_interval)) SERIAL_ECHOLNPGM("axis:pwm_scale" - #if HAS_STEALTHCHOP - "/curr_scale" - #endif - #if HAS_STALLGUARD - "/mech_load" - #endif + TERN_(HAS_STEALTHCHOP, "/curr_scale") + TERN_(HAS_STALLGUARD, "/mech_load") "|flags|warncount" ); } diff --git a/Marlin/src/feature/tmc_util.h b/Marlin/src/feature/tmc_util.h index 1f7d5cf1a5..44cde9c763 100644 --- a/Marlin/src/feature/tmc_util.h +++ b/Marlin/src/feature/tmc_util.h @@ -45,6 +45,12 @@ constexpr uint16_t _tmc_thrs(const uint16_t msteps, const uint32_t thrs, const u return 12650000UL * msteps / (256 * thrs * spmm); } +typedef struct { + uint8_t toff; + int8_t hend; + uint8_t hstrt; +} chopper_timing_t; + template class TMCStorage { protected: @@ -58,13 +64,13 @@ class TMCStorage { uint8_t otpw_count = 0, error_count = 0; bool flag_otpw = false; - inline bool getOTPW() { return flag_otpw; } - inline void clear_otpw() { flag_otpw = 0; } + bool getOTPW() { return flag_otpw; } + void clear_otpw() { flag_otpw = 0; } #endif - inline uint16_t getMilliamps() { return val_mA; } + uint16_t getMilliamps() { return val_mA; } - inline void printLabel() { + void printLabel() { SERIAL_CHAR(AXIS_LETTER); if (DRIVER_ID > '0') SERIAL_CHAR(DRIVER_ID); } @@ -91,25 +97,31 @@ class TMCMarlin : public TMC, public TMCStorage { TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK, const uint8_t axis_chain_index) : TMC(CS, RS, pinMOSI, pinMISO, pinSCK, axis_chain_index) {} - inline uint16_t rms_current() { return TMC::rms_current(); } - inline void rms_current(uint16_t mA) { + uint16_t rms_current() { return TMC::rms_current(); } + void rms_current(uint16_t mA) { this->val_mA = mA; TMC::rms_current(mA); } - inline void rms_current(const uint16_t mA, const float mult) { + void rms_current(const uint16_t mA, const float mult) { this->val_mA = mA; TMC::rms_current(mA, mult); } - inline uint16_t get_microstep_counter() { return TMC::MSCNT(); } + uint16_t get_microstep_counter() { return TMC::MSCNT(); } #if HAS_STEALTHCHOP - inline bool get_stealthChop() { return this->en_pwm_mode(); } - inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } - inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); } - inline void set_stealthChop(const bool stch) { this->stored.stealthChop_enabled = stch; refresh_stepping_mode(); } - inline bool toggle_stepping_mode() { set_stealthChop(!this->stored.stealthChop_enabled); return get_stealthChop(); } + bool get_stealthChop() { return this->en_pwm_mode(); } + bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } + void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); } + void set_stealthChop(const bool stch) { this->stored.stealthChop_enabled = stch; refresh_stepping_mode(); } + bool toggle_stepping_mode() { set_stealthChop(!this->stored.stealthChop_enabled); return get_stealthChop(); } #endif + void set_chopper_times(const chopper_timing_t &ct) { + TMC::toff(ct.toff); + TMC::hysteresis_end(ct.hend); + TMC::hysteresis_start(ct.hstrt); + } + #if ENABLED(HYBRID_THRESHOLD) uint32_t get_pwm_thrs() { return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]); @@ -121,7 +133,7 @@ class TMCMarlin : public TMC, public TMCStorage { #endif #if USE_SENSORLESS - inline int16_t homing_threshold() { return TMC::sgt(); } + int16_t homing_threshold() { return TMC::sgt(); } void homing_threshold(int16_t sgt_val) { sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); TMC::sgt(sgt_val); @@ -133,13 +145,13 @@ class TMCMarlin : public TMC, public TMCStorage { #endif #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } #if ENABLED(HYBRID_THRESHOLD) - inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } #endif #if USE_SENSORLESS - inline void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif #endif @@ -161,24 +173,30 @@ class TMCMarlin : public TMC220 {} uint16_t rms_current() { return TMC2208Stepper::rms_current(); } - inline void rms_current(const uint16_t mA) { + void rms_current(const uint16_t mA) { this->val_mA = mA; TMC2208Stepper::rms_current(mA); } - inline void rms_current(const uint16_t mA, const float mult) { + void rms_current(const uint16_t mA, const float mult) { this->val_mA = mA; TMC2208Stepper::rms_current(mA, mult); } - inline uint16_t get_microstep_counter() { return TMC2208Stepper::MSCNT(); } + uint16_t get_microstep_counter() { return TMC2208Stepper::MSCNT(); } #if HAS_STEALTHCHOP - inline bool get_stealthChop() { return !this->en_spreadCycle(); } - inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } - inline void refresh_stepping_mode() { this->en_spreadCycle(!this->stored.stealthChop_enabled); } - inline void set_stealthChop(const bool stch) { this->stored.stealthChop_enabled = stch; refresh_stepping_mode(); } - inline bool toggle_stepping_mode() { set_stealthChop(!this->stored.stealthChop_enabled); return get_stealthChop(); } + bool get_stealthChop() { return !this->en_spreadCycle(); } + bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } + void refresh_stepping_mode() { this->en_spreadCycle(!this->stored.stealthChop_enabled); } + void set_stealthChop(const bool stch) { this->stored.stealthChop_enabled = stch; refresh_stepping_mode(); } + bool toggle_stepping_mode() { set_stealthChop(!this->stored.stealthChop_enabled); return get_stealthChop(); } #endif + void set_chopper_times(const chopper_timing_t &ct) { + TMC2208Stepper::toff(ct.toff); + TMC2208Stepper::hysteresis_end(ct.hend); + TMC2208Stepper::hysteresis_start(ct.hstrt); + } + #if ENABLED(HYBRID_THRESHOLD) uint32_t get_pwm_thrs() { return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]); @@ -190,10 +208,10 @@ class TMCMarlin : public TMC220 #endif #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } #if ENABLED(HYBRID_THRESHOLD) - inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } #endif #endif }; @@ -209,24 +227,30 @@ class TMCMarlin : public TMC220 {} uint8_t get_address() { return slave_address; } uint16_t rms_current() { return TMC2209Stepper::rms_current(); } - inline void rms_current(const uint16_t mA) { + void rms_current(const uint16_t mA) { this->val_mA = mA; TMC2209Stepper::rms_current(mA); } - inline void rms_current(const uint16_t mA, const float mult) { + void rms_current(const uint16_t mA, const float mult) { this->val_mA = mA; TMC2209Stepper::rms_current(mA, mult); } - inline uint16_t get_microstep_counter() { return TMC2209Stepper::MSCNT(); } + uint16_t get_microstep_counter() { return TMC2209Stepper::MSCNT(); } #if HAS_STEALTHCHOP - inline bool get_stealthChop() { return !this->en_spreadCycle(); } - inline bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } - inline void refresh_stepping_mode() { this->en_spreadCycle(!this->stored.stealthChop_enabled); } - inline void set_stealthChop(const bool stch) { this->stored.stealthChop_enabled = stch; refresh_stepping_mode(); } - inline bool toggle_stepping_mode() { set_stealthChop(!this->stored.stealthChop_enabled); return get_stealthChop(); } + bool get_stealthChop() { return !this->en_spreadCycle(); } + bool get_stored_stealthChop() { return this->stored.stealthChop_enabled; } + void refresh_stepping_mode() { this->en_spreadCycle(!this->stored.stealthChop_enabled); } + void set_stealthChop(const bool stch) { this->stored.stealthChop_enabled = stch; refresh_stepping_mode(); } + bool toggle_stepping_mode() { set_stealthChop(!this->stored.stealthChop_enabled); return get_stealthChop(); } #endif + void set_chopper_times(const chopper_timing_t &ct) { + TMC2209Stepper::toff(ct.toff); + TMC2209Stepper::hysteresis_end(ct.hend); + TMC2209Stepper::hysteresis_start(ct.hstrt); + } + #if ENABLED(HYBRID_THRESHOLD) uint32_t get_pwm_thrs() { return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]); @@ -237,7 +261,7 @@ class TMCMarlin : public TMC220 } #endif #if USE_SENSORLESS - inline int16_t homing_threshold() { return TMC2209Stepper::SGTHRS(); } + int16_t homing_threshold() { return TMC2209Stepper::SGTHRS(); } void homing_threshold(int16_t sgt_val) { sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); TMC2209Stepper::SGTHRS(sgt_val); @@ -246,13 +270,13 @@ class TMCMarlin : public TMC220 #endif #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } #if ENABLED(HYBRID_THRESHOLD) - inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } + void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); } #endif #if USE_SENSORLESS - inline void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif #endif @@ -269,15 +293,21 @@ class TMCMarlin : public TMC266 TMCMarlin(const uint16_t CS, const float RS, const uint16_t pinMOSI, const uint16_t pinMISO, const uint16_t pinSCK, const uint8_t) : TMC2660Stepper(CS, RS, pinMOSI, pinMISO, pinSCK) {} - inline uint16_t rms_current() { return TMC2660Stepper::rms_current(); } - inline void rms_current(const uint16_t mA) { + uint16_t rms_current() { return TMC2660Stepper::rms_current(); } + void rms_current(const uint16_t mA) { this->val_mA = mA; TMC2660Stepper::rms_current(mA); } - inline uint16_t get_microstep_counter() { return TMC2660Stepper::mstep(); } + uint16_t get_microstep_counter() { return TMC2660Stepper::mstep(); } + + void set_chopper_times(const chopper_timing_t &ct) { + TMC2660Stepper::toff(ct.toff); + TMC2660Stepper::hysteresis_end(ct.hend); + TMC2660Stepper::hysteresis_start(ct.hstrt); + } #if USE_SENSORLESS - inline int16_t homing_threshold() { return TMC2660Stepper::sgt(); } + int16_t homing_threshold() { return TMC2660Stepper::sgt(); } void homing_threshold(int16_t sgt_val) { sgt_val = (int16_t)constrain(sgt_val, sgt_min, sgt_max); TMC2660Stepper::sgt(sgt_val); @@ -286,10 +316,10 @@ class TMCMarlin : public TMC266 #endif #if HAS_LCD_MENU - inline void refresh_stepper_current() { rms_current(this->val_mA); } + void refresh_stepper_current() { rms_current(this->val_mA); } #if USE_SENSORLESS - inline void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } + void refresh_homing_thrs() { homing_threshold(this->stored.homing_thrs); } #endif #endif @@ -297,43 +327,6 @@ class TMCMarlin : public TMC266 sgt_max = 63; }; -template -void tmc_print_current(TMC &st) { - st.printLabel(); - SERIAL_ECHOLNPGM(" driver current: ", st.getMilliamps()); -} - -#if ENABLED(MONITOR_DRIVER_STATUS) - template - void tmc_report_otpw(TMC &st) { - st.printLabel(); - SERIAL_ECHOPGM(" temperature prewarn triggered: "); - serialprint_truefalse(st.getOTPW()); - SERIAL_EOL(); - } - template - void tmc_clear_otpw(TMC &st) { - st.clear_otpw(); - st.printLabel(); - SERIAL_ECHOLNPGM(" prewarn flag cleared"); - } -#endif -#if ENABLED(HYBRID_THRESHOLD) - template - void tmc_print_pwmthrs(TMC &st) { - st.printLabel(); - SERIAL_ECHOLNPGM(" stealthChop max speed: ", st.get_pwm_thrs()); - } -#endif -#if USE_SENSORLESS - template - void tmc_print_sgt(TMC &st) { - st.printLabel(); - SERIAL_ECHOPGM(" homing sensitivity: "); - SERIAL_PRINTLN(st.homing_threshold(), PrintBase::Dec); - } -#endif - void monitor_tmc_drivers(); void test_tmc_connection(LOGICAL_AXIS_DECL(const bool, true)); diff --git a/Marlin/src/feature/twibus.h b/Marlin/src/feature/twibus.h index d2c7270303..806e2a147a 100644 --- a/Marlin/src/feature/twibus.h +++ b/Marlin/src/feature/twibus.h @@ -244,11 +244,11 @@ class TWIBus { static void debug(FSTR_P const func, char c); static void debug(FSTR_P const func, char adr[]); #else - static inline void debug(FSTR_P const, uint32_t) {} - static inline void debug(FSTR_P const, char) {} - static inline void debug(FSTR_P const, char[]) {} + static void debug(FSTR_P const, uint32_t) {} + static void debug(FSTR_P const, char) {} + static void debug(FSTR_P const, char[]) {} #endif - static inline void debug(FSTR_P const func, uint8_t v) { debug(func, (uint32_t)v); } + static void debug(FSTR_P const func, uint8_t v) { debug(func, (uint32_t)v); } }; extern TWIBus i2c; diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp index 45f039c132..421220e410 100644 --- a/Marlin/src/gcode/calibrate/G28.cpp +++ b/Marlin/src/gcode/calibrate/G28.cpp @@ -305,21 +305,6 @@ void GcodeSuite::G28() { stepperK.rms_current(K_CURRENT_HOME); if (DEBUGGING(LEVELING)) debug_current(F(AXIS6_STR), tmc_save_current_K, K_CURRENT_HOME); #endif - #if HAS_CURRENT_HOME(I) - const int16_t tmc_save_current_I = stepperI.getMilliamps(); - stepperI.rms_current(I_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F(AXIS4_STR), tmc_save_current_I, I_CURRENT_HOME); - #endif - #if HAS_CURRENT_HOME(J) - const int16_t tmc_save_current_J = stepperJ.getMilliamps(); - stepperJ.rms_current(J_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F(AXIS5_STR), tmc_save_current_J, J_CURRENT_HOME); - #endif - #if HAS_CURRENT_HOME(K) - const int16_t tmc_save_current_K = stepperK.getMilliamps(); - stepperK.rms_current(K_CURRENT_HOME); - if (DEBUGGING(LEVELING)) debug_current(F(AXIS6_STR), tmc_save_current_K, K_CURRENT_HOME); - #endif #if HAS_CURRENT_HOME(Z) && ENABLED(DELTA) const int16_t tmc_save_current_Z = stepperZ.getMilliamps(); stepperZ.rms_current(Z_CURRENT_HOME); @@ -456,15 +441,9 @@ void GcodeSuite::G28() { } #endif - #if LINEAR_AXES >= 4 - if (doI) homeaxis(I_AXIS); - #endif - #if LINEAR_AXES >= 5 - if (doJ) homeaxis(J_AXIS); - #endif - #if LINEAR_AXES >= 6 - if (doK) homeaxis(K_AXIS); - #endif + TERN_(HAS_I_AXIS, if (doI) homeaxis(I_AXIS)); + TERN_(HAS_J_AXIS, if (doJ) homeaxis(J_AXIS)); + TERN_(HAS_K_AXIS, if (doK) homeaxis(K_AXIS)); sync_plan_position(); diff --git a/Marlin/src/gcode/calibrate/G34.cpp b/Marlin/src/gcode/calibrate/G34.cpp index 98a0bdef88..ea5d5fa150 100644 --- a/Marlin/src/gcode/calibrate/G34.cpp +++ b/Marlin/src/gcode/calibrate/G34.cpp @@ -114,10 +114,6 @@ void GcodeSuite::G34() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Final Z Move"); do_blocking_move_to_z(zgrind, MMM_TO_MMS(GANTRY_CALIBRATION_FEEDRATE)); - // Back off end plate, back to normal motion range - if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Backoff"); - do_blocking_move_to_z(zpounce, MMM_TO_MMS(GANTRY_CALIBRATION_FEEDRATE)); - #if _REDUCE_CURRENT // Reset current to original values if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Restore Current"); @@ -146,6 +142,10 @@ void GcodeSuite::G34() { #endif #endif + // Back off end plate, back to normal motion range + if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Z Backoff"); + do_blocking_move_to_z(zpounce, MMM_TO_MMS(GANTRY_CALIBRATION_FEEDRATE)); + #ifdef GANTRY_CALIBRATION_COMMANDS_POST if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Running Post Commands"); process_subcommands_now(F(GANTRY_CALIBRATION_COMMANDS_POST)); diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index 88c906f493..9d630ba1e2 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -73,16 +73,16 @@ #if BOTH(CALIBRATION_MEASURE_LEFT, CALIBRATION_MEASURE_RIGHT) #define HAS_X_CENTER 1 #endif -#if HAS_Y_AXIS && BOTH(CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK) +#if ALL(HAS_Y_AXIS, CALIBRATION_MEASURE_FRONT, CALIBRATION_MEASURE_BACK) #define HAS_Y_CENTER 1 #endif -#if LINEAR_AXES >= 4 && BOTH(CALIBRATION_MEASURE_IMIN, CALIBRATION_MEASURE_IMAX) +#if ALL(HAS_I_AXIS, CALIBRATION_MEASURE_IMIN, CALIBRATION_MEASURE_IMAX) #define HAS_I_CENTER 1 #endif -#if LINEAR_AXES >= 5 && BOTH(CALIBRATION_MEASURE_JMIN, CALIBRATION_MEASURE_JMAX) +#if ALL(HAS_J_AXIS, CALIBRATION_MEASURE_JMIN, CALIBRATION_MEASURE_JMAX) #define HAS_J_CENTER 1 #endif -#if LINEAR_AXES >= 6 && BOTH(CALIBRATION_MEASURE_KMIN, CALIBRATION_MEASURE_KMAX) +#if ALL(HAS_K_AXIS, CALIBRATION_MEASURE_KMIN, CALIBRATION_MEASURE_KMAX) #define HAS_K_CENTER 1 #endif @@ -246,7 +246,7 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t case RIGHT: dir = -1; case LEFT: axis = X_AXIS; break; #endif - #if LINEAR_AXES >= 2 && AXIS_CAN_CALIBRATE(Y) + #if HAS_Y_AXIS && AXIS_CAN_CALIBRATE(Y) case BACK: dir = -1; case FRONT: axis = Y_AXIS; break; #endif @@ -258,15 +258,15 @@ inline void probe_side(measurements_t &m, const float uncertainty, const side_t return; } #endif - #if LINEAR_AXES >= 4 && AXIS_CAN_CALIBRATE(I) + #if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I) case IMINIMUM: dir = -1; case IMAXIMUM: axis = I_AXIS; break; #endif - #if LINEAR_AXES >= 5 && AXIS_CAN_CALIBRATE(J) + #if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J) case JMINIMUM: dir = -1; case JMAXIMUM: axis = J_AXIS; break; #endif - #if LINEAR_AXES >= 6 && AXIS_CAN_CALIBRATE(K) + #if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K) case KMINIMUM: dir = -1; case KMAXIMUM: axis = K_AXIS; break; #endif @@ -370,7 +370,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { SERIAL_ECHOLNPGM(" Back: ", m.obj_side[BACK]); #endif #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS #if ENABLED(CALIBRATION_MEASURE_IMIN) SERIAL_ECHOLNPGM(" " STR_I_MIN ": ", m.obj_side[IMINIMUM]); #endif @@ -378,7 +378,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { SERIAL_ECHOLNPGM(" " STR_I_MAX ": ", m.obj_side[IMAXIMUM]); #endif #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS #if ENABLED(CALIBRATION_MEASURE_JMIN) SERIAL_ECHOLNPGM(" " STR_J_MIN ": ", m.obj_side[JMINIMUM]); #endif @@ -386,7 +386,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { SERIAL_ECHOLNPGM(" " STR_J_MAX ": ", m.obj_side[JMAXIMUM]); #endif #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS #if ENABLED(CALIBRATION_MEASURE_KMIN) SERIAL_ECHOLNPGM(" " STR_K_MIN ": ", m.obj_side[KMINIMUM]); #endif @@ -439,7 +439,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { #if HAS_Z_AXIS && AXIS_CAN_CALIBRATE(Z) SERIAL_ECHOLNPGM(" Top: ", m.backlash[TOP]); #endif - #if LINEAR_AXES >= 4 && AXIS_CAN_CALIBRATE(I) + #if HAS_I_AXIS && AXIS_CAN_CALIBRATE(I) #if ENABLED(CALIBRATION_MEASURE_IMIN) SERIAL_ECHOLNPGM(" " STR_I_MIN ": ", m.backlash[IMINIMUM]); #endif @@ -447,7 +447,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { SERIAL_ECHOLNPGM(" " STR_I_MAX ": ", m.backlash[IMAXIMUM]); #endif #endif - #if LINEAR_AXES >= 5 && AXIS_CAN_CALIBRATE(J) + #if HAS_J_AXIS && AXIS_CAN_CALIBRATE(J) #if ENABLED(CALIBRATION_MEASURE_JMIN) SERIAL_ECHOLNPGM(" " STR_J_MIN ": ", m.backlash[JMINIMUM]); #endif @@ -455,7 +455,7 @@ inline void probe_sides(measurements_t &m, const float uncertainty) { SERIAL_ECHOLNPGM(" " STR_J_MAX ": ", m.backlash[JMAXIMUM]); #endif #endif - #if LINEAR_AXES >= 6 && AXIS_CAN_CALIBRATE(K) + #if HAS_K_AXIS && AXIS_CAN_CALIBRATE(K) #if ENABLED(CALIBRATION_MEASURE_KMIN) SERIAL_ECHOLNPGM(" " STR_K_MIN ": ", m.backlash[KMINIMUM]); #endif @@ -666,7 +666,7 @@ inline void calibrate_all_toolheads(measurements_t &m, const float uncertainty) * 1) For each nozzle, touch top and sides of object to determine object position and * nozzle offsets. Do a fast but rough search over a wider area. * 2) With the first nozzle, touch top and sides of object to determine backlash values - * for all axis (if BACKLASH_GCODE is enabled) + * for all axes (if BACKLASH_GCODE is enabled) * 3) For each nozzle, touch top and sides of object slowly to determine precise * position of object. Adjust coordinate system and nozzle offsets so probed object * location corresponds to known object location with a high degree of precision. diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 7b7ce5e10d..b26a2fe28b 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -253,7 +253,7 @@ void GcodeSuite::M205() { if (parser.seenval('S')) planner.settings.min_feedrate_mm_s = parser.value_linear_units(); if (parser.seenval('T')) planner.settings.min_travel_feedrate_mm_s = parser.value_linear_units(); #if HAS_JUNCTION_DEVIATION - #if HAS_CLASSIC_JERK && (AXIS4_NAME == 'J' || AXIS5_NAME == 'J' || AXIS6_NAME == 'J') + #if HAS_CLASSIC_JERK && AXIS_COLLISION('J') #error "Can't set_max_jerk for 'J' axis because 'J' is used for Junction Deviation." #endif if (parser.seenval('J')) { diff --git a/Marlin/src/gcode/feature/L6470/M906.cpp b/Marlin/src/gcode/feature/L6470/M906.cpp index d058ce5501..f55405b798 100644 --- a/Marlin/src/gcode/feature/L6470/M906.cpp +++ b/Marlin/src/gcode/feature/L6470/M906.cpp @@ -24,6 +24,10 @@ #if HAS_L64XX +#if AXIS_COLLISION('I') + #error "M906 parameter collision with axis name." +#endif + #include "../../gcode.h" #include "../../../libs/L64XX/L64XX_Marlin.h" #include "../../../module/stepper/indirection.h" @@ -202,12 +206,11 @@ void L64XX_report_current(L64XX &motor, const L64XX_axis_t axis) { * On L6474 this sets the TVAL register (same address). * * I - select which driver(s) to change on multi-driver axis - * 0 - (default) all drivers on the axis or E0 - * 1 - monitor only X, Y, Z or E1 - * 2 - monitor only X2, Y2, Z2 or E2 - * 3 - monitor only Z3 or E3 - * 4 - monitor only Z4 or E4 - * 5 - monitor only E5 + * (default) all drivers on the axis + * 0 - monitor only the first XYZ... driver + * 1 - monitor only X2, Y2, Z2 + * 2 - monitor only Z3 + * 3 - monitor only Z4 * Xxxx, Yxxx, Zxxx, Exxx - axis to change (optional) * L6474 - current in mA (4A max) * All others - 0-255 @@ -227,8 +230,10 @@ void GcodeSuite::M906() { uint8_t report_current = true; - #if HAS_L64XX - const uint8_t index = parser.byteval('I'); + #if AXIS_IS_L64XX(X2) || AXIS_IS_L64XX(Y2) || AXIS_IS_L64XX(Z2) || AXIS_IS_L64XX(Z3) || AXIS_IS_L64XX(Z4) + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) { @@ -241,73 +246,72 @@ void GcodeSuite::M906() { } switch (i) { - case X_AXIS: - #if AXIS_IS_L64XX(X) - if (index == 0) L6470_SET_KVAL_HOLD(X); - #endif - #if AXIS_IS_L64XX(X2) - if (index == 1) L6470_SET_KVAL_HOLD(X2); - #endif - break; - - #if HAS_Y_AXIS + #if AXIS_IS_L64XX(X) || AXIS_IS_L64XX(X2) + case X_AXIS: + #if AXIS_IS_L64XX(X) + if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(X); + #endif + #if AXIS_IS_L64XX(X2) + if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(X2); + #endif + break; + #endif + + #if AXIS_IS_L64XX(Y) || AXIS_IS_L64XX(Y2) case Y_AXIS: #if AXIS_IS_L64XX(Y) - if (index == 0) L6470_SET_KVAL_HOLD(Y); + if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(Y); #endif #if AXIS_IS_L64XX(Y2) - if (index == 1) L6470_SET_KVAL_HOLD(Y2); + if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(Y2); #endif break; #endif - #if HAS_Z_AXIS + #if AXIS_IS_L64XX(Z) || AXIS_IS_L64XX(Z2) || AXIS_IS_L64XX(Z3) || AXIS_IS_L64XX(Z4) case Z_AXIS: #if AXIS_IS_L64XX(Z) - if (index == 0) L6470_SET_KVAL_HOLD(Z); + if (index < 0 || index == 0) L6470_SET_KVAL_HOLD(Z); #endif #if AXIS_IS_L64XX(Z2) - if (index == 1) L6470_SET_KVAL_HOLD(Z2); + if (index < 0 || index == 1) L6470_SET_KVAL_HOLD(Z2); #endif #if AXIS_IS_L64XX(Z3) - if (index == 2) L6470_SET_KVAL_HOLD(Z3); + if (index < 0 || index == 2) L6470_SET_KVAL_HOLD(Z3); #endif - #if AXIS_DRIVER_TYPE_Z4(L6470) - if (index == 3) L6470_SET_KVAL_HOLD(Z4); + #if AXIS_IS_L64XX(Z4) + if (index < 0 || index == 3) L6470_SET_KVAL_HOLD(Z4); #endif break; #endif - #if E_STEPPERS + #if AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5) || AXIS_IS_L64XX(E6) || AXIS_IS_L64XX(E7) case E_AXIS: { - const int8_t target_e_stepper = get_target_e_stepper_from_command(0); - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - #if AXIS_IS_L64XX(E0) - case 0: L6470_SET_KVAL_HOLD(E0); break; - #endif - #if AXIS_IS_L64XX(E1) - case 1: L6470_SET_KVAL_HOLD(E1); break; - #endif - #if AXIS_IS_L64XX(E2) - case 2: L6470_SET_KVAL_HOLD(E2); break; - #endif - #if AXIS_IS_L64XX(E3) - case 3: L6470_SET_KVAL_HOLD(E3); break; - #endif - #if AXIS_IS_L64XX(E4) - case 4: L6470_SET_KVAL_HOLD(E4); break; - #endif - #if AXIS_IS_L64XX(E5) - case 5: L6470_SET_KVAL_HOLD(E5); break; - #endif - #if AXIS_IS_L64XX(E6) - case 6: L6470_SET_KVAL_HOLD(E6); break; - #endif - #if AXIS_IS_L64XX(E7) - case 7: L6470_SET_KVAL_HOLD(E7); break; - #endif - } + const int8_t eindex = get_target_e_stepper_from_command(-2); + #if AXIS_IS_L64XX(E0) + if (eindex < 0 || eindex == 0) L6470_SET_KVAL_HOLD(E0); + #endif + #if AXIS_IS_L64XX(E1) + if (eindex < 0 || eindex == 1) L6470_SET_KVAL_HOLD(E1); + #endif + #if AXIS_IS_L64XX(E2) + if (eindex < 0 || eindex == 2) L6470_SET_KVAL_HOLD(E2); + #endif + #if AXIS_IS_L64XX(E3) + if (eindex < 0 || eindex == 3) L6470_SET_KVAL_HOLD(E3); + #endif + #if AXIS_IS_L64XX(E4) + if (eindex < 0 || eindex == 4) L6470_SET_KVAL_HOLD(E4); + #endif + #if AXIS_IS_L64XX(E5) + if (eindex < 0 || eindex == 5) L6470_SET_KVAL_HOLD(E5); + #endif + #if AXIS_IS_L64XX(E6) + if (eindex < 0 || eindex == 6) L6470_SET_KVAL_HOLD(E6); + #endif + #if AXIS_IS_L64XX(E7) + if (eindex < 0 || eindex == 7) L6470_SET_KVAL_HOLD(E7); + #endif } break; #endif } diff --git a/Marlin/src/gcode/feature/L6470/M916-918.cpp b/Marlin/src/gcode/feature/L6470/M916-M918.cpp similarity index 100% rename from Marlin/src/gcode/feature/L6470/M916-918.cpp rename to Marlin/src/gcode/feature/L6470/M916-M918.cpp diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index 665967ca56..febb946bef 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -67,13 +67,13 @@ void GcodeSuite::M600() { #if ENABLED(MIXING_EXTRUDER) - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; + const int8_t eindex = get_target_e_stepper_from_command(); + if (eindex < 0) return; const uint8_t old_mixing_tool = mixer.get_current_vtool(); mixer.T(MIXER_DIRECT_SET_TOOL); - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(target_e_stepper) ? 1.0 : 0.0); + MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(eindex) ? 1.0 : 0.0); mixer.normalize(); const int8_t target_extruder = active_extruder; diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index 21e389a5f2..135b3d384e 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -60,13 +60,13 @@ void GcodeSuite::M701() { if (TERN0(NO_MOTION_BEFORE_HOMING, axes_should_home())) park_point.z = 0; #if ENABLED(MIXING_EXTRUDER) - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; + const int8_t eindex = get_target_e_stepper_from_command(); + if (eindex < 0) return; const uint8_t old_mixing_tool = mixer.get_current_vtool(); mixer.T(MIXER_DIRECT_SET_TOOL); - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, (i == (uint8_t)target_e_stepper) ? 1.0 : 0.0); + MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(eindex) ? 1.0 : 0.0); mixer.normalize(); const int8_t target_extruder = active_extruder; @@ -165,10 +165,10 @@ void GcodeSuite::M702() { #endif if (seenT) { - const int8_t target_e_stepper = get_target_e_stepper_from_command(); - if (target_e_stepper < 0) return; + const int8_t eindex = get_target_e_stepper_from_command(); + if (eindex < 0) return; mixer.T(MIXER_DIRECT_SET_TOOL); - MIXER_STEPPER_LOOP(i) mixer.set_collector(i, (i == (uint8_t)target_e_stepper) ? 1.0 : 0.0); + MIXER_STEPPER_LOOP(i) mixer.set_collector(i, i == uint8_t(eindex) ? 1.0 : 0.0); mixer.normalize(); } diff --git a/Marlin/src/gcode/feature/power_monitor/M430.cpp b/Marlin/src/gcode/feature/power_monitor/M430.cpp index 642a75d061..0f3bb40914 100644 --- a/Marlin/src/gcode/feature/power_monitor/M430.cpp +++ b/Marlin/src/gcode/feature/power_monitor/M430.cpp @@ -53,9 +53,7 @@ void GcodeSuite::M430() { SERIAL_ECHOLNPGM( #if ENABLED(POWER_MONITOR_CURRENT) "Current: ", power_monitor.getAmps(), "A" - #if ENABLED(POWER_MONITOR_VOLTAGE) - " " - #endif + TERN_(POWER_MONITOR_VOLTAGE, " ") #endif #if ENABLED(POWER_MONITOR_VOLTAGE) "Voltage: ", power_monitor.getVolts(), "V" diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index cb33d46d25..7bfedf8c72 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -24,6 +24,10 @@ #if HAS_STEALTHCHOP +#if AXIS_COLLISION('I') + #error "M569 parameter collision with axis name." +#endif + #include "../../gcode.h" #include "../../../feature/tmc_util.h" #include "../../../module/stepper/indirection.h" @@ -40,35 +44,35 @@ void tmc_set_stealthChop(TMC &st, const bool enable) { st.refresh_stepping_mode(); } -static void set_stealth_status(const bool enable, const int8_t target_e_stepper) { +static void set_stealth_status(const bool enable, const int8_t eindex) { #define TMC_SET_STEALTH(Q) tmc_set_stealthChop(stepper##Q, enable) - #if X_HAS_STEALTHCHOP || Y_HAS_STEALTHCHOP || Z_HAS_STEALTHCHOP \ - || I_HAS_STEALTHCHOP || J_HAS_STEALTHCHOP || K_HAS_STEALTHCHOP \ - || X2_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP || Z3_HAS_STEALTHCHOP || Z4_HAS_STEALTHCHOP - const uint8_t index = parser.byteval('I'); + #if X2_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP || Z3_HAS_STEALTHCHOP || Z4_HAS_STEALTHCHOP + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (parser.seen(axis_codes[i])) { switch (i) { case X_AXIS: - TERN_(X_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(X)); - TERN_(X2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(X2)); + TERN_(X_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(X)); + TERN_(X2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_STEALTH(X2)); break; #if HAS_Y_AXIS case Y_AXIS: - TERN_(Y_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(Y)); - TERN_(Y2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(Y2)); + TERN_(Y_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(Y)); + TERN_(Y2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_STEALTH(Y2)); break; #endif #if HAS_Z_AXIS case Z_AXIS: - TERN_(Z_HAS_STEALTHCHOP, if (index == 0) TMC_SET_STEALTH(Z)); - TERN_(Z2_HAS_STEALTHCHOP, if (index == 1) TMC_SET_STEALTH(Z2)); - TERN_(Z3_HAS_STEALTHCHOP, if (index == 2) TMC_SET_STEALTH(Z3)); - TERN_(Z4_HAS_STEALTHCHOP, if (index == 3) TMC_SET_STEALTH(Z4)); + TERN_(Z_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_STEALTH(Z)); + TERN_(Z2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_STEALTH(Z2)); + TERN_(Z3_HAS_STEALTHCHOP, if (index < 0 || index == 2) TMC_SET_STEALTH(Z3)); + TERN_(Z4_HAS_STEALTHCHOP, if (index < 0 || index == 3) TMC_SET_STEALTH(Z4)); break; #endif @@ -84,17 +88,14 @@ static void set_stealth_status(const bool enable, const int8_t target_e_stepper) #if E_STEPPERS case E_AXIS: { - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - TERN_(E0_HAS_STEALTHCHOP, case 0: TMC_SET_STEALTH(E0); break;) - TERN_(E1_HAS_STEALTHCHOP, case 1: TMC_SET_STEALTH(E1); break;) - TERN_(E2_HAS_STEALTHCHOP, case 2: TMC_SET_STEALTH(E2); break;) - TERN_(E3_HAS_STEALTHCHOP, case 3: TMC_SET_STEALTH(E3); break;) - TERN_(E4_HAS_STEALTHCHOP, case 4: TMC_SET_STEALTH(E4); break;) - TERN_(E5_HAS_STEALTHCHOP, case 5: TMC_SET_STEALTH(E5); break;) - TERN_(E6_HAS_STEALTHCHOP, case 6: TMC_SET_STEALTH(E6); break;) - TERN_(E7_HAS_STEALTHCHOP, case 7: TMC_SET_STEALTH(E7); break;) - } + TERN_(E0_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 0) TMC_SET_STEALTH(E0)); + TERN_(E1_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 1) TMC_SET_STEALTH(E1)); + TERN_(E2_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 2) TMC_SET_STEALTH(E2)); + TERN_(E3_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 3) TMC_SET_STEALTH(E3)); + TERN_(E4_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 4) TMC_SET_STEALTH(E4)); + TERN_(E5_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 5) TMC_SET_STEALTH(E5)); + TERN_(E6_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 6) TMC_SET_STEALTH(E6)); + TERN_(E7_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 7) TMC_SET_STEALTH(E7)); } break; #endif } @@ -133,7 +134,7 @@ static void say_stealth_status() { */ void GcodeSuite::M569() { if (parser.seen('S')) - set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command(0)); + set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command(-2)); else say_stealth_status(); } diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index f28718c831..92d2210645 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -28,6 +28,12 @@ #include "../../../feature/tmc_util.h" #include "../../../module/stepper/indirection.h" +template +static void tmc_print_current(TMC &st) { + st.printLabel(); + SERIAL_ECHOLNPGM(" driver current: ", st.getMilliamps()); +} + /** * M906: Set motor current in milliamps. * @@ -48,46 +54,50 @@ void GcodeSuite::M906() { bool report = true; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K) - const uint8_t index = parser.byteval('I'); + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (uint16_t value = parser.intval(axis_codes[i])) { report = false; switch (i) { - case X_AXIS: - #if AXIS_IS_TMC(X) - if (index == 0) TMC_SET_CURRENT(X); - #endif - #if AXIS_IS_TMC(X2) - if (index == 1) TMC_SET_CURRENT(X2); - #endif - break; + #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) + case X_AXIS: + #if AXIS_IS_TMC(X) + if (index < 0 || index == 0) TMC_SET_CURRENT(X); + #endif + #if AXIS_IS_TMC(X2) + if (index < 0 || index == 1) TMC_SET_CURRENT(X2); + #endif + break; + #endif - #if HAS_Y_AXIS + #if AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) case Y_AXIS: #if AXIS_IS_TMC(Y) - if (index == 0) TMC_SET_CURRENT(Y); + if (index < 0 || index == 0) TMC_SET_CURRENT(Y); #endif #if AXIS_IS_TMC(Y2) - if (index == 1) TMC_SET_CURRENT(Y2); + if (index < 0 || index == 1) TMC_SET_CURRENT(Y2); #endif break; #endif - #if HAS_Z_AXIS + #if AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) case Z_AXIS: #if AXIS_IS_TMC(Z) - if (index == 0) TMC_SET_CURRENT(Z); + if (index < 0 || index == 0) TMC_SET_CURRENT(Z); #endif #if AXIS_IS_TMC(Z2) - if (index == 1) TMC_SET_CURRENT(Z2); + if (index < 0 || index == 1) TMC_SET_CURRENT(Z2); #endif #if AXIS_IS_TMC(Z3) - if (index == 2) TMC_SET_CURRENT(Z3); + if (index < 0 || index == 2) TMC_SET_CURRENT(Z3); #endif #if AXIS_IS_TMC(Z4) - if (index == 3) TMC_SET_CURRENT(Z4); + if (index < 0 || index == 3) TMC_SET_CURRENT(Z4); #endif break; #endif @@ -102,36 +112,33 @@ void GcodeSuite::M906() { case K_AXIS: TMC_SET_CURRENT(K); break; #endif - #if E_STEPPERS + #if AXIS_IS_TMC(E0) || AXIS_IS_TMC(E1) || AXIS_IS_TMC(E2) || AXIS_IS_TMC(E3) || AXIS_IS_TMC(E4) || AXIS_IS_TMC(E5) || AXIS_IS_TMC(E6) || AXIS_IS_TMC(E7) case E_AXIS: { - const int8_t target_e_stepper = get_target_e_stepper_from_command(0); - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - #if AXIS_IS_TMC(E0) - case 0: TMC_SET_CURRENT(E0); break; - #endif - #if AXIS_IS_TMC(E1) - case 1: TMC_SET_CURRENT(E1); break; - #endif - #if AXIS_IS_TMC(E2) - case 2: TMC_SET_CURRENT(E2); break; - #endif - #if AXIS_IS_TMC(E3) - case 3: TMC_SET_CURRENT(E3); break; - #endif - #if AXIS_IS_TMC(E4) - case 4: TMC_SET_CURRENT(E4); break; - #endif - #if AXIS_IS_TMC(E5) - case 5: TMC_SET_CURRENT(E5); break; - #endif - #if AXIS_IS_TMC(E6) - case 6: TMC_SET_CURRENT(E6); break; - #endif - #if AXIS_IS_TMC(E7) - case 7: TMC_SET_CURRENT(E7); break; - #endif - } + const int8_t eindex = get_target_e_stepper_from_command(-2); + #if AXIS_IS_TMC(E0) + if (eindex < 0 || eindex == 0) TMC_SET_CURRENT(E0); + #endif + #if AXIS_IS_TMC(E1) + if (eindex < 0 || eindex == 1) TMC_SET_CURRENT(E1); + #endif + #if AXIS_IS_TMC(E2) + if (eindex < 0 || eindex == 2) TMC_SET_CURRENT(E2); + #endif + #if AXIS_IS_TMC(E3) + if (eindex < 0 || eindex == 3) TMC_SET_CURRENT(E3); + #endif + #if AXIS_IS_TMC(E4) + if (eindex < 0 || eindex == 4) TMC_SET_CURRENT(E4); + #endif + #if AXIS_IS_TMC(E5) + if (eindex < 0 || eindex == 5) TMC_SET_CURRENT(E5); + #endif + #if AXIS_IS_TMC(E6) + if (eindex < 0 || eindex == 6) TMC_SET_CURRENT(E6); + #endif + #if AXIS_IS_TMC(E7) + if (eindex < 0 || eindex == 7) TMC_SET_CURRENT(E7); + #endif } break; #endif } diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index 3f83558fd4..628ae40f48 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -38,19 +38,19 @@ #if M91x_USE(X) || M91x_USE(X2) #define M91x_SOME_X 1 #endif - #if LINEAR_AXES >= 2 && (M91x_USE(Y) || M91x_USE(Y2)) + #if HAS_Y_AXIS && (M91x_USE(Y) || M91x_USE(Y2)) #define M91x_SOME_Y 1 #endif #if HAS_Z_AXIS && (M91x_USE(Z) || M91x_USE(Z2) || M91x_USE(Z3) || M91x_USE(Z4)) #define M91x_SOME_Z 1 #endif - #if LINEAR_AXES >= 4 && M91x_USE(I) + #if HAS_I_AXIS && M91x_USE(I) #define M91x_USE_I 1 #endif - #if LINEAR_AXES >= 5 && M91x_USE(J) + #if HAS_J_AXIS && M91x_USE(J) #define M91x_USE_J 1 #endif - #if LINEAR_AXES >= 6 && M91x_USE(K) + #if HAS_K_AXIS && M91x_USE(K) #define M91x_USE_K 1 #endif @@ -62,6 +62,21 @@ #error "MONITOR_DRIVER_STATUS requires at least one TMC2130, 2160, 2208, 2209, 2660, 5130, or 5160." #endif + template + static void tmc_report_otpw(TMC &st) { + st.printLabel(); + SERIAL_ECHOPGM(" temperature prewarn triggered: "); + serialprint_truefalse(st.getOTPW()); + SERIAL_EOL(); + } + + template + static void tmc_clear_otpw(TMC &st) { + st.clear_otpw(); + st.printLabel(); + SERIAL_ECHOLNPGM(" prewarn flag cleared"); + } + /** * M911: Report TMC stepper driver overtemperature pre-warn flag * This flag is held by the library, persisting until cleared by M912 @@ -223,11 +238,17 @@ #endif // MONITOR_DRIVER_STATUS -/** - * M913: Set HYBRID_THRESHOLD speed. - */ #if ENABLED(HYBRID_THRESHOLD) + template + static void tmc_print_pwmthrs(TMC &st) { + st.printLabel(); + SERIAL_ECHOLNPGM(" stealthChop max speed: ", st.get_pwm_thrs()); + } + + /** + * M913: Set HYBRID_THRESHOLD speed. + */ void GcodeSuite::M913() { #define TMC_SAY_PWMTHRS(A,Q) tmc_print_pwmthrs(stepper##Q) #define TMC_SET_PWMTHRS(A,Q) stepper##Q.set_pwm_thrs(value) @@ -235,20 +256,36 @@ #define TMC_SET_PWMTHRS_E(E) stepperE##E.set_pwm_thrs(value) bool report = true; - #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) || AXIS_IS_TMC(I) || AXIS_IS_TMC(J) || AXIS_IS_TMC(K) - const uint8_t index = parser.byteval('I'); + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) + const int8_t index = parser.byteval('I', -1); + #else + constexpr int8_t index = -1; #endif LOOP_LOGICAL_AXES(i) if (int32_t value = parser.longval(axis_codes[i])) { report = false; switch (i) { - case X_AXIS: - TERN_(X_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(X,X)); - TERN_(X2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(X,X2)); - break; - case Y_AXIS: - TERN_(Y_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Y,Y)); - TERN_(Y2_HAS_STEALTHCHOP, if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2)); - break; + #if X_HAS_STEALTHCHOP || X2_HAS_STEALTHCHOP + case X_AXIS: + TERN_(X_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(X,X)); + TERN_(X2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(X,X2)); + break; + #endif + + #if Y_HAS_STEALTHCHOP || Y2_HAS_STEALTHCHOP + case Y_AXIS: + TERN_(Y_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(Y,Y)); + TERN_(Y2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(Y,Y2)); + break; + #endif + + #if Z_HAS_STEALTHCHOP || Z2_HAS_STEALTHCHOP || Z3_HAS_STEALTHCHOP || Z4_HAS_STEALTHCHOP + case Z_AXIS: + TERN_(Z_HAS_STEALTHCHOP, if (index < 0 || index == 0) TMC_SET_PWMTHRS(Z,Z)); + TERN_(Z2_HAS_STEALTHCHOP, if (index < 0 || index == 1) TMC_SET_PWMTHRS(Z,Z2)); + TERN_(Z3_HAS_STEALTHCHOP, if (index < 0 || index == 2) TMC_SET_PWMTHRS(Z,Z3)); + TERN_(Z4_HAS_STEALTHCHOP, if (index < 0 || index == 3) TMC_SET_PWMTHRS(Z,Z4)); + break; + #endif #if I_HAS_STEALTHCHOP case I_AXIS: TMC_SET_PWMTHRS(I,I); break; @@ -260,26 +297,17 @@ case K_AXIS: TMC_SET_PWMTHRS(K,K); break; #endif - case Z_AXIS: - TERN_(Z_HAS_STEALTHCHOP, if (index < 2) TMC_SET_PWMTHRS(Z,Z)); - TERN_(Z2_HAS_STEALTHCHOP, if (index == 0 || index == 2) TMC_SET_PWMTHRS(Z,Z2)); - TERN_(Z3_HAS_STEALTHCHOP, if (index == 0 || index == 3) TMC_SET_PWMTHRS(Z,Z3)); - TERN_(Z4_HAS_STEALTHCHOP, if (index == 0 || index == 4) TMC_SET_PWMTHRS(Z,Z4)); - break; - #if E_STEPPERS + #if E0_HAS_STEALTHCHOP || E1_HAS_STEALTHCHOP || E2_HAS_STEALTHCHOP || E3_HAS_STEALTHCHOP || E4_HAS_STEALTHCHOP || E5_HAS_STEALTHCHOP || E6_HAS_STEALTHCHOP || E7_HAS_STEALTHCHOP case E_AXIS: { - const int8_t target_e_stepper = get_target_e_stepper_from_command(0); - if (target_e_stepper < 0) return; - switch (target_e_stepper) { - TERN_(E0_HAS_STEALTHCHOP, case 0: TMC_SET_PWMTHRS_E(0); break;) - TERN_(E1_HAS_STEALTHCHOP, case 1: TMC_SET_PWMTHRS_E(1); break;) - TERN_(E2_HAS_STEALTHCHOP, case 2: TMC_SET_PWMTHRS_E(2); break;) - TERN_(E3_HAS_STEALTHCHOP, case 3: TMC_SET_PWMTHRS_E(3); break;) - TERN_(E4_HAS_STEALTHCHOP, case 4: TMC_SET_PWMTHRS_E(4); break;) - TERN_(E5_HAS_STEALTHCHOP, case 5: TMC_SET_PWMTHRS_E(5); break;) - TERN_(E6_HAS_STEALTHCHOP, case 6: TMC_SET_PWMTHRS_E(6); break;) - TERN_(E7_HAS_STEALTHCHOP, case 7: TMC_SET_PWMTHRS_E(7); break;) - } + const int8_t eindex = get_target_e_stepper_from_command(-2); + TERN_(E0_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 0) TMC_SET_PWMTHRS_E(0)); + TERN_(E1_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 1) TMC_SET_PWMTHRS_E(1)); + TERN_(E2_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 2) TMC_SET_PWMTHRS_E(2)); + TERN_(E3_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 3) TMC_SET_PWMTHRS_E(3)); + TERN_(E4_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 4) TMC_SET_PWMTHRS_E(4)); + TERN_(E5_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 5) TMC_SET_PWMTHRS_E(5)); + TERN_(E6_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 6) TMC_SET_PWMTHRS_E(6)); + TERN_(E7_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 7) TMC_SET_PWMTHRS_E(7)); } break; #endif // E_STEPPERS } @@ -407,11 +435,18 @@ #endif // HYBRID_THRESHOLD -/** - * M914: Set StallGuard sensitivity. - */ #if USE_SENSORLESS + template + static void tmc_print_sgt(TMC &st) { + st.printLabel(); + SERIAL_ECHOPGM(" homing sensitivity: "); + SERIAL_PRINTLN(st.homing_threshold(), PrintBase::Dec); + } + + /** + * M914: Set StallGuard sensitivity. + */ void GcodeSuite::M914() { bool report = true; diff --git a/Marlin/src/gcode/feature/trinamic/M919.cpp b/Marlin/src/gcode/feature/trinamic/M919.cpp new file mode 100644 index 0000000000..4dce28f0ae --- /dev/null +++ b/Marlin/src/gcode/feature/trinamic/M919.cpp @@ -0,0 +1,266 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfig.h" + +#if HAS_TRINAMIC_CONFIG + +#if AXIS_COLLISION('I') + #error "M919 parameter collision with axis name." +#endif + +#include "../../gcode.h" +#include "../../../feature/tmc_util.h" +#include "../../../module/stepper/indirection.h" + +#define DEBUG_OUT ENABLED(MARLIN_DEV_MODE) +#include "../../../core/debug_out.h" + +template +static void tmc_print_chopper_time(TMC &st) { + st.printLabel(); + SERIAL_ECHOLNPGM(" chopper .toff: ", st.toff(), + " .hend: ", st.hysteresis_end(), + " .hstrt: ", st.hysteresis_start()); +} + +/** + * M919: Set TMC stepper driver chopper times + * + * Parameters: + * XYZ...E - Selected axes + * I[index] - Axis sub-index (Omit for all XYZ steppers, 1 for X2, Y2, Z2; 2 for Z3; 3 for Z4) + * T[index] - Extruder index (Zero-based. Omit for all extruders.) + * O - time-off [ 1..15] + * P - hysteresis_end [-3..12] + * S - hysteresis_start [ 1...8] + * + * With no parameters report chopper times for all axes + */ +void GcodeSuite::M919() { + bool err = false; + + int8_t toff = int8_t(parser.intval('O', -127)); + if (toff != -127) { + if (WITHIN(toff, 1, 15)) + DEBUG_ECHOLNPGM(".toff: ", toff); + else { + SERIAL_ECHOLNPGM("?O out of range (1..15)"); + err = true; + } + } + + int8_t hend = int8_t(parser.intval('P', -127)); + if (hend != -127) { + if (WITHIN(hend, -3, 12)) + DEBUG_ECHOLNPGM(".hend: ", hend); + else { + SERIAL_ECHOLNPGM("?P out of range (-3..12)"); + err = true; + } + } + + int8_t hstrt = int8_t(parser.intval('S', -127)); + if (hstrt != -127) { + if (WITHIN(hstrt, 1, 8)) + DEBUG_ECHOLNPGM(".hstrt: ", hstrt); + else { + SERIAL_ECHOLNPGM("?S out of range (1..8)"); + err = true; + } + } + + if (err) return; + + #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) + const int8_t index = parser.byteval('I'); + #else + constexpr int8_t index = -1; + #endif + + auto make_chopper_timing = [](chopper_timing_t bct, const int8_t toff, const int8_t hend, const int8_t hstrt) { + chopper_timing_t uct = bct; + if (toff != -127) uct.toff = toff; + if (hend != -127) uct.hend = hend; + if (hstrt != -127) uct.hstrt = hstrt; + return uct; + }; + + #define TMC_SET_CHOPPER_TIME(Q) stepper##Q.set_chopper_times(make_chopper_timing(CHOPPER_TIMING_##Q, toff, hend, hstrt)) + + #if AXIS_IS_TMC(E0) || AXIS_IS_TMC(E1) || AXIS_IS_TMC(E2) || AXIS_IS_TMC(E3) || AXIS_IS_TMC(E4) || AXIS_IS_TMC(E5) || AXIS_IS_TMC(E6) || AXIS_IS_TMC(E7) + #define HAS_E_CHOPPER 1 + int8_t eindex = -1; + #endif + bool report = true; + LOOP_LOGICAL_AXES(i) if (parser.seen_test(axis_codes[i])) { + report = false; + + // Get the chopper timing for the specified axis and index + switch (i) { + default: // A specified axis isn't Trinamic + SERIAL_ECHOLNPGM("?Axis ", AS_CHAR(axis_codes[i]), " has no TMC drivers."); + break; + + #if AXIS_IS_TMC(X) || AXIS_IS_TMC(X2) + case X_AXIS: + #if AXIS_IS_TMC(X) + if (index <= 0) TMC_SET_CHOPPER_TIME(X); + #endif + #if AXIS_IS_TMC(X2) + if (index < 0 || index == 1) TMC_SET_CHOPPER_TIME(X2); + #endif + break; + #endif + + #if AXIS_IS_TMC(Y) || AXIS_IS_TMC(Y2) + case Y_AXIS: + #if AXIS_IS_TMC(Y) + if (index <= 0) TMC_SET_CHOPPER_TIME(Y); + #endif + #if AXIS_IS_TMC(Y2) + if (index < 0 || index == 1) TMC_SET_CHOPPER_TIME(Y2); + #endif + break; + #endif + + #if AXIS_IS_TMC(Z) || AXIS_IS_TMC(Z2) || AXIS_IS_TMC(Z3) || AXIS_IS_TMC(Z4) + case Z_AXIS: + #if AXIS_IS_TMC(Z) + if (index <= 0) TMC_SET_CHOPPER_TIME(Z); + #endif + #if AXIS_IS_TMC(Z2) + if (index < 0 || index == 1) TMC_SET_CHOPPER_TIME(Z2); + #endif + #if AXIS_IS_TMC(Z3) + if (index < 0 || index == 2) TMC_SET_CHOPPER_TIME(Z3); + #endif + #if AXIS_IS_TMC(Z4) + if (index < 0 || index == 3) TMC_SET_CHOPPER_TIME(Z4); + #endif + break; + #endif + + #if AXIS_IS_TMC(I) + case I_AXIS: TMC_SET_CHOPPER_TIME(I); break; + #endif + #if AXIS_IS_TMC(J) + case J_AXIS: TMC_SET_CHOPPER_TIME(J); break; + #endif + #if AXIS_IS_TMC(K) + case K_AXIS: TMC_SET_CHOPPER_TIME(K); break; + #endif + + #if HAS_E_CHOPPER + case E_AXIS: { + #if AXIS_IS_TMC(E0) + if (eindex <= 0) TMC_SET_CHOPPER_TIME(E0); + #endif + #if AXIS_IS_TMC(E1) + if (eindex < 0 || eindex == 1) TMC_SET_CHOPPER_TIME(E1); + #endif + #if AXIS_IS_TMC(E2) + if (eindex < 0 || eindex == 2) TMC_SET_CHOPPER_TIME(E2); + #endif + #if AXIS_IS_TMC(E3) + if (eindex < 0 || eindex == 3) TMC_SET_CHOPPER_TIME(E3); + #endif + #if AXIS_IS_TMC(E4) + if (eindex < 0 || eindex == 4) TMC_SET_CHOPPER_TIME(E4); + #endif + #if AXIS_IS_TMC(E5) + if (eindex < 0 || eindex == 5) TMC_SET_CHOPPER_TIME(E5); + #endif + #if AXIS_IS_TMC(E6) + if (eindex < 0 || eindex == 6) TMC_SET_CHOPPER_TIME(E6); + #endif + #if AXIS_IS_TMC(E7) + if (eindex < 0 || eindex == 7) TMC_SET_CHOPPER_TIME(E7); + #endif + } break; + #endif + } + } + + if (report) { + #define TMC_SAY_CHOPPER_TIME(Q) tmc_print_chopper_time(stepper##Q) + #if AXIS_IS_TMC(X) + TMC_SAY_CHOPPER_TIME(X); + #endif + #if AXIS_IS_TMC(X2) + TMC_SAY_CHOPPER_TIME(X2); + #endif + #if AXIS_IS_TMC(Y) + TMC_SAY_CHOPPER_TIME(Y); + #endif + #if AXIS_IS_TMC(Y2) + TMC_SAY_CHOPPER_TIME(Y2); + #endif + #if AXIS_IS_TMC(Z) + TMC_SAY_CHOPPER_TIME(Z); + #endif + #if AXIS_IS_TMC(Z2) + TMC_SAY_CHOPPER_TIME(Z2); + #endif + #if AXIS_IS_TMC(Z3) + TMC_SAY_CHOPPER_TIME(Z3); + #endif + #if AXIS_IS_TMC(Z4) + TMC_SAY_CHOPPER_TIME(Z4); + #endif + #if AXIS_IS_TMC(I) + TMC_SAY_CHOPPER_TIME(I); + #endif + #if AXIS_IS_TMC(J) + TMC_SAY_CHOPPER_TIME(J); + #endif + #if AXIS_IS_TMC(K) + TMC_SAY_CHOPPER_TIME(K); + #endif + #if AXIS_IS_TMC(E0) + TMC_SAY_CHOPPER_TIME(E0); + #endif + #if AXIS_IS_TMC(E1) + TMC_SAY_CHOPPER_TIME(E1); + #endif + #if AXIS_IS_TMC(E2) + TMC_SAY_CHOPPER_TIME(E2); + #endif + #if AXIS_IS_TMC(E3) + TMC_SAY_CHOPPER_TIME(E3); + #endif + #if AXIS_IS_TMC(E4) + TMC_SAY_CHOPPER_TIME(E4); + #endif + #if AXIS_IS_TMC(E5) + TMC_SAY_CHOPPER_TIME(E5); + #endif + #if AXIS_IS_TMC(E6) + TMC_SAY_CHOPPER_TIME(E6); + #endif + #if AXIS_IS_TMC(E7) + TMC_SAY_CHOPPER_TIME(E7); + #endif + } +} + +#endif // HAS_TRINAMIC_CONFIG diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index f62c9e3fa6..d0fcd6be7d 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -152,6 +152,7 @@ int8_t GcodeSuite::get_target_extruder_from_command() { int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) { const int8_t e = parser.intval('T', dval); if (WITHIN(e, 0, E_STEPPERS - 1)) return e; + if (dval == -2) return dval; SERIAL_ECHO_START(); SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum); @@ -163,7 +164,7 @@ int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) { } /** - * Set XYZIJKE destination and feedrate from the current GCode command + * Set XYZ...E destination and feedrate from the current GCode command * * - Set destination from included axis codes * - Set to current for missing axis codes @@ -1024,6 +1025,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) { #if USE_SENSORLESS case 914: M914(); break; // M914: Set StallGuard sensitivity. #endif + case 919: M919(); break; // M919: Set stepper Chopper Times #endif #if HAS_L64XX diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index bbfb31a3fe..78dd0bc680 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -284,7 +284,7 @@ * M871 - Print/reset/clear first layer temperature offset values. (Requires PTC_PROBE, PTC_BED, or PTC_HOTEND) * M876 - Handle Prompt Response. (Requires HOST_PROMPT_SUPPORT and not EMERGENCY_PARSER) * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE) - * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) + * M906 - Set or get motor current in milliamps using axis codes XYZE, etc. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660 or L6470) * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots) * M908 - Control digital trimpot directly. (Requires HAS_MOTOR_CURRENT_DAC or DIGIPOTSS_PIN) * M909 - Print digipot/DAC current value. (Requires HAS_MOTOR_CURRENT_DAC) @@ -296,6 +296,7 @@ * M916 - L6470 tuning: Increase KVAL_HOLD until thermal warning. (Requires at least one _DRIVER_TYPE L6470) * M917 - L6470 tuning: Find minimum current thresholds. (Requires at least one _DRIVER_TYPE L6470) * M918 - L6470 tuning: Increase speed until max or error. (Requires at least one _DRIVER_TYPE L6470) + * M919 - Get or Set motor Chopper Times (time_off, hysteresis_end, hysteresis_start) using axis codes XYZE, etc. If no parameters are given, report. (Requires at least one _DRIVER_TYPE defined as TMC2130/2160/5130/5160/2208/2209/2660) * M951 - Set Magnetic Parking Extruder parameters. (Requires MAGNETIC_PARKING_EXTRUDER) * M3426 - Read MCP3426 ADC over I2C. (Requires HAS_MCP3426_ADC) * M7219 - Control Max7219 Matrix LEDs. (Requires MAX7219_GCODE) @@ -349,7 +350,7 @@ public: static axis_bits_t axis_relative; - static inline bool axis_is_relative(const AxisEnum a) { + static bool axis_is_relative(const AxisEnum a) { #if HAS_EXTRUDERS if (a == E_AXIS) { if (TEST(axis_relative, E_MODE_REL)) return true; @@ -358,7 +359,7 @@ public: #endif return TEST(axis_relative, a); } - static inline void set_relative_mode(const bool rel) { + static void set_relative_mode(const bool rel) { axis_relative = rel ? (0 LOGICAL_AXIS_GANG( | _BV(REL_E), | _BV(REL_X), | _BV(REL_Y), | _BV(REL_Z), @@ -366,11 +367,11 @@ public: )) : 0; } #if HAS_EXTRUDERS - static inline void set_e_relative() { + static void set_e_relative() { CBI(axis_relative, E_MODE_ABS); SBI(axis_relative, E_MODE_REL); } - static inline void set_e_absolute() { + static void set_e_absolute() { CBI(axis_relative, E_MODE_REL); SBI(axis_relative, E_MODE_ABS); } @@ -403,7 +404,7 @@ public: static void report_echo_start(const bool forReplay); static void report_heading(const bool forReplay, FSTR_P const fstr, const bool eol=true); - static inline void report_heading_etc(const bool forReplay, FSTR_P const fstr, const bool eol=true) { + static void report_heading_etc(const bool forReplay, FSTR_P const fstr, const bool eol=true) { report_heading(forReplay, fstr, eol); report_echo_start(forReplay); } @@ -420,20 +421,20 @@ public: static void process_subcommands_now(FSTR_P fgcode); static void process_subcommands_now(char * gcode); - static inline void home_all_axes(const bool keep_leveling=false) { + static void home_all_axes(const bool keep_leveling=false) { process_subcommands_now(keep_leveling ? FPSTR(G28_STR) : TERN(CAN_SET_LEVELING_AFTER_G28, F("G28L0"), FPSTR(G28_STR))); } #if EITHER(HAS_AUTO_REPORTING, HOST_KEEPALIVE_FEATURE) static bool autoreport_paused; - static inline bool set_autoreport_paused(const bool p) { + static bool set_autoreport_paused(const bool p) { const bool was = autoreport_paused; autoreport_paused = p; return was; } #else static constexpr bool autoreport_paused = false; - static inline bool set_autoreport_paused(const bool) { return false; } + static bool set_autoreport_paused(const bool) { return false; } #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) @@ -453,7 +454,7 @@ public: static uint8_t host_keepalive_interval; static void host_keepalive(); - static inline bool host_keepalive_is_paused() { return busy_state >= PAUSED_FOR_USER; } + static bool host_keepalive_is_paused() { return busy_state >= PAUSED_FOR_USER; } #define KEEPALIVE_STATE(N) REMEMBER(_KA_, gcode.busy_state, gcode.N) #else @@ -1140,6 +1141,7 @@ private: static void M914(); static void M914_report(const bool forReplay=true); #endif + static void M919(); #endif #if HAS_L64XX diff --git a/Marlin/src/gcode/lcd/M0_M1.cpp b/Marlin/src/gcode/lcd/M0_M1.cpp index 6e3b84c020..6a93861407 100644 --- a/Marlin/src/gcode/lcd/M0_M1.cpp +++ b/Marlin/src/gcode/lcd/M0_M1.cpp @@ -36,6 +36,7 @@ #elif ENABLED(EXTENSIBLE_UI) #include "../../lcd/extui/ui_api.h" #elif ENABLED(DWIN_CREALITY_LCD_ENHANCED) + #include "../../lcd/e3v2/enhanced/dwin_popup.h" #include "../../lcd/e3v2/enhanced/dwin.h" #endif diff --git a/Marlin/src/gcode/motion/G5.cpp b/Marlin/src/gcode/motion/G5.cpp index 2c98fae845..316a59b650 100644 --- a/Marlin/src/gcode/motion/G5.cpp +++ b/Marlin/src/gcode/motion/G5.cpp @@ -24,6 +24,10 @@ #if ENABLED(BEZIER_CURVE_SUPPORT) +#if AXIS_COLLISION('I') || AXIS_COLLISION('J') + #error "G5 parameter collision with axis name." +#endif + #include "../../module/motion.h" #include "../../module/planner_bezier.h" diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index 83fda54836..bd08467298 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -126,7 +126,7 @@ public: } // Set the flag and pointer for a parameter - static inline void set(const char c, char * const ptr) { + static void set(const char c, char * const ptr) { const uint8_t ind = LETTER_BIT(c); if (ind >= COUNT(param)) return; // Only A-Z SBI32(codebits, ind); // parameter exists @@ -142,7 +142,7 @@ public: // Code seen bit was set. If not found, value_ptr is unchanged. // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static inline bool seen(const char c) { + static bool seen(const char c) { const uint8_t ind = LETTER_BIT(c); if (ind >= COUNT(param)) return false; // Only A-Z const bool b = TEST32(codebits, ind); @@ -183,7 +183,7 @@ public: } #endif - static inline bool seen_any() { return !!codebits; } + static bool seen_any() { return !!codebits; } FORCE_INLINE static bool seen_test(const char c) { return TEST32(codebits, LETTER_BIT(c)); } @@ -204,19 +204,19 @@ public: // Code is found in the string. If not found, value_ptr is unchanged. // This allows "if (seen('A')||seen('B'))" to use the last-found value. - static inline bool seen(const char c) { + static bool seen(const char c) { char *p = strgchr(command_args, c); const bool b = !!p; if (b) value_ptr = valid_number(&p[1]) ? &p[1] : nullptr; return b; } - static inline bool seen_any() { return *command_args == '\0'; } + static bool seen_any() { return *command_args == '\0'; } FORCE_INLINE static bool seen_test(const char c) { return (bool)strgchr(command_args, c); } // At least one of a list of code letters was seen - static inline bool seen(const char * const str) { + static bool seen(const char * const str) { for (uint8_t i = 0; const char c = str[i]; i++) if (seen_test(c)) return true; return false; @@ -225,7 +225,7 @@ public: #endif // !FASTER_GCODE_PARSER // Seen any axis parameter - static inline bool seen_axis() { return seen(LOGICAL_AXES_STRING); } + static bool seen_axis() { return seen(LOGICAL_AXES_STRING); } #if ENABLED(GCODE_QUOTED_STRINGS) static char* unescape_string(char* &src); @@ -243,19 +243,19 @@ public: #endif // Test whether the parsed command matches the input - static inline bool is_command(const char ltr, const uint16_t num) { return command_letter == ltr && codenum == num; } + static bool is_command(const char ltr, const uint16_t num) { return command_letter == ltr && codenum == num; } // The code value pointer was set FORCE_INLINE static bool has_value() { return !!value_ptr; } // Seen a parameter with a value - static inline bool seenval(const char c) { return seen(c) && has_value(); } + static bool seenval(const char c) { return seen(c) && has_value(); } // The value as a string - static inline char* value_string() { return value_ptr; } + static char* value_string() { return value_ptr; } // Float removes 'E' to prevent scientific notation interpretation - static inline float value_float() { + static float value_float() { if (value_ptr) { char *e = value_ptr; for (;;) { @@ -275,31 +275,31 @@ public: } // Code value as a long or ulong - static inline int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; } - static inline uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; } + static int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; } + static uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; } // Code value for use as time - static inline millis_t value_millis() { return value_ulong(); } - static inline millis_t value_millis_from_seconds() { return (millis_t)SEC_TO_MS(value_float()); } + static millis_t value_millis() { return value_ulong(); } + static millis_t value_millis_from_seconds() { return (millis_t)SEC_TO_MS(value_float()); } // Reduce to fewer bits - static inline int16_t value_int() { return (int16_t)value_long(); } - static inline uint16_t value_ushort() { return (uint16_t)value_long(); } - static inline uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } + static int16_t value_int() { return (int16_t)value_long(); } + static uint16_t value_ushort() { return (uint16_t)value_long(); } + static uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); } // Bool is true with no value or non-zero - static inline bool value_bool() { return !has_value() || !!value_byte(); } + static bool value_bool() { return !has_value() || !!value_byte(); } // Units modes: Inches, Fahrenheit, Kelvin #if ENABLED(INCH_MODE_SUPPORT) - static inline float mm_to_linear_unit(const_float_t mm) { return mm / linear_unit_factor; } - static inline float mm_to_volumetric_unit(const_float_t mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } + static float mm_to_linear_unit(const_float_t mm) { return mm / linear_unit_factor; } + static float mm_to_volumetric_unit(const_float_t mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); } // Init linear units by constructor GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } - static inline void set_input_linear_units(const LinearUnit units) { + static void set_input_linear_units(const LinearUnit units) { switch (units) { default: case LINEARUNIT_MM: linear_unit_factor = 1.0f; break; @@ -308,7 +308,7 @@ public: volumetric_unit_factor = POW(linear_unit_factor, 3); } - static inline float axis_unit_factor(const AxisEnum axis) { + static float axis_unit_factor(const AxisEnum axis) { return ( #if HAS_EXTRUDERS axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor @@ -318,46 +318,46 @@ public: ); } - static inline float linear_value_to_mm(const_float_t v) { return v * linear_unit_factor; } - static inline float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } - static inline float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } + static float linear_value_to_mm(const_float_t v) { return v * linear_unit_factor; } + static float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); } + static float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); } #else - static inline float mm_to_linear_unit(const_float_t mm) { return mm; } - static inline float mm_to_volumetric_unit(const_float_t mm) { return mm; } + static float mm_to_linear_unit(const_float_t mm) { return mm; } + static float mm_to_volumetric_unit(const_float_t mm) { return mm; } - static inline float linear_value_to_mm(const_float_t v) { return v; } - static inline float axis_value_to_mm(const AxisEnum, const float v) { return v; } - static inline float per_axis_value(const AxisEnum, const float v) { return v; } + static float linear_value_to_mm(const_float_t v) { return v; } + static float axis_value_to_mm(const AxisEnum, const float v) { return v; } + static float per_axis_value(const AxisEnum, const float v) { return v; } #endif - static inline bool using_inch_units() { return mm_to_linear_unit(1.0f) != 1.0f; } + static bool using_inch_units() { return mm_to_linear_unit(1.0f) != 1.0f; } #define IN_TO_MM(I) ((I) * 25.4f) #define MM_TO_IN(M) ((M) / 25.4f) #define LINEAR_UNIT(V) parser.mm_to_linear_unit(V) #define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V) - static inline float value_linear_units() { return linear_value_to_mm(value_float()); } - static inline float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); } - static inline float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); } + static float value_linear_units() { return linear_value_to_mm(value_float()); } + static float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); } + static float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); } #if ENABLED(TEMPERATURE_UNITS_SUPPORT) - static inline void set_input_temp_units(const TempUnit units) { input_temp_units = units; } + static void set_input_temp_units(const TempUnit units) { input_temp_units = units; } - static inline char temp_units_code() { + static char temp_units_code() { return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; } - static inline FSTR_P temp_units_name() { + static FSTR_P temp_units_name() { return input_temp_units == TEMPUNIT_K ? F("Kelvin") : input_temp_units == TEMPUNIT_F ? F("Fahrenheit") : F("Celsius"); } #if HAS_LCD_MENU && DISABLED(DISABLE_M503) - static inline float to_temp_units(celsius_t c) { + static float to_temp_units(celsius_t c) { switch (input_temp_units) { default: case TEMPUNIT_C: return c; @@ -368,7 +368,7 @@ public: #endif // HAS_LCD_MENU && !DISABLE_M503 - static inline celsius_t value_celsius() { + static celsius_t value_celsius() { float f = value_float(); switch (input_temp_units) { default: @@ -379,7 +379,7 @@ public: return LROUND(f); } - static inline celsius_t value_celsius_diff() { + static celsius_t value_celsius_diff() { float f = value_float(); switch (input_temp_units) { default: @@ -392,35 +392,35 @@ public: #else // !TEMPERATURE_UNITS_SUPPORT - static inline float to_temp_units(int16_t c) { return (float)c; } + static float to_temp_units(int16_t c) { return (float)c; } - static inline celsius_t value_celsius() { return value_int(); } - static inline celsius_t value_celsius_diff() { return value_int(); } + static celsius_t value_celsius() { return value_int(); } + static celsius_t value_celsius_diff() { return value_int(); } #endif // !TEMPERATURE_UNITS_SUPPORT - static inline feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); } + static feedRate_t value_feedrate() { return MMM_TO_MMS(value_linear_units()); } void unknown_command_warning(); // Provide simple value accessors with default option - static inline char* stringval(const char c, char * const dval=nullptr) { return seenval(c) ? value_string() : dval; } - static inline float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } - static inline bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } - static inline uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } - static inline int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } - static inline uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } - static inline int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } - static inline uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } - static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } - static inline float axisunitsval(const char c, const AxisEnum a, const float dval=0) + static char* stringval(const char c, char * const dval=nullptr) { return seenval(c) ? value_string() : dval; } + static float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; } + static bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); } + static uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; } + static int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; } + static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; } + static int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; } + static uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; } + static float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; } + static float axisunitsval(const char c, const AxisEnum a, const float dval=0) { return seenval(c) ? value_axis_units(a) : dval; } - static inline celsius_t celsiusval(const char c, const celsius_t dval=0) { return seenval(c) ? value_celsius() : dval; } - static inline feedRate_t feedrateval(const char c, const feedRate_t dval=0) { return seenval(c) ? value_feedrate() : dval; } + static celsius_t celsiusval(const char c, const celsius_t dval=0) { return seenval(c) ? value_celsius() : dval; } + static feedRate_t feedrateval(const char c, const feedRate_t dval=0) { return seenval(c) ? value_feedrate() : dval; } #if ENABLED(MARLIN_DEV_MODE) - static inline uint8_t* hex_adr_val(const char c, uint8_t * const dval=nullptr) { + static uint8_t* hex_adr_val(const char c, uint8_t * const dval=nullptr) { if (!seen(c) || *value_ptr != 'x') return dval; uint8_t *out = nullptr; for (char *vp = value_ptr + 1; HEXCHR(*vp) >= 0; vp++) @@ -428,7 +428,7 @@ public: return out; } - static inline uint16_t hex_val(const char c, uint16_t const dval=0) { + static uint16_t hex_val(const char c, uint16_t const dval=0) { if (!seen(c) || *value_ptr != 'x') return dval; uint16_t out = 0; for (char *vp = value_ptr + 1; HEXCHR(*vp) >= 0; vp++) diff --git a/Marlin/src/gcode/queue.h b/Marlin/src/gcode/queue.h index 1847246d9f..429cf6d881 100644 --- a/Marlin/src/gcode/queue.h +++ b/Marlin/src/gcode/queue.h @@ -129,14 +129,14 @@ public: * Don't inject comments or use leading spaces! * Aborts the current PROGMEM queue so only use for one or two commands. */ - static inline void inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; } - static inline void inject(FSTR_P const fgcode) { inject_P(FTOP(fgcode)); } + static void inject_P(PGM_P const pgcode) { injected_commands_P = pgcode; } + static void inject(FSTR_P const fgcode) { inject_P(FTOP(fgcode)); } /** * Enqueue command(s) to run from SRAM. Drained by process_injected_command(). * Aborts the current SRAM queue so only use for one or two commands. */ - static inline void inject(const char * const gcode) { + static void inject(const char * const gcode) { strncpy(injected_commands, gcode, sizeof(injected_commands) - 1); } @@ -161,7 +161,7 @@ public: * Enqueue from program memory and return only when commands are actually enqueued */ static void enqueue_now_P(PGM_P const pcmd); - static inline void enqueue_now(FSTR_P const fcmd) { enqueue_now_P(FTOP(fcmd)); } + static void enqueue_now(FSTR_P const fcmd) { enqueue_now_P(FTOP(fcmd)); } /** * Check whether there are any commands yet to be executed @@ -195,7 +195,7 @@ public: * P Planner space remaining * B Block queue space remaining */ - static inline void ok_to_send() { ring_buffer.ok_to_send(); } + static void ok_to_send() { ring_buffer.ok_to_send(); } /** * Clear the serial line and request a resend of @@ -206,7 +206,7 @@ public: /** * (Re)Set the current line number for the last received command */ - static inline void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; } + static void set_current_line_number(long n) { serial_state[ring_buffer.command_port().index].last_N = n; } #if ENABLED(BUFFER_MONITORING) @@ -240,7 +240,7 @@ public: static void auto_report_buffer_statistics(); - static inline void set_auto_report_interval(uint8_t v) { + static void set_auto_report_interval(uint8_t v) { NOMORE(v, 60); auto_buffer_report_interval = v; next_buffer_report_ms = millis() + 1000UL * v; diff --git a/Marlin/src/gcode/temp/M303.cpp b/Marlin/src/gcode/temp/M303.cpp index f823aefbed..a43575933b 100644 --- a/Marlin/src/gcode/temp/M303.cpp +++ b/Marlin/src/gcode/temp/M303.cpp @@ -77,10 +77,17 @@ void GcodeSuite::M303() { return; } - const celsius_t temp = parser.celsiusval('S', default_temp); - const int c = parser.intval('C', 5); + const bool seenC = parser.seenval('C'); + const int c = seenC ? parser.value_int() : 5; + const bool seenS = parser.seenval('S'); + const celsius_t temp = seenS ? parser.value_celsius() : default_temp; const bool u = parser.boolval('U'); + #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) + if (seenC) HMI_data.PidCycles = c; + if (seenS) { if (hid == H_BED) HMI_data.BedPidT = temp; else HMI_data.HotendPidT = temp; } + #endif + #if DISABLED(BUSY_WHILE_HEATING) KEEPALIVE_STATE(NOT_BUSY); #endif diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 9e050101aa..8393f3a53c 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -207,8 +207,11 @@ #define IS_ULTIPANEL 1 #define U8GLIB_SSD1309 #define LCD_RESET_PIN LCD_PINS_D6 // This controller need a reset pin - #define ENCODER_PULSES_PER_STEP 2 - #define ENCODER_STEPS_PER_MENU_ITEM 2 + #define ENCODER_PULSES_PER_STEP 4 + #define ENCODER_STEPS_PER_MENU_ITEM 1 + #ifndef PCA9632 + #define PCA9632 + #endif #elif ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) @@ -693,6 +696,15 @@ #define HAS_Y_AXIS 1 #if LINEAR_AXES >= XYZ #define HAS_Z_AXIS 1 + #if LINEAR_AXES >= 4 + #define HAS_I_AXIS 1 + #if LINEAR_AXES >= 5 + #define HAS_J_AXIS 1 + #if LINEAR_AXES >= 6 + #define HAS_K_AXIS 1 + #endif + #endif + #endif #endif #endif @@ -1215,13 +1227,13 @@ #if HAS_Z_AXIS && !defined(INVERT_Z_DIR) #define INVERT_Z_DIR false #endif -#if LINEAR_AXES >= 4 && !defined(INVERT_I_DIR) +#if HAS_I_AXIS && !defined(INVERT_I_DIR) #define INVERT_I_DIR false #endif -#if LINEAR_AXES >= 5 && !defined(INVERT_J_DIR) +#if HAS_J_AXIS && !defined(INVERT_J_DIR) #define INVERT_J_DIR false #endif -#if LINEAR_AXES >= 6 && !defined(INVERT_K_DIR) +#if HAS_K_AXIS && !defined(INVERT_K_DIR) #define INVERT_K_DIR false #endif #if HAS_EXTRUDERS && !defined(INVERT_E_DIR) @@ -1411,7 +1423,7 @@ #endif #endif -#if ANY(USE_XMIN_PLUG, USE_YMIN_PLUG, USE_ZMIN_PLUG, USE_XMAX_PLUG, USE_YMAX_PLUG, USE_ZMAX_PLUG) +#if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) #define HAS_ENDSTOPS 1 #define COORDINATE_OKAY(N,L,H) WITHIN(N,L,H) #else diff --git a/Marlin/src/inc/Conditionals_adv.h b/Marlin/src/inc/Conditionals_adv.h index 9864b8715c..8c6e79f36a 100644 --- a/Marlin/src/inc/Conditionals_adv.h +++ b/Marlin/src/inc/Conditionals_adv.h @@ -1006,7 +1006,7 @@ #endif // AVR are (usually) too limited in resources to store the configuration into the binary -#if !defined(FORCE_CONFIG_EMBED) && (defined(__AVR__) || DISABLED(SDSUPPORT) || EITHER(SDCARD_READONLY, DISABLE_M503)) +#if ENABLED(CONFIGURATION_EMBEDDING) && !defined(FORCE_CONFIG_EMBED) && (defined(__AVR__) || DISABLED(SDSUPPORT) || EITHER(SDCARD_READONLY, DISABLE_M503)) #undef CONFIGURATION_EMBEDDING #define CANNOT_EMBED_CONFIGURATION defined(__AVR__) #endif diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index a5c9d20eda..a3cb84adb1 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -97,13 +97,13 @@ #else #undef CONTROLLER_FAN_USE_Z_ONLY #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #define I_MAX_LENGTH (I_MAX_POS - (I_MIN_POS)) #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #define J_MAX_LENGTH (J_MAX_POS - (J_MIN_POS)) #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #define K_MAX_LENGTH (K_MAX_POS - (K_MIN_POS)) #endif @@ -114,13 +114,13 @@ #if HAS_Y_AXIS && !defined(Y_BED_SIZE) #define Y_BED_SIZE Y_MAX_LENGTH #endif -#if LINEAR_AXES >= 4 && !defined(I_BED_SIZE) +#if HAS_I_AXIS && !defined(I_BED_SIZE) #define I_BED_SIZE I_MAX_LENGTH #endif -#if LINEAR_AXES >= 5 && !defined(J_BED_SIZE) +#if HAS_J_AXIS && !defined(J_BED_SIZE) #define J_BED_SIZE J_MAX_LENGTH #endif -#if LINEAR_AXES >= 6 && !defined(K_BED_SIZE) +#if HAS_K_AXIS && !defined(K_BED_SIZE) #define K_BED_SIZE K_MAX_LENGTH #endif @@ -134,13 +134,13 @@ #if HAS_Y_AXIS #define _Y_HALF_BED ((Y_BED_SIZE) / 2) #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #define _I_HALF_IMAX ((I_BED_SIZE) / 2) #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #define _J_HALF_JMAX ((J_BED_SIZE) / 2) #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #define _K_HALF_KMAX ((K_BED_SIZE) / 2) #endif @@ -149,13 +149,13 @@ #define Y_CENTER TERN(BED_CENTER_AT_0_0, 0, _Y_HALF_BED) #define XY_CENTER { X_CENTER, Y_CENTER } #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #define I_CENTER TERN(BED_CENTER_AT_0_0, 0, _I_HALF_BED) #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #define J_CENTER TERN(BED_CENTER_AT_0_0, 0, _J_HALF_BED) #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #define K_CENTER TERN(BED_CENTER_AT_0_0, 0, _K_HALF_BED) #endif @@ -166,15 +166,15 @@ #define Y_MIN_BED (Y_CENTER - _Y_HALF_BED) #define Y_MAX_BED (Y_MIN_BED + Y_BED_SIZE) #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #define I_MINIM (I_CENTER - _I_HALF_BED_SIZE) #define I_MAXIM (I_MINIM + I_BED_SIZE) #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #define J_MINIM (J_CENTER - _J_HALF_BED_SIZE) #define J_MAXIM (J_MINIM + J_BED_SIZE) #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #define K_MINIM (K_CENTER - _K_HALF_BED_SIZE) #define K_MAXIM (K_MINIM + K_BED_SIZE) #endif @@ -253,21 +253,21 @@ #define Z_HOME_POS TERN(Z_HOME_TO_MIN, Z_MIN_POS, Z_MAX_POS) #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #ifdef MANUAL_I_HOME_POS #define I_HOME_POS MANUAL_I_HOME_POS #else #define I_HOME_POS TERN(I_HOME_TO_MIN, I_MIN_POS, I_MAX_POS) #endif #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #ifdef MANUAL_J_HOME_POS #define J_HOME_POS MANUAL_J_HOME_POS #else #define J_HOME_POS TERN(J_HOME_TO_MIN, J_MIN_POS, J_MAX_POS) #endif #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #ifdef MANUAL_K_HOME_POS #define K_HOME_POS MANUAL_K_HOME_POS #else @@ -745,7 +745,7 @@ #define LIB_INTERNAL_MAX31865 1 #endif -#endif //HAS_MAX_TC +#endif // HAS_MAX_TC /** * X_DUAL_ENDSTOPS endstop reassignment @@ -1620,7 +1620,7 @@ #endif #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #if PIN_EXISTS(I_ENABLE) || AXIS_IS_L64XX(I) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(I)) #define HAS_I_ENABLE 1 #endif @@ -1640,7 +1640,7 @@ #undef DISABLE_INACTIVE_I #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #if PIN_EXISTS(J_ENABLE) || AXIS_IS_L64XX(J) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(J)) #define HAS_J_ENABLE 1 #endif @@ -1660,7 +1660,7 @@ #undef DISABLE_INACTIVE_J #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #if PIN_EXISTS(K_ENABLE) || AXIS_IS_L64XX(K) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(K)) #define HAS_K_ENABLE 1 #endif @@ -2395,28 +2395,28 @@ // ADC Temp Sensors (Thermistor or Thermocouple with amplifier ADC interface) // #define HAS_ADC_TEST(P) (PIN_EXISTS(TEMP_##P) && TEMP_SENSOR_##P != 0 && NONE(TEMP_SENSOR_##P##_IS_MAX_TC, TEMP_SENSOR_##P##_IS_DUMMY)) -#if HAS_ADC_TEST(0) +#if HOTENDS > 0 && HAS_ADC_TEST(0) #define HAS_TEMP_ADC_0 1 #endif -#if HAS_ADC_TEST(1) +#if HOTENDS > 1 && HAS_ADC_TEST(1) #define HAS_TEMP_ADC_1 1 #endif -#if HAS_ADC_TEST(2) +#if HOTENDS > 2 && HAS_ADC_TEST(2) #define HAS_TEMP_ADC_2 1 #endif -#if HAS_ADC_TEST(3) +#if HOTENDS > 3 && HAS_ADC_TEST(3) #define HAS_TEMP_ADC_3 1 #endif -#if HAS_ADC_TEST(4) +#if HOTENDS > 4 && HAS_ADC_TEST(4) #define HAS_TEMP_ADC_4 1 #endif -#if HAS_ADC_TEST(5) +#if HOTENDS > 5 && HAS_ADC_TEST(5) #define HAS_TEMP_ADC_5 1 #endif -#if HAS_ADC_TEST(6) +#if HOTENDS > 6 && HAS_ADC_TEST(6) #define HAS_TEMP_ADC_6 1 #endif -#if HAS_ADC_TEST(7) +#if HOTENDS > 7 && HAS_ADC_TEST(7) #define HAS_TEMP_ADC_7 1 #endif #if HAS_ADC_TEST(BED) @@ -2549,13 +2549,13 @@ #endif // Thermal protection -#if BOTH(HAS_HEATED_BED, THERMAL_PROTECTION_BED) - #define HAS_THERMALLY_PROTECTED_BED 1 +#if !HAS_HEATED_BED + #undef THERMAL_PROTECTION_BED #endif #if ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0 #define WATCH_HOTENDS 1 #endif -#if HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0 +#if ENABLED(THERMAL_PROTECTION_BED) && WATCH_BED_TEMP_PERIOD > 0 #define WATCH_BED 1 #endif #if BOTH(HAS_HEATED_CHAMBER, THERMAL_PROTECTION_CHAMBER) && WATCH_CHAMBER_TEMP_PERIOD > 0 @@ -2567,7 +2567,7 @@ #if (ENABLED(THERMAL_PROTECTION_HOTENDS) || !EXTRUDERS) \ && (ENABLED(THERMAL_PROTECTION_BED) || !HAS_HEATED_BED) \ && (ENABLED(THERMAL_PROTECTION_CHAMBER) || !HAS_HEATED_CHAMBER) \ - && (ENABLED(THERMAL_PROTECTION_COOLER) || !HAS_COOLER) + && (ENABLED(THERMAL_PROTECTION_COOLER) || !HAS_COOLER) #define THERMALLY_SAFE 1 #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index da4e1023e0..9aa7c16c43 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -824,7 +824,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL) #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)." - #elif HAS_MARLINUI_U8GLIB + #elif HAS_MARLINUI_U8GLIB || IS_DWIN_MARLINUI #error "LCD_PROGRESS_BAR does not apply to graphical displays." #elif ENABLED(FILAMENT_LCD_DISPLAY) #error "LCD_PROGRESS_BAR and FILAMENT_LCD_DISPLAY are not fully compatible. Comment out this line to use both." @@ -1416,7 +1416,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * Allow only extra axis codes that do not conflict with G-code parameter names */ -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W' #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'." #elif !defined(I_MIN_POS) || !defined(I_MAX_POS) @@ -1427,7 +1427,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "I_ENABLE_ON is required for your I driver with LINEAR_AXES >= 4." #endif #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #if AXIS5_NAME == AXIS4_NAME #error "AXIS5_NAME must be unique." #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W' @@ -1440,7 +1440,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "J_ENABLE_ON is required for your J driver with LINEAR_AXES >= 5." #endif #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME #error "AXIS6_NAME must be unique." #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W' @@ -1995,8 +1995,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #endif #endif -#if HAS_FAN0 && CONTROLLER_FAN_PIN == FAN_PIN - #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." +#if HAS_FAN0 + #if CONTROLLER_FAN_PIN == FAN_PIN + #error "You cannot set CONTROLLER_FAN_PIN equal to FAN_PIN." + #elif ENABLED(FAN_SOFT_PWM_REQUIRED) && DISABLED(FAN_SOFT_PWM) + #error "FAN_SOFT_PWM is required. Enable it to continue." + #endif #endif #if ENABLED(USE_CONTROLLER_FAN) @@ -2395,13 +2399,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #if _AXIS_PLUG_UNUSED_TEST(Z) #error "You must enable USE_ZMIN_PLUG or USE_ZMAX_PLUG." #endif - #if LINEAR_AXES >= 4 && _AXIS_PLUG_UNUSED_TEST(I) + #if HAS_I_AXIS && _AXIS_PLUG_UNUSED_TEST(I) #error "You must enable USE_IMIN_PLUG or USE_IMAX_PLUG." #endif - #if LINEAR_AXES >= 5 && _AXIS_PLUG_UNUSED_TEST(J) + #if HAS_J_AXIS && _AXIS_PLUG_UNUSED_TEST(J) #error "You must enable USE_JMIN_PLUG or USE_JMAX_PLUG." #endif - #if LINEAR_AXES >= 6 && _AXIS_PLUG_UNUSED_TEST(K) + #if HAS_K_AXIS && _AXIS_PLUG_UNUSED_TEST(K) #error "You must enable USE_KMIN_PLUG or USE_KMAX_PLUG." #endif @@ -2415,17 +2419,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Enable USE_YMIN_PLUG when homing Y to MIN." #elif Y_HOME_TO_MAX && DISABLED(USE_YMAX_PLUG) #error "Enable USE_YMAX_PLUG when homing Y to MAX." - #elif LINEAR_AXES >= 4 && I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG) + #elif HAS_I_AXIS && I_HOME_TO_MIN && DISABLED(USE_IMIN_PLUG) #error "Enable USE_IMIN_PLUG when homing I to MIN." - #elif LINEAR_AXES >= 4 && I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG) + #elif HAS_I_AXIS && I_HOME_TO_MAX && DISABLED(USE_IMAX_PLUG) #error "Enable USE_IMAX_PLUG when homing I to MAX." - #elif LINEAR_AXES >= 5 && J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG) + #elif HAS_J_AXIS && J_HOME_TO_MIN && DISABLED(USE_JMIN_PLUG) #error "Enable USE_JMIN_PLUG when homing J to MIN." - #elif LINEAR_AXES >= 5 && J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG) + #elif HAS_J_AXIS && J_HOME_TO_MAX && DISABLED(USE_JMAX_PLUG) #error "Enable USE_JMAX_PLUG when homing J to MAX." - #elif LINEAR_AXES >= 6 && K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG) + #elif HAS_K_AXIS && K_HOME_TO_MIN && DISABLED(USE_KMIN_PLUG) #error "Enable USE_KMIN_PLUG when homing K to MIN." - #elif LINEAR_AXES >= 6 && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG) + #elif HAS_K_AXIS && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG) #error "Enable USE_KMAX_PLUG when homing K to MAX." #endif #endif @@ -2765,6 +2769,20 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Please select only one of CHIRON_TFT_STANDARD or CHIRON_TFT_NEW." #endif +#if ENABLED(ANYCUBIC_LCD_CHIRON) + #if !defined(BEEPER_PIN) + #error "ANYCUBIC_LCD_CHIRON requires BEEPER_PIN" + #elif DISABLED(SDSUPPORT) + #error "ANYCUBIC_LCD_CHIRON requires SDSUPPORT" + #elif TEMP_SENSOR_BED == 0 + #error "ANYCUBIC_LCD_CHIRON requires heatbed (TEMP_SENSOR_BED)" + #elif NONE(AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL, MESH_BED_LEVELING) + #error "ANYCUBIC_LCD_CHIRON requires one of: AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_UBL or MESH_BED_LEVELING" + #elif DISABLED(BABYSTEPPING) + #error "ANYCUBIC_LCD_CHIRON requires BABYSTEPPING" + #endif +#endif + #if EITHER(MKS_TS35_V2_0, BTT_TFT35_SPI_V1_0) && SD_CONNECTION_IS(LCD) #error "SDCARD_CONNECTION cannot be set to LCD for the enabled TFT. No available SD card reader." #endif @@ -2936,11 +2954,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "TMC2208 or TMC2209 on E6 requires E6_HARDWARE_SERIAL or E6_SERIAL_(RX|TX)_PIN." #elif INVALID_TMC_UART(E7) #error "TMC2208 or TMC2209 on E7 requires E7_HARDWARE_SERIAL or E7_SERIAL_(RX|TX)_PIN." -#elif LINEAR_AXES >= 4 && INVALID_TMC_UART(I) +#elif HAS_I_AXIS && INVALID_TMC_UART(I) #error "TMC2208 or TMC2209 on I requires I_HARDWARE_SERIAL or I_SERIAL_(RX|TX)_PIN." -#elif LINEAR_AXES >= 5 && INVALID_TMC_UART(J) +#elif HAS_J_AXIS && INVALID_TMC_UART(J) #error "TMC2208 or TMC2209 on J requires J_HARDWARE_SERIAL or J_SERIAL_(RX|TX)_PIN." -#elif LINEAR_AXES >= 6 && INVALID_TMC_UART(K) +#elif HAS_K_AXIS && INVALID_TMC_UART(K) #error "TMC2208 or TMC2209 on K requires K_HARDWARE_SERIAL or K_SERIAL_(RX|TX)_PIN." #endif #undef INVALID_TMC_UART @@ -3026,11 +3044,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS INVALID_TMC_MS(E6) #elif !TMC_MICROSTEP_IS_VALID(E7) INVALID_TMC_MS(E7) -#elif LINEAR_AXES >= 4 && !TMC_MICROSTEP_IS_VALID(I) +#elif HAS_I_AXIS && !TMC_MICROSTEP_IS_VALID(I) INVALID_TMC_MS(I) -#elif LINEAR_AXES >= 5 && !TMC_MICROSTEP_IS_VALID(J) +#elif HAS_J_AXIS && !TMC_MICROSTEP_IS_VALID(J) INVALID_TMC_MS(J) -#elif LINEAR_AXES >= 6 && !TMC_MICROSTEP_IS_VALID(K) +#elif HAS_K_AXIS && !TMC_MICROSTEP_IS_VALID(K) INVALID_TMC_MS(K) #endif #undef INVALID_TMC_MS @@ -3052,13 +3070,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #define X_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(X,TMC2209) #define Y_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Y,TMC2209) #define Z_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(Z,TMC2209) - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS #define I_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(I,TMC2209) #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS #define J_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(J,TMC2209) #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS #define K_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(K,TMC2209) #endif @@ -3075,17 +3093,17 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMIN (or ENDSTOPPULLUPS) when homing to Z_MIN." #elif Z_SENSORLESS && Z_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_ZMAX) #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_ZMAX (or ENDSTOPPULLUPS) when homing to Z_MAX." - #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_IMIN) + #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_IMIN) #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMIN (or ENDSTOPPULLUPS) when homing to I_MIN." - #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_IMAX) + #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_IMAX) #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_IMAX (or ENDSTOPPULLUPS) when homing to I_MAX." - #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_JMIN) + #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_JMIN) #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMIN (or ENDSTOPPULLUPS) when homing to J_MIN." - #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_JMAX) + #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_JMAX) #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_JMAX (or ENDSTOPPULLUPS) when homing to J_MAX." - #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_KMIN) + #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MIN) && DISABLED(ENDSTOPPULLUP_KMIN) #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMIN (or ENDSTOPPULLUPS) when homing to K_MIN." - #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_KMAX) + #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_KMAX) #error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX." #endif #endif @@ -3131,37 +3149,37 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #else #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to Z_MAX." #endif - #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MIN && I_MIN_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING + #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MIN) && I_MIN_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING #if I_ENDSTOP_INVERTING #error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = true when homing to I_MIN." #else #error "SENSORLESS_HOMING requires I_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to I_MIN." #endif - #elif LINEAR_AXES >= 4 && I_SENSORLESS && I_HOME_TO_MAX && I_MAX_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING + #elif ALL(HAS_I_AXIS, I_SENSORLESS, I_HOME_TO_MAX) && I_MAX_ENDSTOP_INVERTING != I_ENDSTOP_INVERTING #if I_ENDSTOP_INVERTING #error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = true when homing to I_MAX." #else #error "SENSORLESS_HOMING requires I_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to I_MAX." #endif - #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MIN && J_MIN_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING + #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MIN) && J_MIN_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING #if J_ENDSTOP_INVERTING #error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = true when homing to J_MIN." #else #error "SENSORLESS_HOMING requires J_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to J_MIN." #endif - #elif LINEAR_AXES >= 5 && J_SENSORLESS && J_HOME_TO_MAX && J_MAX_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING + #elif ALL(HAS_J_AXIS, J_SENSORLESS, J_HOME_TO_MAX) && J_MAX_ENDSTOP_INVERTING != J_ENDSTOP_INVERTING #if J_ENDSTOP_INVERTING #error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = true when homing to J_MAX." #else #error "SENSORLESS_HOMING requires J_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to J_MAX." #endif - #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MIN && K_MIN_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING + #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MIN) && K_MIN_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING #if K_ENDSTOP_INVERTING #error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = true when homing to K_MIN." #else #error "SENSORLESS_HOMING requires K_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to K_MIN." #endif - #elif LINEAR_AXES >= 6 && K_SENSORLESS && K_HOME_TO_MAX && K_MAX_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING + #elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MAX) && K_MAX_ENDSTOP_INVERTING != K_ENDSTOP_INVERTING #if K_ENDSTOP_INVERTING #error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_INVERTING = true when homing to K_MAX." #else @@ -3285,7 +3303,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * L64XX requirement */ -#if HAS_L64XX && LINEAR_AXES >= 4 +#if HAS_L64XX && HAS_I_AXIS #error "L64XX requires LINEAR_AXES 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3." #endif @@ -3669,7 +3687,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #error "COOLANT_FLOOD requires COOLANT_FLOOD_PIN to be defined." #endif -#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) +#if NONE(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, IS_DWIN_MARLINUI) && ENABLED(PRINT_PROGRESS_SHOW_DECIMALS) #error "PRINT_PROGRESS_SHOW_DECIMALS currently requires a Graphical LCD." #endif @@ -3765,17 +3783,17 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive."); #if _BAD_DRIVER(Z) #error "Z_DRIVER_TYPE is not recognized." #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #if _BAD_DRIVER(I) #error "I_DRIVER_TYPE is not recognized." #endif #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #if _BAD_DRIVER(J) #error "J_DRIVER_TYPE is not recognized." #endif #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #if _BAD_DRIVER(K) #error "K_DRIVER_TYPE is not recognized." #endif diff --git a/Marlin/src/inc/Version.h b/Marlin/src/inc/Version.h index 17755de348..767e3e9a8e 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 "2021-09-03" + #define STRING_DISTRIBUTION_DATE "2021-12-25" #endif /** diff --git a/Marlin/src/lcd/buttons.h b/Marlin/src/lcd/buttons.h index 6d028e9bc6..429fb971ec 100644 --- a/Marlin/src/lcd/buttons.h +++ b/Marlin/src/lcd/buttons.h @@ -45,36 +45,6 @@ #define ENCODER_PHASE_3 1 #endif -#if IS_RRW_KEYPAD - #define BTN_OFFSET 0 // Bit offset into buttons for shift register values - - #define BLEN_KEYPAD_F3 0 - #define BLEN_KEYPAD_F2 1 - #define BLEN_KEYPAD_F1 2 - #define BLEN_KEYPAD_DOWN 3 - #define BLEN_KEYPAD_RIGHT 4 - #define BLEN_KEYPAD_MIDDLE 5 - #define BLEN_KEYPAD_UP 6 - #define BLEN_KEYPAD_LEFT 7 - - #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) - #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) - #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) - #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) - #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) - #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) - #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) - #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) - - #define RRK(B) (keypad_buttons & (B)) - - #ifdef EN_C - #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) - #else - #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) - #endif -#endif - #if EITHER(HAS_DIGITAL_BUTTONS, HAS_DWIN_E3V2) // Wheel spin pins where BA is 00, 10, 11, 01 (1 bit always changes) #define BLEN_A 0 @@ -141,7 +111,39 @@ #define B_ST _BV(BL_ST) #ifndef BUTTON_CLICK - #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) + #if EN_C + #define BUTTON_CLICK() (buttons & (B_MI|B_ST)) + #endif + #endif +#endif + +#if IS_RRW_KEYPAD + #define BTN_OFFSET 0 // Bit offset into buttons for shift register values + + #define BLEN_KEYPAD_F3 0 + #define BLEN_KEYPAD_F2 1 + #define BLEN_KEYPAD_F1 2 + #define BLEN_KEYPAD_DOWN 3 + #define BLEN_KEYPAD_RIGHT 4 + #define BLEN_KEYPAD_MIDDLE 5 + #define BLEN_KEYPAD_UP 6 + #define BLEN_KEYPAD_LEFT 7 + + #define EN_KEYPAD_F1 _BV(BTN_OFFSET + BLEN_KEYPAD_F1) + #define EN_KEYPAD_F2 _BV(BTN_OFFSET + BLEN_KEYPAD_F2) + #define EN_KEYPAD_F3 _BV(BTN_OFFSET + BLEN_KEYPAD_F3) + #define EN_KEYPAD_DOWN _BV(BTN_OFFSET + BLEN_KEYPAD_DOWN) + #define EN_KEYPAD_RIGHT _BV(BTN_OFFSET + BLEN_KEYPAD_RIGHT) + #define EN_KEYPAD_MIDDLE _BV(BTN_OFFSET + BLEN_KEYPAD_MIDDLE) + #define EN_KEYPAD_UP _BV(BTN_OFFSET + BLEN_KEYPAD_UP) + #define EN_KEYPAD_LEFT _BV(BTN_OFFSET + BLEN_KEYPAD_LEFT) + + #define RRK(B) (keypad_buttons & (B)) + + #ifdef EN_C + #define BUTTON_CLICK() ((buttons & EN_C) || RRK(EN_KEYPAD_MIDDLE)) + #else + #define BUTTON_CLICK() RRK(EN_KEYPAD_MIDDLE) #endif #endif diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index adf8f3771f..f312976ddc 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1754,7 +1754,7 @@ void update_variable() { if (_new_hotend_target) Draw_Stat_Int(25 + 4 * STAT_CHR_W + 6, 384, _hotendtarget); - static int16_t _flow = planner.flow_percentage[0]; + static int16_t _flow = 0; if (_flow != planner.flow_percentage[0]) { _flow = planner.flow_percentage[0]; Draw_Stat_Int(116 + 2 * STAT_CHR_W, 417, _flow); @@ -1768,7 +1768,7 @@ void update_variable() { Draw_Stat_Int(25 + 4 * STAT_CHR_W + 6, 417, _bedtarget); #endif - static int16_t _feedrate = 100; + static int16_t _feedrate = 0; if (_feedrate != feedrate_percentage) { _feedrate = feedrate_percentage; Draw_Stat_Int(116 + 2 * STAT_CHR_W, 384, _feedrate); @@ -2269,6 +2269,8 @@ void HMI_SelectFile() { // thermalManager.fan_speed[i] = 255; #endif + _card_percent = 0; + _remain_time = 0; Goto_PrintProcess(); } } @@ -4173,10 +4175,7 @@ void EachMomentUpdate() { } #if ENABLED(POWER_LOSS_RECOVERY) else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off - static bool recovery_flag = false; - recovery.dwin_flag = false; - recovery_flag = true; auto update_selection = [&](const bool sel) { HMI_flag.select_flag = sel; @@ -4196,6 +4195,7 @@ void EachMomentUpdate() { DWIN_Draw_String(true, font8x16, Popup_Text_Color, Color_Bg_Window, npos, 252, name); DWIN_UpdateLCD(); + bool recovery_flag = true; while (recovery_flag) { EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); if (encoder_diffState != ENCODER_DIFF_NO) { diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp index d1a9ba7077..1daa26bc7a 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.cpp @@ -23,8 +23,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.7.1 - * Date: 2021/11/09 + * Version: 3.9.1 + * Date: 2021/11/21 */ #include "../../../inc/MarlinConfigPre.h" @@ -32,6 +32,7 @@ #if ENABLED(DWIN_CREALITY_LCD_ENHANCED) #include "dwin.h" +#include "dwin_popup.h" #include "../../fontutils.h" #include "../../marlinui.h" @@ -70,6 +71,10 @@ #include "../../../module/probe.h" #endif +#ifdef BLTOUCH_HS_MODE + #include "../../../feature/bltouch.h" +#endif + #if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) #include "../../../feature/babystep.h" #endif @@ -78,10 +83,18 @@ #include "../../../feature/powerloss.h" #endif +#if HAS_ESDIAG + #include "endstop_diag.h" +#endif + #if HAS_MESH #include "meshviewer.h" #endif +#if ENABLED(PRINTCOUNTER) + #include "printstats.h" +#endif + #include #include #include @@ -207,7 +220,7 @@ static bool sdprint = false; // New menu system pointers MenuClass *PrepareMenu = nullptr; -MenuClass *LevBedMenu = nullptr; +MenuClass *TrammingMenu = nullptr; MenuClass *MoveMenu = nullptr; MenuClass *ControlMenu = nullptr; MenuClass *AdvancedSettings = nullptr; @@ -236,9 +249,12 @@ MenuClass *MaxJerkMenu = nullptr; MenuClass *StepsMenu = nullptr; MenuClass *HotendPIDMenu = nullptr; MenuClass *BedPIDMenu = nullptr; -#if EITHER(HAS_BED_PROBE, BABYSTEPPING) +#if HAS_BED_PROBE MenuClass *ZOffsetWizMenu = nullptr; #endif +#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + MenuClass *HomingMenu = nullptr; +#endif // Updatable menuitems pointers MenuItemClass *HotendTargetItem = nullptr; @@ -270,13 +286,23 @@ void HMI_ToggleLanguage() { #endif } +//----------------------------------------------------------------------------- +// Main Buttons +//----------------------------------------------------------------------------- + typedef struct { uint16_t x, y[2], w, h; } text_info_t; -void ICON_Button(const bool here, const int iconid, const frame_rect_t &ico, const text_info_t (&txt)[2]) { - const bool cn = HMI_IsChinese(); - DWIN_ICON_Show(true, false, false, ICON, iconid + here, ico.x, ico.y); - if (here) DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, ico.x, ico.y, ico.x + ico.w - 1, ico.y + ico.h - 1); - DWIN_Frame_AreaCopy(1, txt[cn].x, txt[cn].y[here], txt[cn].x + txt[cn].w - 1, txt[cn].y[here] + txt[cn].h - 1, ico.x + (ico.w - txt[cn].w) / 2, (ico.y + ico.h - 28) - txt[cn].h/2); +void ICON_Button(const bool selected, const int iconid, const frame_rect_t &ico, const text_info_t (&txt), FSTR_P caption) { + DWIN_ICON_Show(true, false, false, ICON, iconid + selected, ico.x, ico.y); + if (selected) DWINUI::Draw_Box(0, HMI_data.Highlight_Color, ico); + if (HMI_IsChinese()) { + DWIN_Frame_AreaCopy(1, txt.x, txt.y[selected], txt.x + txt.w - 1, txt.y[selected] + txt.h - 1, ico.x + (ico.w - txt.w) / 2, (ico.y + ico.h - 28) - txt.h/2); + } + else { + const uint16_t x = ico.x + (ico.w - strlen_P(FTOP(caption)) * DWINUI::fontWidth()) / 2, + y = (ico.y + ico.h - 28) - DWINUI::fontHeight() / 2; + DWINUI::Draw_String(x, y, caption); + } } // @@ -284,11 +310,8 @@ void ICON_Button(const bool here, const int iconid, const frame_rect_t &ico, con // void ICON_Print() { constexpr frame_rect_t ico = { 17, 110, 110, 100 }; - constexpr text_info_t txt[2] = { - { 1, { 417, 449 }, 30, 14 }, - { 1, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_page.now == PAGE_PRINT, ICON_Print_0, ico, txt); + constexpr text_info_t txt = { 1, { 405, 447 }, 27, 15 }; + ICON_Button(select_page.now == PAGE_PRINT, ICON_Print_0, ico, txt, GET_TEXT_F(MSG_BUTTON_PRINT)); } // @@ -296,11 +319,8 @@ void ICON_Print() { // void ICON_Prepare() { constexpr frame_rect_t ico = { 145, 110, 110, 100 }; - constexpr text_info_t txt[2] = { - { 33, { 417, 449 }, 51, 14 }, - { 31, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_page.now == PAGE_PREPARE, ICON_Prepare_0, ico, txt); + constexpr text_info_t txt = { 31, { 405, 447 }, 27, 15 }; + ICON_Button(select_page.now == PAGE_PREPARE, ICON_Prepare_0, ico, txt, GET_TEXT_F(MSG_PREPARE)); } // @@ -308,11 +328,8 @@ void ICON_Prepare() { // void ICON_Control() { constexpr frame_rect_t ico = { 17, 226, 110, 100 }; - constexpr text_info_t txt[2] = { - { 85, { 417, 449 }, 46, 14 }, - { 61, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_page.now == PAGE_CONTROL, ICON_Control_0, ico, txt); + constexpr text_info_t txt = { 61, { 405, 447 }, 27, 15 }; + ICON_Button(select_page.now == PAGE_CONTROL, ICON_Control_0, ico, txt, GET_TEXT_F(MSG_CONTROL)); } // @@ -320,11 +337,8 @@ void ICON_Control() { // void ICON_StartInfo() { constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt[2] = { - { 133, { 417, 449 }, 23, 14 }, - { 91, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Info_0, ico, txt); + constexpr text_info_t txt = { 91, { 405, 447 }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Info_0, ico, txt, GET_TEXT_F(MSG_BUTTON_INFO)); } // @@ -332,11 +346,8 @@ void ICON_StartInfo() { // void ICON_Leveling() { constexpr frame_rect_t ico = { 145, 226, 110, 100 }; - constexpr text_info_t txt[2] = { - { 88, { 433, 464 }, 36, 14 }, - { 211, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Leveling_0, ico, txt); + constexpr text_info_t txt = { 211, { 405, 447 }, 27, 15 }; + ICON_Button(select_page.now == PAGE_INFO_LEVELING, ICON_Leveling_0, ico, txt, GET_TEXT_F(MSG_BUTTON_LEVEL)); } // @@ -344,11 +355,8 @@ void ICON_Leveling() { // void ICON_Tune() { constexpr frame_rect_t ico = { 8, 232, 80, 100 }; - constexpr text_info_t txt[2] = { - { 0, { 433, 464 }, 32, 14 }, - { 121, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_print.now == PRINT_SETUP, ICON_Setup_0, ico, txt); + constexpr text_info_t txt = { 121, { 405, 447 }, 27, 15 }; + ICON_Button(select_print.now == PRINT_SETUP, ICON_Setup_0, ico, txt, GET_TEXT_F(MSG_TUNE)); } // @@ -356,11 +364,8 @@ void ICON_Tune() { // void ICON_Pause() { constexpr frame_rect_t ico = { 96, 232, 80, 100 }; - constexpr text_info_t txt[2] = { - { 157, { 417, 449 }, 39, 14 }, - { 181, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Pause_0, ico, txt); + constexpr text_info_t txt = { 181, { 405, 447 }, 27, 15 }; + ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Pause_0, ico, txt, GET_TEXT_F(MSG_BUTTON_PAUSE)); } // @@ -368,11 +373,8 @@ void ICON_Pause() { // void ICON_Resume() { constexpr frame_rect_t ico = { 96, 232, 80, 100 }; - constexpr text_info_t txt[2] = { - { 33, { 433, 464 }, 53, 14 }, - { 1, { 405, 447 }, 27, 15 } - }; - ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Continue_0, ico, txt); + constexpr text_info_t txt = { 1, { 405, 447 }, 27, 15 }; + ICON_Button(select_print.now == PRINT_PAUSE_RESUME, ICON_Continue_0, ico, txt, GET_TEXT_F(MSG_BUTTON_RESUME)); } // @@ -380,13 +382,14 @@ void ICON_Resume() { // void ICON_Stop() { constexpr frame_rect_t ico = { 184, 232, 80, 100 }; - constexpr text_info_t txt[2] = { - { 196, { 417, 449 }, 29, 14 }, - { 151, { 405, 447 }, 27, 12 } - }; - ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt); + constexpr text_info_t txt = { 151, { 405, 447 }, 27, 12 }; + ICON_Button(select_print.now == PRINT_STOP, ICON_Stop_0, ico, txt, GET_TEXT_F(MSG_BUTTON_STOP)); } +//----------------------------------------------------------------------------- +// Drawing routines +//----------------------------------------------------------------------------- + void Draw_Menu_Cursor(const int8_t line) { DWIN_Draw_Rectangle(1, HMI_data.Cursor_color, 0, MBASE(line) - 18, 14, MBASE(line + 1) - 20); } @@ -422,10 +425,10 @@ void Erase_Menu_Text(const uint8_t line) { } void Draw_Menu_Line(const uint8_t line, const uint8_t icon=0, const char * const label=nullptr, bool more=false) { + if (icon) DWINUI::Draw_Icon(icon, ICOX, MBASE(line) - 3); if (label) DWINUI::Draw_String(LBLX, MBASE(line) - 1, (char*)label); - if (icon) DWINUI::Draw_Icon(icon, 26, MBASE(line) - 3); - if (more) DWINUI::Draw_Icon(ICON_More, 226, MBASE(line) - 3); - DWIN_Draw_Line(HMI_data.SplitLine_Color, 16, MBASE(line) + 33, 256, MBASE(line) + 33); + if (more) DWINUI::Draw_Icon(ICON_More, VALX + 16, MBASE(line) - 3); + DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MYPOS(line + 1), 240); } void Draw_Chkb_Line(const uint8_t line, const bool checked) { @@ -469,50 +472,21 @@ inline bool Apply_Encoder(const EncoderState &encoder_diffState, T &valref) { return encoder_diffState == ENCODER_DIFF_ENTER; } -// -// Draw Popup Windows -// - -inline void Draw_Popup_Bkgd_60() { - DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, 14, 60, 258, 330); - DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, 14, 60, 258, 330); -} - -inline void Draw_Popup_Bkgd_105() { - DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, 14, 105, 258, 374); - DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, 14, 105, 258, 374); -} - -void Clear_Popup_Area() { - DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 31, DWIN_WIDTH, DWIN_HEIGHT); -} - -void DWIN_Draw_Popup1(const uint8_t icon) { +//PopUps +void Popup_window_PauseOrStop() { + if (HMI_IsChinese()) { DWINUI::ClearMenuArea(); - Draw_Popup_Bkgd_60(); - if (icon) DWINUI::Draw_Icon(icon, 101, 105); -} -void DWIN_Draw_Popup2(FSTR_P const fmsg2, uint8_t button) { - if (fmsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, fmsg2); - if (button) DWINUI::Draw_Icon(button, 86, 280); -} - -void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button) { - DWIN_Draw_Popup1(icon); - if (cmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, cmsg1); - DWIN_Draw_Popup2(fmsg2, button); -} - -void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2, uint8_t button) { - DWIN_Draw_Popup1(icon); - if (fmsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, fmsg1); - DWIN_Draw_Popup2(fmsg2, button); -} - -void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) { - HMI_SaveProcessID(WaitResponse); - DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue + Draw_Popup_Bkgd(); + if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); + else if (select_print.now == PRINT_STOP) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); + DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150); + DWINUI::Draw_Icon(ICON_Confirm_C, 26, 280); + DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280); + Draw_Select_Highlight(true); DWIN_UpdateLCD(); + } + else + DWIN_Popup_ConfirmCancel(ICON_BLTouch, select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); } #if HAS_HOTEND @@ -521,7 +495,7 @@ void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fm if (HMI_IsChinese()) { HMI_SaveProcessID(WaitResponse); DWINUI::ClearMenuArea(); - Draw_Popup_Bkgd_60(); + Draw_Popup_Bkgd(); DWINUI::Draw_Icon(ICON_TempTooLow, 102, 105); DWIN_Frame_AreaCopy(1, 103, 371, 136, 386, 69, 240); DWIN_Frame_AreaCopy(1, 170, 371, 270, 386, 102, 240); @@ -529,84 +503,30 @@ void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fm DWIN_UpdateLCD(); } else - DWIN_Popup_Confirm(ICON_TempTooLow, F("Nozzle is too cold"), F("Preheat the hotend")); + DWIN_Popup_Confirm(ICON_TempTooLow, GET_TEXT_F(MSG_HOTEND_TOO_COLD), GET_TEXT_F(MSG_PLEASE_PREHEAT)); } #endif -void Popup_Window_Resume() { - Clear_Popup_Area(); - Draw_Popup_Bkgd_105(); - if (HMI_IsChinese()) { - DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 135); - DWIN_Frame_AreaCopy(1, 103, 321, 271, 335, 52, 192); - DWINUI::Draw_Icon(ICON_Cancel_C, 26, 307); - DWINUI::Draw_Icon(ICON_Continue_C, 146, 307); - } - else { - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 115, F("Continue Print")); - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 192, F("It looks like the last")); - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 212, F("file was interrupted.")); - DWINUI::Draw_Icon(ICON_Cancel_E, 26, 307); - DWINUI::Draw_Icon(ICON_Continue_E, 146, 307); - } -} - -void Draw_Select_Highlight(const bool sel) { - HMI_flag.select_flag = sel; - const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color, - c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color; - DWIN_Draw_Rectangle(0, c1, 25, 279, 126, 318); - DWIN_Draw_Rectangle(0, c1, 24, 278, 127, 319); - DWIN_Draw_Rectangle(0, c2, 145, 279, 246, 318); - DWIN_Draw_Rectangle(0, c2, 144, 278, 247, 319); -} - -void Popup_window_PauseOrStop() { - if (HMI_IsChinese()) { - DWINUI::ClearMenuArea(); - Draw_Popup_Bkgd_60(); - if (select_print.now == PRINT_PAUSE_RESUME) DWIN_Frame_AreaCopy(1, 237, 338, 269, 356, 98, 150); - else if (select_print.now == PRINT_STOP) DWIN_Frame_AreaCopy(1, 221, 320, 253, 336, 98, 150); - DWIN_Frame_AreaCopy(1, 220, 304, 264, 319, 130, 150); - DWINUI::Draw_Icon(ICON_Confirm_C, 26, 280); - DWINUI::Draw_Icon(ICON_Cancel_C, 146, 280); - } - else { - DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), select_print.now == PRINT_PAUSE_RESUME ? GET_TEXT_F(MSG_PAUSE_PRINT) : GET_TEXT_F(MSG_STOP_PRINT)); - DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); - DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); - } - Draw_Select_Highlight(true); - DWIN_UpdateLCD(); -} - #if HAS_HOTEND || HAS_HEATED_BED void DWIN_Popup_Temperature(const bool toohigh) { - Clear_Popup_Area(); - Draw_Popup_Bkgd_105(); + DWINUI::ClearMenuArea(); + Draw_Popup_Bkgd(); + if (HMI_IsChinese()) { if (toohigh) { DWINUI::Draw_Icon(ICON_TempTooHigh, 102, 165); - if (HMI_IsChinese()) { DWIN_Frame_AreaCopy(1, 103, 371, 237, 386, 52, 285); DWIN_Frame_AreaCopy(1, 151, 389, 185, 402, 187, 285); DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310); } else { - DWINUI::Draw_String(HMI_data.PopupTxt_Color, 36, 300, F("Nozzle or Bed temperature")); - DWINUI::Draw_String(HMI_data.PopupTxt_Color, 92, 300, F("is too high")); - } - } - else { - DWINUI::Draw_Icon(ICON_TempTooLow, 102, 165); - if (HMI_IsChinese()) { + DWINUI::Draw_Icon(ICON_TempTooLow, 102, 165); DWIN_Frame_AreaCopy(1, 103, 371, 270, 386, 52, 285); DWIN_Frame_AreaCopy(1, 189, 389, 271, 402, 95, 310); } - else { - DWINUI::Draw_String(HMI_data.PopupTxt_Color, 36, 300, F("Nozzle or Bed temperature")); - DWINUI::Draw_String(HMI_data.PopupTxt_Color, 92, 300, F("is too low")); - } + } + else { + DWIN_Draw_Popup(toohigh ? ICON_TempTooHigh : ICON_TempTooLow, F("Nozzle or Bed temperature"), toohigh ? F("is too high") : F("is too low")); } } #endif @@ -642,7 +562,7 @@ void DWIN_CheckStatusMessage() { }; void DWIN_DrawStatusMessage() { - const uint8_t max_status_chars = DWIN_WIDTH / DWINUI::fontWidth(DWINUI::font); + const uint8_t max_status_chars = DWIN_WIDTH / DWINUI::fontWidth(); #if ENABLED(STATUS_MESSAGE_SCROLLING) @@ -693,14 +613,12 @@ void DWIN_DrawStatusMessage() { void Draw_Print_Labels() { if (HMI_IsChinese()) { - Title.FrameCopy(30, 1, 42, 14); // "Printing" DWIN_Frame_AreaCopy(1, 0, 72, 63, 86, 41, 173); // Printing Time DWIN_Frame_AreaCopy(1, 65, 72, 128, 86, 176, 173); // Remain } else { - Title.ShowCaption(GET_TEXT(MSG_PRINTING)); - DWINUI::Draw_String( 46, 173, F("Print Time")); - DWINUI::Draw_String(181, 173, F("Remain")); + DWINUI::Draw_String( 46, 173, GET_TEXT_F(MSG_INFO_PRINT_TIME)); + DWINUI::Draw_String(181, 173, GET_TEXT_F(MSG_REMAINING_TIME)); } } @@ -732,27 +650,30 @@ void ICON_ResumeOrPause() { } void Draw_PrintProcess() { + if (HMI_IsChinese()) + Title.FrameCopy(30, 1, 42, 14); // "Printing" + else + Title.ShowCaption(GET_TEXT_F(MSG_PRINTING)); DWINUI::ClearMenuArea(); - Draw_Print_Labels(); - - ICON_Tune(); - ICON_ResumeOrPause(); - ICON_Stop(); - DWIN_Print_Header(sdprint ? card.longest_filename() : nullptr); - + Draw_Print_Labels(); DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); - Draw_Print_ProgressBar(); Draw_Print_ProgressElapsed(); Draw_Print_ProgressRemain(); - + ICON_Tune(); + ICON_ResumeOrPause(); + ICON_Stop(); DWIN_UpdateLCD(); } void Goto_PrintProcess() { - if (checkkey == PrintProcess) return; + if (checkkey == PrintProcess) { + ICON_ResumeOrPause(); + DWIN_UpdateLCD(); + return; + } checkkey = PrintProcess; Draw_PrintProcess(); } @@ -762,30 +683,27 @@ void Draw_PrintDone() { _percent_done = 100; _remain_time = 0; + Title.ShowCaption(GET_TEXT_F(MSG_PRINT_DONE)); DWINUI::ClearMenuArea(); DWIN_Print_Header(nullptr); + Draw_Print_ProgressBar(); Draw_Print_Labels(); DWINUI::Draw_Icon(ICON_PrintTime, 15, 173); DWINUI::Draw_Icon(ICON_RemainTime, 150, 171); - Draw_Print_ProgressBar(); Draw_Print_ProgressElapsed(); Draw_Print_ProgressRemain(); - // show print done confirm - DWIN_Draw_Rectangle(1, HMI_data.Background_Color, 0, 240, DWIN_WIDTH - 1, STATUS_Y - 1); - DWINUI::Draw_Icon(HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 283); + DWINUI::Draw_Icon(HMI_IsChinese() ? ICON_Confirm_C : ICON_Confirm_E, 86, 273); + DWIN_UpdateLCD(); } void Draw_Main_Menu() { DWINUI::ClearMenuArea(); - if (HMI_IsChinese()) Title.FrameCopy(2, 2, 26, 13); // "Home" etc else Title.ShowCaption(MACHINE_NAME); - DWINUI::Draw_Icon(ICON_LOGO, 71, 52); // CREALITY logo - ICON_Print(); ICON_Prepare(); ICON_Control(); @@ -917,6 +835,18 @@ void update_variable() { DWINUI::Draw_Signed_Float(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 2, 2, 210, 417, _offset); } + #if HAS_MESH + static bool _leveling_active = false; + if (_leveling_active != planner.leveling_active) { + _leveling_active = planner.leveling_active; + DWIN_Draw_Box(1, HMI_data.Background_Color, 186, 416, 20, 20); + if (_leveling_active) + DWINUI::Draw_Icon(ICON_SetZOffset, 186, 416); + else + DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); + } + #endif + _draw_xyz_position(false); } @@ -933,14 +863,15 @@ void update_variable() { #endif void make_name_without_ext(char *dst, char *src, size_t maxlen=MENU_CHAR_LIMIT) { - char * const name = card.longest_filename(); - size_t pos = strlen(name); // index of ending nul + size_t pos = strlen(src); // index of ending nul // For files, remove the extension // which may be .gcode, .gco, or .g if (!card.flag.filenameIsDir) while (pos && src[pos] != '.') pos--; // find last '.' (stop at 0) + if (!pos) pos = strlen(src); // pos = 0 ('.' not found) restore pos + size_t len = pos; // nul or '.' if (len > maxlen) { // Keep the name short pos = len = maxlen; // move nul down @@ -1057,7 +988,7 @@ void Redraw_SD_List() { } else { DWIN_Draw_Rectangle(1, HMI_data.AlertBg_Color, 10, MBASE(3) - 10, DWIN_WIDTH - 10, MBASE(4)); - DWINUI::Draw_CenteredString(font16x32, HMI_data.AlertTxt_Color, MBASE(3), F("No Media")); + DWINUI::Draw_CenteredString(font16x32, HMI_data.AlertTxt_Color, MBASE(3), GET_TEXT_F(MSG_MEDIA_NOT_INSERTED)); } } @@ -1083,11 +1014,11 @@ void HMI_SDCardUpdate() { if (DWIN_lcd_sd_status != card.isMounted()) { DWIN_lcd_sd_status = card.isMounted(); //SERIAL_ECHOLNPGM("HMI_SDCardUpdate: ", DWIN_lcd_sd_status); - if (DWIN_lcd_sd_status) { + if (DWIN_lcd_sd_status) { // Media inserted if (checkkey == SelectFile) Redraw_SD_List(); } - else { + else { // Media removed // clean file icon if (checkkey == SelectFile) { Redraw_SD_List(); @@ -1140,7 +1071,7 @@ void Draw_Status_Area(const bool with_update) { #endif #if HAS_ZOFFSET_ITEM - DWINUI::Draw_Icon(ICON_Zoffset, 187, 416); + DWINUI::Draw_Icon(planner.leveling_active ? ICON_SetZOffset : ICON_Zoffset, 187, 416); #endif DWINUI::Draw_Signed_Float(DWIN_FONT_STAT, HMI_data.Indicator_Color, HMI_data.Background_Color, 2, 2, 210, 417, BABY_Z_VAR); @@ -1188,7 +1119,7 @@ void Draw_Info_Menu() { DWINUI::Draw_CenteredString(268, F(CORP_WEBSITE)); LOOP_L_N(i, 3) { - DWINUI::Draw_Icon(ICON_PrintSize + i, 26, 99 + i * 73); + DWINUI::Draw_Icon(ICON_PrintSize + i, ICOX, 99 + i * 73); DWIN_Draw_HLine(HMI_data.SplitLine_Color, 16, MBASE(2) + i * 73, 240); } @@ -1244,7 +1175,7 @@ void HMI_MainMenu() { queue.inject(F("G28Z\nG29")); // Force to get the current Z home position #else last_checkkey = MainMenu; - Goto_InfoMenu(); + Goto_Info_Menu(); #endif break; } @@ -1477,7 +1408,7 @@ void HMI_PauseOrStop() { #ifdef ACTION_ON_CANCEL hostui.cancel(); #endif - DWIN_Draw_Popup(ICON_BLTouch, F("Stopping...") , F("Please wait until done.")); + DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_STOPPING), GET_TEXT_F(MSG_PLEASE_WAIT)); } else Goto_PrintProcess(); // cancel stop @@ -1507,6 +1438,12 @@ void Draw_Main_Area() { case PrintProcess: Draw_PrintProcess(); break; case PrintDone: Draw_PrintDone(); break; case Info: Draw_Info_Menu(); break; + #if HAS_ESDIAG + case ESDiagProcess: Draw_EndStopDiag(); break; + #endif + #if ENABLED(PRINTCOUNTER) + case PrintStatsProcess: Draw_PrintStats(); break; + #endif case PauseOrStop: Popup_window_PauseOrStop(); break; #if ENABLED(ADVANCED_PAUSE_FEATURE) case FilamentPurge: Draw_Popup_FilamentPurge(); break; @@ -1524,6 +1461,7 @@ void Draw_Main_Area() { void HMI_ReturnScreen() { checkkey = last_checkkey; + wait_for_user = false; Draw_Main_Area(); return; } @@ -1532,7 +1470,6 @@ void HMI_Popup() { EncoderState encoder_diffState = get_encoder_state(); if (encoder_diffState == ENCODER_DIFF_NO) return; if (encoder_diffState == ENCODER_DIFF_ENTER) { - wait_for_user = false; HMI_ReturnScreen(); } } @@ -1563,6 +1500,20 @@ void EachMomentUpdate() { if (ELAPSED(ms, next_var_update_ms)) { next_var_update_ms = ms + DWIN_VAR_UPDATE_INTERVAL; update_variable(); + switch (checkkey) { + #if HAS_ESDIAG + case ESDiagProcess: + ESDiag.Update(); + break; + #endif + default: + break; + } + } + + if (ELAPSED(ms, next_status_update_ms)) { + next_status_update_ms = ms + 500; + DWIN_DrawStatusMessage(); } if (ELAPSED(ms, next_status_update_ms)) { @@ -1643,61 +1594,70 @@ void EachMomentUpdate() { #if ENABLED(POWER_LOSS_RECOVERY) else if (DWIN_lcd_sd_status && recovery.dwin_flag) { // resume print before power off - static bool recovery_flag = false; - - recovery.dwin_flag = false; - recovery_flag = true; - - auto update_selection = [&](const bool sel) { - HMI_flag.select_flag = sel; - const uint16_t c1 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color; - DWIN_Draw_Rectangle(0, c1, 25, 306, 126, 345); - DWIN_Draw_Rectangle(0, c1, 24, 305, 127, 346); - const uint16_t c2 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color; - DWIN_Draw_Rectangle(0, c2, 145, 306, 246, 345); - DWIN_Draw_Rectangle(0, c2, 144, 305, 247, 346); - }; - - Popup_Window_Resume(); - update_selection(true); - - // TODO: Get the name of the current file from someplace - // - //(void)recovery.interrupted_file_exists(); - SdFile *dir = nullptr; - const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); - card.selectFileByName(filename); - DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 252, card.longest_filename()); - DWIN_UpdateLCD(); - - while (recovery_flag) { - EncoderState encoder_diffState = Encoder_ReceiveAnalyze(); - if (encoder_diffState != ENCODER_DIFF_NO) { - if (encoder_diffState == ENCODER_DIFF_ENTER) { - recovery_flag = false; - if (HMI_flag.select_flag) break; - TERN_(POWER_LOSS_RECOVERY, queue.inject(F("M1000C"))); - return HMI_StartFrame(true); - } - else - update_selection(encoder_diffState == ENCODER_DIFF_CW); - - DWIN_UpdateLCD(); - } - watchdog_refresh(); - } - - select_print.set(PRINT_SETUP); - queue.inject(F("M1000")); - sdprint = true; - Goto_PrintProcess(); - Draw_Status_Area(true); + Goto_PowerLossRecovery(); } #endif // POWER_LOSS_RECOVERY DWIN_UpdateLCD(); } +#if ENABLED(POWER_LOSS_RECOVERY) + void Popup_PowerLossRecovery() { + DWINUI::ClearMenuArea(); + Draw_Popup_Bkgd(); + if (HMI_IsChinese()) { + DWIN_Frame_AreaCopy(1, 160, 338, 235, 354, 98, 115); + DWIN_Frame_AreaCopy(1, 103, 321, 271, 335, 52, 167); + DWINUI::Draw_Icon(ICON_Cancel_C, 26, 280); + DWINUI::Draw_Icon(ICON_Continue_C, 146, 280); + } + else { + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 70, GET_TEXT_F(MSG_OUTAGE_RECOVERY)); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 147, F("It looks like the last")); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 167, F("file was interrupted.")); + DWINUI::Draw_Icon(ICON_Cancel_E, 26, 280); + DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); + } + SdFile *dir = nullptr; + const char * const filename = card.diveToFile(true, dir, recovery.info.sd_filename); + card.selectFileByName(filename); + DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 207, card.longest_filename()); + Draw_Select_Highlight(HMI_flag.select_flag); + DWIN_UpdateLCD(); + } + + void Goto_PowerLossRecovery() { + recovery.dwin_flag = false; + LCD_MESSAGE_F(GET_TEXT_F(MSG_CONTINUE_PRINT_JOB)); + HMI_flag.select_flag = false; + Popup_PowerLossRecovery(); + last_checkkey = MainMenu; + checkkey = PwrlossRec; + } + + void HMI_PowerlossRecovery() { + EncoderState encoder_diffState = get_encoder_state(); + if (encoder_diffState == ENCODER_DIFF_NO) return; + if (encoder_diffState == ENCODER_DIFF_ENTER) { + if (HMI_flag.select_flag) { + queue.inject(F("M1000C")); + select_page.reset(); + Goto_Main_Menu(); + } + else { + select_print.set(PRINT_SETUP); + queue.inject(F("M1000")); + sdprint = true; + Goto_PrintProcess(); + } + } + else + Draw_Select_Highlight(encoder_diffState != ENCODER_DIFF_CW); + DWIN_UpdateLCD(); + } +#endif // POWER_LOSS_RECOVERY + + void DWIN_HandleScreen() { switch (checkkey) { case MainMenu: HMI_MainMenu(); break; @@ -1720,18 +1680,31 @@ void DWIN_HandleScreen() { #endif case NothingToDo: break; case Locked: HMI_LockScreen(); break; + #if HAS_ESDIAG + case ESDiagProcess: HMI_Popup(); break; + #endif + #if ENABLED(PRINTCOUNTER) + case PrintStatsProcess: HMI_Popup(); break; + #endif default: break; } } +bool IDisPopUp() { // If ID is popup... + return (checkkey == NothingToDo) || + (checkkey == WaitResponse) || + (checkkey == Info) || + (checkkey == Homing) || + (checkkey == Leveling) || + TERN_(HAS_ESDIAG, (checkkey == ESDiagProcess) ||) + TERN_(PRINTCOUNTER, (checkkey == PrintStatsProcess) ||) + (checkkey == PauseOrStop) || + (checkkey == FilamentPurge); +} + void HMI_SaveProcessID(const uint8_t id) { if (checkkey != id) { - if ((checkkey != NothingToDo) && - (checkkey != WaitResponse) && - (checkkey != Homing) && - (checkkey != Leveling) && - (checkkey != PauseOrStop) && - (checkkey != FilamentPurge)) last_checkkey = checkkey; // if not a popup + if (!IDisPopUp()) last_checkkey = checkkey; // if previous is not a popup checkkey = id; } } @@ -1739,8 +1712,8 @@ void HMI_SaveProcessID(const uint8_t id) { void DWIN_StartHoming() { HMI_flag.home_flag = true; HMI_SaveProcessID(Homing); - Title.ShowCaption(F("Axis Homing")); - DWIN_Draw_Popup(ICON_BLTouch, F("Axis Homing"), F("Please wait until done.")); + Title.ShowCaption(GET_TEXT_F(MSG_LEVEL_BED_HOMING)); + DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_LEVEL_BED_HOMING), GET_TEXT_F(MSG_PLEASE_WAIT)); } void DWIN_CompletedHoming() { @@ -1755,8 +1728,8 @@ void DWIN_CompletedHoming() { void DWIN_MeshLevelingStart() { #if HAS_ONESTEP_LEVELING HMI_SaveProcessID(Leveling); - Title.ShowCaption(F("Bed Leveling")); - DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), F("Please wait until done.")); + Title.ShowCaption(GET_TEXT_F(MSG_BED_LEVELING)); + DWIN_Draw_Popup(ICON_AutoLeveling, GET_TEXT_F(MSG_BED_LEVELING), GET_TEXT_F(MSG_PLEASE_WAIT)); #elif ENABLED(MESH_BED_LEVELING) Draw_ManualMesh_Menu(); #endif @@ -1811,7 +1784,7 @@ void DWIN_PidTuning(pidresult_t result) { void DWIN_Print_Header(const char *text = nullptr) { static char headertxt[31] = ""; // Print header text - if (text != nullptr) { + if (text) { const int8_t size = _MIN((unsigned) 30, strlen_P(text)); LOOP_L_N(i, size) headertxt[i] = text[i]; headertxt[size] = '\0'; @@ -1929,8 +1902,8 @@ void MarlinUI::kill_screen(FSTR_P const lcd_error, FSTR_P const lcd_component) { void DWIN_RebootScreen() { DWIN_Frame_Clear(Color_Bg_Black); - DWINUI::Draw_Icon(ICON_LOGO, 71, 150); // CREALITY logo - DWINUI::Draw_CenteredString(Color_White, 200, F("Please wait until reboot.")); + DWIN_JPG_ShowAndCache(0); + DWINUI::Draw_CenteredString(Color_White, 220, GET_TEXT_F(MSG_PLEASE_WAIT_REBOOT)); DWIN_UpdateLCD(); delay(500); } @@ -1944,7 +1917,7 @@ void DWIN_Redraw_screen() { void DWIN_Popup_Pause(FSTR_P const fmsg, uint8_t button = 0) { HMI_SaveProcessID(button ? WaitResponse : NothingToDo); - DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), fmsg, button); + DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), fmsg, button); ui.reset_status(true); } @@ -1954,7 +1927,7 @@ void DWIN_Redraw_screen() { case PAUSE_MESSAGE_CHANGING: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_INIT)); break; case PAUSE_MESSAGE_UNLOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_UNLOAD)); break; case PAUSE_MESSAGE_WAITING: DWIN_Popup_Pause(GET_TEXT_F(MSG_ADVANCED_PAUSE_WAITING), ICON_Continue_E); break; - case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, F("Advanced Pause"), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; + case PAUSE_MESSAGE_INSERT: DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), GET_TEXT_F(MSG_FILAMENT_CHANGE_INSERT)); break; case PAUSE_MESSAGE_LOAD: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_LOAD)); break; case PAUSE_MESSAGE_PURGE: DWIN_Popup_Pause(GET_TEXT_F(MSG_FILAMENT_CHANGE_PURGE)); break; case PAUSE_MESSAGE_OPTION: DWIN_Popup_FilamentPurge(); break; @@ -1967,7 +1940,7 @@ void DWIN_Redraw_screen() { } void Draw_Popup_FilamentPurge() { - DWIN_Draw_Popup(ICON_BLTouch, F("Advanced Pause"), F("Purge or Continue?")); + DWIN_Draw_Popup(ICON_BLTouch, GET_TEXT_F(MSG_ADVANCED_PAUSE), F("Purge or Continue?")); DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); DWINUI::Draw_Icon(ICON_Continue_E, 146, 280); Draw_Select_Highlight(true); @@ -2006,35 +1979,53 @@ void DWIN_Redraw_screen() { #if HAS_MESH void DWIN_MeshViewer() { if (!leveling_is_valid()) - DWIN_Popup_Continue(ICON_BLTouch, F("Mesh viewer"), F("No valid mesh")); + DWIN_Popup_Continue(ICON_BLTouch, GET_TEXT_F(MSG_MESH_VIEWER), GET_TEXT_F(MSG_NO_VALID_MESH)); else { HMI_SaveProcessID(WaitResponse); MeshViewer.Draw(); } } -#endif +#endif // HAS_MESH + +void DWIN_LockScreen() { + if (checkkey != Locked) { + lockScreen.rprocess = checkkey; + checkkey = Locked; + lockScreen.init(); + } +} + +void DWIN_UnLockScreen() { + if (checkkey == Locked) { + checkkey = lockScreen.rprocess; + Draw_Main_Area(); + } +} void HMI_LockScreen() { EncoderState encoder_diffState = get_encoder_state(); if (encoder_diffState == ENCODER_DIFF_NO) return; lockScreen.onEncoder(encoder_diffState); - if (lockScreen.isUnlocked()) { - if (CurrentMenu == AdvancedSettings) - Draw_AdvancedSettings_Menu(); - else - Draw_Tune_Menu(); - } + if (lockScreen.isUnlocked()) DWIN_UnLockScreen(); } -void DWIN_LockScreen(const bool flag) { - HMI_flag.lock_flag = flag; - checkkey = Locked; - lockScreen.init(); -} +#if HAS_ESDIAG + void Draw_EndStopDiag() { + HMI_SaveProcessID(ESDiagProcess); + ESDiag.Draw(); + } +#endif -// -// NEW MENU SUBSYSTEM ========================================================= -// +#if ENABLED(PRINTCOUNTER) + void Draw_PrintStats() { + HMI_SaveProcessID(PrintStatsProcess); + PrintStats.Draw(); + } +#endif + +//============================================================================= +// NEW MENU SUBSYSTEM +//============================================================================= // On click functions @@ -2152,15 +2143,31 @@ void RebootPrinter() { HAL_reboot(); } -void Goto_InfoMenu(){ - checkkey = Info; +void Goto_Info_Menu(){ + HMI_SaveProcessID(Info); Draw_Info_Menu(); } +void Goto_Move_Menu() { + #if HAS_HOTEND + gcode.process_subcommands_now(F("G92E0")); // reset extruder position + planner.synchronize(); + #endif + Draw_Move_Menu(); +} + void DisableMotors() { queue.inject(F("M84")); } +void AutoLev() { queue.inject(F("G28Z\nG29")); } // Force to get the current Z home position + void AutoHome() { queue.inject_P(G28_STR); } +void HomeX() { queue.inject(F("G28X")); } + +void HomeY() { queue.inject(F("G28Y")); } + +void HomeZ() { queue.inject(F("G28Z")); } + void SetHome() { // Apply workspace offset, making the current position 0,0,0 queue.inject(F("G92 X0 Y0 Z0")); @@ -2285,8 +2292,6 @@ void SetPID(celsius_t t, heater_id_t h) { } #endif -void Goto_LockScreen() { DWIN_LockScreen(true); } - #if HAS_HOME_OFFSET void ApplyHomeOffset() { set_home_offset(HMI_value.axis, HMI_value.Value / MINUNITMULT); } void SetHomeOffsetX() { HMI_value.axis = X_AXIS; SetPFloatOnClick(-50, 50, UNITFDIGITS, ApplyHomeOffset); } @@ -2295,13 +2300,23 @@ void Goto_LockScreen() { DWIN_LockScreen(true); } #endif #if HAS_BED_PROBE - void SetProbeOffsetX() { SetPFloatOnClick(-50, 50, UNITFDIGITS); } - void SetProbeOffsetY() { SetPFloatOnClick(-50, 50, UNITFDIGITS); } + void SetProbeOffsetX() { SetPFloatOnClick(-60, 60, UNITFDIGITS); } + void SetProbeOffsetY() { SetPFloatOnClick(-60, 60, UNITFDIGITS); } void SetProbeOffsetZ() { SetPFloatOnClick(-10, 10, 2); } void ProbeTest() { LCD_MESSAGE(MSG_M48_TEST); queue.inject(F("G28O\nM48 P10")); } + void ProbeStow() { probe.stow(); } + void ProbeDeploy() { probe.deploy(); } + + #ifdef BLTOUCH_HS_MODE + void SetHSMode() { + bltouch.high_speed_mode = !bltouch.high_speed_mode; + Draw_Chkb_Line(CurrentMenu->line(), bltouch.high_speed_mode); + DWIN_UpdateLCD(); + } + #endif #endif #if HAS_FILAMENT_SENSOR @@ -2356,7 +2371,7 @@ void DWIN_ApplyColor() { DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color); Draw_Status_Area(false); Draw_SelectColors_Menu(); - LCD_MESSAGE_F("Colors applied"); + LCD_MESSAGE_F(GET_TEXT_F(MSG_COLORS_APPLIED)); } void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } @@ -2405,16 +2420,16 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); } void ApplyFlow() { planner.refresh_e_factor(0); } void SetFlow() { SetPIntOnClick(MIN_PRINT_FLOW, MAX_PRINT_FLOW, ApplyFlow); } -// Leveling Bed Corners -void LevBed(uint8_t point) { +// Bed Tramming +void Tram(uint8_t point) { char cmd[100] = ""; #if HAS_ONESTEP_LEVELING + static bool inLev = false; + if (inLev) return; char str_1[6] = "", str_2[6] = "", str_3[6] = ""; - #define fmt "X:%s, Y:%s, Z:%s" float xpos = 0, ypos = 0, zval = 0; float margin = PROBING_MARGIN; #else - #define fmt "M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300" int16_t xpos = 0, ypos = 0; int16_t margin = 30; #endif @@ -2444,27 +2459,30 @@ void LevBed(uint8_t point) { #if HAS_ONESTEP_LEVELING planner.synchronize(); + probe.stow(); gcode.process_subcommands_now(F("M420S0\nG28O")); planner.synchronize(); + inLev = true; zval = probe.probe_at_point(xpos, ypos, PROBE_PT_STOW); - sprintf_P(cmd, PSTR(fmt), + sprintf_P(cmd, PSTR("X:%s, Y:%s, Z:%s"), dtostrf(xpos, 1, 1, str_1), dtostrf(ypos, 1, 1, str_2), dtostrf(zval, 1, 2, str_3) ); ui.set_status(cmd); + inLev = false; #else planner.synchronize(); - sprintf_P(cmd, PSTR(fmt), xpos, ypos); + sprintf_P(cmd, PSTR("M420S0\nG28O\nG90\nG0Z5F300\nG0X%iY%iF5000\nG0Z0F300"), xpos, ypos); queue.inject(cmd); #endif } -void LevBedFL() { LevBed(0); } -void LevBedFR() { LevBed(1); } -void LevBedBR() { LevBed(2); } -void LevBedBL() { LevBed(3); } -void LevBedC () { LevBed(4); } +void TramFL() { Tram(0); } +void TramFR() { Tram(1); } +void TramBR() { Tram(2); } +void TramBL() { Tram(3); } +void TramC () { Tram(4); } #if ENABLED(MESH_BED_LEVELING) @@ -2572,6 +2590,13 @@ void SetStepsZ() { HMI_value.axis = Z_AXIS, SetPFloatOnClick( MIN_STEP, MAX_STEP } #endif +#if ENABLED(FWRETRACT) + void SetRetractLength() { SetPFloatOnClick( 0, 10, UNITFDIGITS); }; + void SetRetractSpeed() { SetPFloatOnClick( 1, 90, UNITFDIGITS); }; + void SetZRaise() { SetPFloatOnClick( 0, 2, 2); }; + void SetRecoverSpeed() { SetPFloatOnClick( 1, 90, UNITFDIGITS); }; +#endif + // Menuitem Drawing functions ================================================= void onDrawMenuItem(MenuItemClass* menuitem, int8_t line) { @@ -2745,7 +2770,13 @@ void onDrawLanguage(MenuItemClass* menuitem, int8_t line) { void onDrawPwrLossR(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, recovery.enabled); } #endif -void onDrawEnableSound(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, ui.buzzer_enabled); } +#if ENABLED(SOUND_MENU_ITEM) + void onDrawEnableSound(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, ui.buzzer_enabled); } +#endif + +#ifdef BLTOUCH_HS_MODE + void onDrawHSMode(MenuItemClass* menuitem, int8_t line) { onDrawChkbMenu(menuitem, line, bltouch.high_speed_mode); } +#endif void onDrawSelColorItem(MenuItemClass* menuitem, int8_t line) { const uint16_t color = *(uint16_t*)static_cast(menuitem)->value; @@ -3025,9 +3056,12 @@ void onDrawStepsZ(MenuItemClass* menuitem, int8_t line) { void HMI_Menu() { EncoderState encoder_diffState = get_encoder_state(); if (encoder_diffState == ENCODER_DIFF_NO) return; - if (encoder_diffState == ENCODER_DIFF_ENTER) { - if (CurrentMenu != nullptr) CurrentMenu->onClick(); - } else if (CurrentMenu != nullptr) CurrentMenu->onScroll(encoder_diffState == ENCODER_DIFF_CW); + if (CurrentMenu) { + if (encoder_diffState == ENCODER_DIFF_ENTER) + CurrentMenu->onClick(); + else + CurrentMenu->onScroll(encoder_diffState == ENCODER_DIFF_CW); + } } // Get an integer value using the encoder without draw anything @@ -3079,8 +3113,8 @@ void HMI_SetInt() { int8_t val = HMI_GetInt(HMI_value.MinValue, HMI_value.MaxValue); switch (val) { case 0: return; break; - case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; - case 2: if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; + case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; + case 2: if (HMI_value.Apply) HMI_value.Apply(); break; } } @@ -3089,8 +3123,8 @@ void HMI_SetIntNoDraw() { int8_t val = HMI_GetIntNoDraw(HMI_value.MinValue, HMI_value.MaxValue); switch (val) { case 0: return; break; - case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; - case 2: if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; + case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; + case 2: if (HMI_value.Apply) HMI_value.Apply(); break; } } @@ -3099,8 +3133,8 @@ void HMI_SetPInt() { int8_t val = HMI_GetInt(HMI_value.MinValue, HMI_value.MaxValue); switch (val) { case 0: return; - case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; - case 2: *HMI_value.P_Int = HMI_value.Value; if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; + case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; + case 2: *HMI_value.P_Int = HMI_value.Value; if (HMI_value.Apply) HMI_value.Apply(); break; } } @@ -3133,8 +3167,8 @@ void HMI_SetFloat() { const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); switch (val) { case 0: return; - case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; - case 2: if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; + case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; + case 2: if (HMI_value.Apply) HMI_value.Apply(); break; } } @@ -3143,8 +3177,8 @@ void HMI_SetPFloat() { const int8_t val = HMI_GetFloat(HMI_value.dp, HMI_value.MinValue, HMI_value.MaxValue); switch (val) { case 0: return; - case 1: if (HMI_value.LiveUpdate != nullptr) HMI_value.LiveUpdate(); break; - case 2: *HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp); if (HMI_value.Apply != nullptr) HMI_value.Apply(); break; + case 1: if (HMI_value.LiveUpdate) HMI_value.LiveUpdate(); break; + case 2: *HMI_value.P_Float = HMI_value.Value / POW(10, HMI_value.dp); if (HMI_value.Apply) HMI_value.Apply(); break; } } @@ -3159,156 +3193,169 @@ void SetMenuTitle(frame_rect_t cn, const __FlashStringHelper* fstr) { void Draw_Prepare_Menu() { checkkey = Menu; - if (PrepareMenu == nullptr) PrepareMenu = new MenuClass(); + if (!PrepareMenu) PrepareMenu = new MenuClass(); if (CurrentMenu != PrepareMenu) { CurrentMenu = PrepareMenu; SetMenuTitle({133, 1, 28, 13}, GET_TEXT_F(MSG_PREPARE)); DWINUI::MenuItemsPrepare(13); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); #if ENABLED(ADVANCED_PAUSE_FEATURE) - ADDMENUITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENT_MAN), onDrawSubMenu, Draw_FilamentMan_Menu); + MENU_ITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENT_MAN), onDrawSubMenu, Draw_FilamentMan_Menu); + #endif + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_MOVE_AXIS), onDrawMoveSubMenu, Goto_Move_Menu); + MENU_ITEM(ICON_Tram, GET_TEXT_F(MSG_BED_TRAMMING), onDrawSubMenu, Draw_Tramming_Menu); + MENU_ITEM(ICON_CloseMotor, GET_TEXT_F(MSG_DISABLE_STEPPERS), onDrawDisableMotors, DisableMotors); + #if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_HOMING), onDrawSubMenu, Draw_Homing_Menu); + #else + MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawAutoHome, AutoHome); #endif - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_MOVE_AXIS), onDrawMoveSubMenu, Draw_Move_Menu); - ADDMENUITEM(ICON_LevBed, GET_TEXT_F(MSG_BED_LEVELING), onDrawSubMenu, Draw_LevBedCorners_Menu); - ADDMENUITEM(ICON_CloseMotor, GET_TEXT_F(MSG_DISABLE_STEPPERS), onDrawDisableMotors, DisableMotors); - ADDMENUITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawAutoHome, AutoHome); #if ENABLED(MESH_BED_LEVELING) - ADDMENUITEM(ICON_ManualMesh, GET_TEXT_F(MSG_MANUAL_MESH), onDrawSubMenu, Draw_ManualMesh_Menu); + MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_MANUAL_MESH), onDrawSubMenu, Draw_ManualMesh_Menu); #endif #if HAS_ZOFFSET_ITEM - #if EITHER(HAS_BED_PROBE, BABYSTEPPING) - ADDMENUITEM(ICON_SetZOffset, GET_TEXT_F(MSG_PROBE_WIZARD), onDrawSubMenu, Draw_ZOffsetWiz_Menu); + #if HAS_BED_PROBE + MENU_ITEM(ICON_SetZOffset, GET_TEXT_F(MSG_PROBE_WIZARD), onDrawSubMenu, Draw_ZOffsetWiz_Menu); + #elif ENABLED(BABYSTEPPING) + EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); #else - ADDMENUITEM(ICON_SetHome, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawHomeOffset, SetHome); + MENU_ITEM(ICON_SetHome, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawHomeOffset, SetHome); #endif #endif #if HAS_PREHEAT - ADDMENUITEM(ICON_PLAPreheat, GET_TEXT_F(MSG_PREHEAT_1), onDrawPreheat1, DoPreheat0); + MENU_ITEM(ICON_PLAPreheat, GET_TEXT_F(MSG_PREHEAT_1), onDrawPreheat1, DoPreheat0); #if PREHEAT_COUNT > 1 - ADDMENUITEM(ICON_ABSPreheat, PSTR("Preheat " PREHEAT_2_LABEL), onDrawPreheat2, DoPreheat1); + MENU_ITEM(ICON_ABSPreheat, PSTR("Preheat " PREHEAT_2_LABEL), onDrawPreheat2, DoPreheat1); #endif #if PREHEAT_COUNT > 2 - ADDMENUITEM(ICON_CustomPreheat, GET_TEXT_F(MSG_PREHEAT_CUSTOM), onDrawMenuItem, DoPreheat2); + MENU_ITEM(ICON_CustomPreheat, GET_TEXT_F(MSG_PREHEAT_CUSTOM), onDrawMenuItem, DoPreheat2); #endif #endif - ADDMENUITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, DoCoolDown); - ADDMENUITEM(ICON_Language, PSTR("UI Language"), onDrawLanguage, SetLanguage); + MENU_ITEM(ICON_Cool, GET_TEXT_F(MSG_COOLDOWN), onDrawCooldown, DoCoolDown); + MENU_ITEM(ICON_Language, PSTR(GET_TEXT_F(MSG_UI_LANGUAGE)), onDrawLanguage, SetLanguage); } CurrentMenu->draw(); } -void Draw_LevBedCorners_Menu() { +void Draw_Tramming_Menu() { DWINUI::ClearMenuArea(); checkkey = Menu; - if (LevBedMenu == nullptr) LevBedMenu = new MenuClass(); - if (CurrentMenu != LevBedMenu) { - CurrentMenu = LevBedMenu; + if (!TrammingMenu) TrammingMenu = new MenuClass(); + if (CurrentMenu != TrammingMenu) { + CurrentMenu = TrammingMenu; SetMenuTitle({0}, GET_TEXT_F(MSG_BED_TRAMMING)); // TODO: Chinese, English "Bed Tramming" JPG DWINUI::MenuItemsPrepare(6); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, LevBedFL); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, LevBedFR); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, LevBedBR); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, LevBedBL); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, LevBedC ); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FL), onDrawMenuItem, TramFL); + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_FR), onDrawMenuItem, TramFR); + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BR), onDrawMenuItem, TramBR); + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_BL), onDrawMenuItem, TramBL); + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_LEVBED_C ), onDrawMenuItem, TramC ); } CurrentMenu->draw(); } void Draw_Control_Menu() { checkkey = Menu; - if (ControlMenu == nullptr) ControlMenu = new MenuClass(); + if (!ControlMenu) ControlMenu = new MenuClass(); if (CurrentMenu != ControlMenu) { CurrentMenu = ControlMenu; SetMenuTitle({103, 1, 28, 14}, GET_TEXT_F(MSG_CONTROL)); DWINUI::MenuItemsPrepare(9); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); - ADDMENUITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu); - ADDMENUITEM(ICON_Motion, GET_TEXT_F(MSG_MOTION), onDrawMotionSubMenu, Draw_Motion_Menu); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_Main_Menu); + MENU_ITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawTempSubMenu, Draw_Temperature_Menu); + MENU_ITEM(ICON_Motion, GET_TEXT_F(MSG_MOTION), onDrawMotionSubMenu, Draw_Motion_Menu); #if ENABLED(EEPROM_SETTINGS) - ADDMENUITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawWriteEeprom, WriteEeprom); - ADDMENUITEM(ICON_ReadEEPROM, GET_TEXT_F(MSG_LOAD_EEPROM), onDrawReadEeprom, ReadEeprom); - ADDMENUITEM(ICON_ResumeEEPROM, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawResetEeprom, ResetEeprom); + MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawWriteEeprom, WriteEeprom); + MENU_ITEM(ICON_ReadEEPROM, GET_TEXT_F(MSG_LOAD_EEPROM), onDrawReadEeprom, ReadEeprom); + MENU_ITEM(ICON_ResumeEEPROM, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawResetEeprom, ResetEeprom); #endif - ADDMENUITEM(ICON_Reboot, GET_TEXT_F(MSG_RESET_PRINTER), onDrawMenuItem, RebootPrinter); - ADDMENUITEM(ICON_AdvSet, GET_TEXT_F(MSG_ADVANCED_SETTINGS), onDrawSubMenu, Draw_AdvancedSettings_Menu); - ADDMENUITEM(ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN), onDrawInfoSubMenu, Goto_InfoMenu); + MENU_ITEM(ICON_Reboot, GET_TEXT_F(MSG_RESET_PRINTER), onDrawMenuItem, RebootPrinter); + MENU_ITEM(ICON_AdvSet, GET_TEXT_F(MSG_ADVANCED_SETTINGS), onDrawSubMenu, Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_Info, GET_TEXT_F(MSG_INFO_SCREEN), onDrawInfoSubMenu, Goto_Info_Menu); } CurrentMenu->draw(); } void Draw_AdvancedSettings_Menu() { checkkey = Menu; - if (AdvancedSettings == nullptr) AdvancedSettings = new MenuClass(); + if (!AdvancedSettings) AdvancedSettings = new MenuClass(); if (CurrentMenu != AdvancedSettings) { CurrentMenu = AdvancedSettings; SetMenuTitle({0}, GET_TEXT_F(MSG_ADVANCED_SETTINGS)); // TODO: Chinese, English "Advanced Settings" JPG - DWINUI::MenuItemsPrepare(12); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + DWINUI::MenuItemsPrepare(15); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); #if HAS_HOME_OFFSET - ADDMENUITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); + MENU_ITEM(ICON_HomeOffset, GET_TEXT_F(MSG_SET_HOME_OFFSETS), onDrawSubMenu, Draw_HomeOffset_Menu); #endif #if HAS_BED_PROBE - ADDMENUITEM(ICON_ProbeSet, GET_TEXT_F(MSG_ZPROBE_SETTINGS), onDrawSubMenu, Draw_ProbeSet_Menu); + MENU_ITEM(ICON_ProbeSet, GET_TEXT_F(MSG_ZPROBE_SETTINGS), onDrawSubMenu, Draw_ProbeSet_Menu); #endif #if HAS_HOTEND - ADDMENUITEM(ICON_PIDNozzle, F("Hotend PID Settings"), onDrawSubMenu, Draw_HotendPID_Menu); + MENU_ITEM(ICON_PIDNozzle, F("Hotend PID Settings"), onDrawSubMenu, Draw_HotendPID_Menu); #endif #if HAS_HEATED_BED - ADDMENUITEM(ICON_PIDbed, F("Bed PID Settings"), onDrawSubMenu, Draw_BedPID_Menu); + MENU_ITEM(ICON_PIDbed, F("Bed PID Settings"), onDrawSubMenu, Draw_BedPID_Menu); #endif #if HAS_FILAMENT_SENSOR - ADDMENUITEM(ICON_FilSet, GET_TEXT_F(MSG_FILAMENT_SET), onDrawSubMenu, Draw_FilSet_Menu); + MENU_ITEM(ICON_FilSet, GET_TEXT_F(MSG_FILAMENT_SET), onDrawSubMenu, Draw_FilSet_Menu); #endif #if ENABLED(POWER_LOSS_RECOVERY) - ADDMENUITEM(ICON_Pwrlossr, GET_TEXT_F(MSG_OUTAGE_RECOVERY), onDrawPwrLossR, SetPwrLossr); + MENU_ITEM(ICON_Pwrlossr, GET_TEXT_F(MSG_OUTAGE_RECOVERY), onDrawPwrLossR, SetPwrLossr); #endif #if HAS_LCD_BRIGHTNESS - ADDMENUITEM_P(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness); + EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness); #endif - ADDMENUITEM(ICON_Scolor, F("Select Colors"), onDrawSubMenu, Draw_SelectColors_Menu); + MENU_ITEM(ICON_Scolor, GET_TEXT_F(MSG_COLORS_SELECT), onDrawSubMenu, Draw_SelectColors_Menu); #if ENABLED(SOUND_MENU_ITEM) - ADDMENUITEM(ICON_Sound, F("Enable Sound"), onDrawEnableSound, SetEnableSound); + MENU_ITEM(ICON_Sound, GET_TEXT_F(MSG_SOUND_ENABLE), onDrawEnableSound, SetEnableSound); #endif #if HAS_MESH - ADDMENUITEM(ICON_MeshViewer, GET_TEXT_F(MSG_MESH_VIEW), onDrawSubMenu, DWIN_MeshViewer); + MENU_ITEM(ICON_MeshViewer, GET_TEXT_F(MSG_MESH_VIEW), onDrawSubMenu, DWIN_MeshViewer); #endif - ADDMENUITEM(ICON_Lock, F("Lock Screen"), onDrawMenuItem, Goto_LockScreen); + #if HAS_ESDIAG + MENU_ITEM(ICON_ESDiag, F("End-stops diag."), onDrawSubMenu, Draw_EndStopDiag); + #endif + #if ENABLED(PRINTCOUNTER) + MENU_ITEM(ICON_PrintStats, GET_TEXT_F(MSG_INFO_STATS_MENU), onDrawSubMenu, Draw_PrintStats); + MENU_ITEM(ICON_PrintStatsReset, GET_TEXT_F(MSG_INFO_PRINT_COUNT_RESET), onDrawSubMenu, PrintStats.Reset); + #endif + MENU_ITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen); } CurrentMenu->draw(); } void Draw_Move_Menu() { checkkey = Menu; - if (MoveMenu == nullptr) MoveMenu = new MenuClass(); + if (!MoveMenu) MoveMenu = new MenuClass(); if (CurrentMenu != MoveMenu) { CurrentMenu = MoveMenu; SetMenuTitle({192, 1, 42, 14}, GET_TEXT_F(MSG_MOVE_AXIS)); DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - ADDMENUITEM_P(ICON_MoveX, GET_TEXT_F(MSG_MOVE_X), onDrawMoveX, SetMoveX, ¤t_position.x); - ADDMENUITEM_P(ICON_MoveY, GET_TEXT_F(MSG_MOVE_Y), onDrawMoveY, SetMoveY, ¤t_position.y); - ADDMENUITEM_P(ICON_MoveZ, GET_TEXT_F(MSG_MOVE_Z), onDrawMoveZ, SetMoveZ, ¤t_position.z); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); + EDIT_ITEM(ICON_MoveX, GET_TEXT_F(MSG_MOVE_X), onDrawMoveX, SetMoveX, ¤t_position.x); + EDIT_ITEM(ICON_MoveY, GET_TEXT_F(MSG_MOVE_Y), onDrawMoveY, SetMoveY, ¤t_position.y); + EDIT_ITEM(ICON_MoveZ, GET_TEXT_F(MSG_MOVE_Z), onDrawMoveZ, SetMoveZ, ¤t_position.z); #if HAS_HOTEND - ADDMENUITEM_P(ICON_Extruder, GET_TEXT_F(MSG_MOVE_E), onDrawMoveE, SetMoveE, ¤t_position.e); + EDIT_ITEM(ICON_Extruder, GET_TEXT_F(MSG_MOVE_E), onDrawMoveE, SetMoveE, ¤t_position.e); #endif } CurrentMenu->draw(); - if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: position is unknown"); + if (!all_axes_trusted()) LCD_MESSAGE_F("WARNING: current position is unknown, home axes"); } #if HAS_HOME_OFFSET void Draw_HomeOffset_Menu() { checkkey = Menu; - if (HomeOffMenu == nullptr) HomeOffMenu = new MenuClass(); + if (!HomeOffMenu) HomeOffMenu = new MenuClass(); if (CurrentMenu != HomeOffMenu) { CurrentMenu = HomeOffMenu; SetMenuTitle({0}, GET_TEXT_F(MSG_SET_HOME_OFFSETS)); // TODO: Chinese, English "Set Home Offsets" JPG DWINUI::MenuItemsPrepare(4); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); - ADDMENUITEM_P(ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X), onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]); - ADDMENUITEM_P(ICON_HomeOffsetY, GET_TEXT_F(MSG_HOME_OFFSET_Y), onDrawPFloatMenu, SetHomeOffsetY, &home_offset[Y_AXIS]); - ADDMENUITEM_P(ICON_HomeOffsetZ, GET_TEXT_F(MSG_HOME_OFFSET_Z), onDrawPFloatMenu, SetHomeOffsetZ, &home_offset[Z_AXIS]); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); + EDIT_ITEM(ICON_HomeOffsetX, GET_TEXT_F(MSG_HOME_OFFSET_X), onDrawPFloatMenu, SetHomeOffsetX, &home_offset[X_AXIS]); + EDIT_ITEM(ICON_HomeOffsetY, GET_TEXT_F(MSG_HOME_OFFSET_Y), onDrawPFloatMenu, SetHomeOffsetY, &home_offset[Y_AXIS]); + EDIT_ITEM(ICON_HomeOffsetZ, GET_TEXT_F(MSG_HOME_OFFSET_Z), onDrawPFloatMenu, SetHomeOffsetZ, &home_offset[Z_AXIS]); } CurrentMenu->draw(); } @@ -3317,16 +3364,21 @@ void Draw_Move_Menu() { #if HAS_BED_PROBE void Draw_ProbeSet_Menu() { checkkey = Menu; - if (ProbeSetMenu == nullptr) ProbeSetMenu = new MenuClass(); + if (!ProbeSetMenu) ProbeSetMenu = new MenuClass(); if (CurrentMenu != ProbeSetMenu) { CurrentMenu = ProbeSetMenu; SetMenuTitle({0}, GET_TEXT_F(MSG_ZPROBE_SETTINGS)); // TODO: Chinese, English "Probe Settings" JPG - DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); - ADDMENUITEM_P(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); - ADDMENUITEM_P(ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET), onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); - ADDMENUITEM_P(ICON_ProbeOffsetZ, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); - ADDMENUITEM(ICON_ProbeTest, GET_TEXT_F(MSG_M48_TEST), onDrawMenuItem, ProbeTest); + DWINUI::MenuItemsPrepare(8); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); + EDIT_ITEM(ICON_ProbeOffsetX, GET_TEXT_F(MSG_ZPROBE_XOFFSET), onDrawPFloatMenu, SetProbeOffsetX, &probe.offset.x); + EDIT_ITEM(ICON_ProbeOffsetY, GET_TEXT_F(MSG_ZPROBE_YOFFSET), onDrawPFloatMenu, SetProbeOffsetY, &probe.offset.y); + EDIT_ITEM(ICON_ProbeOffsetZ, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetProbeOffsetZ, &probe.offset.z); + #ifdef BLTOUCH_HS_MODE + MENU_ITEM(ICON_HSMode, F("Enable HS mode"), onDrawHSMode, SetHSMode); + #endif + MENU_ITEM(ICON_ProbeTest, GET_TEXT_F(MSG_M48_TEST), onDrawMenuItem, ProbeTest); + MENU_ITEM(ICON_ProbeStow, GET_TEXT_F(MSG_MANUAL_STOW), onDrawMenuItem, ProbeStow); + MENU_ITEM(ICON_ProbeDeploy, GET_TEXT_F(MSG_MANUAL_DEPLOY), onDrawMenuItem, ProbeDeploy); } CurrentMenu->draw(); } @@ -3335,24 +3387,30 @@ void Draw_Move_Menu() { #if HAS_FILAMENT_SENSOR void Draw_FilSet_Menu() { checkkey = Menu; - if (FilSetMenu == nullptr) FilSetMenu = new MenuClass(); + if (!FilSetMenu) FilSetMenu = new MenuClass(); if (CurrentMenu != FilSetMenu) { CurrentMenu = FilSetMenu; CurrentMenu->MenuTitle.SetCaption(GET_TEXT_F(MSG_FILAMENT_SET)); - DWINUI::MenuItemsPrepare(6); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); + DWINUI::MenuItemsPrepare(10); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); #if HAS_FILAMENT_SENSOR - ADDMENUITEM(ICON_Runout, GET_TEXT_F(MSG_RUNOUT_ENABLE), onDrawRunoutEnable, SetRunoutEnable); + MENU_ITEM(ICON_Runout, GET_TEXT_F(MSG_RUNOUT_ENABLE), onDrawRunoutEnable, SetRunoutEnable); #endif #if HAS_FILAMENT_RUNOUT_DISTANCE - ADDMENUITEM_P(ICON_Runout, F("Runout Distance"), onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance()); + EDIT_ITEM(ICON_Runout, F("Runout Distance"), onDrawPFloatMenu, SetRunoutDistance, &runout.runout_distance()); #endif #if ENABLED(PREVENT_COLD_EXTRUSION) - ADDMENUITEM_P(ICON_ExtrudeMinT, F("Extrude Min Temp."), onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT); + EDIT_ITEM(ICON_ExtrudeMinT, F("Extrude Min Temp."), onDrawPIntMenu, SetExtMinT, &HMI_data.ExtMinT); #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) - ADDMENUITEM_P(ICON_FilLoad, GET_TEXT_F(MSG_FILAMENT_LOAD), onDrawPFloatMenu, SetFilLoad, &fc_settings[0].load_length); - ADDMENUITEM_P(ICON_FilUnload, GET_TEXT_F(MSG_FILAMENT_UNLOAD), onDrawPFloatMenu, SetFilUnload, &fc_settings[0].unload_length); + EDIT_ITEM(ICON_FilLoad, GET_TEXT_F(MSG_FILAMENT_LOAD), onDrawPFloatMenu, SetFilLoad, &fc_settings[0].load_length); + EDIT_ITEM(ICON_FilUnload, GET_TEXT_F(MSG_FILAMENT_UNLOAD), onDrawPFloatMenu, SetFilUnload, &fc_settings[0].unload_length); + #endif + #if ENABLED(FWRETRACT) + EDIT_ITEM(ICON_FWRetLength, GET_TEXT_F(MSG_CONTROL_RETRACT), onDrawPFloatMenu, SetRetractLength, &fwretract.settings.retract_length); + EDIT_ITEM(ICON_FWRetSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_RETRACT_SPEED), onDrawPFloatMenu, SetRetractSpeed, &fwretract.settings.retract_feedrate_mm_s); + EDIT_ITEM(ICON_FWRetZRaise, GET_TEXT_F(MSG_CONTROL_RETRACT_ZHOP), onDrawPFloat2Menu, SetZRaise, &fwretract.settings.retract_zraise); + EDIT_ITEM(ICON_FWRecSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_UNRETRACT_SPEED), onDrawPFloatMenu, SetRecoverSpeed, &fwretract.settings.retract_recover_feedrate_mm_s); #endif } CurrentMenu->draw(); @@ -3361,47 +3419,47 @@ void Draw_Move_Menu() { void Draw_SelectColors_Menu() { checkkey = Menu; - if (SelectColorMenu == nullptr) SelectColorMenu = new MenuClass(); + if (!SelectColorMenu) SelectColorMenu = new MenuClass(); if (CurrentMenu != SelectColorMenu) { CurrentMenu = SelectColorMenu; - SetMenuTitle({0}, F("Select Colors")); // TODO: Chinese, English "Select Color" JPG + SetMenuTitle({0}, GET_TEXT_F(MSG_COLORS_SELECT)); // TODO: Chinese, English "Select Color" JPG DWINUI::MenuItemsPrepare(20); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); - ADDMENUITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors); - ADDMENUITEM_P(0, "Screen Background", onDrawSelColorItem, SelColor, &HMI_data.Background_Color); - ADDMENUITEM_P(0, "Cursor", onDrawSelColorItem, SelColor, &HMI_data.Cursor_color); - ADDMENUITEM_P(0, "Title Background", onDrawSelColorItem, SelColor, &HMI_data.TitleBg_color); - ADDMENUITEM_P(0, "Title Text", onDrawSelColorItem, SelColor, &HMI_data.TitleTxt_color); - ADDMENUITEM_P(0, "Text", onDrawSelColorItem, SelColor, &HMI_data.Text_Color); - ADDMENUITEM_P(0, "Selected", onDrawSelColorItem, SelColor, &HMI_data.Selected_Color); - ADDMENUITEM_P(0, "Split Line", onDrawSelColorItem, SelColor, &HMI_data.SplitLine_Color); - ADDMENUITEM_P(0, "Highlight", onDrawSelColorItem, SelColor, &HMI_data.Highlight_Color); - ADDMENUITEM_P(0, "Status Background", onDrawSelColorItem, SelColor, &HMI_data.StatusBg_Color); - ADDMENUITEM_P(0, "Status Text", onDrawSelColorItem, SelColor, &HMI_data.StatusTxt_Color); - ADDMENUITEM_P(0, "Popup Background", onDrawSelColorItem, SelColor, &HMI_data.PopupBg_color); - ADDMENUITEM_P(0, "Popup Text", onDrawSelColorItem, SelColor, &HMI_data.PopupTxt_Color); - ADDMENUITEM_P(0, "Alert Background", onDrawSelColorItem, SelColor, &HMI_data.AlertBg_Color); - ADDMENUITEM_P(0, "Alert Text", onDrawSelColorItem, SelColor, &HMI_data.AlertTxt_Color); - ADDMENUITEM_P(0, "Percent Text", onDrawSelColorItem, SelColor, &HMI_data.PercentTxt_Color); - ADDMENUITEM_P(0, "Bar Fill", onDrawSelColorItem, SelColor, &HMI_data.Barfill_Color); - ADDMENUITEM_P(0, "Indicator value", onDrawSelColorItem, SelColor, &HMI_data.Indicator_Color); - ADDMENUITEM_P(0, "Coordinate value", onDrawSelColorItem, SelColor, &HMI_data.Coordinate_Color); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_StockConfiguration, GET_TEXT_F(MSG_RESTORE_DEFAULTS), onDrawMenuItem, RestoreDefaultsColors); + EDIT_ITEM(0, "Screen Background", onDrawSelColorItem, SelColor, &HMI_data.Background_Color); + EDIT_ITEM(0, "Cursor", onDrawSelColorItem, SelColor, &HMI_data.Cursor_color); + EDIT_ITEM(0, "Title Background", onDrawSelColorItem, SelColor, &HMI_data.TitleBg_color); + EDIT_ITEM(0, "Title Text", onDrawSelColorItem, SelColor, &HMI_data.TitleTxt_color); + EDIT_ITEM(0, "Text", onDrawSelColorItem, SelColor, &HMI_data.Text_Color); + EDIT_ITEM(0, "Selected", onDrawSelColorItem, SelColor, &HMI_data.Selected_Color); + EDIT_ITEM(0, "Split Line", onDrawSelColorItem, SelColor, &HMI_data.SplitLine_Color); + EDIT_ITEM(0, "Highlight", onDrawSelColorItem, SelColor, &HMI_data.Highlight_Color); + EDIT_ITEM(0, "Status Background", onDrawSelColorItem, SelColor, &HMI_data.StatusBg_Color); + EDIT_ITEM(0, "Status Text", onDrawSelColorItem, SelColor, &HMI_data.StatusTxt_Color); + EDIT_ITEM(0, "Popup Background", onDrawSelColorItem, SelColor, &HMI_data.PopupBg_color); + EDIT_ITEM(0, "Popup Text", onDrawSelColorItem, SelColor, &HMI_data.PopupTxt_Color); + EDIT_ITEM(0, "Alert Background", onDrawSelColorItem, SelColor, &HMI_data.AlertBg_Color); + EDIT_ITEM(0, "Alert Text", onDrawSelColorItem, SelColor, &HMI_data.AlertTxt_Color); + EDIT_ITEM(0, "Percent Text", onDrawSelColorItem, SelColor, &HMI_data.PercentTxt_Color); + EDIT_ITEM(0, "Bar Fill", onDrawSelColorItem, SelColor, &HMI_data.Barfill_Color); + EDIT_ITEM(0, "Indicator value", onDrawSelColorItem, SelColor, &HMI_data.Indicator_Color); + EDIT_ITEM(0, "Coordinate value", onDrawSelColorItem, SelColor, &HMI_data.Coordinate_Color); } CurrentMenu->draw(); } void Draw_GetColor_Menu() { checkkey = Menu; - if (GetColorMenu == nullptr) GetColorMenu = new MenuClass(); + if (!GetColorMenu) GetColorMenu = new MenuClass(); if (CurrentMenu != GetColorMenu) { CurrentMenu = GetColorMenu; - SetMenuTitle({0}, F("Get Color")); // TODO: Chinese, English "Get Color" JPG + SetMenuTitle({0}, GET_TEXT_F(MSG_COLORS_GET)); // TODO: Chinese, English "Get Color" JPG DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor); - ADDMENUITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu); - ADDMENUITEM(0, "Red", onDrawGetColorItem, SetRGBColor); - ADDMENUITEM(1, "Green", onDrawGetColorItem, SetRGBColor); - ADDMENUITEM(2, "Blue", onDrawGetColorItem, SetRGBColor); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, DWIN_ApplyColor); + MENU_ITEM(ICON_Cancel, GET_TEXT_F(MSG_BUTTON_CANCEL), onDrawMenuItem, Draw_SelectColors_Menu); + MENU_ITEM(0, GET_TEXT_F(MSG_COLORS_RED), onDrawGetColorItem, SetRGBColor); + MENU_ITEM(1, GET_TEXT_F(MSG_COLORS_GREEN), onDrawGetColorItem, SetRGBColor); + MENU_ITEM(2, GET_TEXT_F(MSG_COLORS_BLUE), onDrawGetColorItem, SetRGBColor); } CurrentMenu->draw(); DWIN_Draw_Rectangle(1, *HMI_value.P_Int, 20, 315, DWIN_WIDTH - 20, 335); @@ -3409,32 +3467,38 @@ void Draw_GetColor_Menu() { void Draw_Tune_Menu() { checkkey = Menu; - if (TuneMenu == nullptr) TuneMenu = new MenuClass(); + if (!TuneMenu) TuneMenu = new MenuClass(); if (CurrentMenu != TuneMenu) { CurrentMenu = TuneMenu; SetMenuTitle({73, 2, 28, 12}, GET_TEXT_F(MSG_TUNE)); // TODO: Chinese, English "Tune" JPG - DWINUI::MenuItemsPrepare(10); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess); - ADDMENUITEM_P(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage); + DWINUI::MenuItemsPrepare(14); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Goto_PrintProcess); + EDIT_ITEM(ICON_Speed, GET_TEXT_F(MSG_SPEED), onDrawSpeedItem, SetSpeed, &feedrate_percentage); #if HAS_HOTEND - HotendTargetItem = ADDMENUITEM_P(ICON_HotendTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); + HotendTargetItem = EDIT_ITEM(ICON_HotendTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - BedTargetItem = ADDMENUITEM_P(ICON_BedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); + BedTargetItem = EDIT_ITEM(ICON_BedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN - FanSpeedItem = ADDMENUITEM_P(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); + FanSpeedItem = EDIT_ITEM(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); #endif #if HAS_ZOFFSET_ITEM && EITHER(HAS_BED_PROBE, BABYSTEPPING) - ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawZOffset, SetZOffset, &BABY_Z_VAR); + EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawZOffset, SetZOffset, &BABY_Z_VAR); #endif - ADDMENUITEM_P(ICON_Flow, GET_TEXT_F(MSG_FLOW), onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); + #if ENABLED(FWRETRACT) + EDIT_ITEM(ICON_FWRetLength, GET_TEXT_F(MSG_CONTROL_RETRACT), onDrawPFloatMenu, SetRetractLength, &fwretract.settings.retract_length); + EDIT_ITEM(ICON_FWRetSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_RETRACT_SPEED), onDrawPFloatMenu, SetRetractSpeed, &fwretract.settings.retract_feedrate_mm_s); + EDIT_ITEM(ICON_FWRetZRaise, GET_TEXT_F(MSG_CONTROL_RETRACT_ZHOP), onDrawPFloat2Menu, SetZRaise, &fwretract.settings.retract_zraise); + EDIT_ITEM(ICON_FWRecSpeed, GET_TEXT_F(MSG_SINGLENOZZLE_UNRETRACT_SPEED), onDrawPFloatMenu, SetRecoverSpeed, &fwretract.settings.retract_recover_feedrate_mm_s); + #endif + EDIT_ITEM(ICON_Flow, GET_TEXT_F(MSG_FLOW), onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); #if ENABLED(ADVANCED_PAUSE_FEATURE) - ADDMENUITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENTCHANGE), onDrawMenuItem, ChangeFilament); + MENU_ITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENTCHANGE), onDrawMenuItem, ChangeFilament); #endif - ADDMENUITEM(ICON_Lock, F("Lock Screen"), onDrawMenuItem, Goto_LockScreen); + MENU_ITEM(ICON_Lock, GET_TEXT_F(MSG_LOCKSCREEN), onDrawMenuItem, DWIN_LockScreen); #if HAS_LCD_BRIGHTNESS - ADDMENUITEM_P(ICON_Brightness, F("LCD Brightness"), onDrawPInt8Menu, SetBrightness, &ui.brightness); + EDIT_ITEM(ICON_Brightness, GET_TEXT_F(MSG_BRIGHTNESS), onDrawPInt8Menu, SetBrightness, &ui.brightness); #endif } CurrentMenu->draw(); @@ -3442,19 +3506,19 @@ void Draw_Tune_Menu() { void Draw_Motion_Menu() { checkkey = Menu; - if (MotionMenu == nullptr) MotionMenu = new MenuClass(); + if (!MotionMenu) MotionMenu = new MenuClass(); if (CurrentMenu != MotionMenu) { CurrentMenu = MotionMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MOTION)); // TODO: Chinese, English "Motion" JPG DWINUI::MenuItemsPrepare(6); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); - ADDMENUITEM(ICON_MaxSpeed, GET_TEXT_F(MSG_SPEED), onDrawSpeed, Draw_MaxSpeed_Menu); - ADDMENUITEM(ICON_MaxAccelerated, GET_TEXT_F(MSG_ACCELERATION), onDrawAcc, Draw_MaxAccel_Menu); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + MENU_ITEM(ICON_MaxSpeed, GET_TEXT_F(MSG_SPEED), onDrawSpeed, Draw_MaxSpeed_Menu); + MENU_ITEM(ICON_MaxAccelerated, GET_TEXT_F(MSG_ACCELERATION), onDrawAcc, Draw_MaxAccel_Menu); #if HAS_CLASSIC_JERK - ADDMENUITEM(ICON_MaxJerk, GET_TEXT_F(MSG_JERK), onDrawJerk, Draw_MaxJerk_Menu); + MENU_ITEM(ICON_MaxJerk, GET_TEXT_F(MSG_JERK), onDrawJerk, Draw_MaxJerk_Menu); #endif - ADDMENUITEM(ICON_Step, GET_TEXT_F(MSG_STEPS_PER_MM), onDrawSteps, Draw_Steps_Menu); - ADDMENUITEM_P(ICON_Flow, GET_TEXT_F(MSG_FLOW), onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); + MENU_ITEM(ICON_Step, GET_TEXT_F(MSG_STEPS_PER_MM), onDrawSteps, Draw_Steps_Menu); + EDIT_ITEM(ICON_Flow, GET_TEXT_F(MSG_FLOW), onDrawPIntMenu, SetFlow, &planner.flow_percentage[0]); } CurrentMenu->draw(); } @@ -3462,17 +3526,17 @@ void Draw_Motion_Menu() { #if ENABLED(ADVANCED_PAUSE_FEATURE) void Draw_FilamentMan_Menu() { checkkey = Menu; - if (FilamentMenu == nullptr) FilamentMenu = new MenuClass(); + if (!FilamentMenu) FilamentMenu = new MenuClass(); if (CurrentMenu != FilamentMenu) { CurrentMenu = FilamentMenu; SetMenuTitle({0}, GET_TEXT_F(MSG_FILAMENT_MAN)); // TODO: Chinese, English "Filament Management" JPG DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - ADDMENUITEM(ICON_Park, GET_TEXT_F(MSG_FILAMENT_PARK_ENABLED), onDrawMenuItem, ParkHead); - ADDMENUITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENTCHANGE), onDrawMenuItem, ChangeFilament); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); + MENU_ITEM(ICON_Park, GET_TEXT_F(MSG_FILAMENT_PARK_ENABLED), onDrawMenuItem, ParkHead); + MENU_ITEM(ICON_FilMan, GET_TEXT_F(MSG_FILAMENTCHANGE), onDrawMenuItem, ChangeFilament); #if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES) - ADDMENUITEM(ICON_FilUnload, GET_TEXT_F(MSG_FILAMENTUNLOAD), onDrawMenuItem, UnloadFilament); - ADDMENUITEM(ICON_FilLoad, GET_TEXT_F(MSG_FILAMENTLOAD), onDrawMenuItem, LoadFilament); + MENU_ITEM(ICON_FilUnload, GET_TEXT_F(MSG_FILAMENTUNLOAD), onDrawMenuItem, UnloadFilament); + MENU_ITEM(ICON_FilLoad, GET_TEXT_F(MSG_FILAMENTLOAD), onDrawMenuItem, LoadFilament); #endif } CurrentMenu->draw(); @@ -3482,17 +3546,17 @@ void Draw_Motion_Menu() { #if ENABLED(MESH_BED_LEVELING) void Draw_ManualMesh_Menu() { checkkey = Menu; - if (ManualMesh == nullptr) ManualMesh = new MenuClass(); + if (!ManualMesh) ManualMesh = new MenuClass(); if (CurrentMenu != ManualMesh) { CurrentMenu = ManualMesh; SetMenuTitle({0}, GET_TEXT_F(MSG_MANUAL_MESH)); // TODO: Chinese, English "Manual Mesh Leveling" JPG DWINUI::MenuItemsPrepare(6); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); - ADDMENUITEM(ICON_ManualMesh, GET_TEXT_F(MSG_LEVEL_BED), onDrawMenuItem, ManualMeshStart); - MMeshMoveZItem = ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_MOVE_Z), onDrawMMeshMoveZ, SetMMeshMoveZ, ¤t_position.z); - ADDMENUITEM(ICON_Axis, GET_TEXT_F(MSG_UBL_CONTINUE_MESH), onDrawMenuItem, ManualMeshContinue); - ADDMENUITEM(ICON_MeshViewer, GET_TEXT_F(MSG_MESH_VIEW), onDrawSubMenu, DWIN_MeshViewer); - ADDMENUITEM(ICON_MeshSave, GET_TEXT_F(MSG_UBL_SAVE_MESH), onDrawMenuItem, ManualMeshSave); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Prepare_Menu); + MENU_ITEM(ICON_ManualMesh, GET_TEXT_F(MSG_LEVEL_BED), onDrawMenuItem, ManualMeshStart); + MMeshMoveZItem = EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_MOVE_Z), onDrawMMeshMoveZ, SetMMeshMoveZ, ¤t_position.z); + MENU_ITEM(ICON_Axis, GET_TEXT_F(MSG_UBL_CONTINUE_MESH), onDrawMenuItem, ManualMeshContinue); + MENU_ITEM(ICON_MeshViewer, GET_TEXT_F(MSG_MESH_VIEW), onDrawSubMenu, DWIN_MeshViewer); + MENU_ITEM(ICON_MeshSave, GET_TEXT_F(MSG_UBL_SAVE_MESH), onDrawMenuItem, ManualMeshSave); } CurrentMenu->draw(); } @@ -3506,18 +3570,18 @@ void Draw_Motion_Menu() { CurrentMenu = PreheatMenu; SetMenuTitle(cn, fstr); DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Temperature_Menu); #if HAS_HOTEND - ADDMENUITEM_P(ICON_SetEndTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawSetPreheatHotend, SetPreheatEndTemp, &ui.material_preset[HMI_value.Preheat].hotend_temp); + EDIT_ITEM(ICON_SetEndTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawSetPreheatHotend, SetPreheatEndTemp, &ui.material_preset[HMI_value.Preheat].hotend_temp); #endif #if HAS_HEATED_BED - ADDMENUITEM_P(ICON_SetBedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawSetPreheatBed, SetPreheatBedTemp, &ui.material_preset[HMI_value.Preheat].bed_temp); + EDIT_ITEM(ICON_SetBedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawSetPreheatBed, SetPreheatBedTemp, &ui.material_preset[HMI_value.Preheat].bed_temp); #endif #if HAS_FAN - ADDMENUITEM_P(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawSetPreheatFan, SetPreheatFanSpeed, &ui.material_preset[HMI_value.Preheat].fan_speed); + EDIT_ITEM(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawSetPreheatFan, SetPreheatFanSpeed, &ui.material_preset[HMI_value.Preheat].fan_speed); #endif #if ENABLED(EEPROM_SETTINGS) - ADDMENUITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawWriteEeprom, WriteEeprom); + MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawWriteEeprom, WriteEeprom); #endif } CurrentMenu->draw(); @@ -3525,20 +3589,20 @@ void Draw_Motion_Menu() { void Draw_Preheat1_Menu() { HMI_value.Preheat = 0; - if (PreheatMenu == nullptr) PreheatMenu = new MenuClass(); + if (!PreheatMenu) PreheatMenu = new MenuClass(); Draw_Preheat_Menu({59, 16, 81, 14}, F(PREHEAT_1_LABEL " Preheat Settings")); // TODO: English "PLA Settings" JPG } void Draw_Preheat2_Menu() { HMI_value.Preheat = 1; - if (PreheatMenu == nullptr) PreheatMenu = new MenuClass(); + if (!PreheatMenu) PreheatMenu = new MenuClass(); Draw_Preheat_Menu({142, 16, 82, 14}, F(PREHEAT_2_LABEL " Preheat Settings")); // TODO: English "ABS Settings" JPG } #ifdef PREHEAT_3_LABEL void Draw_Preheat3_Menu() { HMI_value.Preheat = 2; - if (PreheatMenu == nullptr) PreheatMenu = new MenuClass(); + if (!PreheatMenu) PreheatMenu = new MenuClass(); #define PREHEAT_3_TITLE PREHEAT_3_LABEL " Preheat Set." Draw_Preheat_Menu({0}, F(PREHEAT_3_TITLE)); // TODO: Chinese, English "Custom Preheat Settings" JPG } @@ -3548,26 +3612,26 @@ void Draw_Motion_Menu() { void Draw_Temperature_Menu() { checkkey = Menu; - if (TemperatureMenu == nullptr) TemperatureMenu = new MenuClass(); + if (!TemperatureMenu) TemperatureMenu = new MenuClass(); if (CurrentMenu != TemperatureMenu) { CurrentMenu = TemperatureMenu; SetMenuTitle({236, 2, 28, 12}, GET_TEXT_F(MSG_TEMPERATURE)); DWINUI::MenuItemsPrepare(7); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Control_Menu); #if HAS_HOTEND - HotendTargetItem = ADDMENUITEM_P(ICON_SetEndTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); + HotendTargetItem = EDIT_ITEM(ICON_SetEndTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_HOTEND), onDrawHotendTemp, SetHotendTemp, &thermalManager.temp_hotend[0].target); #endif #if HAS_HEATED_BED - BedTargetItem = ADDMENUITEM_P(ICON_SetBedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); + BedTargetItem = EDIT_ITEM(ICON_SetBedTemp, GET_TEXT_F(MSG_UBL_SET_TEMP_BED), onDrawBedTemp, SetBedTemp, &thermalManager.temp_bed.target); #endif #if HAS_FAN - FanSpeedItem = ADDMENUITEM_P(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); + FanSpeedItem = EDIT_ITEM(ICON_FanSpeed, GET_TEXT_F(MSG_FAN_SPEED), onDrawFanSpeed, SetFanSpeed, &thermalManager.fan_speed[0]); #endif #if HAS_HOTEND - ADDMENUITEM(ICON_SetPLAPreheat, F(PREHEAT_1_LABEL " Preheat Settings"), onDrawPLAPreheatSubMenu, Draw_Preheat1_Menu); - ADDMENUITEM(ICON_SetABSPreheat, F(PREHEAT_2_LABEL " Preheat Settings"), onDrawABSPreheatSubMenu, Draw_Preheat2_Menu); + MENU_ITEM(ICON_SetPLAPreheat, F(PREHEAT_1_LABEL " Preheat Settings"), onDrawPLAPreheatSubMenu, Draw_Preheat1_Menu); + MENU_ITEM(ICON_SetABSPreheat, F(PREHEAT_2_LABEL " Preheat Settings"), onDrawABSPreheatSubMenu, Draw_Preheat2_Menu); #ifdef PREHEAT_3_LABEL - ADDMENUITEM(ICON_SetCustomPreheat, PREHEAT_3_TITLE, onDrawSubMenu, Draw_Preheat3_Menu); + MENU_ITEM(ICON_SetCustomPreheat, PREHEAT_3_TITLE, onDrawSubMenu, Draw_Preheat3_Menu); #endif #endif } @@ -3576,17 +3640,17 @@ void Draw_Temperature_Menu() { void Draw_MaxSpeed_Menu() { checkkey = Menu; - if (MaxSpeedMenu == nullptr) MaxSpeedMenu = new MenuClass(); + if (!MaxSpeedMenu) MaxSpeedMenu = new MenuClass(); if (CurrentMenu != MaxSpeedMenu) { CurrentMenu = MaxSpeedMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_MAXSPEED)); DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - ADDMENUITEM_P(ICON_MaxSpeedX, GET_TEXT_F(MSG_MAXSPEED_X), onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); - ADDMENUITEM_P(ICON_MaxSpeedY, GET_TEXT_F(MSG_MAXSPEED_Y), onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); - ADDMENUITEM_P(ICON_MaxSpeedZ, GET_TEXT_F(MSG_MAXSPEED_Z), onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); + EDIT_ITEM(ICON_MaxSpeedX, GET_TEXT_F(MSG_MAXSPEED_X), onDrawMaxSpeedX, SetMaxSpeedX, &planner.settings.max_feedrate_mm_s[X_AXIS]); + EDIT_ITEM(ICON_MaxSpeedY, GET_TEXT_F(MSG_MAXSPEED_Y), onDrawMaxSpeedY, SetMaxSpeedY, &planner.settings.max_feedrate_mm_s[Y_AXIS]); + EDIT_ITEM(ICON_MaxSpeedZ, GET_TEXT_F(MSG_MAXSPEED_Z), onDrawMaxSpeedZ, SetMaxSpeedZ, &planner.settings.max_feedrate_mm_s[Z_AXIS]); #if HAS_HOTEND - ADDMENUITEM_P(ICON_MaxSpeedE, GET_TEXT_F(MSG_MAXSPEED_E), onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[Z_AXIS]); + EDIT_ITEM(ICON_MaxSpeedE, GET_TEXT_F(MSG_MAXSPEED_E), onDrawMaxSpeedE, SetMaxSpeedE, &planner.settings.max_feedrate_mm_s[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3594,17 +3658,17 @@ void Draw_MaxSpeed_Menu() { void Draw_MaxAccel_Menu() { checkkey = Menu; - if (MaxAccelMenu == nullptr) MaxAccelMenu = new MenuClass(); + if (!MaxAccelMenu) MaxAccelMenu = new MenuClass(); if (CurrentMenu != MaxAccelMenu) { CurrentMenu = MaxAccelMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_ACCELERATION)); DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - ADDMENUITEM_P(ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A), onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]); - ADDMENUITEM_P(ICON_MaxAccY, GET_TEXT_F(MSG_AMAX_B), onDrawMaxAccelY, SetMaxAccelY, &planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); - ADDMENUITEM_P(ICON_MaxAccZ, GET_TEXT_F(MSG_AMAX_C), onDrawMaxAccelZ, SetMaxAccelZ, &planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); + EDIT_ITEM(ICON_MaxAccX, GET_TEXT_F(MSG_AMAX_A), onDrawMaxAccelX, SetMaxAccelX, &planner.settings.max_acceleration_mm_per_s2[X_AXIS]); + EDIT_ITEM(ICON_MaxAccY, GET_TEXT_F(MSG_AMAX_B), onDrawMaxAccelY, SetMaxAccelY, &planner.settings.max_acceleration_mm_per_s2[Y_AXIS]); + EDIT_ITEM(ICON_MaxAccZ, GET_TEXT_F(MSG_AMAX_C), onDrawMaxAccelZ, SetMaxAccelZ, &planner.settings.max_acceleration_mm_per_s2[Z_AXIS]); #if HAS_HOTEND - ADDMENUITEM_P(ICON_MaxAccE, GET_TEXT_F(MSG_AMAX_E), onDrawMaxAccelE, SetMaxAccelE, &planner.settings.max_acceleration_mm_per_s2[E_AXIS]); + EDIT_ITEM(ICON_MaxAccE, GET_TEXT_F(MSG_AMAX_E), onDrawMaxAccelE, SetMaxAccelE, &planner.settings.max_acceleration_mm_per_s2[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3613,17 +3677,17 @@ void Draw_MaxAccel_Menu() { #if HAS_CLASSIC_JERK void Draw_MaxJerk_Menu() { checkkey = Menu; - if (MaxJerkMenu == nullptr) MaxJerkMenu = new MenuClass(); + if (!MaxJerkMenu) MaxJerkMenu = new MenuClass(); if (CurrentMenu != MaxJerkMenu) { CurrentMenu = MaxJerkMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_JERK)); DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - ADDMENUITEM_P(ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK), onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]); - ADDMENUITEM_P(ICON_MaxSpeedJerkY, GET_TEXT_F(MSG_VB_JERK), onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk[Y_AXIS]); - ADDMENUITEM_P(ICON_MaxSpeedJerkZ, GET_TEXT_F(MSG_VC_JERK), onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk[Z_AXIS]); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); + EDIT_ITEM(ICON_MaxSpeedJerkX, GET_TEXT_F(MSG_VA_JERK), onDrawMaxJerkX, SetMaxJerkX, &planner.max_jerk[X_AXIS]); + EDIT_ITEM(ICON_MaxSpeedJerkY, GET_TEXT_F(MSG_VB_JERK), onDrawMaxJerkY, SetMaxJerkY, &planner.max_jerk[Y_AXIS]); + EDIT_ITEM(ICON_MaxSpeedJerkZ, GET_TEXT_F(MSG_VC_JERK), onDrawMaxJerkZ, SetMaxJerkZ, &planner.max_jerk[Z_AXIS]); #if HAS_HOTEND - ADDMENUITEM_P(ICON_MaxSpeedJerkE, GET_TEXT_F(MSG_VE_JERK), onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk[E_AXIS]); + EDIT_ITEM(ICON_MaxSpeedJerkE, GET_TEXT_F(MSG_VE_JERK), onDrawMaxJerkE, SetMaxJerkE, &planner.max_jerk[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3632,17 +3696,17 @@ void Draw_MaxAccel_Menu() { void Draw_Steps_Menu() { checkkey = Menu; - if (StepsMenu == nullptr) StepsMenu = new MenuClass(); + if (!StepsMenu) StepsMenu = new MenuClass(); if (CurrentMenu != StepsMenu) { CurrentMenu = StepsMenu; SetMenuTitle({1, 16, 28, 13}, GET_TEXT_F(MSG_STEPS_PER_MM)); DWINUI::MenuItemsPrepare(5); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); - ADDMENUITEM_P(ICON_StepX, GET_TEXT_F(MSG_A_STEPS), onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]); - ADDMENUITEM_P(ICON_StepY, GET_TEXT_F(MSG_B_STEPS), onDrawStepsY, SetStepsY, &planner.settings.axis_steps_per_mm[Y_AXIS]); - ADDMENUITEM_P(ICON_StepZ, GET_TEXT_F(MSG_C_STEPS), onDrawStepsZ, SetStepsZ, &planner.settings.axis_steps_per_mm[Z_AXIS]); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawBack, Draw_Motion_Menu); + EDIT_ITEM(ICON_StepX, GET_TEXT_F(MSG_A_STEPS), onDrawStepsX, SetStepsX, &planner.settings.axis_steps_per_mm[X_AXIS]); + EDIT_ITEM(ICON_StepY, GET_TEXT_F(MSG_B_STEPS), onDrawStepsY, SetStepsY, &planner.settings.axis_steps_per_mm[Y_AXIS]); + EDIT_ITEM(ICON_StepZ, GET_TEXT_F(MSG_C_STEPS), onDrawStepsZ, SetStepsZ, &planner.settings.axis_steps_per_mm[Z_AXIS]); #if HAS_HOTEND - ADDMENUITEM_P(ICON_StepE, GET_TEXT_F(MSG_E_STEPS), onDrawStepsE, SetStepsE, &planner.settings.axis_steps_per_mm[E_AXIS]); + EDIT_ITEM(ICON_StepE, GET_TEXT_F(MSG_E_STEPS), onDrawStepsE, SetStepsE, &planner.settings.axis_steps_per_mm[E_AXIS]); #endif } CurrentMenu->draw(); @@ -3651,20 +3715,20 @@ void Draw_Steps_Menu() { #if HAS_HOTEND void Draw_HotendPID_Menu() { checkkey = Menu; - if (HotendPIDMenu == nullptr) HotendPIDMenu = new MenuClass(); + if (!HotendPIDMenu) HotendPIDMenu = new MenuClass(); if (CurrentMenu != HotendPIDMenu) { CurrentMenu = HotendPIDMenu; CurrentMenu->MenuTitle.SetCaption(F("Hotend PID Settings")); DWINUI::MenuItemsPrepare(8); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); - ADDMENUITEM(ICON_PIDNozzle, F("Hotend PID"), onDrawMenuItem, HotendPID); - ADDMENUITEM_P(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp); - ADDMENUITEM_P(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_hotend[0].pid.Ki); - ADDMENUITEM_P(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_hotend[0].pid.Kd); - ADDMENUITEM_P(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawPIntMenu, SetHotendPidT, &HMI_data.HotendPidT); - ADDMENUITEM_P(ICON_PIDcycles, GET_TEXT_F(MSG_PID_CYCLE), onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_PIDNozzle, F("Hotend PID"), onDrawMenuItem, HotendPID); + EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_hotend[0].pid.Kp); + EDIT_ITEM(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_hotend[0].pid.Ki); + EDIT_ITEM(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_hotend[0].pid.Kd); + EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawPIntMenu, SetHotendPidT, &HMI_data.HotendPidT); + EDIT_ITEM(ICON_PIDcycles, GET_TEXT_F(MSG_PID_CYCLE), onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); #if ENABLED(EEPROM_SETTINGS) - ADDMENUITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); + MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); #endif } CurrentMenu->draw(); @@ -3674,42 +3738,60 @@ void Draw_Steps_Menu() { #if HAS_HEATED_BED void Draw_BedPID_Menu() { checkkey = Menu; - if (BedPIDMenu == nullptr) BedPIDMenu = new MenuClass(); + if (!BedPIDMenu) BedPIDMenu = new MenuClass(); if (CurrentMenu != BedPIDMenu) { CurrentMenu = BedPIDMenu; CurrentMenu->MenuTitle.SetCaption(F("Bed PID Settings")); DWINUI::MenuItemsPrepare(8); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); - ADDMENUITEM(ICON_PIDNozzle, F("Bed PID"), onDrawMenuItem,BedPID); - ADDMENUITEM_P(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp); - ADDMENUITEM_P(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_bed.pid.Ki); - ADDMENUITEM_P(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_bed.pid.Kd); - ADDMENUITEM_P(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawPIntMenu, SetBedPidT, &HMI_data.BedPidT); - ADDMENUITEM_P(ICON_PIDcycles, GET_TEXT_F(MSG_PID_CYCLE), onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_AdvancedSettings_Menu); + MENU_ITEM(ICON_PIDNozzle, F("Bed PID"), onDrawMenuItem,BedPID); + EDIT_ITEM(ICON_PIDValue, F("Set" STR_KP), onDrawPFloat2Menu, SetKp, &thermalManager.temp_bed.pid.Kp); + EDIT_ITEM(ICON_PIDValue, F("Set" STR_KI), onDrawPIDi, SetKi, &thermalManager.temp_bed.pid.Ki); + EDIT_ITEM(ICON_PIDValue, F("Set" STR_KD), onDrawPIDd, SetKd, &thermalManager.temp_bed.pid.Kd); + EDIT_ITEM(ICON_Temperature, GET_TEXT_F(MSG_TEMPERATURE), onDrawPIntMenu, SetBedPidT, &HMI_data.BedPidT); + EDIT_ITEM(ICON_PIDcycles, GET_TEXT_F(MSG_PID_CYCLE), onDrawPIntMenu, SetPidCycles, &HMI_data.PidCycles); #if ENABLED(EEPROM_SETTINGS) - ADDMENUITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); + MENU_ITEM(ICON_WriteEEPROM, GET_TEXT_F(MSG_STORE_EEPROM), onDrawMenuItem, WriteEeprom); #endif } CurrentMenu->draw(); } #endif -#if EITHER(HAS_BED_PROBE, BABYSTEPPING) +#if HAS_BED_PROBE void Draw_ZOffsetWiz_Menu() { checkkey = Menu; - if (ZOffsetWizMenu == nullptr) ZOffsetWizMenu = new MenuClass(); + if (!ZOffsetWizMenu) ZOffsetWizMenu = new MenuClass(); if (CurrentMenu != ZOffsetWizMenu) { CurrentMenu = ZOffsetWizMenu; CurrentMenu->MenuTitle.SetCaption(GET_TEXT_F(MSG_PROBE_WIZARD)); DWINUI::MenuItemsPrepare(4); - ADDMENUITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_Prepare_Menu); - ADDMENUITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawMenuItem, AutoHome); - ADDMENUITEM(ICON_MoveZ0, F("Move Z to Home"), onDrawMenuItem, SetMoveZto0); - ADDMENUITEM_P(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_Prepare_Menu); + MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawMenuItem, AutoHome); + MENU_ITEM(ICON_MoveZ0, F("Move Z to Home"), onDrawMenuItem, SetMoveZto0); + EDIT_ITEM(ICON_Zoffset, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), onDrawPFloat2Menu, SetZOffset, &BABY_Z_VAR); } CurrentMenu->draw(); if (!axis_is_trusted(Z_AXIS)) LCD_MESSAGE_F("WARNING: Z position unknown, move Z to home"); } #endif +#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + void Draw_Homing_Menu() { + checkkey = Menu; + if (!HomingMenu) HomingMenu = new MenuClass(); + if (CurrentMenu != HomingMenu) { + CurrentMenu = HomingMenu; + CurrentMenu->MenuTitle.SetCaption(GET_TEXT_F(MSG_HOMING)); + DWINUI::MenuItemsPrepare(5); + MENU_ITEM(ICON_Back, GET_TEXT_F(MSG_BUTTON_BACK), onDrawMenuItem, Draw_Prepare_Menu); + MENU_ITEM(ICON_Homing, GET_TEXT_F(MSG_AUTO_HOME), onDrawMenuItem, AutoHome); + MENU_ITEM(ICON_HomeX, GET_TEXT_F(MSG_AUTO_HOME_X), onDrawMenuItem, HomeX); + MENU_ITEM(ICON_HomeY, GET_TEXT_F(MSG_AUTO_HOME_Y), onDrawMenuItem, HomeY); + MENU_ITEM(ICON_HomeZ, GET_TEXT_F(MSG_AUTO_HOME_Z), onDrawMenuItem, HomeZ); + } + CurrentMenu->draw(); + } +#endif + #endif // DWIN_CREALITY_LCD_ENHANCED diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin.h b/Marlin/src/lcd/e3v2/enhanced/dwin.h index 05b81c1019..f377732b41 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin.h @@ -24,8 +24,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.7.1 - * Date: 2021/11/09 + * Version: 3.9.1 + * Date: 2021/11/21 */ #include "../../../inc/MarlinConfigPre.h" @@ -45,7 +45,7 @@ #define HAS_ZOFFSET_ITEM 1 #endif -static constexpr size_t eeprom_data_size = 64; +#include "dwin_defines.h" enum processID : uint8_t { // Process ID @@ -59,11 +59,16 @@ enum processID : uint8_t { SelectFile, PrintProcess, PrintDone, + PwrlossRec, + Reboot, Info, // Popup Windows Homing, Leveling, + PidProcess, + ESDiagProcess, + PrintStatsProcess, PauseOrStop, FilamentPurge, WaitResponse, @@ -97,39 +102,6 @@ typedef struct { void (*LiveUpdate)() = nullptr; // Auxiliar live update function } HMI_value_t; -typedef struct { - uint16_t Background_Color = Def_Background_Color; - uint16_t Cursor_color = Def_Cursor_color; - uint16_t TitleBg_color = Def_TitleBg_color; - uint16_t TitleTxt_color = Def_TitleTxt_color; - uint16_t Text_Color = Def_Text_Color; - uint16_t Selected_Color = Def_Selected_Color; - uint16_t SplitLine_Color = Def_SplitLine_Color; - uint16_t Highlight_Color = Def_Highlight_Color; - uint16_t StatusBg_Color = Def_StatusBg_Color; - uint16_t StatusTxt_Color = Def_StatusTxt_Color; - uint16_t PopupBg_color = Def_PopupBg_color; - uint16_t PopupTxt_Color = Def_PopupTxt_Color; - uint16_t AlertBg_Color = Def_AlertBg_Color; - uint16_t AlertTxt_Color = Def_AlertTxt_Color; - uint16_t PercentTxt_Color = Def_PercentTxt_Color; - uint16_t Barfill_Color = Def_Barfill_Color; - uint16_t Indicator_Color = Def_Indicator_Color; - uint16_t Coordinate_Color = Def_Coordinate_Color; - #if HAS_PREHEAT - #ifdef PREHEAT_1_TEMP_HOTEND - int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND; - int16_t PidCycles = 10; - #endif - #ifdef PREHEAT_1_TEMP_BED - int16_t BedPidT = PREHEAT_1_TEMP_BED; - #endif - #endif - #if ENABLED(PREVENT_COLD_EXTRUSION) - int16_t ExtMinT = EXTRUDE_MINTEMP; - #endif -} HMI_data_t; - typedef struct { uint8_t language; bool pause_flag:1; // printing is paused @@ -138,15 +110,24 @@ typedef struct { bool select_flag:1; // Popup button selected bool home_flag:1; // homing in course bool heat_flag:1; // 0: heating done 1: during heating - bool lock_flag:1; // 0: lock called from AdvSet 1: lock called from Tune } HMI_flag_t; extern HMI_value_t HMI_value; extern HMI_flag_t HMI_flag; -extern HMI_data_t HMI_data; extern uint8_t checkkey; extern millis_t dwin_heat_time; +// Popups +#if HAS_HOTEND || HAS_HEATED_BED + void DWIN_Popup_Temperature(const bool toohigh); +#endif +#if HAS_HOTEND + void Popup_Window_ETempTooLow(); +#endif +#if ENABLED(POWER_LOSS_RECOVERY) + void Popup_PowerLossRecovery(); +#endif + // SD Card void HMI_SDCardInit(); void HMI_SDCardUpdate(); @@ -154,8 +135,8 @@ void HMI_SDCardUpdate(); // Other void Goto_PrintProcess(); void Goto_Main_Menu(); -void Goto_InfoMenu(); -void Draw_Select_Highlight(const bool sel); +void Goto_Info_Menu(); +void Goto_PowerLossRecovery(); void Draw_Status_Area(const bool with_update); // Status Area void Draw_Main_Area(); // Redraw main area; void DWIN_Redraw_screen(); // Redraw all screen elements @@ -204,11 +185,18 @@ void DWIN_RebootScreen(); #endif // Utility and extensions +void DWIN_LockScreen(); +void DWIN_UnLockScreen(); void HMI_LockScreen(); -void DWIN_LockScreen(const bool flag = true); #if HAS_MESH void DWIN_MeshViewer(); #endif +#if HAS_ESDIAG + void Draw_EndStopDiag(); +#endif +#if ENABLED(PRINTCOUNTER) + void Draw_PrintStats(); +#endif // HMI user control functions void HMI_Menu(); @@ -223,7 +211,7 @@ void Draw_Control_Menu(); void Draw_AdvancedSettings_Menu(); void Draw_Prepare_Menu(); void Draw_Move_Menu(); -void Draw_LevBedCorners_Menu(); +void Draw_Tramming_Menu(); #if HAS_HOME_OFFSET void Draw_HomeOffset_Menu(); #endif @@ -262,23 +250,6 @@ void Draw_Steps_Menu(); #if EITHER(HAS_BED_PROBE, BABYSTEPPING) void Draw_ZOffsetWiz_Menu(); #endif - -// Popup windows - -void DWIN_Draw_Popup(const uint8_t icon, const char * const cmsg1, FSTR_P const fmsg2, uint8_t button=0); -void DWIN_Draw_Popup(const uint8_t icon, FSTR_P const fmsg1=nullptr, FSTR_P const fmsg2=nullptr, uint8_t button=0); - -template -void DWIN_Popup_Confirm(const uint8_t icon, T amsg1, U amsg2) { - HMI_SaveProcessID(WaitResponse); - DWIN_Draw_Popup(icon, amsg1, amsg2, ICON_Confirm_E); // Button Confirm - DWIN_UpdateLCD(); -} - -#if HAS_HOTEND || HAS_HEATED_BED - void DWIN_Popup_Temperature(const bool toohigh); -#endif -#if HAS_HOTEND - void Popup_Window_ETempTooLow(); +#if ENABLED(INDIVIDUAL_AXIS_HOMING_SUBMENU) + void Draw_Homing_Menu(); #endif -void Popup_Window_Resume(); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h b/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h new file mode 100644 index 0000000000..b92d3d3b85 --- /dev/null +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_defines.h @@ -0,0 +1,92 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 + +/** + * DWIN general defines and data structs + * Author: Miguel A. Risco-Castillo + * Version: 3.9.1 + * Date: 2021/11/21 + */ + +#include "../../../core/types.h" +#include "../common/dwin_color.h" + +#define Def_Background_Color RGB( 1, 12, 8) +#define Def_Cursor_color RGB(20, 49, 31) +#define Def_TitleBg_color RGB( 0, 23, 16) +#define Def_TitleTxt_color Color_White +#define Def_Text_Color Color_White +#define Def_Selected_Color Select_Color +#define Def_SplitLine_Color RGB( 0, 23, 16) +#define Def_Highlight_Color Color_White +#define Def_StatusBg_Color RGB( 0, 23, 16) +#define Def_StatusTxt_Color Color_Yellow +#define Def_PopupBg_color Color_Bg_Window +#define Def_PopupTxt_Color Popup_Text_Color +#define Def_AlertBg_Color Color_Bg_Red +#define Def_AlertTxt_Color Color_Yellow +#define Def_PercentTxt_Color Percent_Color +#define Def_Barfill_Color BarFill_Color +#define Def_Indicator_Color Color_White +#define Def_Coordinate_Color Color_White + +#define HAS_ESDIAG 1 +#define DEFAULT_LCD_BRIGHTNESS 127 + +typedef struct { +// Color settings + uint16_t Background_Color = Def_Background_Color; + uint16_t Cursor_color = Def_Cursor_color; + uint16_t TitleBg_color = Def_TitleBg_color; + uint16_t TitleTxt_color = Def_TitleTxt_color; + uint16_t Text_Color = Def_Text_Color; + uint16_t Selected_Color = Def_Selected_Color; + uint16_t SplitLine_Color = Def_SplitLine_Color; + uint16_t Highlight_Color = Def_Highlight_Color; + uint16_t StatusBg_Color = Def_StatusBg_Color; + uint16_t StatusTxt_Color = Def_StatusTxt_Color; + uint16_t PopupBg_color = Def_PopupBg_color; + uint16_t PopupTxt_Color = Def_PopupTxt_Color; + uint16_t AlertBg_Color = Def_AlertBg_Color; + uint16_t AlertTxt_Color = Def_AlertTxt_Color; + uint16_t PercentTxt_Color = Def_PercentTxt_Color; + uint16_t Barfill_Color = Def_Barfill_Color; + uint16_t Indicator_Color = Def_Indicator_Color; + uint16_t Coordinate_Color = Def_Coordinate_Color; +// + #if defined(PREHEAT_1_TEMP_HOTEND) && HAS_HOTEND + int16_t HotendPidT = PREHEAT_1_TEMP_HOTEND; + #endif + #if defined(PREHEAT_1_TEMP_BED) && HAS_HEATED_BED + int16_t BedPidT = PREHEAT_1_TEMP_BED; + #endif + #if ANY(HAS_HOTEND, HAS_HEATED_BED) + int16_t PidCycles = 10; + #endif + #if ENABLED(PREVENT_COLD_EXTRUSION) + int16_t ExtMinT = EXTRUDE_MINTEMP; + #endif +} HMI_data_t; + +static constexpr size_t eeprom_data_size = 64; +extern HMI_data_t HMI_data; diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp index 681b318a15..83cbc20718 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.cpp @@ -23,7 +23,7 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.7.1 + * Version: 3.8.1 * Date: 2021/11/09 */ diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h index 43cb098b91..fc1b6d6756 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_lcd.h @@ -24,7 +24,7 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.7.1 + * Version: 3.8.1 * Date: 2021/11/09 */ diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp b/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp new file mode 100644 index 0000000000..89909e5c27 --- /dev/null +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_popup.cpp @@ -0,0 +1,55 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ + +/** + * DWIN UI Enhanced implementation + * Author: Miguel A. Risco-Castillo + * Version: 3.8.1 + * Date: 2021/11/06 + */ + +#include "dwin.h" +#include "dwin_popup.h" + +void Draw_Select_Highlight(const bool sel) { + HMI_flag.select_flag = sel; + const uint16_t c1 = sel ? HMI_data.Highlight_Color : HMI_data.PopupBg_color, + c2 = sel ? HMI_data.PopupBg_color : HMI_data.Highlight_Color; + DWIN_Draw_Rectangle(0, c1, 25, 279, 126, 318); + DWIN_Draw_Rectangle(0, c1, 24, 278, 127, 319); + DWIN_Draw_Rectangle(0, c2, 145, 279, 246, 318); + DWIN_Draw_Rectangle(0, c2, 144, 278, 247, 319); +} + +void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2) { + HMI_SaveProcessID(WaitResponse); + DWIN_Draw_Popup(icon, fmsg1, fmsg2, ICON_Continue_E); // Button Continue + DWIN_UpdateLCD(); +} + +void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2) { + DWIN_Draw_Popup(ICON_BLTouch, F("Please confirm"), fmsg2); + DWINUI::Draw_Icon(ICON_Confirm_E, 26, 280); + DWINUI::Draw_Icon(ICON_Cancel_E, 146, 280); + Draw_Select_Highlight(true); + DWIN_UpdateLCD(); +} diff --git a/Marlin/src/lcd/e3v2/enhanced/dwin_popup.h b/Marlin/src/lcd/e3v2/enhanced/dwin_popup.h new file mode 100644 index 0000000000..65784a8c9f --- /dev/null +++ b/Marlin/src/lcd/e3v2/enhanced/dwin_popup.h @@ -0,0 +1,62 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 + +/** + * DWIN UI Enhanced implementation + * Author: Miguel A. Risco-Castillo + * Version: 3.8.1 + * Date: 2021/11/06 + */ + +#include "dwinui.h" +#include "dwin.h" + +// Popup windows + +void Draw_Select_Highlight(const bool sel); + +inline void Draw_Popup_Bkgd() { + DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, 14, 60, 258, 330); + DWIN_Draw_Rectangle(0, HMI_data.Highlight_Color, 14, 60, 258, 330); +} + +template +void DWIN_Draw_Popup(const uint8_t icon, T amsg1=nullptr, U amsg2=nullptr, uint8_t button=0) { + DWINUI::ClearMenuArea(); + Draw_Popup_Bkgd(); + if (icon) DWINUI::Draw_Icon(icon, 101, 105); + if (amsg1) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 210, amsg1); + if (amsg2) DWINUI::Draw_CenteredString(HMI_data.PopupTxt_Color, 240, amsg2); + if (button) DWINUI::Draw_Icon(button, 86, 280); +} + +template +void DWIN_Popup_Confirm(const uint8_t icon, T amsg1, U amsg2) { + HMI_SaveProcessID(WaitResponse); + DWIN_Draw_Popup(icon, amsg1, amsg2, ICON_Confirm_E); // Button Confirm + DWIN_UpdateLCD(); +} + +void DWIN_Popup_Continue(const uint8_t icon, FSTR_P const fmsg1, FSTR_P const fmsg2); + +void DWIN_Popup_ConfirmCancel(const uint8_t icon, FSTR_P const fmsg2); diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp b/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp index 52b7c3b521..5017253740 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/dwinui.cpp @@ -23,7 +23,7 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.7.1 + * Version: 3.8.1 * Date: 2021/11/09 */ @@ -34,6 +34,7 @@ #include "../../../inc/MarlinConfig.h" #include "dwin_lcd.h" #include "dwinui.h" +#include "dwin_defines.h" //#define DEBUG_OUT 1 #include "../../../core/debug_out.h" diff --git a/Marlin/src/lcd/e3v2/enhanced/dwinui.h b/Marlin/src/lcd/e3v2/enhanced/dwinui.h index 9a717da80d..cb7720834c 100644 --- a/Marlin/src/lcd/e3v2/enhanced/dwinui.h +++ b/Marlin/src/lcd/e3v2/enhanced/dwinui.h @@ -24,8 +24,8 @@ /** * DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.7.1 - * Date: 2021/11/09 + * Version: 3.9.1 + * Date: 2021/11/21 */ #include "dwin_lcd.h" @@ -38,13 +38,22 @@ #define ICON_Cancel ICON_StockConfiguration #define ICON_CustomPreheat ICON_SetEndTemp #define ICON_Error ICON_TempTooHigh +#define ICON_ESDiag ICON_Info #define ICON_ExtrudeMinT ICON_HotendTemp #define ICON_FilLoad ICON_WriteEEPROM #define ICON_FilMan ICON_ResumeEEPROM #define ICON_FilSet ICON_ResumeEEPROM #define ICON_FilUnload ICON_ReadEEPROM #define ICON_Flow ICON_StepE -#define ICON_LevBed ICON_SetEndTemp +#define ICON_FWRetLength ICON_StepE +#define ICON_FWRetSpeed ICON_Setspeed +#define ICON_FWRetZRaise ICON_MoveZ +#define ICON_FWRecSpeed ICON_Setspeed +#define ICON_HomeX ICON_MoveX +#define ICON_HomeY ICON_MoveY +#define ICON_HomeZ ICON_MoveZ +#define ICON_HSMode ICON_StockConfiguration +#define ICON_Tram ICON_SetEndTemp #define ICON_Lock ICON_Cool #define ICON_ManualMesh ICON_HotendTemp #define ICON_MeshNext ICON_Axis @@ -52,9 +61,14 @@ #define ICON_MeshViewer ICON_HotendTemp #define ICON_MoveZ0 ICON_HotendTemp #define ICON_Park ICON_Motion +#define ICON_PIDbed ICON_SetBedTemp #define ICON_PIDcycles ICON_ResumeEEPROM #define ICON_PIDValue ICON_Contact +#define ICON_PrintStats ICON_PrintTime +#define ICON_PrintStatsReset ICON_RemainTime +#define ICON_ProbeDeploy ICON_SetEndTemp #define ICON_ProbeSet ICON_SetEndTemp +#define ICON_ProbeStow ICON_SetEndTemp #define ICON_ProbeTest ICON_SetEndTemp #define ICON_Pwrlossr ICON_Motion #define ICON_Reboot ICON_ResumeEEPROM @@ -63,25 +77,11 @@ #define ICON_SetCustomPreheat ICON_SetEndTemp #define ICON_Sound ICON_Cool -// Default UI Colors -#define Def_Background_Color Color_Bg_Black -#define Def_Cursor_color Rectangle_Color -#define Def_TitleBg_color Color_Bg_Blue -#define Def_TitleTxt_color Color_White -#define Def_Text_Color Color_White -#define Def_Selected_Color Select_Color -#define Def_SplitLine_Color Line_Color -#define Def_Highlight_Color Color_White -#define Def_StatusBg_Color RGB(0,20,20) -#define Def_StatusTxt_Color Color_Yellow -#define Def_PopupBg_color Color_Bg_Window -#define Def_PopupTxt_Color Popup_Text_Color -#define Def_AlertBg_Color Color_Bg_Red -#define Def_AlertTxt_Color Color_Yellow -#define Def_PercentTxt_Color Percent_Color -#define Def_Barfill_Color BarFill_Color -#define Def_Indicator_Color Color_White -#define Def_Coordinate_Color Color_White +// Extended and default UI Colors +#define Color_Black 0 +#define Color_Green RGB(0,63,0) +#define Color_Aqua RGB(0,63,31) +#define Color_Blue RGB(0,0,31) // UI element defines and constants #define DWIN_FONT_MENU font8x16 @@ -111,8 +111,8 @@ constexpr uint16_t TITLE_HEIGHT = 30, // Title bar heig #define MBASE(L) (MYPOS(L) + CAPOFF) // Create and add a MenuItem object to the menu array -#define ADDMENUITEM(V...) DWINUI::MenuItemsAdd(new MenuItemClass(V)) -#define ADDMENUITEM_P(V...) DWINUI::MenuItemsAdd(new MenuItemPtrClass(V)) +#define MENU_ITEM(V...) DWINUI::MenuItemsAdd(new MenuItemClass(V)) +#define EDIT_ITEM(V...) DWINUI::MenuItemsAdd(new MenuItemPtrClass(V)) typedef struct { uint16_t left, top, right, bottom; } rect_t; typedef struct { uint16_t x, y, w, h; } frame_rect_t; @@ -197,9 +197,11 @@ namespace DWINUI { // Get font character width uint8_t fontWidth(uint8_t cfont); + inline uint8_t fontWidth() { return fontWidth(font); }; // Get font character height uint8_t fontHeight(uint8_t cfont); + inline uint8_t fontHeight() { return fontHeight(font); }; // Get screen x coordinates from text column uint16_t ColToX(uint8_t col); @@ -412,6 +414,14 @@ namespace DWINUI { Draw_CenteredString(false, font, textcolor, backcolor, y, title); } + // Draw a box + // mode: 0=frame, 1=fill, 2=XOR fill + // color: Rectangle color + // frame: Box coordinates and size + inline void Draw_Box(uint8_t mode, uint16_t color, frame_rect_t frame) { + DWIN_Draw_Box(mode, color, frame.x, frame.y, frame.w, frame.h); + } + // Draw a circle // Color: circle color // x: abscissa of the center of the circle diff --git a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp b/Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp new file mode 100644 index 0000000000..0f982c3a36 --- /dev/null +++ b/Marlin/src/lcd/e3v2/enhanced/endstop_diag.cpp @@ -0,0 +1,109 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ + +/** + * DWIN End Stops diagnostic page + * Author: Miguel A. Risco-Castillo + * Version: 1.0 + * Date: 2021/11/06 + */ + +#include "../../../inc/MarlinConfigPre.h" +#include "dwin_defines.h" + +#if BOTH(DWIN_CREALITY_LCD_ENHANCED, HAS_ESDIAG) + +#include "endstop_diag.h" + +#include "../../../core/types.h" +#include "../../marlinui.h" +#include "dwin_lcd.h" +#include "dwinui.h" +#include "dwin_popup.h" +#include "dwin.h" + +#if HAS_FILAMENT_SENSOR + #include "../../../feature/runout.h" +#endif + +#if HAS_BED_PROBE + #include "../../../module/probe.h" +#endif + +ESDiagClass ESDiag; + +void draw_es_label(FSTR_P const flabel=nullptr) { + DWINUI::cursor.x = 40; + if (flabel) DWINUI::Draw_String(F(flabel)); + DWINUI::Draw_String(F(": ")); + DWINUI::MoveBy(0, 25); +} + +void draw_es_state(const bool is_hit) { + const uint8_t LM = 130; + DWINUI::cursor.x = LM; + DWIN_Draw_Rectangle(1, HMI_data.PopupBg_color, LM, DWINUI::cursor.y, LM + 100, DWINUI::cursor.y + 20); + is_hit ? DWINUI::Draw_String(RGB(31,31,16), F(STR_ENDSTOP_HIT)) : DWINUI::Draw_String(RGB(16,63,16), F(STR_ENDSTOP_OPEN)); + DWINUI::MoveBy(0, 25); +} + +void ESDiagClass::Draw() { + Title.ShowCaption(F("End-stops Diagnostic")); + DWINUI::ClearMenuArea(); + Draw_Popup_Bkgd(); + DWINUI::Draw_Icon(ICON_Continue_E, 86, 250); + DWINUI::cursor.y = 80; + #define ES_LABEL(S) draw_es_label(F(STR_##S)) + #if HAS_X_MIN + ES_LABEL(X_MIN); + #endif + #if HAS_Y_MIN + ES_LABEL(Y_MIN); + #endif + #if HAS_Z_MIN + ES_LABEL(Z_MIN); + #endif + #if HAS_FILAMENT_SENSOR + draw_es_label(F(STR_FILAMENT)); + #endif + Update(); +} + +void ESDiagClass::Update() { + DWINUI::cursor.y = 80; + #define ES_REPORT(S) draw_es_state(READ(S##_PIN) != S##_ENDSTOP_INVERTING) + #if HAS_X_MIN + ES_REPORT(X_MIN); + #endif + #if HAS_Y_MIN + ES_REPORT(Y_MIN); + #endif + #if HAS_Z_MIN + ES_REPORT(Z_MIN); + #endif + #if HAS_FILAMENT_SENSOR + draw_es_state(READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE); + #endif + DWIN_UpdateLCD(); +} + +#endif // DWIN_CREALITY_LCD_ENHANCED && HAS_MESH diff --git a/Marlin/src/lcd/e3v2/enhanced/endstop_diag.h b/Marlin/src/lcd/e3v2/enhanced/endstop_diag.h new file mode 100644 index 0000000000..1864b95723 --- /dev/null +++ b/Marlin/src/lcd/e3v2/enhanced/endstop_diag.h @@ -0,0 +1,37 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 + +/** + * DWIN End Stops diagnostic page + * Author: Miguel A. Risco-Castillo + * Version: 1.0 + * Date: 2021/11/06 + */ + +class ESDiagClass { +public: + void Draw(); + void Update(); +}; + +extern ESDiagClass ESDiag; diff --git a/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp b/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp index ca772184f1..8dc84dcc46 100644 --- a/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/lockscreen.cpp @@ -21,10 +21,10 @@ */ /** - * DWIN UI Enhanced implementation + * Lock screen implementation for DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/08 + * Version: 2.1 + * Date: 2021/11/09 */ #include "../../../inc/MarlinConfigPre.h" @@ -41,6 +41,7 @@ LockScreenClass lockScreen; uint8_t LockScreenClass::lock_pos = 0; bool LockScreenClass::unlocked = false; +uint8_t LockScreenClass::rprocess = 0; void LockScreenClass::init() { lock_pos = 0; diff --git a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h b/Marlin/src/lcd/e3v2/enhanced/lockscreen.h index f0c4c1fde8..a51c82f34e 100644 --- a/Marlin/src/lcd/e3v2/enhanced/lockscreen.h +++ b/Marlin/src/lcd/e3v2/enhanced/lockscreen.h @@ -22,10 +22,10 @@ #pragma once /** - * DWIN UI Enhanced implementation + * Lock screen implementation for DWIN UI Enhanced implementation * Author: Miguel A. Risco-Castillo - * Version: 3.6.3 - * Date: 2021/09/08 + * Version: 2.1 + * Date: 2021/11/09 */ #include "../common/encoder.h" @@ -36,10 +36,11 @@ private: static bool unlocked; static uint8_t lock_pos; public: + static uint8_t rprocess; static void init(); static void onEncoder(EncoderState encoder_diffState); static void draw(); - static inline bool isUnlocked() { return unlocked; } + static bool isUnlocked() { return unlocked; } }; extern LockScreenClass lockScreen; diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp b/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp index 3824d63b2b..1ecbbff0aa 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp +++ b/Marlin/src/lcd/e3v2/enhanced/meshviewer.cpp @@ -1,12 +1,13 @@ /** - * DWIN Mesh Viewer - * Author: Miguel A. Risco-Castillo - * version: 3.8.1 - * Date: 2021/11/06 + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or + * 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, @@ -14,11 +15,18 @@ * 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 Lesser General Public License + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ +/** + * DWIN Mesh Viewer + * Author: Miguel A. Risco-Castillo + * Version: 3.8.1 + * Date: 2021/11/06 + */ + #include "../../../inc/MarlinConfigPre.h" #if BOTH(DWIN_CREALITY_LCD_ENHANCED, HAS_MESH) diff --git a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h b/Marlin/src/lcd/e3v2/enhanced/meshviewer.h index 0ba6ae2d7d..6e7fe6fd82 100644 --- a/Marlin/src/lcd/e3v2/enhanced/meshviewer.h +++ b/Marlin/src/lcd/e3v2/enhanced/meshviewer.h @@ -1,12 +1,13 @@ /** - * DWIN Mesh Viewer - * Author: Miguel A. Risco-Castillo - * Version: 3.8.1 - * Date: 2021/11/06 + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the License, or + * 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, @@ -14,12 +15,19 @@ * 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 Lesser General Public License + * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #pragma once +/** + * DWIN Mesh Viewer + * Author: Miguel A. Risco-Castillo + * Version: 3.8.1 + * Date: 2021/11/06 + */ + class MeshViewerClass { public: void Draw(); diff --git a/Marlin/src/lcd/e3v2/enhanced/printstats.cpp b/Marlin/src/lcd/e3v2/enhanced/printstats.cpp new file mode 100644 index 0000000000..a32d698b96 --- /dev/null +++ b/Marlin/src/lcd/e3v2/enhanced/printstats.cpp @@ -0,0 +1,76 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 . + * + */ + +/** + * DWIN Print Stats page + * Author: Miguel A. Risco-Castillo + * Version: 1.0 + * Date: 2021/11/21 + */ + +#include "../../../inc/MarlinConfigPre.h" + +#if BOTH(DWIN_CREALITY_LCD_ENHANCED, PRINTCOUNTER) + +#include "printstats.h" + +#include "../../../core/types.h" +#include "../../marlinui.h" +#include "../../../module/printcounter.h" +#include "dwin_lcd.h" +#include "dwinui.h" +#include "dwin_popup.h" +#include "dwin.h" + +PrintStatsClass PrintStats; + +void PrintStatsClass::Draw() { + char buf[50] = ""; + char str[30] = ""; + constexpr int8_t MRG = 30; + + Title.ShowCaption(GET_TEXT_F(MSG_INFO_STATS_MENU)); + DWINUI::ClearMenuArea(); + Draw_Popup_Bkgd(); + DWINUI::Draw_Icon(ICON_Continue_E, 86, 250); + printStatistics ps = print_job_timer.getStats(); + + sprintf_P(buf, PSTR(S_FMT ": %i"), GET_TEXT(MSG_INFO_PRINT_COUNT), ps.totalPrints); + DWINUI::Draw_String(MRG, 80, buf); + sprintf_P(buf, PSTR(S_FMT ": %i"), GET_TEXT(MSG_INFO_COMPLETED_PRINTS), ps.finishedPrints); + DWINUI::Draw_String(MRG, 100, buf); + duration_t(print_job_timer.getStats().printTime).toDigital(str, true); + sprintf_P(buf, PSTR(S_FMT ": %s"), GET_TEXT(MSG_INFO_PRINT_TIME), str); + DWINUI::Draw_String(MRG, 120, buf); + duration_t(print_job_timer.getStats().longestPrint).toDigital(str, true); + sprintf_P(buf, PSTR(S_FMT ": %s"), GET_TEXT(MSG_INFO_PRINT_LONGEST), str); + DWINUI::Draw_String(MRG, 140, buf); + sprintf_P(buf, PSTR(S_FMT ": %s m"), GET_TEXT(MSG_INFO_PRINT_FILAMENT), dtostrf(ps.filamentUsed / 1000, 1, 2, str)); + DWINUI::Draw_String(MRG, 160, buf); +} + +void PrintStatsClass::Reset() { + print_job_timer.initStats(); + HMI_AudioFeedback(); +} + +#endif // DWIN_CREALITY_LCD_ENHANCED && PRINTCOUNTER diff --git a/Marlin/src/lcd/e3v2/enhanced/printstats.h b/Marlin/src/lcd/e3v2/enhanced/printstats.h new file mode 100644 index 0000000000..5f62a4c268 --- /dev/null +++ b/Marlin/src/lcd/e3v2/enhanced/printstats.h @@ -0,0 +1,37 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2021 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 + +/** + * DWIN Print Stats page + * Author: Miguel A. Risco-Castillo + * Version: 1.0 + * Date: 2021/11/21 + */ + +class PrintStatsClass { +public: + void Draw(); + static void Reset(); +}; + +extern PrintStatsClass PrintStats; diff --git a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h index 30af387bdc..64676dddfd 100644 --- a/Marlin/src/lcd/e3v2/marlinui/dwin_string.h +++ b/Marlin/src/lcd/e3v2/marlinui/dwin_string.h @@ -55,7 +55,7 @@ class DWIN_String { //static font_t *font() { return font_header; }; //static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; } //static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ - //static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); } + //static glyph_t *glyph(uint8_t *character) { return glyph(*character); } static void set(); //static void add(uint8_t character) { add_character(character); eol(); } @@ -65,10 +65,10 @@ class DWIN_String { static void set(uint8_t *string) { set(); add(string); } static void set(wchar_t character) { set(); add(character); } static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); } - static inline void set(FSTR_P fstring) { set((uint8_t *)fstring); } - static inline void set(const char *string) { set((uint8_t *)string); } - static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } - static inline void add(const char *string) { add((uint8_t *)string); } + static void set(FSTR_P fstring) { set((uint8_t *)fstring); } + static void set(const char *string) { set((uint8_t *)string); } + static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } + static void add(const char *string) { add((uint8_t *)string); } static void trim(const uint8_t character=0x20); static void rtrim(const uint8_t character=0x20); @@ -76,9 +76,9 @@ class DWIN_String { static void truncate(uint8_t maxlen) { if (len > maxlen) { len = maxlen; eol(); } } - static inline uint8_t length() { return len; } - static inline uint16_t width() { return span; } - static inline uint8_t *string() { return data; } + static uint8_t length() { return len; } + static uint16_t width() { return span; } + static uint8_t *string() { return data; } static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; } }; diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp index 9f558e3a98..c56d8aa7fb 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_tft.cpp @@ -243,7 +243,7 @@ void ChironTFT::StatusChange(const char * const msg) { case AC_printer_probing: { // If probing completes ok save the mesh and park // Ignore the custom machine name - if (strcmp_P(msg + strlen(CUSTOM_MACHINE_NAME), MARLIN_msg_ready) == 0) { + if (strcmp_P(msg + strlen(MACHINE_NAME), MARLIN_msg_ready) == 0) { injectCommands(F("M500\nG27")); SendtoTFTLN(AC_msg_probing_complete); printer_state = AC_printer_idle; @@ -366,7 +366,7 @@ int8_t ChironTFT::FindToken(char c) { #endif return pos; } - } while(++pos < command_len); + } while (++pos < command_len); #if ACDEBUG(AC_INFO) SERIAL_ECHOLNPGM("Not found: ", c); #endif diff --git a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h index e486a00145..3040225d07 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus/DGUSDisplay.h @@ -95,14 +95,14 @@ public: // Checks two things: Can we confirm the presence of the display and has we initialized it. // (both boils down that the display answered to our chatting) - static inline bool isInitialized() { return Initialized; } + static bool isInitialized() { return Initialized; } private: static void WriteHeader(uint16_t adr, uint8_t cmd, uint8_t payloadlen); static void WritePGM(const char str[], uint8_t len); static void ProcessRx(); - static inline uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } + static uint16_t swap16(const uint16_t value) { return (value & 0xFFU) << 8U | (value >> 8U); } static rx_datagram_state_t rx_datagram_state; static uint8_t rx_datagram_len; static bool Initialized, no_reentrance; diff --git a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp index 2b00fd16f8..70bcca1859 100644 --- a/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/DGUSScreenHandler.cpp @@ -508,9 +508,9 @@ void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; default: return; } - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisSteps_per_mm(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis)); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel return; } @@ -531,9 +531,9 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo #endif #endif } - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisSteps_per_mm(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp index 750acece1c..eba4b153f1 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp @@ -268,7 +268,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel diff --git a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h index bb0bd2bd3b..dfc1e9ea7d 100644 --- a/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.h @@ -38,10 +38,10 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -206,20 +206,20 @@ public: static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp index 79a3cb9103..88b3255b66 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp @@ -268,7 +268,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel diff --git a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h index bb0bd2bd3b..dfc1e9ea7d 100644 --- a/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.h @@ -38,10 +38,10 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -206,20 +206,20 @@ public: static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp index 0e2a971fd1..8054181353 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp @@ -93,7 +93,7 @@ void DGUSScreenHandler::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) { void DGUSScreenHandler::DGUSLCD_SendBabyStepToDisplay_MKS(DGUS_VP_Variable &var) { float value = current_position.z; - DEBUG_ECHOLNPAIR_F(" >> ", value, 6); + DEBUG_ECHOLNPGM(" >> ", value, 6); value *= cpow(10, 2); dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value); } @@ -399,7 +399,7 @@ void DGUSScreenHandler::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr) { #if HAS_BED_PROBE int32_t value = swap32(*(int32_t *)val_ptr); float Offset = value / 100.0f; - DEBUG_ECHOLNPAIR_F("\nget int6 offset >> ", value, 6); + DEBUG_ECHOLNPGM("\nget int6 offset >> ", value, 6); #endif switch (var.VP) { @@ -909,7 +909,7 @@ void DGUSScreenHandler::HandleChangeLevelPoint_MKS(DGUS_VP_Variable &var, void * DEBUG_ECHOLNPGM("HandleChangeLevelPoint_MKS"); const int16_t value_raw = swap16(*(int16_t*)val_ptr); - DEBUG_ECHOLNPAIR_F("value_raw:", value_raw); + DEBUG_ECHOLNPGM("value_raw:", value_raw); *(int16_t*)var.memadr = value_raw; @@ -924,7 +924,7 @@ void DGUSScreenHandler::HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void * const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::axis_t axis; switch (var.VP) { @@ -934,7 +934,7 @@ void DGUSScreenHandler::HandleStepPerMMChanged_MKS(DGUS_VP_Variable &var, void * case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break; } ExtUI::setAxisSteps_per_mm(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -946,7 +946,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::extruder_t extruder; switch (var.VP) { @@ -959,7 +959,7 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged_MKS(DGUS_VP_Variable &var #endif } ExtUI::setAxisSteps_per_mm(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -971,7 +971,7 @@ void DGUSScreenHandler::HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *va const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::axis_t axis; switch (var.VP) { @@ -981,7 +981,7 @@ void DGUSScreenHandler::HandleMaxSpeedChange_MKS(DGUS_VP_Variable &var, void *va default: return; } ExtUI::setAxisMaxFeedrate_mm_s(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -993,7 +993,7 @@ void DGUSScreenHandler::HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var, const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::extruder_t extruder; switch (var.VP) { @@ -1006,7 +1006,7 @@ void DGUSScreenHandler::HandleExtruderMaxSpeedChange_MKS(DGUS_VP_Variable &var, case VP_E1_MAX_SPEED: extruder = ExtUI::extruder_t::E1; break; } ExtUI::setAxisMaxFeedrate_mm_s(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1018,7 +1018,7 @@ void DGUSScreenHandler::HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_ const float value = (float)value_raw; DEBUG_ECHOLNPGM("value_raw:", value_raw); - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::axis_t axis; switch (var.VP) { @@ -1028,7 +1028,7 @@ void DGUSScreenHandler::HandleMaxAccChange_MKS(DGUS_VP_Variable &var, void *val_ case VP_Z_ACC_MAX_SPEED: axis = ExtUI::axis_t::Z; break; } ExtUI::setAxisMaxAcceleration_mm_s2(value, axis); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(axis)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(axis)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1049,9 +1049,9 @@ void DGUSScreenHandler::HandleExtruderAccChange_MKS(DGUS_VP_Variable &var, void case VP_E1_ACC_MAX_SPEED: extruder = ExtUI::extruder_t::E1; settings.load(); break; #endif } - DEBUG_ECHOLNPAIR_F("value:", value); + DEBUG_ECHOLNPGM("value:", value); ExtUI::setAxisMaxAcceleration_mm_s2(value, extruder); - DEBUG_ECHOLNPAIR_F("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(extruder)); + DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(extruder)); settings.save(); skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel } @@ -1115,7 +1115,7 @@ void DGUSScreenHandler::HandleAccChange_MKS(DGUS_VP_Variable &var, void *val_ptr #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; settings.save(); @@ -1175,7 +1175,7 @@ void DGUSScreenHandler::GetManualFilament(DGUS_VP_Variable &var, void *val_ptr) float value = (float)value_len; - DEBUG_ECHOLNPAIR_F("Get Filament len value:", value); + DEBUG_ECHOLNPGM("Get Filament len value:", value); distanceFilament = value; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel @@ -1186,7 +1186,7 @@ void DGUSScreenHandler::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ uint16_t value_len = swap16(*(uint16_t*)val_ptr); - DEBUG_ECHOLNPAIR_F("filamentSpeed_mm_s value:", value_len); + DEBUG_ECHOLNPGM("filamentSpeed_mm_s value:", value_len); filamentSpeed_mm_s = value_len; diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h index 0c80cd260e..ee423b7bb9 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.h @@ -38,10 +38,10 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -273,20 +273,20 @@ public: static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp index b77c92b7eb..fb08fbf849 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp @@ -268,7 +268,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) { #endif } - DEBUG_ECHOLNPAIR_F("V3:", newvalue); + DEBUG_ECHOLNPGM("V3:", newvalue); *(float *)var.memadr = newvalue; skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel diff --git a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h index bb0bd2bd3b..dfc1e9ea7d 100644 --- a/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.h @@ -38,10 +38,10 @@ public: // Send all 4 strings that are displayed on the infoscreen, confirmation screen and kill screen // The bools specifying whether the strings are in RAM or FLASH. static void sendinfoscreen(const char *line1, const char *line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash); - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, const char *line3, const char *line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), line3, line4, l1inflash, l2inflash, l3inflash, liinflash); } - static inline void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { + static void sendinfoscreen(FSTR_P const line1, FSTR_P const line2, FSTR_P const line3, FSTR_P const line4, bool l1inflash, bool l2inflash, bool l3inflash, bool liinflash) { sendinfoscreen(FTOP(line1), FTOP(line2), FTOP(line3), FTOP(line4), l1inflash, l2inflash, l3inflash, liinflash); } @@ -206,20 +206,20 @@ public: static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) { if (var.memadr) { float f = *(float *)var.memadr; - DEBUG_ECHOLNPAIR_F(" >> ", f, 6); + DEBUG_ECHOLNPGM(" >> ", f, 6); f *= cpow(10, decimals); dgusdisplay.WriteVariable(var.VP, (int16_t)f); } } // Force an update of all VP on the current screen. - static inline void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } + static void ForceCompleteUpdate() { update_ptr = 0; ScreenComplete = false; } // Has all VPs sent to the screen - static inline bool IsScreenComplete() { return ScreenComplete; } + static bool IsScreenComplete() { return ScreenComplete; } - static inline DGUSLCD_Screens getCurrentScreen() { return current_screen; } + static DGUSLCD_Screens getCurrentScreen() { return current_screen; } - static inline void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } + static void SetupConfirmAction( void (*f)()) { confirm_action_cb = f; } private: static DGUSLCD_Screens current_screen; //< currently on screen diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h index 265e2fe584..332108d81a 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h @@ -98,7 +98,7 @@ public: // Checks two things: Can we confirm the presence of the display and has we initialized it. // (both boils down that the display answered to our chatting) - static inline bool IsInitialized() { + static bool IsInitialized() { return initialized; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h index 3b63b0fd5b..afb380aa90 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/compat.h @@ -43,8 +43,8 @@ #define min(a,b) ((a)<(b)?(a):(b)) #else namespace UI { - static inline uint32_t safe_millis() { return millis(); } - static inline void yield() {} + static uint32_t safe_millis() { return millis(); } + static void yield() {} }; #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h index b8e687147b..da911c772d 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/compat.h @@ -40,13 +40,13 @@ template struct port_pin { typedef port_t port; - static inline void set_high() {port::port() = (port::port() | bits);} - static inline void set_low() {port::port() = (port::port() & (~bits));} - static inline void set_input() {port::ddr() = (port::ddr() & (~bits));} - static inline void set_input_pullup() {set_input(); set_high();} - static inline void set_output() {port::ddr() = (port::ddr() | bits);} - static inline uint8_t read() {return port::pin() & bits;} - static inline void write(bool v) {if (v) set_high(); else set_low();} + static void set_high() {port::port() = (port::port() | bits);} + static void set_low() {port::port() = (port::port() & (~bits));} + static void set_input() {port::ddr() = (port::ddr() & (~bits));} + static void set_input_pullup() {set_input(); set_high();} + static void set_output() {port::ddr() = (port::ddr() | bits);} + static uint8_t read() {return port::pin() & bits;} + static void write(bool v) {if (v) set_high(); else set_low();} }; #define MAKE_AVR_PORT_PINS(ID) \ @@ -109,13 +109,13 @@ template struct arduino_digital_pin { static constexpr uint8_t pin = p; - static inline void set_high() {digitalWrite(p, HIGH);} - static inline void set_low() {digitalWrite(p, LOW);} - static inline void set_input() {pinMode(p, INPUT);} - static inline void set_input_pullup() {pinMode(p, INPUT_PULLUP);} - static inline void set_output() {pinMode(p, OUTPUT);} - static inline uint8_t read() {return digitalRead(p);} - static inline void write(bool v) {digitalWrite(p, v ? HIGH : LOW);} + static void set_high() {digitalWrite(p, HIGH);} + static void set_low() {digitalWrite(p, LOW);} + static void set_input() {pinMode(p, INPUT);} + static void set_input_pullup() {pinMode(p, INPUT_PULLUP);} + static void set_output() {pinMode(p, OUTPUT);} + static uint8_t read() {return digitalRead(p);} + static void write(bool v) {digitalWrite(p, v ? HIGH : LOW);} }; #define MAKE_ARDUINO_PINS(ID) typedef arduino_digital_pin ARDUINO_DIGITAL_##ID; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h index 2ddab1b818..b204f04743 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_lib/extended/sound_list.h @@ -29,10 +29,10 @@ class SoundList { } list[]; public: static const uint8_t n; - static inline const char* name(uint8_t val) { + static const char* name(uint8_t val) { return (const char* ) pgm_read_ptr_far(&list[val].name); } - static inline FTDI::SoundPlayer::sound_t* data(uint8_t val) { + static FTDI::SoundPlayer::sound_t* data(uint8_t val) { return (FTDI::SoundPlayer::sound_t*) pgm_read_ptr_far(&list[val].data); } }; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp index 6cb85e47c4..43e5c33365 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/about_screen.cpp @@ -69,8 +69,8 @@ void AboutScreen::onRedraw(draw_mode_t) { #endif draw_text_box(cmd, HEADING_POS, - #ifdef CUSTOM_MACHINE_NAME - F(CUSTOM_MACHINE_NAME) + #ifdef MACHINE_NAME + F(MACHINE_NAME) #else GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1) #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp index 5076e58adf..6f428fa174 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/files_screen.cpp @@ -77,7 +77,7 @@ const char *FilesScreen::getSelectedFilename(bool shortName) { } void FilesScreen::drawSelectedFile() { - if(mydata.selected_tag == 0xFF) return; + if (mydata.selected_tag == 0xFF) return; FileList files; files.seek(getSelectedFileIndex(), true); mydata.flags.is_dir = files.isDir(); diff --git a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h index 4683ff9351..72394286ac 100644 --- a/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h +++ b/Marlin/src/lcd/extui/mks_ui/SPIFlashStorage.h @@ -96,12 +96,12 @@ private: static uint8_t m_pageData[SPI_FLASH_PageSize]; static uint32_t m_currentPage; static uint16_t m_pageDataUsed; - static inline uint16_t pageDataFree() { return SPI_FLASH_PageSize - m_pageDataUsed; } + static uint16_t pageDataFree() { return SPI_FLASH_PageSize - m_pageDataUsed; } static uint32_t m_startAddress; #if HAS_SPI_FLASH_COMPRESSION static uint8_t m_compressedData[SPI_FLASH_PageSize]; static uint16_t m_compressedDataUsed; - static inline uint16_t compressedDataFree() { return SPI_FLASH_PageSize - m_compressedDataUsed; } + static uint16_t compressedDataFree() { return SPI_FLASH_PageSize - m_compressedDataUsed; } #endif }; diff --git a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp index 4305462162..a14fa4d1df 100644 --- a/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp +++ b/Marlin/src/lcd/extui/mks_ui/mks_hardware.cpp @@ -45,7 +45,7 @@ #if PIN_EXISTS(MT_DET_2) bool mt_det2_sta; #endif - #if HAS_X_MIN || HAS_X_MAX + #if X_HOME_DIR bool endstopx1_sta; #else constexpr static bool endstopx1_sta = true; @@ -55,7 +55,7 @@ #else constexpr static bool endstopx2_sta = true; #endif - #if HAS_Y_MIN || HAS_Y_MAX + #if HAS_Y_AXIS && Y_HOME_DIR bool endstopy1_sta; #else constexpr static bool endstopy1_sta = true; @@ -65,7 +65,7 @@ #else constexpr static bool endstopy2_sta = true; #endif - #if HAS_Z_MIN || HAS_Z_MAX + #if HAS_Z_AXIS && Z_HOME_DIR bool endstopz1_sta; #else constexpr static bool endstopz1_sta = true; diff --git a/Marlin/src/lcd/extui/nextion/nextion_tft.cpp b/Marlin/src/lcd/extui/nextion/nextion_tft.cpp index 2c1bde245c..92349659eb 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_tft.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_tft.cpp @@ -430,25 +430,24 @@ void NextionTFT::PanelInfo(uint8_t req) { break; case 36: // Endstop Info - #if HAS_X_MIN + #if X_HOME_TO_MIN SEND_VALasTXT("x1", READ(X_MIN_PIN) != X_MIN_ENDSTOP_INVERTING ? "triggered" : "open"); - #endif - #if HAS_X_MAX + #elif X_HOME_TO_MAX SEND_VALasTXT("x2", READ(X_MAX_PIN) != X_MAX_ENDSTOP_INVERTING ? "triggered" : "open"); #endif - #if HAS_Y_MIN + #if Y_HOME_TO_MIN SEND_VALasTXT("y1", READ(Y_MIN_PIN) != Y_MIN_ENDSTOP_INVERTING ? "triggered" : "open"); + #elif Y_HOME_TO_MAX + SEND_VALasTXT("y2", READ(X_MAX_PIN) != Y_MAX_ENDSTOP_INVERTING ? "triggered" : "open"); #endif - #if HAS_Z_MIN + #if Z_HOME_TO_MIN SEND_VALasTXT("z1", READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING ? "triggered" : "open"); - #endif - #if HAS_Z_MAX + #elif Z_HOME_TO_MAX SEND_VALasTXT("z2", READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING ? "triggered" : "open"); #endif #if HAS_Z2_MIN SEND_VALasTXT("z2", READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING ? "triggered" : "open"); - #endif - #if HAS_Z2_MAX + #elif HAS_Z2_MAX SEND_VALasTXT("z2", READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING ? "triggered" : "open"); #endif #if HAS_BED_PROBE diff --git a/Marlin/src/lcd/language/language_an.h b/Marlin/src/lcd/language/language_an.h index 8e4ff0e95c..02d4455331 100644 --- a/Marlin/src/lcd/language/language_an.h +++ b/Marlin/src/lcd/language/language_an.h @@ -195,7 +195,7 @@ namespace Language_an { LSTR MSG_INFO_PROTOCOL = _UxGT("Protocolo"); LSTR MSG_CASE_LIGHT = _UxGT("Luz"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Conteo de impresion"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tiempo total d'imp."); diff --git a/Marlin/src/lcd/language/language_ca.h b/Marlin/src/lcd/language/language_ca.h index 6fba76a552..d70e6051b5 100644 --- a/Marlin/src/lcd/language/language_ca.h +++ b/Marlin/src/lcd/language/language_ca.h @@ -183,7 +183,7 @@ namespace Language_ca { LSTR MSG_INFO_PROTOCOL = _UxGT("Protocol"); LSTR MSG_CASE_LIGHT = _UxGT("Llum"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Total impressions"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Acabades"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Temps imprimint"); diff --git a/Marlin/src/lcd/language/language_cz.h b/Marlin/src/lcd/language/language_cz.h index 596591e0f6..20c8686a24 100644 --- a/Marlin/src/lcd/language/language_cz.h +++ b/Marlin/src/lcd/language/language_cz.h @@ -60,7 +60,7 @@ namespace Language_cz { LSTR MSG_RUN_AUTO_FILES = _UxGT("Autostart"); LSTR MSG_DISABLE_STEPPERS = _UxGT("Uvolnit motory"); LSTR MSG_DEBUG_MENU = _UxGT("Nabídka ladění"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Test ukaz. průběhu"); #else LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Test uk. průběhu"); @@ -421,12 +421,12 @@ namespace Language_cz { LSTR MSG_PLEASE_RESET = _UxGT("Proveďte reset"); LSTR MSG_HEATING = _UxGT("Zahřívání..."); LSTR MSG_COOLING = _UxGT("Chlazení..."); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_BED_HEATING = _UxGT("Zahřívání podložky"); #else LSTR MSG_BED_HEATING = _UxGT("Zahřívání podl."); #endif - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_BED_COOLING = _UxGT("Chlazení podložky"); #else LSTR MSG_BED_COOLING = _UxGT("Chlazení podl."); @@ -465,7 +465,7 @@ namespace Language_cz { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas světla"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("NESPRÁVNÁ TISKÁRNA"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Počet tisků"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončeno"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); @@ -535,7 +535,7 @@ namespace Language_cz { LSTR MSG_CYCLE_MIX = _UxGT("Střídat mix"); LSTR MSG_GRADIENT_MIX = _UxGT("Přechod mix"); LSTR MSG_REVERSE_GRADIENT = _UxGT("Opačný přechod"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_ACTIVE_VTOOL = _UxGT("Aktivní V-nástroj"); LSTR MSG_START_VTOOL = _UxGT("Spustit V-nástroj"); LSTR MSG_END_VTOOL = _UxGT("Ukončit V-nástroj"); diff --git a/Marlin/src/lcd/language/language_da.h b/Marlin/src/lcd/language/language_da.h index e032605578..b3644a754c 100644 --- a/Marlin/src/lcd/language/language_da.h +++ b/Marlin/src/lcd/language/language_da.h @@ -156,7 +156,7 @@ namespace Language_da { LSTR MSG_INFO_BOARD_MENU = _UxGT("Kort Info"); LSTR MSG_INFO_THERMISTOR_MENU = _UxGT("Thermistors"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Ant. Prints"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Færdige"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Total print tid"); diff --git a/Marlin/src/lcd/language/language_de.h b/Marlin/src/lcd/language/language_de.h index 00f759a83a..5ac0f1487b 100644 --- a/Marlin/src/lcd/language/language_de.h +++ b/Marlin/src/lcd/language/language_de.h @@ -491,7 +491,7 @@ namespace Language_de { LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Falscher Drucker"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Gesamte Drucke"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Komplette Drucke"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Gesamte Druckzeit"); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 1d8861b2c7..8eeb661557 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -75,6 +75,9 @@ namespace Language_en { LSTR MSG_HOMING = _UxGT("Homing"); LSTR MSG_AUTO_HOME = _UxGT("Auto Home"); LSTR MSG_AUTO_HOME_A = _UxGT("Home @"); + LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); + LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); + LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); LSTR MSG_FILAMENT_SET = _UxGT("Filament Settings"); LSTR MSG_FILAMENT_MAN = _UxGT("Filament Management"); LSTR MSG_LEVBED_FL = _UxGT("Front Left"); @@ -83,6 +86,7 @@ namespace Language_en { LSTR MSG_LEVBED_BL = _UxGT("Back Left"); LSTR MSG_LEVBED_BR = _UxGT("Back Right"); LSTR MSG_MANUAL_MESH = _UxGT("Manual Mesh"); + LSTR MSG_AUTO_MESH = _UxGT("Auto Build Mesh"); LSTR MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Align"); LSTR MSG_ITERATION = _UxGT("G34 Iteration: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Accuracy Decreasing!"); @@ -153,9 +157,11 @@ namespace Language_en { LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Last Z: "); LSTR MSG_NEXT_CORNER = _UxGT("Next Corner"); LSTR MSG_MESH_EDITOR = _UxGT("Mesh Editor"); + LSTR MSG_MESH_VIEWER = _UxGT("Mesh Viewer"); LSTR MSG_EDIT_MESH = _UxGT("Edit Mesh"); LSTR MSG_MESH_VIEW = _UxGT("View Mesh"); LSTR MSG_EDITING_STOPPED = _UxGT("Mesh Editing Stopped"); + LSTR MSG_NO_VALID_MESH = _UxGT("No valid mesh"); LSTR MSG_PROBING_POINT = _UxGT("Probing Point"); LSTR MSG_MESH_X = _UxGT("Index X"); LSTR MSG_MESH_Y = _UxGT("Index Y"); @@ -426,8 +432,14 @@ namespace Language_en { LSTR MSG_BUTTON_BACK = _UxGT("Back"); LSTR MSG_BUTTON_PROCEED = _UxGT("Proceed"); LSTR MSG_BUTTON_SKIP = _UxGT("Skip"); + LSTR MSG_BUTTON_INFO = _UxGT("Info"); + LSTR MSG_BUTTON_LEVEL = _UxGT("Level"); + LSTR MSG_BUTTON_PAUSE = _UxGT("Pause"); + LSTR MSG_BUTTON_RESUME = _UxGT("Resume"); + LSTR MSG_BUTTON_ADVANCED = _UxGT("Advanced"); LSTR MSG_PAUSING = _UxGT("Pausing..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pause Print"); + LSTR MSG_ADVANCED_PAUSE = _UxGT("Advanced Pause"); LSTR MSG_RESUME_PRINT = _UxGT("Resume Print"); LSTR MSG_HOST_START_PRINT = _UxGT("Start Host Print"); LSTR MSG_STOP_PRINT = _UxGT("Stop Print"); @@ -436,12 +448,14 @@ namespace Language_en { LSTR MSG_CANCEL_OBJECT = _UxGT("Cancel Object"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Cancel Object ="); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Power Outage"); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Continue Print Job"); LSTR MSG_MEDIA_MENU = _UxGT("Print from ") MEDIA_TYPE_EN; LSTR MSG_NO_MEDIA = _UxGT("No ") MEDIA_TYPE_EN; LSTR MSG_DWELL = _UxGT("Sleep..."); LSTR MSG_USERWAIT = _UxGT("Click to Resume..."); LSTR MSG_PRINT_PAUSED = _UxGT("Print Paused"); LSTR MSG_PRINTING = _UxGT("Printing..."); + LSTR MSG_STOPPING = _UxGT("Stopping..."); LSTR MSG_PRINT_ABORTED = _UxGT("Print Aborted"); LSTR MSG_PRINT_DONE = _UxGT("Print Done"); LSTR MSG_NO_MOVE = _UxGT("No Move."); @@ -531,6 +545,7 @@ namespace Language_en { LSTR MSG_ERR_MAXTEMP = _UxGT("Err: MAXTEMP"); LSTR MSG_ERR_MINTEMP = _UxGT("Err: MINTEMP"); LSTR MSG_HALTED = _UxGT("PRINTER HALTED"); + LSTR MSG_PLEASE_WAIT = _UxGT("Please wait..."); LSTR MSG_PLEASE_RESET = _UxGT("Please Reset"); LSTR MSG_PREHEATING = _UxGT("Preheating..."); LSTR MSG_HEATING = _UxGT("Heating..."); @@ -577,20 +592,36 @@ namespace Language_en { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No media inserted."); + LSTR MSG_REMAINING_TIME = _UxGT("Remaining time"); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Please wait until reboot. "); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Please preheat the hot end."); + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Reset Print Count"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Print Count"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Total Print Time"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest Job Time"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded Total"); + LSTR MSG_COLORS_GET = _UxGT("Get Color"); + LSTR MSG_COLORS_SELECT = _UxGT("Select Colors"); + LSTR MSG_COLORS_APPLIED = _UxGT("Colors applied"); + LSTR MSG_COLORS_RED = _UxGT("Red"); + LSTR MSG_COLORS_GREEN = _UxGT("Green"); + LSTR MSG_COLORS_BLUE = _UxGT("Blue"); + LSTR MSG_UI_LANGUAGE = _UxGT("UI Language"); + LSTR MSG_SOUND_ENABLE = _UxGT("Enable sound"); + LSTR MSG_LOCKSCREEN = _UxGT("Lock Screen"); #else + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("No Media"); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Please Preheat"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Prints"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); + LSTR MSG_REMAINING_TIME = _UxGT("Remaining"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Total"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Longest"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Extruded"); #endif + LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completed"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Min Temp"); LSTR MSG_INFO_MAX_TEMP = _UxGT("Max Temp"); LSTR MSG_INFO_PSU = _UxGT("PSU"); diff --git a/Marlin/src/lcd/language/language_es.h b/Marlin/src/lcd/language/language_es.h index 9c593215bb..1dbc7faf70 100644 --- a/Marlin/src/lcd/language/language_es.h +++ b/Marlin/src/lcd/language/language_es.h @@ -463,7 +463,7 @@ namespace Language_es { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Brillo cabina"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Impresora incorrecta"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Cont. de impresión"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tiempo total de imp."); diff --git a/Marlin/src/lcd/language/language_eu.h b/Marlin/src/lcd/language/language_eu.h index adc812f6ff..ad6a4f3071 100644 --- a/Marlin/src/lcd/language/language_eu.h +++ b/Marlin/src/lcd/language/language_eu.h @@ -280,7 +280,7 @@ namespace Language_eu { LSTR MSG_INFO_PROTOCOL = _UxGT("Protokoloa"); LSTR MSG_CASE_LIGHT = _UxGT("Kabina Argia"); LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Argiaren Distira"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Inprim. Zenbaketa"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Burututa"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Inprim. denbora"); diff --git a/Marlin/src/lcd/language/language_fr.h b/Marlin/src/lcd/language/language_fr.h index e9c55ed401..41ab9ebaf1 100644 --- a/Marlin/src/lcd/language/language_fr.h +++ b/Marlin/src/lcd/language/language_fr.h @@ -58,12 +58,10 @@ namespace Language_fr { LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Test barre progress."); LSTR MSG_HOMING = _UxGT("Origine"); LSTR MSG_AUTO_HOME = _UxGT("Origine auto"); + LSTR MSG_AUTO_HOME_A = _UxGT("Origine @ auto"); LSTR MSG_AUTO_HOME_X = _UxGT("Origine X auto"); LSTR MSG_AUTO_HOME_Y = _UxGT("Origine Y auto"); LSTR MSG_AUTO_HOME_Z = _UxGT("Origine Z auto"); - LSTR MSG_AUTO_HOME_I = _UxGT("Origine ") LCD_STR_I _UxGT(" auto"); - LSTR MSG_AUTO_HOME_J = _UxGT("Origine ") LCD_STR_J _UxGT(" auto"); - LSTR MSG_AUTO_HOME_K = _UxGT("Origine ") LCD_STR_K _UxGT(" auto"); LSTR MSG_AUTO_Z_ALIGN = _UxGT("Align. Z auto"); LSTR MSG_LEVEL_BED_HOMING = _UxGT("Origine XYZ..."); LSTR MSG_LEVEL_BED_WAITING = _UxGT("Clic pour commencer"); @@ -504,7 +502,7 @@ namespace Language_fr { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosité"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Imprimante incorrecte"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Nbre impressions"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Terminées"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tps impr. total"); diff --git a/Marlin/src/lcd/language/language_gl.h b/Marlin/src/lcd/language/language_gl.h index 1f3acf5f09..3026e761c4 100644 --- a/Marlin/src/lcd/language/language_gl.h +++ b/Marlin/src/lcd/language/language_gl.h @@ -479,7 +479,7 @@ namespace Language_gl { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Brillo Luces"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("IMPRESORA INCORRECTA"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Total Impresións"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completadas"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo Total Imp."); diff --git a/Marlin/src/lcd/language/language_hr.h b/Marlin/src/lcd/language/language_hr.h index 23be8abbb1..78db2ad660 100644 --- a/Marlin/src/lcd/language/language_hr.h +++ b/Marlin/src/lcd/language/language_hr.h @@ -137,7 +137,7 @@ namespace Language_hr { LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Neispravan pisač"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Broj printova"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Završeni"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Ukupno printanja"); diff --git a/Marlin/src/lcd/language/language_hu.h b/Marlin/src/lcd/language/language_hu.h index 204091f5d5..8b5e786303 100644 --- a/Marlin/src/lcd/language/language_hu.h +++ b/Marlin/src/lcd/language/language_hu.h @@ -62,12 +62,10 @@ namespace Language_hu { LSTR MSG_DEBUG_MENU = _UxGT("Hiba Menü"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Haladás sáv teszt"); LSTR MSG_AUTO_HOME = _UxGT("X-Y-Z auto kezdöpont"); + LSTR MSG_AUTO_HOME_A = _UxGT("Kezdö @"); LSTR MSG_AUTO_HOME_X = _UxGT("X kezdöpont"); LSTR MSG_AUTO_HOME_Y = _UxGT("Y kezdöpont"); LSTR MSG_AUTO_HOME_Z = _UxGT("Z kezdöpont"); - LSTR MSG_AUTO_HOME_I = _UxGT("Kezdö ") LCD_STR_I; - LSTR MSG_AUTO_HOME_J = _UxGT("Kezdö ") LCD_STR_J; - LSTR MSG_AUTO_HOME_K = _UxGT("Kezdö ") LCD_STR_K; LSTR MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-igazítás"); LSTR MSG_ITERATION = _UxGT("G34 Ismétlés: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Pontosság csökken!"); @@ -553,7 +551,7 @@ namespace Language_hu { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Fényerösség"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("HELYTELEN NYOMTATÓ"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Nyomtatás számláló"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Befejezett"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Összes nyomtatási idö"); diff --git a/Marlin/src/lcd/language/language_it.h b/Marlin/src/lcd/language/language_it.h index 780f4e9743..1c36a5de21 100644 --- a/Marlin/src/lcd/language/language_it.h +++ b/Marlin/src/lcd/language/language_it.h @@ -68,12 +68,10 @@ namespace Language_it { LSTR MSG_DEBUG_MENU = _UxGT("Menu di debug"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Test barra avanzam."); LSTR MSG_AUTO_HOME = _UxGT("Auto Home"); + LSTR MSG_AUTO_HOME_A = _UxGT("Home @"); LSTR MSG_AUTO_HOME_X = _UxGT("Home X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Home Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Home Z"); - LSTR MSG_AUTO_HOME_I = _UxGT("Home ") LCD_STR_I; - LSTR MSG_AUTO_HOME_J = _UxGT("Home ") LCD_STR_J; - LSTR MSG_AUTO_HOME_K = _UxGT("Home ") LCD_STR_K; LSTR MSG_AUTO_Z_ALIGN = _UxGT("Allineam.automat. Z"); LSTR MSG_ITERATION = _UxGT("Iterazione G34: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Precisione in calo!"); @@ -562,7 +560,7 @@ namespace Language_it { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Luminosità Luci"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("STAMPANTE ERRATA"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Contat. stampa"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completati"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo totale"); diff --git a/Marlin/src/lcd/language/language_nl.h b/Marlin/src/lcd/language/language_nl.h index 42df92b880..e55ed9fea7 100644 --- a/Marlin/src/lcd/language/language_nl.h +++ b/Marlin/src/lcd/language/language_nl.h @@ -180,7 +180,7 @@ namespace Language_nl { LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Onjuiste printer"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Printed Aantal"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Totaal Voltooid"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Totale Printtijd"); diff --git a/Marlin/src/lcd/language/language_pl.h b/Marlin/src/lcd/language/language_pl.h index bf94feea54..7c012f46df 100644 --- a/Marlin/src/lcd/language/language_pl.h +++ b/Marlin/src/lcd/language/language_pl.h @@ -430,7 +430,7 @@ namespace Language_pl { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jasność oświetlenia"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Niepoprawna drukarka"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Wydrukowano"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Ukończono"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Czas druku"); diff --git a/Marlin/src/lcd/language/language_pt_br.h b/Marlin/src/lcd/language/language_pt_br.h index c66f717f9d..0c44145e00 100644 --- a/Marlin/src/lcd/language/language_pt_br.h +++ b/Marlin/src/lcd/language/language_pt_br.h @@ -400,7 +400,7 @@ namespace Language_pt_br { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Intensidade Brilho"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Impressora Incorreta"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Total de Impressões"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Realizadas"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tempo de Impressão"); diff --git a/Marlin/src/lcd/language/language_ro.h b/Marlin/src/lcd/language/language_ro.h index fee63dc2ad..29cdc51c80 100644 --- a/Marlin/src/lcd/language/language_ro.h +++ b/Marlin/src/lcd/language/language_ro.h @@ -486,7 +486,7 @@ namespace Language_ro { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Light Brightness"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("INCORRECT PRINTER"); -#if LCD_WIDTH >= 20 +#if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Total Printuri"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Completat"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Timp Imprimare Total"); diff --git a/Marlin/src/lcd/language/language_ru.h b/Marlin/src/lcd/language/language_ru.h index 96ddec5973..1c31371000 100644 --- a/Marlin/src/lcd/language/language_ru.h +++ b/Marlin/src/lcd/language/language_ru.h @@ -44,7 +44,7 @@ namespace Language_ru { LSTR MSG_MEDIA_INSERTED = _UxGT("SD карта вставлена"); LSTR MSG_MEDIA_REMOVED = _UxGT("SD карта извлечена"); LSTR MSG_MEDIA_WAITING = _UxGT("Вставьте SD карту"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Сбой инициализации SD"); #else LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Сбой инициализ. SD"); @@ -52,7 +52,7 @@ namespace Language_ru { LSTR MSG_MEDIA_READ_ERROR = _UxGT("Ошибка считывания"); LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB диск удалён"); LSTR MSG_MEDIA_USB_FAILED = _UxGT("Ошибка USB диска"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переполнение вызова"); #else LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переполн. вызова"); @@ -67,12 +67,10 @@ namespace Language_ru { LSTR MSG_DEBUG_MENU = _UxGT("Меню отладки"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Тест индикатора"); LSTR MSG_AUTO_HOME = _UxGT("Парковка XYZ"); + LSTR MSG_AUTO_HOME_A = _UxGT("Парковка @"); LSTR MSG_AUTO_HOME_X = _UxGT("Парковка X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Парковка Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Парковка Z"); - LSTR MSG_AUTO_HOME_I = _UxGT("Парковка ") LCD_STR_I; - LSTR MSG_AUTO_HOME_J = _UxGT("Парковка ") LCD_STR_J; - LSTR MSG_AUTO_HOME_K = _UxGT("Парковка ") LCD_STR_K; LSTR MSG_AUTO_Z_ALIGN = _UxGT("Авто Z-выравнивание"); LSTR MSG_ITERATION = _UxGT("G34 Итерация: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Уменьшение точности!"); @@ -82,7 +80,7 @@ namespace Language_ru { LSTR MSG_LEVEL_BED_NEXT_POINT = _UxGT("Следующая точка"); LSTR MSG_LEVEL_BED_DONE = _UxGT("Выравнивание готово!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Высота спада"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_SET_HOME_OFFSETS = _UxGT("Установ. смещения дома"); LSTR MSG_HOME_OFFSET_X = _UxGT("Смещение дома X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Смещение дома Y"); @@ -102,7 +100,7 @@ namespace Language_ru { LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Смещения применены"); LSTR MSG_SET_ORIGIN = _UxGT("Установить ноль"); LSTR MSG_SELECT_ORIGIN = _UxGT("Выберите ноль"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_LAST_VALUE_SP = _UxGT("Последнее знач. "); #else LSTR MSG_LAST_VALUE_SP = _UxGT("Послед. знач. "); @@ -128,7 +126,7 @@ namespace Language_ru { LSTR MSG_COOLDOWN = _UxGT("Охлаждение"); LSTR MSG_CUTTER_FREQUENCY = _UxGT("Частота"); LSTR MSG_LASER_MENU = _UxGT("Управление лазером"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_SPINDLE_MENU = _UxGT("Управление шпинделем"); LSTR MSG_LASER_TOGGLE = _UxGT("Переключить лазер"); LSTR MSG_SPINDLE_TOGGLE = _UxGT("Переключ.шпиндель"); @@ -162,7 +160,7 @@ namespace Language_ru { LSTR MSG_LEVEL_BED = _UxGT("Выровнять стол"); LSTR MSG_BED_TRAMMING = _UxGT("Выровнять углы"); LSTR MSG_NEXT_CORNER = _UxGT("Следующий угол"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Вверх до срабатыв. зонда"); LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Углы в норме. Вырав.стола"); #else @@ -171,7 +169,7 @@ namespace Language_ru { #endif LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Хорошие точки: "); LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Последняя Z: "); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MESH_EDITOR = _UxGT("Смещение по Z"); LSTR MSG_EDITING_STOPPED = _UxGT("Правка сетки окончена"); #else @@ -206,7 +204,7 @@ namespace Language_ru { LSTR MSG_UBL_LEVEL_BED = _UxGT("Настройка UBL"); LSTR MSG_LCD_TILTING_MESH = _UxGT("Точка разворота"); LSTR MSG_UBL_MANUAL_MESH = _UxGT("Ручной ввод сетки"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_BC_INSERT = _UxGT("Разместить шайбу,измерить"); LSTR MSG_UBL_BC_REMOVE = _UxGT("Убрать и замерить стол"); #else @@ -220,7 +218,7 @@ namespace Language_ru { LSTR MSG_UBL_DEACTIVATE_MESH = _UxGT("Деактивировать UBL"); LSTR MSG_UBL_MESH_EDIT = _UxGT("Редактор сеток"); LSTR MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Править свою сетку"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_SET_TEMP_BED = _UxGT("Температура стола"); LSTR MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Температура стола"); LSTR MSG_UBL_SET_TEMP_HOTEND = _UxGT("Температура сопла"); @@ -238,7 +236,7 @@ namespace Language_ru { LSTR MSG_UBL_FINE_TUNE_MESH = _UxGT("Точная правка сетки"); LSTR MSG_UBL_BUILD_MESH_MENU = _UxGT("Построить сетку"); LSTR MSG_UBL_BUILD_MESH_M = _UxGT("Построить сетку $"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_BUILD_COLD_MESH = _UxGT("Построить холодную сетку"); #else LSTR MSG_UBL_BUILD_COLD_MESH = _UxGT("Строить холод.сетку"); @@ -246,7 +244,7 @@ namespace Language_ru { LSTR MSG_UBL_MESH_HEIGHT_ADJUST = _UxGT("Правка высоты сетки"); LSTR MSG_UBL_MESH_HEIGHT_AMOUNT = _UxGT("Высота"); LSTR MSG_UBL_VALIDATE_MESH_MENU = _UxGT("Проверить сетку"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_VALIDATE_MESH_M = _UxGT("Проверить сетку $"); LSTR MSG_UBL_VALIDATE_CUSTOM_MESH = _UxGT("Проверить свою сетку"); #else @@ -262,7 +260,7 @@ namespace Language_ru { LSTR MSG_G26_LEAVING = _UxGT("Выйти из G26"); LSTR MSG_UBL_CONTINUE_MESH = _UxGT("Продолжить сетку"); LSTR MSG_UBL_MESH_LEVELING = _UxGT("Выравнивание сетки"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-х точечное выравнивание"); #else LSTR MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-точечное выравн."); @@ -274,7 +272,7 @@ namespace Language_ru { LSTR MSG_UBL_OUTPUT_MAP = _UxGT("Вывести карту сетки"); LSTR MSG_UBL_OUTPUT_MAP_HOST = _UxGT("Вывести на хост"); LSTR MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Вывести в CSV"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Сохранить сетку снаружи"); LSTR MSG_UBL_INFO_UBL = _UxGT("Вывод информации UBL"); LSTR MSG_UBL_FILLIN_AMOUNT = _UxGT("Кол-во заполнителя"); @@ -324,7 +322,7 @@ namespace Language_ru { LSTR MSG_SET_LEDS_DEFAULT = _UxGT("Свет по умолчанию"); LSTR MSG_LED_CHANNEL_N = _UxGT("Канал ="); LSTR MSG_LEDS2 = _UxGT("Свет #2"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_NEO2_PRESETS = _UxGT("Свет #2 предустановки"); #else LSTR MSG_NEO2_PRESETS = _UxGT("Свет #2 предустан."); @@ -361,7 +359,7 @@ namespace Language_ru { LSTR MSG_NOZZLE_STANDBY = _UxGT("Сопло ожидает"); LSTR MSG_BED = _UxGT("Стол, ") LCD_STR_DEGREE "C"; LSTR MSG_CHAMBER = _UxGT("Камера,") LCD_STR_DEGREE "C"; - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_COOLER = _UxGT("Охлаждение лазера"); LSTR MSG_COOLER_TOGGLE = _UxGT("Переключ. охлажд."); LSTR MSG_FLOWMETER_SAFETY = _UxGT("Безопасн. потока"); @@ -409,7 +407,7 @@ namespace Language_ru { LSTR MSG_VJ_JERK = _UxGT("V") LCD_STR_J _UxGT("-рывок"); LSTR MSG_VK_JERK = _UxGT("V") LCD_STR_K _UxGT("-рывок"); LSTR MSG_VE_JERK = _UxGT("Ve-рывок"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_JUNCTION_DEVIATION = _UxGT("Отклонение узла"); #else LSTR MSG_JUNCTION_DEVIATION = _UxGT("Отклон. узла"); @@ -453,7 +451,7 @@ namespace Language_ru { LSTR MSG_VOLUMETRIC_ENABLED = _UxGT("E в мм") SUPERSCRIPT_THREE; LSTR MSG_VOLUMETRIC_LIMIT = _UxGT("E огран.,мм") SUPERSCRIPT_THREE; LSTR MSG_VOLUMETRIC_LIMIT_E = _UxGT("E огран. *"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_FILAMENT_DIAM = _UxGT("Диам. филамента"); LSTR MSG_FILAMENT_DIAM_E = _UxGT("Диам. филамента *"); #else @@ -467,7 +465,7 @@ namespace Language_ru { LSTR MSG_CONTRAST = _UxGT("Контраст экрана"); LSTR MSG_STORE_EEPROM = _UxGT("Сохранить настройки"); LSTR MSG_LOAD_EEPROM = _UxGT("Загрузить настройки"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_RESTORE_DEFAULTS = _UxGT("На базовые параметры"); LSTR MSG_INIT_EEPROM = _UxGT("Инициализация EEPROM"); #else @@ -521,7 +519,7 @@ namespace Language_ru { LSTR MSG_NO_MOVE = _UxGT("Нет движения."); LSTR MSG_KILLED = _UxGT("УБИТО. "); LSTR MSG_STOPPED = _UxGT("ОСТАНОВЛЕНО. "); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_CONTROL_RETRACT = _UxGT("Втягивание, мм"); LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Смена втягив., мм"); LSTR MSG_CONTROL_RETRACT_RECOVER_SWAP = _UxGT("Возврат смены, мм"); @@ -540,7 +538,7 @@ namespace Language_ru { LSTR MSG_CONTROL_RETRACT_RECOVERF = _UxGT("Возврат V"); LSTR MSG_FILAMENT_SWAP_LENGTH = _UxGT("Поменять длины"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_FILAMENT_SWAP_EXTRA = _UxGT("Поменять дополнительно"); #else LSTR MSG_FILAMENT_SWAP_EXTRA = _UxGT("Поменять дополнит."); @@ -549,7 +547,7 @@ namespace Language_ru { LSTR MSG_TOOL_CHANGE = _UxGT("Смена сопел"); LSTR MSG_TOOL_CHANGE_ZLIFT = _UxGT("Поднятие по Z"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Начальная скор."); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Скорость втягив."); #else @@ -569,7 +567,7 @@ namespace Language_ru { LSTR MSG_FILAMENTCHANGE = _UxGT("Смена филамента"); LSTR MSG_FILAMENTCHANGE_E = _UxGT("Смена филамента *"); LSTR MSG_FILAMENTLOAD = _UxGT("Загрузить филамент"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_FILAMENTLOAD_E = _UxGT("Загрузить филамент *"); LSTR MSG_FILAMENTUNLOAD_E = _UxGT("Выгрузить филамент *"); #else @@ -607,7 +605,7 @@ namespace Language_ru { LSTR MSG_ZPROBE_XOFFSET = _UxGT("Смещение X"); LSTR MSG_ZPROBE_YOFFSET = _UxGT("Смещение Y"); LSTR MSG_ZPROBE_ZOFFSET = _UxGT("Смещение Z"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Двигать сопло к столу"); #else LSTR MSG_MOVE_NOZZLE_TO_BED = _UxGT("Двиг. сопло к столу"); @@ -651,7 +649,7 @@ namespace Language_ru { LSTR MSG_DELTA_SETTINGS = _UxGT("Настройки Delta"); LSTR MSG_DELTA_AUTO_CALIBRATE = _UxGT("Авто калибровка"); LSTR MSG_DELTA_HEIGHT_CALIBRATE = _UxGT("Высота Delta"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондировать Z-смещения"); #else LSTR MSG_DELTA_Z_OFFSET_CALIBRATE = _UxGT("Зондир. Z-смещения"); @@ -661,7 +659,7 @@ namespace Language_ru { LSTR MSG_DELTA_RADIUS = _UxGT("Радиус"); LSTR MSG_INFO_MENU = _UxGT("О принтере"); LSTR MSG_INFO_PRINTER_MENU = _UxGT("Данные принтера"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_3POINT_LEVELING = _UxGT("3-точечное выравнивание"); LSTR MSG_LINEAR_LEVELING = _UxGT("Линейное выравнивание"); LSTR MSG_BILINEAR_LEVELING = _UxGT("Билинейное выравнивание"); @@ -672,7 +670,7 @@ namespace Language_ru { #endif LSTR MSG_UBL_LEVELING = _UxGT("Управление UBL"); LSTR MSG_MESH_LEVELING = _UxGT("Выравнивание сетки"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MESH_DONE = _UxGT("Зондирование выполнено"); #else LSTR MSG_MESH_DONE = _UxGT("Зондиров. выполнено"); @@ -684,7 +682,7 @@ namespace Language_ru { LSTR MSG_INFO_EXTRUDERS = _UxGT("Экструдеры"); LSTR MSG_INFO_BAUDRATE = _UxGT("Скорость,БОД"); LSTR MSG_INFO_PROTOCOL = _UxGT("Протокол"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Контроль утечки Т: Выкл"); LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Контроль утечки Т: Вкл"); LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Время простоя хотенда"); @@ -697,7 +695,7 @@ namespace Language_ru { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Яркость подсветки"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Неверный принтер"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Счётчик печати"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Общее время печати"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Наидольшее задание"); @@ -731,7 +729,7 @@ namespace Language_ru { LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Выдавить ещё"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Возобновить печать"); LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Сопла: "); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_RUNOUT_SENSOR = _UxGT("Датчик оконч. филамента"); #else LSTR MSG_RUNOUT_SENSOR = _UxGT("Датчик оконч.филам."); @@ -742,7 +740,7 @@ namespace Language_ru { LSTR MSG_MMU2_CHOOSE_FILAMENT_HEADER = _UxGT("ВЫБИРЕТЕ ФИЛАМЕНТ"); LSTR MSG_MMU2_MENU = _UxGT("Настройки MMU"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_KILL_MMU2_FIRMWARE = _UxGT("Обновить прошивку MMU!"); #else LSTR MSG_KILL_MMU2_FIRMWARE = _UxGT("Обнови прошивку MMU"); @@ -757,7 +755,7 @@ namespace Language_ru { LSTR MSG_MMU2_EJECT_FILAMENT_N = _UxGT("Извлечь филамент ~"); LSTR MSG_MMU2_UNLOAD_FILAMENT = _UxGT("Выгрузить филамент"); LSTR MSG_MMU2_LOADING_FILAMENT = _UxGT("Загрузка %i..."); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MMU2_EJECTING_FILAMENT = _UxGT("Извлечение филамента..."); #else LSTR MSG_MMU2_EJECTING_FILAMENT = _UxGT("Извлеч.филамента..."); @@ -769,7 +767,7 @@ namespace Language_ru { LSTR MSG_MMU2_RESETTING = _UxGT("Перезапуск MMU..."); LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("Удалите и нажмите"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MIX = _UxGT("Смешивание"); #else LSTR MSG_MIX = _UxGT("Смешив."); @@ -781,7 +779,7 @@ namespace Language_ru { LSTR MSG_CYCLE_MIX = _UxGT("Цикличное смешивание"); LSTR MSG_GRADIENT_MIX = _UxGT("Градиент смешивания"); LSTR MSG_REVERSE_GRADIENT = _UxGT("Сменить градиент"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_TOGGLE_MIX = _UxGT("Переключить смешивание"); LSTR MSG_ACTIVE_VTOOL = _UxGT("Активация В-инструм."); LSTR MSG_START_VTOOL = _UxGT("Начало В-инструмента"); @@ -809,7 +807,7 @@ namespace Language_ru { LSTR MSG_SNAKE = _UxGT("Змейка"); LSTR MSG_MAZE = _UxGT("Лабиринт"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_BAD_PAGE = _UxGT("Плохой индекс страницы"); LSTR MSG_BAD_PAGE_SPEED = _UxGT("Плохая скорость страницы"); #else @@ -825,7 +823,7 @@ namespace Language_ru { LSTR MSG_REMOVE_PASSWORD = _UxGT("Удалить пароль"); LSTR MSG_PASSWORD_SET = _UxGT("Пароль это "); LSTR MSG_START_OVER = _UxGT("Старт через"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_REMINDER_SAVE_SETTINGS = _UxGT("Запомни для сохранения!"); #else LSTR MSG_REMINDER_SAVE_SETTINGS = _UxGT("Запомни, сохрани!"); @@ -876,7 +874,7 @@ namespace Language_ru { LSTR MSG_LEVEL_X_AXIS = _UxGT("Уровень оси X"); LSTR MSG_AUTO_CALIBRATE = _UxGT("Авто калибровка"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_HEATER_TIMEOUT = _UxGT("Время нагревателя вышло"); #else LSTR MSG_HEATER_TIMEOUT = _UxGT("Время нагрев. вышло"); @@ -885,7 +883,7 @@ namespace Language_ru { LSTR MSG_REHEATING = _UxGT("Нагрев..."); LSTR MSG_PROBE_WIZARD = _UxGT("Мастер Z-зонда"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_PROBE_WIZARD_PROBING = _UxGT("Зондиров. контр. точки Z"); LSTR MSG_PROBE_WIZARD_MOVING = _UxGT("Движение к точке зондиров."); #else diff --git a/Marlin/src/lcd/language/language_sk.h b/Marlin/src/lcd/language/language_sk.h index 9ab08f2766..db694e2242 100644 --- a/Marlin/src/lcd/language/language_sk.h +++ b/Marlin/src/lcd/language/language_sk.h @@ -72,12 +72,10 @@ namespace Language_sk { LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Test uk. priebehu"); LSTR MSG_HOMING = _UxGT("Parkovanie"); LSTR MSG_AUTO_HOME = _UxGT("Domovská pozícia"); + LSTR MSG_AUTO_HOME_A = _UxGT("Domov os @"); LSTR MSG_AUTO_HOME_X = _UxGT("Domov os X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Domov os Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Domov os Z"); - LSTR MSG_AUTO_HOME_I = _UxGT("Domov os ") LCD_STR_I; - LSTR MSG_AUTO_HOME_J = _UxGT("Domov os ") LCD_STR_J; - LSTR MSG_AUTO_HOME_K = _UxGT("Domov os ") LCD_STR_K; LSTR MSG_FILAMENT_SET = _UxGT("Nastav. filamentu"); LSTR MSG_FILAMENT_MAN = _UxGT("Správa filamentu"); LSTR MSG_LEVBED_FL = _UxGT("Ľavý predný"); @@ -86,6 +84,7 @@ namespace Language_sk { LSTR MSG_LEVBED_BL = _UxGT("Ľavý zadný"); LSTR MSG_LEVBED_BR = _UxGT("Pravý zadný"); LSTR MSG_MANUAL_MESH = _UxGT("Ručná mriežka"); + LSTR MSG_AUTO_MESH = _UxGT("Automat. mriežka"); LSTR MSG_AUTO_Z_ALIGN = _UxGT("Auto-zarovn. Z"); LSTR MSG_ITERATION = _UxGT("Iterácia G34: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Klesajúca presnosť!"); @@ -156,8 +155,11 @@ namespace Language_sk { LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Posl. Z: "); LSTR MSG_NEXT_CORNER = _UxGT("Ďalší roh"); LSTR MSG_MESH_EDITOR = _UxGT("Editor sieťe bodov"); + LSTR MSG_MESH_VIEWER = _UxGT("Zobraz. sieťe bodov"); LSTR MSG_EDIT_MESH = _UxGT("Upraviť sieť bodov"); + LSTR MSG_MESH_VIEW = _UxGT("Zobraz. sieť bodov"); LSTR MSG_EDITING_STOPPED = _UxGT("Koniec úprav siete"); + LSTR MSG_NO_VALID_MESH = _UxGT("Neplatná sieť bodov"); LSTR MSG_PROBING_POINT = _UxGT("Skúšam bod"); LSTR MSG_MESH_X = _UxGT("Index X"); LSTR MSG_MESH_Y = _UxGT("Index Y"); @@ -397,6 +399,7 @@ namespace Language_sk { LSTR MSG_ADVANCE_K = _UxGT("K pre posun"); LSTR MSG_ADVANCE_K_E = _UxGT("K pre posun *"); LSTR MSG_CONTRAST = _UxGT("Kontrast LCD"); + LSTR MSG_BRIGHTNESS = _UxGT("Jas LCD"); LSTR MSG_STORE_EEPROM = _UxGT("Uložiť nastavenie"); LSTR MSG_LOAD_EEPROM = _UxGT("Načítať nastavenie"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("Obnoviť nastavenie"); @@ -427,8 +430,14 @@ namespace Language_sk { LSTR MSG_BUTTON_BACK = _UxGT("Naspäť"); LSTR MSG_BUTTON_PROCEED = _UxGT("Pokračovať"); LSTR MSG_BUTTON_SKIP = _UxGT("Preskočiť"); + LSTR MSG_BUTTON_INFO = _UxGT("Informácie"); + LSTR MSG_BUTTON_LEVEL = _UxGT("Vyrovnať"); + LSTR MSG_BUTTON_PAUSE = _UxGT("Pauza"); + LSTR MSG_BUTTON_RESUME = _UxGT("Obnoviť"); + LSTR MSG_BUTTON_ADVANCED = _UxGT("Pokročilé"); LSTR MSG_PAUSING = _UxGT("Pozastavujem..."); LSTR MSG_PAUSE_PRINT = _UxGT("Pozastaviť tlač"); + LSTR MSG_ADVANCED_PAUSE = _UxGT("Pokročil. pauza"); LSTR MSG_RESUME_PRINT = _UxGT("Obnoviť tlač"); LSTR MSG_HOST_START_PRINT = _UxGT("Spustiť z hosta"); LSTR MSG_STOP_PRINT = _UxGT("Zastaviť tlač"); @@ -437,12 +446,14 @@ namespace Language_sk { LSTR MSG_CANCEL_OBJECT = _UxGT("Zrušiť objekt"); LSTR MSG_CANCEL_OBJECT_N = _UxGT("Zrušiť objekt ="); LSTR MSG_OUTAGE_RECOVERY = _UxGT("Obnova po výp. nap."); + LSTR MSG_CONTINUE_PRINT_JOB = _UxGT("Pokračovať v úlohe"); LSTR MSG_MEDIA_MENU = _UxGT("Tlačiť z SD"); LSTR MSG_NO_MEDIA = _UxGT("Žiadna SD karta"); LSTR MSG_DWELL = _UxGT("Spím..."); LSTR MSG_USERWAIT = _UxGT("Pokrač. kliknutím..."); LSTR MSG_PRINT_PAUSED = _UxGT("Tlač pozastavená"); LSTR MSG_PRINTING = _UxGT("Tlačím..."); + LSTR MSG_STOPPING = _UxGT("Zastavujem..."); LSTR MSG_PRINT_ABORTED = _UxGT("Tlač zrušená"); LSTR MSG_PRINT_DONE = _UxGT("Tlač dokončená"); LSTR MSG_NO_MOVE = _UxGT("Žiadny pohyb."); @@ -492,6 +503,7 @@ namespace Language_sk { LSTR MSG_BLTOUCH_STOW = _UxGT("Zasunúť"); LSTR MSG_BLTOUCH_DEPLOY = _UxGT("Vysunúť"); LSTR MSG_BLTOUCH_SW_MODE = _UxGT("Režim SW"); + LSTR MSG_BLTOUCH_SPEED_MODE = _UxGT("Vysoká rýchl."); LSTR MSG_BLTOUCH_5V_MODE = _UxGT("Režim 5V"); LSTR MSG_BLTOUCH_OD_MODE = _UxGT("Režim OD"); LSTR MSG_BLTOUCH_MODE_STORE = _UxGT("Ulož. režim"); @@ -524,6 +536,7 @@ namespace Language_sk { LSTR MSG_HEATING_FAILED_LCD = _UxGT("Chyba ohrevu"); LSTR MSG_ERR_REDUNDANT_TEMP = _UxGT("Chyba: REDUND. TEP."); LSTR MSG_THERMAL_RUNAWAY = _UxGT("TEPLOTNÝ SKOK"); + LSTR MSG_TEMP_MALFUNCTION = _UxGT("TEPLOTNÁ PORUCHA"); LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("TEPLOTNÝ SKOK PODL."); LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("TEPLOTNÝ SKOK KOMO."); LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("TEPLOTNÝ SKOK CHLAD."); @@ -531,7 +544,9 @@ namespace Language_sk { LSTR MSG_ERR_MAXTEMP = _UxGT("Chyba: MAXTEMP"); LSTR MSG_ERR_MINTEMP = _UxGT("Chyba: MINTEMP"); LSTR MSG_HALTED = _UxGT("TLAČIAREŇ ZASTAVENÁ"); + LSTR MSG_PLEASE_WAIT = _UxGT("Čakajte prosím..."); LSTR MSG_PLEASE_RESET = _UxGT("Reštartuje ju"); + LSTR MSG_PREHEATING = _UxGT("Zahrievanie..."); LSTR MSG_HEATING = _UxGT("Ohrev..."); LSTR MSG_COOLING = _UxGT("Ochladzovanie..."); LSTR MSG_BED_HEATING = _UxGT("Ohrev podložky..."); @@ -570,25 +585,42 @@ namespace Language_sk { LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Tepl. ochrana: VYP"); LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Tepl. ochrana: ZAP"); LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Vypr.čas nečinnosti"); + LSTR MSG_FAN_SPEED_FAULT = _UxGT("Chyba rýchl. vent."); LSTR MSG_CASE_LIGHT = _UxGT("Osvetlenie"); LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Jas svetla"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Nesprávna tlačiareň"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Nie je vložená karta."); + LSTR MSG_REMAINING_TIME = _UxGT("Zostávajúci čas"); + LSTR MSG_PLEASE_WAIT_REBOOT = _UxGT("Prosím čakajte do reštartu. "); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte hotend."); + LSTR MSG_INFO_PRINT_COUNT_RESET = _UxGT("Vynulovať počítadlo"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Počet tlačí"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončené"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Celkový čas"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia tlač"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Celkom vytlačené"); + LSTR MSG_COLORS_GET = _UxGT("Zvoliť farbu"); + LSTR MSG_COLORS_SELECT = _UxGT("Zvoliť farby"); + LSTR MSG_COLORS_APPLIED = _UxGT("Farby aplikované"); + LSTR MSG_COLORS_RED = _UxGT("Červená"); + LSTR MSG_COLORS_GREEN = _UxGT("Zelená"); + LSTR MSG_COLORS_BLUE = _UxGT("Modrá"); + LSTR MSG_UI_LANGUAGE = _UxGT("Jazyk rozhrania"); + LSTR MSG_SOUND_ENABLE = _UxGT("Povoliť zvuky"); + LSTR MSG_LOCKSCREEN = _UxGT("Uzamknúť obrazovku"); #else + LSTR MSG_MEDIA_NOT_INSERTED = _UxGT("Žiadna karta"); + LSTR MSG_PLEASE_PREHEAT = _UxGT("Prosím zahrejte"); LSTR MSG_INFO_PRINT_COUNT = _UxGT("Tlače"); - LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Hotovo"); + LSTR MSG_REMAINING_TIME = _UxGT("Zostávajúci"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Čas"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Najdlhšia"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Vytlačené"); #endif + LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Dokončené"); LSTR MSG_INFO_MIN_TEMP = _UxGT("Teplota min"); LSTR MSG_INFO_MAX_TEMP = _UxGT("Teplota max"); LSTR MSG_INFO_PSU = _UxGT("Nap. zdroj"); @@ -613,6 +645,7 @@ namespace Language_sk { LSTR MSG_RUNOUT_SENSOR = _UxGT("Senzor filamentu"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Vzd. mm fil. senz."); LSTR MSG_RUNOUT_ENABLE = _UxGT("Zapnúť senzor"); + LSTR MSG_FANCHECK = _UxGT("Kontrola rýchl."); LSTR MSG_KILL_HOMING_FAILED = _UxGT("Parkovanie zlyhalo"); LSTR MSG_LCD_PROBING_FAILED = _UxGT("Kalibrácia zlyhala"); @@ -732,6 +765,10 @@ namespace Language_sk { LSTR MSG_PROBE_WIZARD_PROBING = _UxGT("Referencia Z"); LSTR MSG_PROBE_WIZARD_MOVING = _UxGT("Presúvam na pozíciu"); + LSTR MSG_XATC = _UxGT("Sprievodca X-Twist"); + LSTR MSG_XATC_DONE = _UxGT("Spriev. X-Twist dokonč.!"); + LSTR MSG_XATC_UPDATE_Z_OFFSET = _UxGT("Aktual. ofset sondy Z na "); + LSTR MSG_SOUND = _UxGT("Zvuk"); LSTR MSG_TOP_LEFT = _UxGT("Ľavý horný"); @@ -745,4 +782,6 @@ namespace Language_sk { LSTR MSG_SD_CARD = _UxGT("SD karta"); LSTR MSG_USB_DISK = _UxGT("USB disk"); + + LSTR MSG_HOST_SHUTDOWN = _UxGT("Vypnúť hosta"); } diff --git a/Marlin/src/lcd/language/language_sv.h b/Marlin/src/lcd/language/language_sv.h index 69161d6b55..d4c03d0d61 100644 --- a/Marlin/src/lcd/language/language_sv.h +++ b/Marlin/src/lcd/language/language_sv.h @@ -523,7 +523,7 @@ namespace Language_sv { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Ljus ljusstyrka"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("INKORREKT SKRIVARE"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Utskriftsantal"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Färdiga"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Total Utskriftstid"); diff --git a/Marlin/src/lcd/language/language_tr.h b/Marlin/src/lcd/language/language_tr.h index 4c2bbfa0dc..447ea9d5bf 100644 --- a/Marlin/src/lcd/language/language_tr.h +++ b/Marlin/src/lcd/language/language_tr.h @@ -456,7 +456,7 @@ namespace Language_tr { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Aydınlatma Parlaklğı"); LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("Yanlış Yazıcı"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Baskı Sayısı"); LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Tamamlanan"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Toplam Baskı Süresi"); diff --git a/Marlin/src/lcd/language/language_uk.h b/Marlin/src/lcd/language/language_uk.h index 23110b5e4d..028e48bb41 100644 --- a/Marlin/src/lcd/language/language_uk.h +++ b/Marlin/src/lcd/language/language_uk.h @@ -44,7 +44,7 @@ namespace Language_uk { LSTR MSG_MEDIA_INSERTED = _UxGT("SD-картка вставлена"); LSTR MSG_MEDIA_REMOVED = _UxGT("SD-картка видалена"); LSTR MSG_MEDIA_WAITING = _UxGT("Вставте SD-картку"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Збій ініціалізації SD"); #else LSTR MSG_MEDIA_INIT_FAIL = _UxGT("Збій ініціаліз. SD"); @@ -52,7 +52,7 @@ namespace Language_uk { LSTR MSG_MEDIA_READ_ERROR = _UxGT("Помилка зчитування"); LSTR MSG_MEDIA_USB_REMOVED = _UxGT("USB диск видалений"); LSTR MSG_MEDIA_USB_FAILED = _UxGT("Помилка USB диску"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_KILL_SUBCALL_OVERFLOW = _UxGT("Переповнення виклику"); LSTR MSG_LCD_SOFT_ENDSTOPS = _UxGT("Програмні кінцевики"); #else @@ -68,12 +68,10 @@ namespace Language_uk { LSTR MSG_DEBUG_MENU = _UxGT("Меню Debug"); LSTR MSG_PROGRESS_BAR_TEST = _UxGT("Тест лінії прогр."); LSTR MSG_AUTO_HOME = _UxGT("Авто паркування"); + LSTR MSG_AUTO_HOME_A = _UxGT("Паркування @"); LSTR MSG_AUTO_HOME_X = _UxGT("Паркування X"); LSTR MSG_AUTO_HOME_Y = _UxGT("Паркування Y"); LSTR MSG_AUTO_HOME_Z = _UxGT("Паркування Z"); - LSTR MSG_AUTO_HOME_I = _UxGT("Паркування ") LCD_STR_I; - LSTR MSG_AUTO_HOME_J = _UxGT("Паркування ") LCD_STR_J; - LSTR MSG_AUTO_HOME_K = _UxGT("Паркування ") LCD_STR_K; LSTR MSG_AUTO_Z_ALIGN = _UxGT("Авто Z-вирівнювання"); LSTR MSG_ITERATION = _UxGT("G34 Ітерація: %i"); LSTR MSG_DECREASING_ACCURACY = _UxGT("Зменьшення точності!"); @@ -83,7 +81,7 @@ namespace Language_uk { LSTR MSG_LEVEL_BED_NEXT_POINT = _UxGT("Наступна точка"); LSTR MSG_LEVEL_BED_DONE = _UxGT("Завершено!"); LSTR MSG_Z_FADE_HEIGHT = _UxGT("Висота спаду"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_SET_HOME_OFFSETS = _UxGT("Встанов. зміщення дому"); LSTR MSG_HOME_OFFSET_X = _UxGT("Зміщення дому X"); LSTR MSG_HOME_OFFSET_Y = _UxGT("Зміщення дому Y"); @@ -103,7 +101,7 @@ namespace Language_uk { LSTR MSG_HOME_OFFSETS_APPLIED = _UxGT("Зміщення прийняті"); LSTR MSG_SET_ORIGIN = _UxGT("Встановити нуль"); LSTR MSG_SELECT_ORIGIN = _UxGT("Оберіть нуль"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_LAST_VALUE_SP = _UxGT("Останнє значення "); #else LSTR MSG_LAST_VALUE_SP = _UxGT("Останнє знач. "); @@ -131,7 +129,7 @@ namespace Language_uk { LSTR MSG_CUTTER_FREQUENCY = _UxGT("Частота"); LSTR MSG_LASER_MENU = _UxGT("Керування лазером"); LSTR MSG_SPINDLE_MENU = _UxGT("Керування шпінделем"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_LASER_POWER = _UxGT("Потужність лазера"); LSTR MSG_SPINDLE_TOGGLE = _UxGT("Перемкн. шпіндель"); LSTR MSG_SPINDLE_EVAC_TOGGLE = _UxGT("Перемкнути вакуум"); @@ -162,7 +160,7 @@ namespace Language_uk { LSTR MSG_BED_LEVELING = _UxGT("Вирівнювання столу"); LSTR MSG_LEVEL_BED = _UxGT("Вирівняти стіл"); LSTR MSG_BED_TRAMMING = _UxGT("Вирівняти кути"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_BED_TRAMMING_RAISE = _UxGT("Вгору до спрацюв. зонду"); LSTR MSG_BED_TRAMMING_IN_RANGE = _UxGT("Кути в межах. Вирів.столу"); #else @@ -172,7 +170,7 @@ namespace Language_uk { LSTR MSG_BED_TRAMMING_GOOD_POINTS = _UxGT("Хороші точки: "); LSTR MSG_BED_TRAMMING_LAST_Z = _UxGT("Остання Z: "); LSTR MSG_NEXT_CORNER = _UxGT("Наступний кут"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MESH_EDITOR = _UxGT("Зміщення по Z"); #else LSTR MSG_MESH_EDITOR = _UxGT("Зміщення Z"); @@ -205,7 +203,7 @@ namespace Language_uk { LSTR MSG_UBL_TOOLS = _UxGT("Інструменти UBL"); LSTR MSG_UBL_LEVEL_BED = _UxGT("Налаштування UBL"); LSTR MSG_LCD_TILTING_MESH = _UxGT("Точка нахилу"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_MANUAL_MESH = _UxGT("Ручне введення сітки"); LSTR MSG_UBL_BC_INSERT = _UxGT("Розмістити шайбу і вимір."); #else @@ -214,7 +212,7 @@ namespace Language_uk { #endif LSTR MSG_UBL_MESH_WIZARD = _UxGT("Майстер сіток UBL"); LSTR MSG_UBL_BC_INSERT2 = _UxGT("Вимірювання"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_BC_REMOVE = _UxGT("Видалити і виміряти стіл"); #else LSTR MSG_UBL_BC_REMOVE = _UxGT("Видали і вимір. стіл"); @@ -226,7 +224,7 @@ namespace Language_uk { LSTR MSG_UBL_BED_TEMP_CUSTOM = _UxGT("Своя ") LCD_STR_THERMOMETER _UxGT(" столу,") LCD_STR_DEGREE "C"; LSTR MSG_UBL_SET_TEMP_HOTEND = LCD_STR_THERMOMETER _UxGT(" сопла, ") LCD_STR_DEGREE "C"; LSTR MSG_UBL_HOTEND_TEMP_CUSTOM = _UxGT("Своя ") LCD_STR_THERMOMETER _UxGT(" сопла,") LCD_STR_DEGREE "C"; - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_EDIT_CUSTOM_MESH = _UxGT("Редагувати свою сітку"); LSTR MSG_UBL_FINE_TUNE_MESH = _UxGT("Точне редагування сітки"); LSTR MSG_UBL_BUILD_CUSTOM_MESH = _UxGT("Будувати свою сітку"); @@ -256,7 +254,7 @@ namespace Language_uk { LSTR MSG_UBL_CONTINUE_MESH = _UxGT("Продовжити сітку"); LSTR MSG_UBL_MESH_LEVELING = _UxGT("Вирівнювання сітки"); LSTR MSG_UBL_3POINT_MESH_LEVELING = _UxGT("3-точкове вирівн."); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_GRID_MESH_LEVELING = _UxGT("Вирівнювання растру"); #else LSTR MSG_UBL_GRID_MESH_LEVELING = _UxGT("Вирівнюв. растру"); @@ -269,7 +267,7 @@ namespace Language_uk { LSTR MSG_UBL_OUTPUT_MAP_CSV = _UxGT("Вивести в CSV"); LSTR MSG_UBL_OUTPUT_MAP_BACKUP = _UxGT("Зберегти зовні"); LSTR MSG_UBL_INFO_UBL = _UxGT("Інформація по UBL"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_FILLIN_AMOUNT = _UxGT("Обсяг заповнюв."); #else LSTR MSG_UBL_FILLIN_AMOUNT = _UxGT("Обсяг заповн."); @@ -279,7 +277,7 @@ namespace Language_uk { LSTR MSG_UBL_FILLIN_MESH = _UxGT("Заповнити сітку"); LSTR MSG_UBL_INVALIDATE_ALL = _UxGT("Анулювати все"); LSTR MSG_UBL_INVALIDATE_CLOSEST = _UxGT("Анулювати найближчу"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_UBL_FINE_TUNE_ALL = _UxGT("Точно налаштувати все"); LSTR MSG_UBL_FINE_TUNE_CLOSEST = _UxGT("Точно налашт.найближчу"); #else @@ -308,7 +306,7 @@ namespace Language_uk { LSTR MSG_LED_CONTROL = _UxGT("Керування світлом"); LSTR MSG_LEDS = _UxGT("Підсвітка"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_LED_PRESETS = _UxGT("Передустановки світла"); #else LSTR MSG_LED_PRESETS = _UxGT("Передустан. світла"); @@ -324,7 +322,7 @@ namespace Language_uk { LSTR MSG_SET_LEDS_DEFAULT = _UxGT("За умовчанням"); LSTR MSG_LED_CHANNEL_N = _UxGT("Канал ="); LSTR MSG_LEDS2 = _UxGT("Світло #2"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_NEO2_PRESETS = _UxGT("Передустановка світла #2"); #else LSTR MSG_NEO2_PRESETS = _UxGT("Передуст. світла #2"); @@ -361,7 +359,7 @@ namespace Language_uk { LSTR MSG_NOZZLE_STANDBY = _UxGT("Сопло очікує"); LSTR MSG_BED = _UxGT("Стіл, ") LCD_STR_DEGREE "C"; LSTR MSG_CHAMBER = _UxGT("Камера,") LCD_STR_DEGREE "C"; - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_COOLER = _UxGT("Охолодження лазеру"); LSTR MSG_COOLER_TOGGLE = _UxGT("Перемк. охолодж."); #else @@ -372,7 +370,7 @@ namespace Language_uk { LSTR MSG_LASER = _UxGT("Лазер"); LSTR MSG_FAN_SPEED = _UxGT("Швидк. вент."); LSTR MSG_FAN_SPEED_N = _UxGT("Швидк. вент. ~"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_STORED_FAN_N = _UxGT("Збереж.швидк.вент. ~"); LSTR MSG_EXTRA_FAN_SPEED_N = _UxGT("Дод. швидк. вент. ~"); #else @@ -413,7 +411,7 @@ namespace Language_uk { LSTR MSG_VJ_JERK = _UxGT("V") LCD_STR_J _UxGT("-ривок"); LSTR MSG_VK_JERK = _UxGT("V") LCD_STR_K _UxGT("-ривок"); LSTR MSG_VE_JERK = _UxGT("Ve-ривок"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_JUNCTION_DEVIATION = _UxGT("Відхилення вузла"); #else LSTR MSG_JUNCTION_DEVIATION = _UxGT("Відхил.вузла"); @@ -428,7 +426,7 @@ namespace Language_uk { LSTR MSG_VMAX_E = _UxGT("Швидк.макс ") LCD_STR_E; LSTR MSG_VMAX_EN = _UxGT("Швидк.макс *"); LSTR MSG_VMIN = _UxGT("Швидк. мін"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_VTRAV_MIN = _UxGT("Переміщення мін"); #else LSTR MSG_VTRAV_MIN = _UxGT("Переміщ. мін"); @@ -471,7 +469,7 @@ namespace Language_uk { LSTR MSG_STORE_EEPROM = _UxGT("Зберегти в EEPROM"); LSTR MSG_LOAD_EEPROM = _UxGT("Зчитати з EEPROM"); LSTR MSG_RESTORE_DEFAULTS = _UxGT("На базові параметри"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_INIT_EEPROM = _UxGT("Ініціалізація EEPROM"); #else LSTR MSG_INIT_EEPROM = _UxGT("Ініціаліз. EEPROM"); @@ -525,7 +523,7 @@ namespace Language_uk { LSTR MSG_NO_MOVE = _UxGT("Немає руху."); LSTR MSG_KILLED = _UxGT("ПЕРЕРВАНО. "); LSTR MSG_STOPPED = _UxGT("ЗУПИНЕНО. "); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_CONTROL_RETRACT = _UxGT("Втягування, мм"); LSTR MSG_CONTROL_RETRACT_SWAP = _UxGT("Зміна втягув.,мм"); LSTR MSG_CONTROL_RETRACT_RECOVER = _UxGT("Повернення, мм"); @@ -547,7 +545,7 @@ namespace Language_uk { LSTR MSG_FILAMENT_PURGE_LENGTH = _UxGT("Очистити довжину"); LSTR MSG_TOOL_CHANGE = _UxGT("Зміна сопла"); LSTR MSG_TOOL_CHANGE_ZLIFT = _UxGT("Підняти по Z"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_SINGLENOZZLE_PRIME_SPEED = _UxGT("Початк.швидкість"); LSTR MSG_SINGLENOZZLE_RETRACT_SPEED = _UxGT("Швидкість втягув."); #else @@ -556,7 +554,7 @@ namespace Language_uk { #endif LSTR MSG_FILAMENT_PARK_ENABLED = _UxGT("Паркувати голову"); LSTR MSG_SINGLENOZZLE_UNRETRACT_SPEED = _UxGT("Відновити швидкість"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_SINGLENOZZLE_FAN_SPEED = _UxGT("Оберти вентилятора"); LSTR MSG_SINGLENOZZLE_FAN_TIME = _UxGT("Час вентилятора"); #else @@ -621,7 +619,7 @@ namespace Language_uk { LSTR MSG_THERMAL_RUNAWAY_BED = _UxGT("ВИТІК ТЕПЛА СТОЛУ"); LSTR MSG_THERMAL_RUNAWAY_CHAMBER = _UxGT("ВИТІК ТЕПЛА КАМЕРИ"); LSTR MSG_THERMAL_RUNAWAY_COOLER = _UxGT("ВИТІК ОХОЛОДЖЕННЯ"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_COOLING_FAILED = _UxGT("ОХОЛОДЖЕННЯ НЕ ВДАЛОСЬ"); #else LSTR MSG_COOLING_FAILED = _UxGT("ОХОЛОДЖ. НЕ ВДАЛОСЬ"); @@ -638,7 +636,7 @@ namespace Language_uk { LSTR MSG_BED_HEATING = _UxGT("Нагрів столу..."); LSTR MSG_PROBE_HEATING = _UxGT("Нагрів зонду..."); LSTR MSG_CHAMBER_HEATING = _UxGT("Нагрів камери..."); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_BED_COOLING = _UxGT("Охолодження столу..."); LSTR MSG_PROBE_COOLING = _UxGT("Охолодження зонду..."); LSTR MSG_CHAMBER_COOLING = _UxGT("Охолодження камери..."); @@ -665,7 +663,7 @@ namespace Language_uk { LSTR MSG_INFO_MENU = _UxGT("Про принтер"); LSTR MSG_INFO_PRINTER_MENU = _UxGT("Дані принтера"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_3POINT_LEVELING = _UxGT("3-точкове вирівнювання"); LSTR MSG_LINEAR_LEVELING = _UxGT("Лінійне вирівнювання"); LSTR MSG_BILINEAR_LEVELING = _UxGT("Білінійне вирівнювання"); @@ -676,7 +674,7 @@ namespace Language_uk { #endif LSTR MSG_UBL_LEVELING = _UxGT("UBL"); LSTR MSG_MESH_LEVELING = _UxGT("Вирівнювання сітки"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MESH_DONE = _UxGT("Зондування сітки виконано"); #else LSTR MSG_MESH_DONE = _UxGT("Зондування виконано"); @@ -688,7 +686,7 @@ namespace Language_uk { LSTR MSG_INFO_EXTRUDERS = _UxGT("Екструдери"); LSTR MSG_INFO_BAUDRATE = _UxGT("Бод"); LSTR MSG_INFO_PROTOCOL = _UxGT("Протокол"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_INFO_RUNAWAY_OFF = _UxGT("Контроль витіку ") LCD_STR_THERMOMETER _UxGT(" Вимк"); LSTR MSG_INFO_RUNAWAY_ON = _UxGT("Контроль витіку ") LCD_STR_THERMOMETER _UxGT(" Увімк"); LSTR MSG_HOTEND_IDLE_TIMEOUT = _UxGT("Час простою хотенду"); @@ -704,7 +702,7 @@ namespace Language_uk { LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Завершено"); LSTR MSG_INFO_PRINT_FILAMENT = _UxGT("Екструдовано"); - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Кількість друків"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Весь час друку"); LSTR MSG_INFO_PRINT_LONGEST = _UxGT("Найдовший час"); @@ -731,7 +729,7 @@ namespace Language_uk { LSTR MSG_FILAMENT_CHANGE_HEADER_PAUSE = _UxGT("ЗУПИНКА ДРУКУ"); LSTR MSG_FILAMENT_CHANGE_HEADER_LOAD = _UxGT("ЗАВАНТАЖИТИ ПРУТОК"); LSTR MSG_FILAMENT_CHANGE_HEADER_UNLOAD = _UxGT("ВИВАНТАЖИТИ ПРУТОК"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ПАРАМЕТРИ ПРОДОВЖЕННЯ:"); #else LSTR MSG_FILAMENT_CHANGE_OPTION_HEADER = _UxGT("ПАРАМ.ПРОДОВЖЕННЯ:"); @@ -739,7 +737,7 @@ namespace Language_uk { LSTR MSG_FILAMENT_CHANGE_OPTION_PURGE = _UxGT("Видавити ще"); LSTR MSG_FILAMENT_CHANGE_OPTION_RESUME = _UxGT("Відновити друк"); LSTR MSG_FILAMENT_CHANGE_NOZZLE = _UxGT(" Сопло: "); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_RUNOUT_SENSOR = _UxGT("Датчик закінчення прутка"); LSTR MSG_RUNOUT_DISTANCE_MM = _UxGT("Відстань закінч.,мм"); #else @@ -757,7 +755,7 @@ namespace Language_uk { LSTR MSG_MMU2_RESUMING = _UxGT("MMU Продовження..."); LSTR MSG_MMU2_LOAD_FILAMENT = _UxGT("MMU Завантажити"); LSTR MSG_MMU2_LOAD_ALL = _UxGT("MMU Завантажити все"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU Завантажити в сопло"); #else LSTR MSG_MMU2_LOAD_TO_NOZZLE = _UxGT("MMU Завант. в сопло"); @@ -774,7 +772,7 @@ namespace Language_uk { LSTR MSG_MMU2_RESETTING = _UxGT("MMU Перезапуск..."); LSTR MSG_MMU2_EJECT_RECOVER = _UxGT("Видаліть, натисніть"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_MIX = _UxGT("Змішування"); #else LSTR MSG_MIX = _UxGT("Змішув."); @@ -783,7 +781,7 @@ namespace Language_uk { LSTR MSG_MIXER = _UxGT("Змішувач"); LSTR MSG_GRADIENT = _UxGT("Градієнт"); LSTR MSG_FULL_GRADIENT = _UxGT("Повний градієнт"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_TOGGLE_MIX = _UxGT("Переключити змішування"); #else LSTR MSG_TOGGLE_MIX = _UxGT("Переключ.змішування"); @@ -792,7 +790,7 @@ namespace Language_uk { LSTR MSG_GRADIENT_MIX = _UxGT("Градієнт змішування"); LSTR MSG_REVERSE_GRADIENT = _UxGT("Змінити градієнт"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_ACTIVE_VTOOL = _UxGT("Активація В-інструменту"); LSTR MSG_GRADIENT_ALIAS = _UxGT("Псевдонім В-інструменту"); LSTR MSG_RESET_VTOOLS = _UxGT("Зкидання В-інструментів"); @@ -815,7 +813,7 @@ namespace Language_uk { LSTR MSG_MAZE = _UxGT("Лабіринт"); LSTR MSG_BAD_PAGE = _UxGT("Погана сторінка"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_BAD_PAGE_SPEED = _UxGT("Погана швидкість стор."); #else LSTR MSG_BAD_PAGE_SPEED = _UxGT("Погана швидк. стор."); @@ -888,7 +886,7 @@ namespace Language_uk { LSTR MSG_REHEATING = _UxGT("Нагрівання..."); LSTR MSG_PROBE_WIZARD = _UxGT("Майстер Z-зонда"); - #if LCD_WIDTH > 21 + #if LCD_WIDTH > 21 || HAS_DWIN_E3V2 LSTR MSG_PROBE_WIZARD_PROBING = _UxGT("Зондув. контрольної точки Z"); LSTR MSG_PROBE_WIZARD_MOVING = _UxGT("Рух до точки зондування"); #else diff --git a/Marlin/src/lcd/language/language_vi.h b/Marlin/src/lcd/language/language_vi.h index ae0babbf8b..a419ddee56 100644 --- a/Marlin/src/lcd/language/language_vi.h +++ b/Marlin/src/lcd/language/language_vi.h @@ -383,7 +383,7 @@ namespace Language_vi { LSTR MSG_INFO_PROTOCOL = _UxGT("Giao Thức"); // Protocol LSTR MSG_CASE_LIGHT = _UxGT("Đèn Khuông"); // Case light LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("Độ Sáng"); // Light Brightness - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("Số In"); // Print Count LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("Đã hoàn thành"); LSTR MSG_INFO_PRINT_TIME = _UxGT("Tổng số thời gian in"); // Total print time diff --git a/Marlin/src/lcd/language/language_zh_CN.h b/Marlin/src/lcd/language/language_zh_CN.h index d61634e431..e641f235e6 100644 --- a/Marlin/src/lcd/language/language_zh_CN.h +++ b/Marlin/src/lcd/language/language_zh_CN.h @@ -489,7 +489,7 @@ namespace Language_zh_CN { LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("打印机不正确"); // "The printer is incorrect" - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("打印计数"); // "Print Count" LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("完成了"); // "Completed" LSTR MSG_INFO_PRINT_TIME = _UxGT("总打印时间"); // "Total print time" diff --git a/Marlin/src/lcd/language/language_zh_TW.h b/Marlin/src/lcd/language/language_zh_TW.h index 7680721b00..f168679e4a 100644 --- a/Marlin/src/lcd/language/language_zh_TW.h +++ b/Marlin/src/lcd/language/language_zh_TW.h @@ -437,7 +437,7 @@ namespace Language_zh_TW { LSTR MSG_CASE_LIGHT_BRIGHTNESS = _UxGT("燈亮度"); // "Light BRIGHTNESS" LSTR MSG_KILL_EXPECTED_PRINTER = _UxGT("打印機不正確"); // "The printer is incorrect" - #if LCD_WIDTH >= 20 + #if LCD_WIDTH >= 20 || HAS_DWIN_E3V2 LSTR MSG_INFO_PRINT_COUNT = _UxGT("列印計數"); // "Print Count" LSTR MSG_INFO_COMPLETED_PRINTS = _UxGT("已完成"); // "Completed" LSTR MSG_INFO_PRINT_TIME = _UxGT("總列印時間"); // "Total print time" diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 5cf3e66826..7b3e267310 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -150,10 +150,10 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP; void MarlinUI::apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e/*=active_extruder*/) { const preheat_t &pre = material_preset[m]; - TERN_(HAS_HOTEND, if (TEST(pmask, PM_HOTEND)) thermalManager.setTargetHotend(pre.hotend_temp, e)); - TERN_(HAS_HEATED_BED, if (TEST(pmask, PM_BED)) thermalManager.setTargetBed(pre.bed_temp)); - //TERN_(HAS_HEATED_CHAMBER, if (TEST(pmask, PM_CHAMBER)) thermalManager.setTargetBed(pre.chamber_temp)); - TERN_(HAS_FAN, if (TEST(pmask, PM_FAN)) thermalManager.set_fan_speed(0, pre.fan_speed)); + TERN_(HAS_HOTEND, if (TEST(pmask, PT_HOTEND)) thermalManager.setTargetHotend(pre.hotend_temp, e)); + TERN_(HAS_HEATED_BED, if (TEST(pmask, PT_BED)) thermalManager.setTargetBed(pre.bed_temp)); + //TERN_(HAS_HEATED_CHAMBER, if (TEST(pmask, PT_CHAMBER)) thermalManager.setTargetBed(pre.chamber_temp)); + TERN_(HAS_FAN, if (TEST(pmask, PT_FAN)) thermalManager.set_fan_speed(0, pre.fan_speed)); } #endif diff --git a/Marlin/src/lcd/marlinui.h b/Marlin/src/lcd/marlinui.h index 7014040097..f409970e42 100644 --- a/Marlin/src/lcd/marlinui.h +++ b/Marlin/src/lcd/marlinui.h @@ -274,8 +274,8 @@ public: static bool detected(); static void init_lcd(); #else - static inline bool detected() { return true; } - static inline void init_lcd() {} + static bool detected() { return true; } + static void init_lcd() {} #endif #if HAS_PRINT_PROGRESS @@ -294,7 +294,7 @@ public: static void set_progress_done() { progress_override = (PROGRESS_MASK + 1U) + 100U * (PROGRESS_SCALE); } static void progress_reset() { if (progress_override & (PROGRESS_MASK + 1U)) set_progress(0); } #if ENABLED(SHOW_REMAINING_TIME) - static inline uint32_t _calculated_remaining_time() { + static uint32_t _calculated_remaining_time() { const duration_t elapsed = print_job_timer.duration(); const progress_t progress = _get_progress(); return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0; @@ -342,12 +342,12 @@ public: static bool has_status(); static void reset_status(const bool no_welcome=false); static void set_alert_status(FSTR_P const fstr); - static inline void reset_alert_level() { alert_level = 0; } + static void reset_alert_level() { alert_level = 0; } #else static constexpr bool has_status() { return false; } - static inline void reset_status(const bool=false) {} - static inline void set_alert_status(FSTR_P const) {} - static inline void reset_alert_level() {} + static void reset_status(const bool=false) {} + static void set_alert_status(FSTR_P const) {} + static void reset_alert_level() {} #endif static void set_status(const char * const cstr, const bool persist=false); @@ -360,7 +360,7 @@ public: static void draw_status_message(const bool blink); #endif #else - static inline void kill_screen(FSTR_P const, FSTR_P const) {} + static void kill_screen(FSTR_P const, FSTR_P const) {} #endif #if HAS_DISPLAY @@ -444,7 +444,7 @@ public: #if HAS_BUZZER static void completion_feedback(const bool good=true); #else - static inline void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); } + static void completion_feedback(const bool=true) { TERN_(HAS_TOUCH_SLEEP, wakeup_screen()); } #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) @@ -479,9 +479,9 @@ public: #else // No LCD - static inline void init() {} - static inline void update() {} - static inline void return_to_status() {} + static void init() {} + static void update() {} + static void return_to_status() {} #endif @@ -496,22 +496,20 @@ public: #endif #if HAS_PREHEAT - enum PreheatMask : uint8_t { PM_HOTEND = _BV(0), PM_BED = _BV(1), PM_FAN = _BV(2), PM_CHAMBER = _BV(3) }; + enum PreheatTarget : uint8_t { PT_HOTEND, PT_BED, PT_FAN, PT_CHAMBER, PT_ALL = 0xFF }; static preheat_t material_preset[PREHEAT_COUNT]; static PGM_P get_preheat_label(const uint8_t m); static void apply_preheat(const uint8_t m, const uint8_t pmask, const uint8_t e=active_extruder); - static inline void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, PM_FAN)); } - static inline void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, PM_HOTEND)); } - static inline void preheat_hotend_and_fan(const uint8_t m, const uint8_t e=active_extruder) { preheat_hotend(m, e); preheat_set_fan(m); } - static inline void preheat_bed(const uint8_t m) { TERN_(HAS_HEATED_BED, apply_preheat(m, PM_BED)); } - static inline void preheat_all(const uint8_t m) { apply_preheat(m, 0xFF); } + static void preheat_set_fan(const uint8_t m) { TERN_(HAS_FAN, apply_preheat(m, _BV(PT_FAN))); } + static void preheat_hotend(const uint8_t m, const uint8_t e=active_extruder) { TERN_(HAS_HOTEND, apply_preheat(m, _BV(PT_HOTEND))); } + static void preheat_hotend_and_fan(const uint8_t m, const uint8_t e=active_extruder) { preheat_hotend(m, e); preheat_set_fan(m); } + static void preheat_bed(const uint8_t m) { TERN_(HAS_HEATED_BED, apply_preheat(m, _BV(PT_BED))); } + static void preheat_all(const uint8_t m) { apply_preheat(m, PT_ALL); } #endif - #if SCREENS_CAN_TIME_OUT - static inline void reset_status_timeout(const millis_t ms) { return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS; } - #else - static inline void reset_status_timeout(const millis_t) {} - #endif + static void reset_status_timeout(const millis_t ms) { + TERN(SCREENS_CAN_TIME_OUT, return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS, UNUSED(ms)); + } #if HAS_LCD_MENU @@ -548,11 +546,11 @@ public: // goto_previous_screen and go_back may also be used as menu item callbacks static void _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back)); - static inline void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); } - static inline void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); } + static void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); } + static void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); } static void return_to_status(); - static inline bool on_status_screen() { return currentScreen == status_screen; } + static bool on_status_screen() { return currentScreen == status_screen; } FORCE_INLINE static void run_current_screen() { (*currentScreen)(); } #if ENABLED(LIGHTWEIGHT_UI) @@ -567,7 +565,7 @@ public: TERN(SCREENS_CAN_TIME_OUT, defer_return_to_status = defer, UNUSED(defer)); } - static inline void goto_previous_screen_no_defer() { + static void goto_previous_screen_no_defer() { defer_status_screen(false); goto_previous_screen(); } @@ -599,20 +597,20 @@ public: #if EITHER(HAS_LCD_MENU, EXTENSIBLE_UI) static bool lcd_clicked; - static inline bool use_click() { + static bool use_click() { const bool click = lcd_clicked; lcd_clicked = false; return click; } #else static constexpr bool lcd_clicked = false; - static inline bool use_click() { return false; } + static bool use_click() { return false; } #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) && ANY(HAS_LCD_MENU, EXTENSIBLE_UI, DWIN_CREALITY_LCD_ENHANCED, DWIN_CREALITY_LCD_JYERSUI) static void pause_show_message(const PauseMessage message, const PauseMode mode=PAUSE_MODE_SAME, const uint8_t extruder=active_extruder); #else - static inline void _pause_show_message() {} + static void _pause_show_message() {} #define pause_show_message(...) _pause_show_message() #endif @@ -631,9 +629,9 @@ public: #endif #if DISABLED(EEPROM_AUTO_INIT) static void eeprom_alert(const uint8_t msgid); - static inline void eeprom_alert_crc() { eeprom_alert(0); } - static inline void eeprom_alert_index() { eeprom_alert(1); } - static inline void eeprom_alert_version() { eeprom_alert(2); } + static void eeprom_alert_crc() { eeprom_alert(0); } + static void eeprom_alert_index() { eeprom_alert(1); } + static void eeprom_alert_version() { eeprom_alert(2); } #endif #endif @@ -674,7 +672,7 @@ public: #endif static void update_buttons(); - static inline bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); } + static bool button_pressed() { return BUTTON_CLICK() || TERN(TOUCH_SCREEN, touch_pressed(), false); } #if EITHER(AUTO_BED_LEVELING_UBL, G26_MESH_VALIDATION) static void wait_for_release(); #endif @@ -705,7 +703,7 @@ public: #else - static inline void update_buttons() {} + static void update_buttons() {} #endif diff --git a/Marlin/src/lcd/menu/menu.h b/Marlin/src/lcd/menu/menu.h index 048dab9b73..72826262f4 100644 --- a/Marlin/src/lcd/menu/menu.h +++ b/Marlin/src/lcd/menu/menu.h @@ -109,7 +109,7 @@ class MenuItem_confirm : public MenuItemBase { selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr ); - static inline void select_screen( + static void select_screen( PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, FSTR_P const string, PGM_P const suff=nullptr @@ -178,7 +178,7 @@ class MenuEditItemBase : public MenuItemBase { static void draw_edit_screen(PGM_P const pstr, const char * const value); // This method is for the current menu item - static inline void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } + static void draw_edit_screen(const char * const value) { draw_edit_screen(editLabel, value); } }; #if ENABLED(SDSUPPORT) diff --git a/Marlin/src/lcd/menu/menu_backlash.cpp b/Marlin/src/lcd/menu/menu_backlash.cpp index ad276e11c0..28be1ca9cf 100644 --- a/Marlin/src/lcd/menu/menu_backlash.cpp +++ b/Marlin/src/lcd/menu/menu_backlash.cpp @@ -51,13 +51,13 @@ void menu_backlash() { #if HAS_Z_AXIS && _CAN_CALI(C) EDIT_BACKLASH_DISTANCE(C); #endif - #if LINEAR_AXES >= 4 && _CAN_CALI(I) + #if HAS_I_AXIS && _CAN_CALI(I) EDIT_BACKLASH_DISTANCE(I); #endif - #if LINEAR_AXES >= 5 && _CAN_CALI(J) + #if HAS_J_AXIS && _CAN_CALI(J) EDIT_BACKLASH_DISTANCE(J); #endif - #if LINEAR_AXES >= 6 && _CAN_CALI(K) + #if HAS_K_AXIS && _CAN_CALI(K) EDIT_BACKLASH_DISTANCE(K); #endif diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 624b9b303d..1834b56a88 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -39,14 +39,14 @@ class MenuItem_submenu : public MenuItemBase { FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { _draw(sel, row, pstr, '>', LCD_STR_ARROW_RIGHT[0]); } - static inline void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } + static void action(PGM_P const, const screenFunc_t func) { ui.push_current_screen(); ui.goto_screen(func); } }; // Any menu item that invokes an immediate action class MenuItem_button : public MenuItemBase { public: // Button-y Items are selectable lines with no other indicator - static inline void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { + static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) { _draw(sel, row, pstr, '>', ' '); } }; @@ -54,8 +54,8 @@ class MenuItem_button : public MenuItemBase { // ACTION_ITEM(LABEL, FUNC) class MenuItem_function : public MenuItem_button { public: - //static inline void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; - static inline void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); }; + //static void action(PGM_P const, const uint8_t, const menuAction_t func) { (*func)(); }; + static void action(PGM_P const, const menuAction_t func) { if (func) (*func)(); }; }; // GCODES_ITEM(LABEL, GCODES) @@ -65,7 +65,7 @@ class MenuItem_gcode : public MenuItem_button { _draw(sel, row, pstr, '>', ' '); } static void action(PGM_P const, PGM_P const pgcode) { queue.inject(FPSTR(pgcode)); } - static inline void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); } + static void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); } }; //////////////////////////////////////////// @@ -77,8 +77,8 @@ template class TMenuEditItem : MenuEditItemBase { private: typedef typename NAME::type_t type_t; - static inline float scale(const_float_t value) { return NAME::scale(value); } - static inline float unscale(const_float_t value) { return NAME::unscale(value); } + static float scale(const_float_t value) { return NAME::scale(value); } + static float unscale(const_float_t value) { return NAME::unscale(value); } static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); } static void load(void *ptr, const int32_t value) { *((type_t*)ptr) = unscale(value); } public: @@ -117,9 +117,9 @@ class TMenuEditItem : MenuEditItemBase { * * struct MenuEditItemInfo_percent { * typedef uint8_t type_t; - * static inline float scale(const_float_t value) { return value * (100.f/255.f) +0.5f; } - * static inline float unscale(const_float_t value) { return value / (100.f/255.f) +0.5f; } - * static inline const char* strfunc(const_float_t value) { return ui8tostr4pctrj(_DOFIX(uint8_t,value)); } + * static float scale(const_float_t value) { return value * (100.f/255.f) +0.5f; } + * static float unscale(const_float_t value) { return value / (100.f/255.f) +0.5f; } + * static const char* strfunc(const_float_t value) { return ui8tostr4pctrj(_DOFIX(uint8_t,value)); } * }; * typedef TMenuEditItem MenuItem_percent */ @@ -128,9 +128,9 @@ class TMenuEditItem : MenuEditItemBase { #define DEFINE_MENU_EDIT_ITEM_TYPE(NAME, TYPE, STRFUNC, SCALE, ETC...) \ struct MenuEditItemInfo_##NAME { \ typedef TYPE type_t; \ - static inline float scale(const_float_t value) { return value * (SCALE) ETC; } \ - static inline float unscale(const_float_t value) { return value / (SCALE) ETC; } \ - static inline const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \ + static float scale(const_float_t value) { return value * (SCALE) ETC; } \ + static float unscale(const_float_t value) { return value / (SCALE) ETC; } \ + static const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \ }; \ typedef TMenuEditItem MenuItem_##NAME diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 29a908ac33..344b94e2e9 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -97,13 +97,13 @@ void lcd_move_x() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_X), X_AXIS); } #if HAS_Z_AXIS void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); } #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS void lcd_move_i() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_I), I_AXIS); } #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS void lcd_move_j() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_J), J_AXIS); } #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS void lcd_move_k() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_K), K_AXIS); } #endif @@ -254,13 +254,13 @@ void menu_move() { #if HAS_Z_AXIS SUBMENU(MSG_MOVE_Z, []{ _menu_move_distance(Z_AXIS, lcd_move_z); }); #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS SUBMENU(MSG_MOVE_I, []{ _menu_move_distance(I_AXIS, lcd_move_i); }); #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS SUBMENU(MSG_MOVE_J, []{ _menu_move_distance(J_AXIS, lcd_move_j); }); #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS SUBMENU(MSG_MOVE_K, []{ _menu_move_distance(K_AXIS, lcd_move_k); }); #endif } @@ -345,13 +345,13 @@ void menu_move() { #if HAS_Z_AXIS GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z")); #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS4_STR)); #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS5_STR)); #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS6_STR)); #endif @@ -398,13 +398,13 @@ void menu_motion() { #if HAS_Z_AXIS GCODES_ITEM_N(Z_AXIS, MSG_AUTO_HOME_A, PSTR("G28Z")); #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS GCODES_ITEM_N(I_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS4_STR)); #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS GCODES_ITEM_N(J_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS5_STR)); #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS GCODES_ITEM_N(K_AXIS, MSG_AUTO_HOME_A, PSTR("G28" AXIS6_STR)); #endif #endif diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 1576518b4b..435e7c30bf 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -81,24 +81,24 @@ class TFT { static uint16_t buffer[TFT_BUFFER_SIZE]; static void init(); - static inline void set_font(const uint8_t *Font) { string.set_font(Font); } - static inline void add_glyphs(const uint8_t *Font) { string.add_glyphs(Font); } + static void set_font(const uint8_t *Font) { string.set_font(Font); } + static void add_glyphs(const uint8_t *Font) { string.add_glyphs(Font); } - static inline bool is_busy() { return io.isBusy(); } - static inline void abort() { io.Abort(); } - static inline void write_multiple(uint16_t Data, uint16_t Count) { io.WriteMultiple(Data, Count); } - static inline void write_sequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); } - static inline void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { io.set_window(Xmin, Ymin, Xmax, Ymax); } + static bool is_busy() { return io.isBusy(); } + static void abort() { io.Abort(); } + static void write_multiple(uint16_t Data, uint16_t Count) { io.WriteMultiple(Data, Count); } + static void write_sequence(uint16_t *Data, uint16_t Count) { io.WriteSequence(Data, Count); } + static void set_window(uint16_t Xmin, uint16_t Ymin, uint16_t Xmax, uint16_t Ymax) { io.set_window(Xmin, Ymin, Xmax, Ymax); } - static inline void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.fill(x, y, width, height, color); } - static inline void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); } - static inline void set_background(uint16_t color) { queue.set_background(color); } - static inline void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); } - static inline void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); } - static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); } - static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } - static inline void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); } - static inline void add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_rectangle(x, y, width, height, color); } + static void fill(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.fill(x, y, width, height, color); } + static void canvas(uint16_t x, uint16_t y, uint16_t width, uint16_t height) { queue.canvas(x, y, width, height); } + static void set_background(uint16_t color) { queue.set_background(color); } + static void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); } + static void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); } + static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); } + static void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } + static void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); } + static void add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_rectangle(x, y, width, height, color); } static void draw_edit_screen_buttons(); }; diff --git a/Marlin/src/lcd/tft/tft_string.h b/Marlin/src/lcd/tft/tft_string.h index 133889d9ae..e486c2ee91 100644 --- a/Marlin/src/lcd/tft/tft_string.h +++ b/Marlin/src/lcd/tft/tft_string.h @@ -81,7 +81,7 @@ class TFT_String { static font_t *font() { return font_header; }; static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; } static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; } /* Use '?' for unknown glyphs */ - static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); } + static glyph_t *glyph(uint8_t *character) { return glyph(*character); } static void set(); static void add(uint8_t character) { add_character(character); eol(); } @@ -89,9 +89,9 @@ class TFT_String { static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr); static void set(uint8_t *string) { set(); add(string); }; static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); }; - static inline void set(const char *string) { set((uint8_t *)string); } - static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } - static inline void add(const char *string) { add((uint8_t *)string); } + static void set(const char *string) { set((uint8_t *)string); } + static void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); } + static void add(const char *string) { add((uint8_t *)string); } static void trim(uint8_t character=0x20); static void rtrim(uint8_t character=0x20); diff --git a/Marlin/src/lcd/tft/touch.h b/Marlin/src/lcd/tft/touch.h index 238453f765..6021a840b6 100644 --- a/Marlin/src/lcd/tft/touch.h +++ b/Marlin/src/lcd/tft/touch.h @@ -106,7 +106,7 @@ class Touch { static millis_t last_touch_ms, time_to_hold, repeat_delay, touch_time; static TouchControlType touch_control_type; - static inline bool get_point(int16_t *x, int16_t *y); + static bool get_point(int16_t *x, int16_t *y); static void touch(touch_control_t *control); static void hold(touch_control_t *control, millis_t delay = 0); @@ -126,7 +126,7 @@ class Touch { static void enable() { enabled = true; } #if HAS_TOUCH_SLEEP static millis_t next_sleep_ms; - static inline bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; } + static bool isSleeping() { return next_sleep_ms == TSLP_SLEEPING; } static void sleepTimeout(); static void wakeUp(); #endif diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp index 6f80652ce5..dea2e3fc2d 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.cpp +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.cpp @@ -497,7 +497,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in } break; #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS case AXIS4_NAME: { position_min = I_center - displacement; position_max = I_center + displacement; @@ -509,7 +509,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in } break; #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS case AXIS5_NAME: { position_min = J_center - displacement; position_max = J_center + displacement; @@ -521,7 +521,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in } break; #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS case AXIS6_NAME: { position_min = K_center - displacement; position_max = K_center + displacement; diff --git a/Marlin/src/libs/L64XX/L64XX_Marlin.h b/Marlin/src/libs/L64XX/L64XX_Marlin.h index e11d8e872e..de7c0d6057 100644 --- a/Marlin/src/libs/L64XX/L64XX_Marlin.h +++ b/Marlin/src/libs/L64XX/L64XX_Marlin.h @@ -118,11 +118,11 @@ public: #if ENABLED(MONITOR_L6470_DRIVER_STATUS) static bool monitor_paused; - static inline void pause_monitor(const bool p) { monitor_paused = p; } + static void pause_monitor(const bool p) { monitor_paused = p; } static void monitor_update(L64XX_axis_t stepper_index); static void monitor_driver(); #else - static inline void pause_monitor(const bool) {} + static void pause_monitor(const bool) {} #endif //protected: diff --git a/Marlin/src/libs/buzzer.h b/Marlin/src/libs/buzzer.h index 21b69002ff..db5e3ee4ca 100644 --- a/Marlin/src/libs/buzzer.h +++ b/Marlin/src/libs/buzzer.h @@ -77,7 +77,7 @@ * @brief Resets the state of the class * @details Brings the class state to a known one. */ - static inline void reset() { + static void reset() { off(); state.endtime = 0; } @@ -86,7 +86,7 @@ /** * @brief Init Buzzer */ - static inline void init() { + static void init() { SET_OUTPUT(BEEPER_PIN); reset(); } diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index fe5101a5be..829d510050 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -53,7 +53,7 @@ class Stopwatch { * @return true on success */ static bool stop(); - static inline bool abort() { return stop(); } // Alias by default + static bool abort() { return stop(); } // Alias by default /** * @brief Pause the stopwatch @@ -114,7 +114,7 @@ class Stopwatch { #else - static inline void debug(FSTR_P const) {} + static void debug(FSTR_P const) {} #endif }; diff --git a/Marlin/src/module/endstops.cpp b/Marlin/src/module/endstops.cpp index 7a2cefdd4c..50ee33b3c0 100644 --- a/Marlin/src/module/endstops.cpp +++ b/Marlin/src/module/endstops.cpp @@ -1059,7 +1059,7 @@ void Endstops::update() { } #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS if (stepper.axis_is_moving(I_AXIS)) { if (stepper.motor_direction(I_AXIS_HEAD)) { // -direction #if HAS_I_MIN || (I_SPI_SENSORLESS && I_HOME_TO_MIN) @@ -1074,7 +1074,7 @@ void Endstops::update() { } #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS if (stepper.axis_is_moving(J_AXIS)) { if (stepper.motor_direction(J_AXIS_HEAD)) { // -direction #if HAS_J_MIN || (J_SPI_SENSORLESS && J_HOME_TO_MIN) @@ -1089,7 +1089,7 @@ void Endstops::update() { } #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS if (stepper.axis_is_moving(K_AXIS)) { if (stepper.motor_direction(K_AXIS_HEAD)) { // -direction #if HAS_K_MIN || (K_SPI_SENSORLESS && K_HOME_TO_MIN) diff --git a/Marlin/src/module/endstops.h b/Marlin/src/module/endstops.h index a35966a98c..82a44cf95b 100644 --- a/Marlin/src/module/endstops.h +++ b/Marlin/src/module/endstops.h @@ -47,16 +47,26 @@ enum EndstopEnum : char { _ES_ITEM(HAS_K_MAX, K_MAX) // Extra Endstops for XYZ - _ES_ITEM(HAS_X2_MIN, X2_MIN) - _ES_ITEM(HAS_X2_MAX, X2_MAX) - _ES_ITEM(HAS_Y2_MIN, Y2_MIN) - _ES_ITEM(HAS_Y2_MAX, Y2_MAX) - _ES_ITEM(HAS_Z2_MIN, Z2_MIN) - _ES_ITEM(HAS_Z2_MAX, Z2_MAX) - _ES_ITEM(HAS_Z3_MIN, Z3_MIN) - _ES_ITEM(HAS_Z3_MAX, Z3_MAX) - _ES_ITEM(HAS_Z4_MIN, Z4_MIN) - _ES_ITEM(HAS_Z4_MAX, Z4_MAX) + #if ENABLED(X_DUAL_ENDSTOPS) + _ES_ITEM(HAS_X_MIN, X2_MIN) + _ES_ITEM(HAS_X_MAX, X2_MAX) + #endif + #if ENABLED(Y_DUAL_ENDSTOPS) + _ES_ITEM(HAS_Y_MIN, Y2_MIN) + _ES_ITEM(HAS_Y_MAX, Y2_MAX) + #endif + #if ENABLED(Z_MULTI_ENDSTOPS) + _ES_ITEM(HAS_Z_MIN, Z2_MIN) + _ES_ITEM(HAS_Z_MAX, Z2_MAX) + #if NUM_Z_STEPPER_DRIVERS >= 3 + _ES_ITEM(HAS_Z_MIN, Z3_MIN) + _ES_ITEM(HAS_Z_MAX, Z3_MAX) + #endif + #if NUM_Z_STEPPER_DRIVERS >= 4 + _ES_ITEM(HAS_Z_MIN, Z4_MIN) + _ES_ITEM(HAS_Z_MAX, Z4_MAX) + #endif + #endif // Bed Probe state is distinct or shared with Z_MIN (i.e., when the probe is the only Z endstop) #if !HAS_DELTA_SENSORLESS_PROBING @@ -136,7 +146,7 @@ class Endstops { return enabled || TERN0(HAS_BED_PROBE, z_probe_enabled); } - static inline bool global_enabled() { return enabled_globally; } + static bool global_enabled() { return enabled_globally; } /** * Periodic call to poll endstops if required. Called from temperature ISR @@ -168,7 +178,7 @@ class Endstops { ; } - static inline bool probe_switch_activated() { + static bool probe_switch_activated() { return (true #if ENABLED(PROBE_ACTIVATION_SWITCH) && READ(PROBE_ACTIVATION_SWITCH_PIN) == PROBE_ACTIVATION_SWITCH_STATE diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index 2248c52d85..a77f395fb4 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -603,7 +603,7 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) { } #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s/*=0.0*/) { do_blocking_move_to_xyz_i(current_position, ri, fr_mm_s); } @@ -615,7 +615,7 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) { } #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s/*=0.0*/) { do_blocking_move_to_xyzi_j(current_position, rj, fr_mm_s); } @@ -627,7 +627,7 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) { } #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS void do_blocking_move_to_k(const_float_t rk, const_feedRate_t fr_mm_s/*=0.0*/) { do_blocking_move_to_xyzij_k(current_position, rk, fr_mm_s); } @@ -839,7 +839,7 @@ void restore_feedrate_and_scaling() { #endif } #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS if (axis_was_homed(I_AXIS)) { #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_I) NOLESS(target.i, soft_endstop.min.i); @@ -849,7 +849,7 @@ void restore_feedrate_and_scaling() { #endif } #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS if (axis_was_homed(J_AXIS)) { #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_J) NOLESS(target.j, soft_endstop.min.j); @@ -859,7 +859,7 @@ void restore_feedrate_and_scaling() { #endif } #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS if (axis_was_homed(K_AXIS)) { #if !HAS_SOFTWARE_ENDSTOPS || ENABLED(MIN_SOFTWARE_ENDSTOP_K) NOLESS(target.k, soft_endstop.min.k); @@ -1417,13 +1417,13 @@ void prepare_line_to_destination() { #if HAS_Z_AXIS case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = true; break; #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = true; break; #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = true; break; #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = true; break; #endif default: break; @@ -1494,13 +1494,13 @@ void prepare_line_to_destination() { #if HAS_Z_AXIS case Z_AXIS: if (ENABLED(Z_SPI_SENSORLESS)) endstops.tmc_spi_homing.z = false; break; #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS case I_AXIS: if (ENABLED(I_SPI_SENSORLESS)) endstops.tmc_spi_homing.i = false; break; #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS case J_AXIS: if (ENABLED(J_SPI_SENSORLESS)) endstops.tmc_spi_homing.j = false; break; #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS case K_AXIS: if (ENABLED(K_SPI_SENSORLESS)) endstops.tmc_spi_homing.k = false; break; #endif default: break; @@ -1821,13 +1821,13 @@ void prepare_line_to_destination() { case X_AXIS: es = X_ENDSTOP; break; case Y_AXIS: es = Y_ENDSTOP; break; case Z_AXIS: es = Z_ENDSTOP; break; - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS case I_AXIS: es = I_ENDSTOP; break; #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS case J_AXIS: es = J_ENDSTOP; break; #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS case K_AXIS: es = K_ENDSTOP; break; #endif } diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 50df5675e6..9fe61aad33 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -180,19 +180,19 @@ inline float home_bump_mm(const AxisEnum axis) { TERN_(MAX_SOFTWARE_ENDSTOP_Z, amax = max.z); break; #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS case I_AXIS: TERN_(MIN_SOFTWARE_ENDSTOP_I, amin = min.i); TERN_(MIN_SOFTWARE_ENDSTOP_I, amax = max.i); break; #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS case J_AXIS: TERN_(MIN_SOFTWARE_ENDSTOP_J, amin = min.j); TERN_(MIN_SOFTWARE_ENDSTOP_J, amax = max.j); break; #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS case K_AXIS: TERN_(MIN_SOFTWARE_ENDSTOP_K, amin = min.k); TERN_(MIN_SOFTWARE_ENDSTOP_K, amax = max.k); @@ -333,15 +333,15 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s=0.0f); #if HAS_Z_AXIS void do_blocking_move_to_z(const_float_t rz, const_feedRate_t fr_mm_s=0.0f); #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS void do_blocking_move_to_i(const_float_t ri, const_feedRate_t fr_mm_s=0.0f); void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i, const_feedRate_t fr_mm_s=0.0f); #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS void do_blocking_move_to_j(const_float_t rj, const_feedRate_t fr_mm_s=0.0f); void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j, const_feedRate_t fr_mm_s=0.0f); #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS void do_blocking_move_to_k(const_float_t rk, const_feedRate_t fr_mm_s=0.0f); void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k, const_feedRate_t fr_mm_s=0.0f); #endif @@ -476,15 +476,15 @@ void home_if_needed(const bool keeplev=false); #define LOGICAL_Z_POSITION(POS) NATIVE_TO_LOGICAL(POS, Z_AXIS) #define RAW_Z_POSITION(POS) LOGICAL_TO_NATIVE(POS, Z_AXIS) #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #define LOGICAL_I_POSITION(POS) NATIVE_TO_LOGICAL(POS, I_AXIS) #define RAW_I_POSITION(POS) LOGICAL_TO_NATIVE(POS, I_AXIS) #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #define LOGICAL_J_POSITION(POS) NATIVE_TO_LOGICAL(POS, J_AXIS) #define RAW_J_POSITION(POS) LOGICAL_TO_NATIVE(POS, J_AXIS) #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #define LOGICAL_K_POSITION(POS) NATIVE_TO_LOGICAL(POS, K_AXIS) #define RAW_K_POSITION(POS) LOGICAL_TO_NATIVE(POS, K_AXIS) #endif diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 45ccdd1702..4c86c06efe 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1866,13 +1866,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, " A:", target.a, " (", da, " steps)" " B:", target.b, " (", db, " steps)" " C:", target.c, " (", dc, " steps)" - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS " " AXIS4_STR ":", target.i, " (", di, " steps)" #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS " " AXIS5_STR ":", target.j, " (", dj, " steps)" #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS " " AXIS6_STR ":", target.k, " (", dk, " steps)" #endif #if HAS_EXTRUDERS @@ -1939,13 +1939,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, if (db + dc < 0) SBI(dm, B_AXIS); // Motor B direction if (CORESIGN(db - dc) < 0) SBI(dm, C_AXIS); // Motor C direction #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS if (di < 0) SBI(dm, I_AXIS); #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS if (dj < 0) SBI(dm, J_AXIS); #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS if (dk < 0) SBI(dm, K_AXIS); #endif #elif ENABLED(MARKFORGED_XY) @@ -2041,13 +2041,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, steps_dist_mm.b = (db + dc) * mm_per_step[B_AXIS]; steps_dist_mm.c = CORESIGN(db - dc) * mm_per_step[C_AXIS]; #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS steps_dist_mm.i = di * mm_per_step[I_AXIS]; #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS steps_dist_mm.j = dj * mm_per_step[J_AXIS]; #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS steps_dist_mm.k = dk * mm_per_step[K_AXIS]; #endif #elif ENABLED(MARKFORGED_XY) @@ -2104,7 +2104,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, ) #elif ENABLED(FOAMCUTTER_XYUV) // Return the largest distance move from either X/Y or I/J plane - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS _MAX(sq(steps_dist_mm.x) + sq(steps_dist_mm.y), sq(steps_dist_mm.i) + sq(steps_dist_mm.j)) #else sq(steps_dist_mm.x) + sq(steps_dist_mm.y) @@ -2197,13 +2197,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move, ); #endif #if ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX) - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS if (block->steps.i) stepper.enable_axis(I_AXIS); #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS if (block->steps.j) stepper.enable_axis(J_AXIS); #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS if (block->steps.k) stepper.enable_axis(K_AXIS); #endif #endif @@ -2949,17 +2949,17 @@ bool Planner::buffer_segment(const abce_pos_t &abce SERIAL_ECHOPGM(" (", position.z, "->", target.z); SERIAL_CHAR(')'); #endif - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS SERIAL_ECHOPGM_P(SP_I_LBL, abce.i); SERIAL_ECHOPGM(" (", position.i, "->", target.i); SERIAL_CHAR(')'); #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS SERIAL_ECHOPGM_P(SP_J_LBL, abce.j); SERIAL_ECHOPGM(" (", position.j, "->", target.j); SERIAL_CHAR(')'); #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS SERIAL_ECHOPGM_P(SP_K_LBL, abce.k); SERIAL_ECHOPGM(" (", position.k, "->", target.k); SERIAL_CHAR(')'); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 69e3f035ba..380c35755c 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -431,15 +431,15 @@ class Planner { static int8_t xy_freq_limit_hz; // Minimum XY frequency setting static float xy_freq_min_speed_factor; // Minimum speed factor setting static int32_t xy_freq_min_interval_us; // Minimum segment time based on xy_freq_limit_hz - static inline void refresh_frequency_limit() { + static void refresh_frequency_limit() { //xy_freq_min_interval_us = xy_freq_limit_hz ?: LROUND(1000000.0f / xy_freq_limit_hz); if (xy_freq_limit_hz) xy_freq_min_interval_us = LROUND(1000000.0f / xy_freq_limit_hz); } - static inline void set_min_speed_factor_u8(const uint8_t v255) { + static void set_min_speed_factor_u8(const uint8_t v255) { xy_freq_min_speed_factor = float(ui8_to_percent(v255)) / 100; } - static inline void set_frequency_limit(const uint8_t hz) { + static void set_frequency_limit(const uint8_t hz) { xy_freq_limit_hz = constrain(hz, 0, 100); refresh_frequency_limit(); } @@ -508,7 +508,7 @@ class Planner { #if HAS_CLASSIC_JERK static void set_max_jerk(const AxisEnum axis, float inMaxJerkMMS); #else - static inline void set_max_jerk(const AxisEnum, const_float_t) {} + static void set_max_jerk(const AxisEnum, const_float_t) {} #endif #if HAS_EXTRUDERS @@ -516,7 +516,7 @@ class Planner { e_factor[e] = flow_percentage[e] * 0.01f * TERN(NO_VOLUMETRICS, 1.0f, volumetric_multiplier[e]); } - static inline void set_flow(const uint8_t e, const int16_t flow) { + static void set_flow(const uint8_t e, const int16_t flow) { flow_percentage[e] = flow; refresh_e_factor(e); } @@ -539,7 +539,7 @@ class Planner { #if ENABLED(FILAMENT_WIDTH_SENSOR) void apply_filament_width_sensor(const int8_t encoded_ratio); - static inline float volumetric_percent(const bool vol) { + static float volumetric_percent(const bool vol) { return 100.0f * (vol ? volumetric_area_nominal / volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] : volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] @@ -588,7 +588,7 @@ class Planner { * Returns 1.0 if planner.z_fade_height is 0.0. * Returns 0.0 if Z is past the specified 'Fade Height'. */ - static inline float fade_scaling_factor_for_z(const_float_t rz) { + static float fade_scaling_factor_for_z(const_float_t rz) { static float z_fade_factor = 1; if (!z_fade_height) return 1; if (rz >= z_fade_height) return 0; @@ -838,7 +838,7 @@ class Planner { */ static float get_axis_position_mm(const AxisEnum axis); - static inline abce_pos_t get_axis_positions_mm() { + static abce_pos_t get_axis_positions_mm() { const abce_pos_t out = LOGICAL_AXIS_ARRAY( get_axis_position_mm(E_AXIS), get_axis_position_mm(A_AXIS), get_axis_position_mm(B_AXIS), get_axis_position_mm(C_AXIS), @@ -870,7 +870,7 @@ class Planner { static float triggered_position_mm(const AxisEnum axis); // Blocks are queued, or we're running out moves, or the closed loop controller is waiting - static inline bool busy() { + static bool busy() { return (has_blocks_queued() || cleaning_buffer_counter || TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING()) ); @@ -938,7 +938,7 @@ class Planner { #if ENABLED(AUTOTEMP_PROPORTIONAL) static void _autotemp_update_from_hotend(); #else - static inline void _autotemp_update_from_hotend() {} + static void _autotemp_update_from_hotend() {} #endif #endif diff --git a/Marlin/src/module/printcounter.h b/Marlin/src/module/printcounter.h index 4deae45a65..931d14ded6 100644 --- a/Marlin/src/module/printcounter.h +++ b/Marlin/src/module/printcounter.h @@ -112,7 +112,7 @@ class PrintCounter: public Stopwatch { /** * @brief Initialize the print counter */ - static inline void init() { + static void init() { super::init(); loadStats(); } @@ -176,8 +176,8 @@ class PrintCounter: public Stopwatch { */ static bool start(); static bool _stop(const bool completed); - static inline bool stop() { return _stop(true); } - static inline bool abort() { return _stop(false); } + static bool stop() { return _stop(true); } + static bool abort() { return _stop(false); } static void reset(); diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 5fda608e38..750aab74fd 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -1584,7 +1584,7 @@ void MarlinSettings::postprocess() { #if ENABLED(EEPROM_INIT_NOW) uint32_t stored_hash; EEPROM_READ_ALWAYS(stored_hash); - if (stored_hash != build_hash) { EEPROM_FINISH(); return true; } + if (stored_hash != build_hash) { EEPROM_FINISH(); return false; } #endif uint16_t stored_crc; @@ -2712,13 +2712,13 @@ void MarlinSettings::reset() { #if HAS_Z_AXIS && !defined(DEFAULT_ZJERK) #define DEFAULT_ZJERK 0 #endif - #if LINEAR_AXES >= 4 && !defined(DEFAULT_IJERK) + #if HAS_I_AXIS && !defined(DEFAULT_IJERK) #define DEFAULT_IJERK 0 #endif - #if LINEAR_AXES >= 5 && !defined(DEFAULT_JJERK) + #if HAS_J_AXIS && !defined(DEFAULT_JJERK) #define DEFAULT_JJERK 0 #endif - #if LINEAR_AXES >= 6 && !defined(DEFAULT_KJERK) + #if HAS_K_AXIS && !defined(DEFAULT_KJERK) #define DEFAULT_KJERK 0 #endif planner.max_jerk.set( diff --git a/Marlin/src/module/settings.h b/Marlin/src/module/settings.h index 967d49c073..a8fca60baa 100644 --- a/Marlin/src/module/settings.h +++ b/Marlin/src/module/settings.h @@ -59,7 +59,7 @@ class MarlinSettings { static bool load(); // Return 'true' if data was loaded ok static bool validate(); // Return 'true' if EEPROM data is ok - static inline void first_load() { + static void first_load() { static bool loaded = false; if (!loaded && load()) loaded = true; } diff --git a/Marlin/src/module/stepper.cpp b/Marlin/src/module/stepper.cpp index c100051f98..b61f36bbb4 100644 --- a/Marlin/src/module/stepper.cpp +++ b/Marlin/src/module/stepper.cpp @@ -435,15 +435,15 @@ xyze_int8_t Stepper::count_direction{0}; #define Z_APPLY_STEP(v,Q) Z_STEP_WRITE(v) #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #define I_APPLY_DIR(v,Q) I_DIR_WRITE(v) #define I_APPLY_STEP(v,Q) I_STEP_WRITE(v) #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #define J_APPLY_DIR(v,Q) J_DIR_WRITE(v) #define J_APPLY_STEP(v,Q) J_STEP_WRITE(v) #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #define K_APPLY_DIR(v,Q) K_DIR_WRITE(v) #define K_APPLY_STEP(v,Q) K_STEP_WRITE(v) #endif @@ -1688,7 +1688,7 @@ void Stepper::pulse_phase_isr() { const bool is_page = IS_PAGE(current_block); #if ENABLED(DIRECT_STEPPING) - // TODO (DerAndere): Add support for LINEAR_AXES >= 4 + // TODO (DerAndere): Add support for HAS_I_AXIS if (is_page) { #if STEPPER_PAGE_FORMAT == SP_4x4D_128 @@ -1929,7 +1929,7 @@ uint32_t Stepper::block_phase_isr() { // If current block is finished, reset pointer and finalize state if (step_events_completed >= step_event_count) { #if ENABLED(DIRECT_STEPPING) - // TODO (DerAndere): Add support for LINEAR_AXES >= 4 + // TODO (DerAndere): Add support for HAS_I_AXIS #if STEPPER_PAGE_FORMAT == SP_4x4D_128 #define PAGE_SEGMENT_UPDATE_POS(AXIS) \ count_position[_AXIS(AXIS)] += page_step_state.bd[_AXIS(AXIS)] - 128 * 7; @@ -3184,13 +3184,13 @@ void Stepper::report_positions() { } break; - #if LINEAR_AXES >= 4 + #if HAS_I_AXIS case I_AXIS: BABYSTEP_AXIS(I, 0, direction); break; #endif - #if LINEAR_AXES >= 5 + #if HAS_J_AXIS case J_AXIS: BABYSTEP_AXIS(J, 0, direction); break; #endif - #if LINEAR_AXES >= 6 + #if HAS_K_AXIS case K_AXIS: BABYSTEP_AXIS(K, 0, direction); break; #endif diff --git a/Marlin/src/module/stepper.h b/Marlin/src/module/stepper.h index f170dd4104..6b190889cd 100644 --- a/Marlin/src/module/stepper.h +++ b/Marlin/src/module/stepper.h @@ -457,11 +457,11 @@ class Stepper { // The stepper subsystem goes to sleep when it runs out of things to execute. // Call this to notify the subsystem that it is time to go to work. - static inline void wake_up() { ENABLE_STEPPER_DRIVER_INTERRUPT(); } + static void wake_up() { ENABLE_STEPPER_DRIVER_INTERRUPT(); } - static inline bool is_awake() { return STEPPER_ISR_ENABLED(); } + static bool is_awake() { return STEPPER_ISR_ENABLED(); } - static inline bool suspend() { + static bool suspend() { const bool awake = is_awake(); if (awake) DISABLE_STEPPER_DRIVER_INTERRUPT(); return awake; @@ -564,7 +564,7 @@ class Stepper { FORCE_INLINE static void set_z4_lock(const bool state) { locked_Z4_motor = state; } #endif #endif - static inline void set_all_z_lock(const bool lock, const int8_t except=-1) { + static void set_all_z_lock(const bool lock, const int8_t except=-1) { set_z1_lock(lock ^ (except == 0)); set_z2_lock(lock ^ (except == 1)); #if NUM_Z_STEPPER_DRIVERS >= 3 @@ -586,16 +586,16 @@ class Stepper { static axis_flags_t axis_enabled; // Axis stepper(s) ENABLED states - static inline bool axis_is_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static bool axis_is_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { return TEST(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex)); } - static inline void mark_axis_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static void mark_axis_enabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { SBI(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex)); } - static inline void mark_axis_disabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static void mark_axis_disabled(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { CBI(axis_enabled.bits, INDEX_OF_AXIS(axis, eindex)); } - static inline bool can_axis_disable(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { + static bool can_axis_disable(const AxisEnum axis E_OPTARG(const uint8_t eindex=0)) { return !any_enable_overlap() || !(axis_enabled.bits & enable_overlap[INDEX_OF_AXIS(axis, eindex)]); } @@ -608,10 +608,10 @@ class Stepper { static void enable_e_steppers(); static void disable_e_steppers(); #else - static inline void enable_extruder() {} - static inline bool disable_extruder() { return true; } - static inline void enable_e_steppers() {} - static inline void disable_e_steppers() {} + static void enable_extruder() {} + static bool disable_extruder() { return true; } + static void enable_e_steppers() {} + static void disable_e_steppers() {} #endif #define ENABLE_EXTRUDER(N) enable_extruder(E_TERN_(N)) diff --git a/Marlin/src/module/stepper/indirection.h b/Marlin/src/module/stepper/indirection.h index 93b765d7a5..7aea677534 100644 --- a/Marlin/src/module/stepper/indirection.h +++ b/Marlin/src/module/stepper/indirection.h @@ -206,7 +206,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif // I Stepper -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #ifndef I_ENABLE_INIT #define I_ENABLE_INIT() SET_OUTPUT(I_ENABLE_PIN) #define I_ENABLE_WRITE(STATE) WRITE(I_ENABLE_PIN,STATE) @@ -225,7 +225,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif // J Stepper -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #ifndef J_ENABLE_INIT #define J_ENABLE_INIT() SET_OUTPUT(J_ENABLE_PIN) #define J_ENABLE_WRITE(STATE) WRITE(J_ENABLE_PIN,STATE) @@ -244,7 +244,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #endif // K Stepper -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #ifndef K_ENABLE_INIT #define K_ENABLE_INIT() SET_OUTPUT(K_ENABLE_PIN) #define K_ENABLE_WRITE(STATE) WRITE(K_ENABLE_PIN,STATE) @@ -895,21 +895,21 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset #define Z_RESET() #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #define ENABLE_AXIS_I() if (SHOULD_ENABLE(i)) { ENABLE_STEPPER_I(); AFTER_CHANGE(i, true); } #define DISABLE_AXIS_I() if (SHOULD_DISABLE(i)) { DISABLE_STEPPER_I(); AFTER_CHANGE(i, false); set_axis_untrusted(I_AXIS); } #else #define ENABLE_AXIS_I() NOOP #define DISABLE_AXIS_I() NOOP #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #define ENABLE_AXIS_J() if (SHOULD_ENABLE(j)) { ENABLE_STEPPER_J(); AFTER_CHANGE(j, true); } #define DISABLE_AXIS_J() if (SHOULD_DISABLE(j)) { DISABLE_STEPPER_J(); AFTER_CHANGE(j, false); set_axis_untrusted(J_AXIS); } #else #define ENABLE_AXIS_J() NOOP #define DISABLE_AXIS_J() NOOP #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #define ENABLE_AXIS_K() if (SHOULD_ENABLE(k)) { ENABLE_STEPPER_K(); AFTER_CHANGE(k, true); } #define DISABLE_AXIS_K() if (SHOULD_DISABLE(k)) { DISABLE_STEPPER_K(); AFTER_CHANGE(k, false); set_axis_untrusted(K_AXIS); } #else diff --git a/Marlin/src/module/stepper/trinamic.h b/Marlin/src/module/stepper/trinamic.h index 0a956a70b3..dd3a64240f 100644 --- a/Marlin/src/module/stepper/trinamic.h +++ b/Marlin/src/module/stepper/trinamic.h @@ -74,12 +74,6 @@ #define TMC_CLASS_E(N) TMC_CLASS(E##N, E) #endif -typedef struct { - uint8_t toff; - int8_t hend; - uint8_t hstrt; -} chopper_timing_t; - #ifndef CHOPPER_TIMING_X #define CHOPPER_TIMING_X CHOPPER_TIMING #endif @@ -89,13 +83,13 @@ typedef struct { #if HAS_Z_AXIS && !defined(CHOPPER_TIMING_Z) #define CHOPPER_TIMING_Z CHOPPER_TIMING #endif -#if LINEAR_AXES >= 4 && !defined(CHOPPER_TIMING_I) +#if HAS_I_AXIS && !defined(CHOPPER_TIMING_I) #define CHOPPER_TIMING_I CHOPPER_TIMING #endif -#if LINEAR_AXES >= 5 && !defined(CHOPPER_TIMING_J) +#if HAS_J_AXIS && !defined(CHOPPER_TIMING_J) #define CHOPPER_TIMING_J CHOPPER_TIMING #endif -#if LINEAR_AXES >= 6 && !defined(CHOPPER_TIMING_K) +#if HAS_K_AXIS && !defined(CHOPPER_TIMING_K) #define CHOPPER_TIMING_K CHOPPER_TIMING #endif #if HAS_EXTRUDERS && !defined(CHOPPER_TIMING_E) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index dccdc55034..c5c4b3524b 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1444,7 +1444,7 @@ void Temperature::manage_heater() { TERN_(HEATER_IDLE_HANDLER, heater_idle[IDLE_INDEX_BED].update(ms)); - #if HAS_THERMALLY_PROTECTED_BED + #if ENABLED(THERMAL_PROTECTION_BED) tr_state_machine[RUNAWAY_IND_BED].run(temp_bed.celsius, temp_bed.target, H_BED, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS); #endif @@ -2570,20 +2570,14 @@ void Temperature::init() { ); */ - #if HEATER_IDLE_HANDLER - // If the heater idle timeout expires, restart - if (heater_idle[idle_index].timed_out) { - state = TRInactive; - running_temp = 0; - } - else - #endif - { - // If the target temperature changes, restart - if (running_temp != target) { - running_temp = target; - state = target > 0 ? TRFirstHeating : TRInactive; - } + // If the heater idle timeout expires, restart + if (TERN0(HEATER_IDLE_HANDLER, heater_idle[idle_index].timed_out)) { + state = TRInactive; + running_temp = 0; + } + else if (running_temp != target) { // If the target temperature changes, restart + running_temp = target; + state = target > 0 ? TRFirstHeating : TRInactive; } switch (state) { @@ -2596,7 +2590,7 @@ void Temperature::init() { state = TRStable; // While the temperature is stable watch for a bad temperature - case TRStable: + case TRStable: { #if ENABLED(ADAPTIVE_FAN_SLOWING) if (adaptive_fan_slowing && heater_id >= 0) { @@ -2614,13 +2608,17 @@ void Temperature::init() { } #endif + const millis_t now = millis(); + if (current >= running_temp - hysteresis_degc) { - timer = millis() + SEC_TO_MS(period_seconds); + timer = now + SEC_TO_MS(period_seconds); break; } - else if (PENDING(millis(), timer)) break; + else if (PENDING(now, timer)) break; state = TRRunaway; + } // fall through + case TRRunaway: TERN_(HAS_DWIN_E3V2_BASIC, DWIN_Popup_Temperature(0)); _temp_error(heater_id, FPSTR(str_t_thermal_runaway), GET_TEXT_F(MSG_THERMAL_RUNAWAY)); diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 0e4302938e..5661668204 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -359,7 +359,7 @@ class Temperature { #if HAS_HOTEND static hotend_info_t temp_hotend[HOTENDS]; static const celsius_t hotend_maxtemp[HOTENDS]; - static inline celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); } + static celsius_t hotend_max_target(const uint8_t e) { return hotend_maxtemp[e] - (HOTEND_OVERSHOOT); } #endif #if HAS_HEATED_BED static bed_info_t temp_bed; @@ -402,16 +402,16 @@ class Temperature { #if ENABLED(PREVENT_COLD_EXTRUSION) static bool allow_cold_extrude; static celsius_t extrude_min_temp; - static inline bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); } - static inline bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); } - static inline bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); } + static bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); } + static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); } + static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); } #else - static inline bool tooColdToExtrude(const uint8_t) { return false; } - static inline bool targetTooColdToExtrude(const uint8_t) { return false; } + static bool tooColdToExtrude(const uint8_t) { return false; } + static bool targetTooColdToExtrude(const uint8_t) { return false; } #endif - static inline bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } - static inline bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } + static bool hotEnoughToExtrude(const uint8_t e) { return !tooColdToExtrude(e); } + static bool targetHotEnoughToExtrude(const uint8_t e) { return !targetTooColdToExtrude(e); } #if EITHER(SINGLENOZZLE_STANDBY_TEMP, SINGLENOZZLE_STANDBY_FAN) #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) @@ -449,7 +449,7 @@ class Temperature { }; // Convert the given heater_id_t to idle array index - static inline IdleIndex idle_index_for_id(const int8_t heater_id) { + static IdleIndex idle_index_for_id(const int8_t heater_id) { TERN_(HAS_HEATED_BED, if (heater_id == H_BED) return IDLE_INDEX_BED); return (IdleIndex)_MAX(heater_id, 0); } @@ -525,7 +525,7 @@ class Temperature { #if HAS_FAN_LOGIC static millis_t fan_update_ms; - static inline void manage_extruder_fans(millis_t ms) { + static void manage_extruder_fans(millis_t ms) { if (ELAPSED(ms, fan_update_ms)) { // only need to check fan state very infrequently const millis_t next_ms = ms + fan_update_interval_ms; #if HAS_PWMFANCHECK @@ -566,25 +566,25 @@ class Temperature { static void M305_report(const uint8_t t_index, const bool forReplay=true); static void reset_user_thermistors(); static celsius_float_t user_thermistor_to_deg_c(const uint8_t t_index, const int16_t raw); - static inline bool set_pull_up_res(int8_t t_index, float value) { + static bool set_pull_up_res(int8_t t_index, float value) { //if (!WITHIN(t_index, 0, USER_THERMISTORS - 1)) return false; if (!WITHIN(value, 1, 1000000)) return false; user_thermistor[t_index].series_res = value; return true; } - static inline bool set_res25(int8_t t_index, float value) { + static bool set_res25(int8_t t_index, float value) { if (!WITHIN(value, 1, 10000000)) return false; user_thermistor[t_index].res_25 = value; user_thermistor[t_index].pre_calc = true; return true; } - static inline bool set_beta(int8_t t_index, float value) { + static bool set_beta(int8_t t_index, float value) { if (!WITHIN(value, 1, 1000000)) return false; user_thermistor[t_index].beta = value; user_thermistor[t_index].pre_calc = true; return true; } - static inline bool set_sh_coeff(int8_t t_index, float value) { + static bool set_sh_coeff(int8_t t_index, float value) { if (!WITHIN(value, -0.01f, 0.01f)) return false; user_thermistor[t_index].sh_c_coeff = value; user_thermistor[t_index].pre_calc = true; @@ -634,18 +634,18 @@ class Temperature { static uint8_t fan_speed_scaler[FAN_COUNT]; #endif - static inline uint8_t scaledFanSpeed(const uint8_t fan, const uint8_t fs) { + static uint8_t scaledFanSpeed(const uint8_t fan, const uint8_t fs) { UNUSED(fan); // Potentially unused! return (fs * uint16_t(TERN(ADAPTIVE_FAN_SLOWING, fan_speed_scaler[fan], 128))) >> 7; } - static inline uint8_t scaledFanSpeed(const uint8_t fan) { + static uint8_t scaledFanSpeed(const uint8_t fan) { return scaledFanSpeed(fan, fan_speed[fan]); } static constexpr inline uint8_t pwmToPercent(const uint8_t speed) { return ui8_to_percent(speed); } - static inline uint8_t fanSpeedPercent(const uint8_t fan) { return ui8_to_percent(fan_speed[fan]); } - static inline uint8_t scaledFanSpeedPercent(const uint8_t fan) { return ui8_to_percent(scaledFanSpeed(fan)); } + static uint8_t fanSpeedPercent(const uint8_t fan) { return ui8_to_percent(fan_speed[fan]); } + static uint8_t scaledFanSpeedPercent(const uint8_t fan) { return ui8_to_percent(scaledFanSpeed(fan)); } #if ENABLED(EXTRA_FAN_SPEED) typedef struct { uint8_t saved, speed; } extra_fan_t; @@ -659,7 +659,7 @@ class Temperature { #endif // HAS_FAN - static inline void zero_fan_speeds() { + static void zero_fan_speeds() { #if HAS_FAN FANS_LOOP(i) set_fan_speed(i, 0); #endif @@ -680,13 +680,13 @@ class Temperature { * Preheating hotends */ #if MILLISECONDS_PREHEAT_TIME > 0 - static inline bool is_preheating(const uint8_t E_NAME) { + static bool is_preheating(const uint8_t E_NAME) { return preheat_end_time[HOTEND_INDEX] && PENDING(millis(), preheat_end_time[HOTEND_INDEX]); } - static inline void start_preheat_time(const uint8_t E_NAME) { + static void start_preheat_time(const uint8_t E_NAME) { preheat_end_time[HOTEND_INDEX] = millis() + MILLISECONDS_PREHEAT_TIME; } - static inline void reset_preheat_time(const uint8_t E_NAME) { + static void reset_preheat_time(const uint8_t E_NAME) { preheat_end_time[HOTEND_INDEX] = 0; } #else @@ -697,21 +697,21 @@ class Temperature { //inline so that there is no performance decrease. //deg=degreeCelsius - static inline celsius_float_t degHotend(const uint8_t E_NAME) { + static celsius_float_t degHotend(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].celsius); } - static inline celsius_t wholeDegHotend(const uint8_t E_NAME) { + static celsius_t wholeDegHotend(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, static_cast(temp_hotend[HOTEND_INDEX].celsius + 0.5f)); } #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawHotendTemp(const uint8_t E_NAME) { + static int16_t rawHotendTemp(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].raw); } #endif - static inline celsius_t degTargetHotend(const uint8_t E_NAME) { + static celsius_t degTargetHotend(const uint8_t E_NAME) { return TERN0(HAS_HOTEND, temp_hotend[HOTEND_INDEX].target); } @@ -730,11 +730,11 @@ class Temperature { start_watching_hotend(ee); } - static inline bool isHeatingHotend(const uint8_t E_NAME) { + static bool isHeatingHotend(const uint8_t E_NAME) { return temp_hotend[HOTEND_INDEX].target > temp_hotend[HOTEND_INDEX].celsius; } - static inline bool isCoolingHotend(const uint8_t E_NAME) { + static bool isCoolingHotend(const uint8_t E_NAME) { return temp_hotend[HOTEND_INDEX].target < temp_hotend[HOTEND_INDEX].celsius; } @@ -748,16 +748,16 @@ class Temperature { #endif #endif - static inline bool still_heating(const uint8_t e) { + static bool still_heating(const uint8_t e) { return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(wholeDegHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS; } - static inline bool degHotendNear(const uint8_t e, const celsius_t temp) { + static bool degHotendNear(const uint8_t e, const celsius_t temp) { return ABS(wholeDegHotend(e) - temp) < (TEMP_HYSTERESIS); } // Start watching a Hotend to make sure it's really heating up - static inline void start_watching_hotend(const uint8_t E_NAME) { + static void start_watching_hotend(const uint8_t E_NAME) { UNUSED(HOTEND_INDEX); #if WATCH_HOTENDS watch_hotend[HOTEND_INDEX].restart(degHotend(HOTEND_INDEX), degTargetHotend(HOTEND_INDEX)); @@ -769,16 +769,16 @@ class Temperature { #if HAS_HEATED_BED #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawBedTemp() { return temp_bed.raw; } + static int16_t rawBedTemp() { return temp_bed.raw; } #endif - static inline celsius_float_t degBed() { return temp_bed.celsius; } - static inline celsius_t wholeDegBed() { return static_cast(degBed() + 0.5f); } - static inline celsius_t degTargetBed() { return temp_bed.target; } - static inline bool isHeatingBed() { return temp_bed.target > temp_bed.celsius; } - static inline bool isCoolingBed() { return temp_bed.target < temp_bed.celsius; } + static celsius_float_t degBed() { return temp_bed.celsius; } + static celsius_t wholeDegBed() { return static_cast(degBed() + 0.5f); } + static celsius_t degTargetBed() { return temp_bed.target; } + static bool isHeatingBed() { return temp_bed.target > temp_bed.celsius; } + static bool isCoolingBed() { return temp_bed.target < temp_bed.celsius; } // Start watching the Bed to make sure it's really heating up - static inline void start_watching_bed() { TERN_(WATCH_BED, watch_bed.restart(degBed(), degTargetBed())); } + static void start_watching_bed() { TERN_(WATCH_BED, watch_bed.restart(degBed(), degTargetBed())); } static void setTargetBed(const celsius_t celsius) { TERN_(AUTO_POWER_CONTROL, if (celsius) powerManager.power_on()); @@ -792,7 +792,7 @@ class Temperature { static void wait_for_bed_heating(); - static inline bool degBedNear(const celsius_t temp) { + static bool degBedNear(const celsius_t temp) { return ABS(wholeDegBed() - temp) < (TEMP_BED_HYSTERESIS); } @@ -800,25 +800,25 @@ class Temperature { #if HAS_TEMP_PROBE #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawProbeTemp() { return temp_probe.raw; } + static int16_t rawProbeTemp() { return temp_probe.raw; } #endif - static inline celsius_float_t degProbe() { return temp_probe.celsius; } - static inline celsius_t wholeDegProbe() { return static_cast(degProbe() + 0.5f); } - static inline bool isProbeBelowTemp(const celsius_t target_temp) { return wholeDegProbe() < target_temp; } - static inline bool isProbeAboveTemp(const celsius_t target_temp) { return wholeDegProbe() > target_temp; } + static celsius_float_t degProbe() { return temp_probe.celsius; } + static celsius_t wholeDegProbe() { return static_cast(degProbe() + 0.5f); } + static bool isProbeBelowTemp(const celsius_t target_temp) { return wholeDegProbe() < target_temp; } + static bool isProbeAboveTemp(const celsius_t target_temp) { return wholeDegProbe() > target_temp; } static bool wait_for_probe(const celsius_t target_temp, bool no_wait_for_cooling=true); #endif #if HAS_TEMP_CHAMBER #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawChamberTemp() { return temp_chamber.raw; } + static int16_t rawChamberTemp() { return temp_chamber.raw; } #endif - static inline celsius_float_t degChamber() { return temp_chamber.celsius; } - static inline celsius_t wholeDegChamber() { return static_cast(degChamber() + 0.5f); } + static celsius_float_t degChamber() { return temp_chamber.celsius; } + static celsius_t wholeDegChamber() { return static_cast(degChamber() + 0.5f); } #if HAS_HEATED_CHAMBER - static inline celsius_t degTargetChamber() { return temp_chamber.target; } - static inline bool isHeatingChamber() { return temp_chamber.target > temp_chamber.celsius; } - static inline bool isCoolingChamber() { return temp_chamber.target < temp_chamber.celsius; } + static celsius_t degTargetChamber() { return temp_chamber.target; } + static bool isHeatingChamber() { return temp_chamber.target > temp_chamber.celsius; } + static bool isCoolingChamber() { return temp_chamber.target < temp_chamber.celsius; } static bool wait_for_chamber(const bool no_wait_for_cooling=true); #endif #endif @@ -829,49 +829,49 @@ class Temperature { start_watching_chamber(); } // Start watching the Chamber to make sure it's really heating up - static inline void start_watching_chamber() { TERN_(WATCH_CHAMBER, watch_chamber.restart(degChamber(), degTargetChamber())); } + static void start_watching_chamber() { TERN_(WATCH_CHAMBER, watch_chamber.restart(degChamber(), degTargetChamber())); } #endif #if HAS_TEMP_COOLER #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawCoolerTemp() { return temp_cooler.raw; } + static int16_t rawCoolerTemp() { return temp_cooler.raw; } #endif - static inline celsius_float_t degCooler() { return temp_cooler.celsius; } - static inline celsius_t wholeDegCooler() { return static_cast(temp_cooler.celsius + 0.5f); } + static celsius_float_t degCooler() { return temp_cooler.celsius; } + static celsius_t wholeDegCooler() { return static_cast(temp_cooler.celsius + 0.5f); } #if HAS_COOLER - static inline celsius_t degTargetCooler() { return temp_cooler.target; } - static inline bool isLaserHeating() { return temp_cooler.target > temp_cooler.celsius; } - static inline bool isLaserCooling() { return temp_cooler.target < temp_cooler.celsius; } + static celsius_t degTargetCooler() { return temp_cooler.target; } + static bool isLaserHeating() { return temp_cooler.target > temp_cooler.celsius; } + static bool isLaserCooling() { return temp_cooler.target < temp_cooler.celsius; } static bool wait_for_cooler(const bool no_wait_for_cooling=true); #endif #endif #if HAS_TEMP_BOARD #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawBoardTemp() { return temp_board.raw; } + static int16_t rawBoardTemp() { return temp_board.raw; } #endif - static inline celsius_float_t degBoard() { return temp_board.celsius; } - static inline celsius_t wholeDegBoard() { return static_cast(temp_board.celsius + 0.5f); } + static celsius_float_t degBoard() { return temp_board.celsius; } + static celsius_t wholeDegBoard() { return static_cast(temp_board.celsius + 0.5f); } #endif #if HAS_TEMP_REDUNDANT #if ENABLED(SHOW_TEMP_ADC_VALUES) - static inline int16_t rawRedundantTemp() { return temp_redundant.raw; } - static inline int16_t rawRedundanTargetTemp() { return (*temp_redundant.target).raw; } + static int16_t rawRedundantTemp() { return temp_redundant.raw; } + static int16_t rawRedundanTargetTemp() { return (*temp_redundant.target).raw; } #endif - static inline celsius_float_t degRedundant() { return temp_redundant.celsius; } - static inline celsius_float_t degRedundantTarget() { return (*temp_redundant.target).celsius; } - static inline celsius_t wholeDegRedundant() { return static_cast(temp_redundant.celsius + 0.5f); } - static inline celsius_t wholeDegRedundantTarget() { return static_cast((*temp_redundant.target).celsius + 0.5f); } + static celsius_float_t degRedundant() { return temp_redundant.celsius; } + static celsius_float_t degRedundantTarget() { return (*temp_redundant.target).celsius; } + static celsius_t wholeDegRedundant() { return static_cast(temp_redundant.celsius + 0.5f); } + static celsius_t wholeDegRedundantTarget() { return static_cast((*temp_redundant.target).celsius + 0.5f); } #endif #if HAS_COOLER - static inline void setTargetCooler(const celsius_t celsius) { + static void setTargetCooler(const celsius_t celsius) { temp_cooler.target = constrain(celsius, COOLER_MIN_TARGET, COOLER_MAX_TARGET); start_watching_cooler(); } // Start watching the Cooler to make sure it's really cooling down - static inline void start_watching_cooler() { TERN_(WATCH_COOLER, watch_cooler.restart(degCooler(), degTargetCooler())); } + static void start_watching_cooler() { TERN_(WATCH_COOLER, watch_cooler.restart(degCooler(), degTargetCooler())); } #endif /** @@ -887,7 +887,7 @@ class Temperature { /** * Cooldown, as from the LCD. Disables all heaters and fans. */ - static inline void cooldown() { + static void cooldown() { zero_fan_speeds(); disable_all_heaters(); } @@ -921,7 +921,7 @@ class Temperature { * Update the temp manager when PID values change */ #if ENABLED(PIDTEMP) - static inline void updatePID() { + static void updatePID() { TERN_(PID_EXTRUSION_SCALING, last_e_position = 0); } #endif @@ -934,13 +934,13 @@ class Temperature { #if HEATER_IDLE_HANDLER - static inline void reset_hotend_idle_timer(const uint8_t E_NAME) { + static void reset_hotend_idle_timer(const uint8_t E_NAME) { heater_idle[HOTEND_INDEX].reset(); start_watching_hotend(HOTEND_INDEX); } #if HAS_HEATED_BED - static inline void reset_bed_idle_timer() { + static void reset_bed_idle_timer() { heater_idle[IDLE_INDEX_BED].reset(); start_watching_bed(); } @@ -961,7 +961,7 @@ class Temperature { #if HAS_HOTEND && HAS_STATUS_MESSAGE static void set_heating_message(const uint8_t e); #else - static inline void set_heating_message(const uint8_t) {} + static void set_heating_message(const uint8_t) {} #endif #if HAS_LCD_MENU && HAS_TEMPERATURE @@ -974,7 +974,7 @@ class Temperature { static volatile bool raw_temps_ready; static void update_raw_temperatures(); static void updateTemperaturesFromRawValues(); - static inline bool updateTemperaturesIfReady() { + static bool updateTemperaturesIfReady() { if (!raw_temps_ready) return false; updateTemperaturesFromRawValues(); raw_temps_ready = false; @@ -1009,7 +1009,7 @@ class Temperature { static void min_temp_error(const heater_id_t e); static void max_temp_error(const heater_id_t e); - #define HAS_THERMAL_PROTECTION ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER, HAS_THERMALLY_PROTECTED_BED, THERMAL_PROTECTION_COOLER) + #define HAS_THERMAL_PROTECTION ANY(THERMAL_PROTECTION_HOTENDS, THERMAL_PROTECTION_CHAMBER, THERMAL_PROTECTION_BED, THERMAL_PROTECTION_COOLER) #if HAS_THERMAL_PROTECTION @@ -1021,17 +1021,17 @@ class Temperature { REPEAT(HOTENDS, _RUNAWAY_IND_E) #undef _RUNAWAY_IND_E #endif - OPTARG(HAS_THERMALLY_PROTECTED_BED, RUNAWAY_IND_BED) + OPTARG(THERMAL_PROTECTION_BED, RUNAWAY_IND_BED) OPTARG(THERMAL_PROTECTION_CHAMBER, RUNAWAY_IND_CHAMBER) OPTARG(THERMAL_PROTECTION_COOLER, RUNAWAY_IND_COOLER) , NR_HEATER_RUNAWAY }; // Convert the given heater_id_t to runaway state array index - static inline RunawayIndex runaway_index_for_id(const int8_t heater_id) { - TERN_(HAS_THERMALLY_PROTECTED_CHAMBER, if (heater_id == H_CHAMBER) return RUNAWAY_IND_CHAMBER); - TERN_(HAS_THERMALLY_PROTECTED_CHAMBER, if (heater_id == H_COOLER) return RUNAWAY_IND_COOLER); - TERN_(HAS_THERMALLY_PROTECTED_BED, if (heater_id == H_BED) return RUNAWAY_IND_BED); + static RunawayIndex runaway_index_for_id(const int8_t heater_id) { + TERN_(THERMAL_PROTECTION_CHAMBER, if (heater_id == H_CHAMBER) return RUNAWAY_IND_CHAMBER); + TERN_(THERMAL_PROTECTION_COOLER, if (heater_id == H_COOLER) return RUNAWAY_IND_COOLER); + TERN_(THERMAL_PROTECTION_BED, if (heater_id == H_BED) return RUNAWAY_IND_BED); return (RunawayIndex)_MAX(heater_id, 0); } diff --git a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h index bfa38adadf..5cae63d31a 100644 --- a/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h +++ b/Marlin/src/pins/esp32/pins_MKS_TINYBEE.h @@ -127,7 +127,7 @@ * ------ ------ * (BEEPER) 149 |10 9 | 13 (BTN_ENC) (SPI MISO) 19 |10 9 | 18 (SPI SCK) * (LCD_EN) 21 | 8 7 | 4 (LCD_RS) (BTN_EN1) 14 | 8 7 | 5 (SPI CS) - * (LCD_D4) 0 | 6 5 16 (LCD_D5) (BTN_EN2) 12 | 6 5 23 (SPI MOSI) + * (LCD_D4) 0 6 5 | 16 (LCD_D5) (BTN_EN2) 12 6 5 | 23 (SPI MOSI) * (LCD_D6) 15 | 4 3 | 17 (LCD_D7) (SPI_DET) 34 | 4 3 | RESET * GND | 2 1 | 5V GND | 2 1 | 3.3V * ------ ------ diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index 48b178dab5..f0f57c63ee 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -60,9 +60,9 @@ /** ------ ------ * 1.30 |10 9 | 2.11 0.17 |10 9 | 0.15 * 0.18 | 8 7 | 0.16 3.26 | 8 7 | 1.23 - * 0.15 6 5 | NC 3.25 6 5 | 0.18 - * NC | 4 3 | NC 1.31 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * 0.15 6 5 | -- 3.25 6 5 | 0.18 + * -- | 4 3 | -- 1.31 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 97d78c0d24..586fb14e8e 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -195,7 +195,7 @@ * (LCD_EN) 1.18 | 8 7 | 1.19 (LCD_RS) (BTN_EN1) 3.26 | 8 7 | 0.16 (SD_SS) * (LCD_D4) 1.20 6 5 | 1.21 (LCD_D5) (BTN_EN2) 3.25 6 5 | 0.18 (MOSI) * (LCD_D6) 1.22 | 4 3 | 1.23 (LCD_D7) (SD_DETECT) 1.31 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ @@ -237,11 +237,11 @@ * * BEFORE AFTER * ------ ------ - * GND 1 | 1 2 | 2 5V 5V 1 | 1 2 | 2 GND - * CS 3 | 3 4 | 4 BTN_EN2 CS 3 | 3 4 | 4 BTN_EN2 - * SID 5 | 5 6 6 BTN_EN1 SID 5 | 5 6 6 BTN_EN1 - * open 7 | 7 8 | 8 BTN_ENC CLK 7 | 7 8 | 8 BTN_ENC - * CLK 9 | 9 10 | 10 Beeper open 9 | 9 10 | 10 Beeper + * (CLK) |10 9 | (BEEPER) (BEEPER) |10 9 | -- + * -- | 8 7 | (BTN_ENC) (BTN_ENC) | 8 7 | (CLK) + * (SID) 6 5 | (BTN_EN1) (BTN_EN1) 6 5 | (SID) + * (CS) | 4 3 | (BTN_EN2) (BTN_EN2) | 4 3 | (CS) + * GND | 2 1 | 5V GND | 2 1 | 5V * ------ ------ * LCD LCD */ @@ -270,11 +270,11 @@ * * BEFORE AFTER * ______ ______ - * GND | 1 2 | 5V 5V | 1 2 | GND - * CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2 - * SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1 - * SCK | 7 8 | BTN_ENC SCK | 7 8 | BTN_ENC - * MOSI | 9 10 | open | 9 10 | MOSI + * |10 9 | (MOSI) (MOSI) |10 9 | -- + * (BTN_ENC) | 8 7 | (SCK) (BTN_ENC) | 8 7 | (SCK) + * (BTN_EN1) 6 5 | (SID) (BTN_EN1) 6 5 | (SID) + * (BTN_EN2) | 4 3 | (CS) (BTN_EN2) | 4 3 | (CS) + * 5V | 2 1 | GND GND | 2 1 | 5V * ------ ------ * LCD LCD */ @@ -424,13 +424,13 @@ /** * Creality Ender-2 display pinout - * ----- - * 5V | 1 2 | GND - * (MOSI) P1_23 | 3 4 | P1_22 (LCD_CS) - * (LCD_A0) P1_21 | 5 6 P1_20 (BTN_EN2) - * (RESET) P1_19 | 7 8 | P1_18 (BTN_EN1) - * (BTN_ENC) P0_28 | 9 10| P1_30 (SCK) - * ----- + * ------ + * (SCK) P1_30 |10 9 | P0_28 (BTN_ENC) + * (BTN_EN1) P1_18 | 8 7 | P1_19 (RESET) + * (BTN_EN2) P1_20 6 5 | P1_21 (LCD_A0) + * (LCD_CS) P1_22 | 4 3 | P1_23 (MOSI) + * GND | 2 1 | 5V + * ------ * EXP1 */ diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index b9dc845c5b..03a0360b6e 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -250,7 +250,7 @@ * 1.18 | 8 7 | 1.19 3.26 | 8 7 | 0.16 * 1.20 6 5 | 1.21 3.25 6 5 | 0.18 * 1.22 | 4 3 | 1.23 1.31 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ @@ -298,11 +298,11 @@ * * BEFORE AFTER * ------ ------ - * GND | 1 2 | 5V 5V | 1 2 | GND - * CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2 - * SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1 - * open | 7 8 | BTN_ENC open | 7 8 | BTN_ENC - * CLK | 9 10| BEEPER CLK | 9 10| BEEPER + * (BEEPER) | 10 9 | (CLK) (BEEPER) | 10 9 | (CLK) + * (BTN_ENC) | 8 7 | -- (BTN_ENC) | 8 7 | -- + * (BTN_EN1) 6 5 | (SID) (BTN_EN1) 6 5 | (SID) + * (BTN_EN2) | 4 3 | (CS) (BTN_EN2) | 4 3 | (CS) + * 5V | 2 1 | GND GND | 2 1 | 5V * ------ ------ * LCD LCD */ @@ -330,15 +330,15 @@ * * The ANET_FULL_GRAPHICS_LCD connector plug: * - * BEFORE AFTER - * ------ ------ - * GND | 1 2 | 5V 5V | 1 2 | GND - * CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2 - * SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1 - * open | 7 8 | BTN_ENC CLK | 7 8 | BTN_ENC - * CLK | 9 10 | BEEPER open | 9 10 | BEEPER - * ------ ------ - * LCD LCD + * BEFORE AFTER + * ------ ------ + * (BEEPER) |10 9 | (CLK) (BEEPER) |10 9 | -- + * (BTN_ENC) | 8 7 | -- (BTN_ENC) | 8 7 | (CLK) + * (BTN_EN1) 6 5 | (SID) (BTN_EN1) 6 5 | (SID) + * (BTN_EN2) | 4 3 | (CS) (BTN_EN2) | 4 3 | (CS) + * 5V | 2 1 | GND GND | 2 1 | 5V + * ------ ------ + * LCD LCD */ #define LCD_PINS_RS EXP1_03_PIN @@ -366,11 +366,11 @@ /** Creality Ender-2 display pinout * ------ - * 5V | 1 2 | GND - * (MOSI) 1.23 | 3 4 | 1.22 (LCD_RS) - * (LCD_A0) 1.21 | 5 6 1.20 (BTN_EN2) - * RESET 1.19 | 7 8 | 1.18 (BTN_EN1) - * (BTN_ENC) 0.28 | 9 10 | 1.30 (SCK) + * (SCK) 1.30 |10 9 | 0.28 (BTN_ENC) + * (BTN_EN1) 1.18 | 8 7 | 1.19 (RESET) + * (BTN_EN2) 1.20 6 5 | 1.21 (LCD_A0) + * (LCD_RS) 1.22 | 4 3 | 1.23 (MOSI) + * GND | 2 1 | 5V * ------ * EXP1 */ diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h index 52f34ed0f0..37d0cb7fb1 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h @@ -150,14 +150,15 @@ #endif #if ENABLED(BTT_MOTOR_EXPANSION) - /** ------ ------ - * NC | 1 2 | GND NC | 1 2 | GND - * NC | 3 4 | M1EN M2EN | 3 4 | M3EN - * M1STP | 5 6 M1DIR M1RX | 5 6 M1DIAG - * M2DIR | 7 8 | M2STP M2RX | 7 8 | M2DIAG - * M3DIR | 9 10 | M3STP M3RX | 9 10 | M3DIAG - * ------ ------ - * EXP2 EXP1 + /** + * ------ ------ + * (M3STP) |10 9 | (M3DIR) (M3DIAG) |10 9 | (M3RX) + * (M2STP) | 8 7 | (M2DIR) (M2DIAG) | 8 7 | (M2RX) + * (M1DIR) 6 5 | (M1STP) (M1DIAG) 6 5 | (M1RX) + * (M1EN) | 4 3 | -- (M3EN) | 4 3 | (M2EN) + * GND | 2 1 | -- GND | 2 1 | -- + * ------ ------ + * EXP2 EXP1 * * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN */ diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 15afe7e238..95bbe17b9b 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -233,9 +233,9 @@ /** ------ ------ * (BEEPER) 1.31 |10 9 | 1.30 (BTN_ENC) (MISO) 0.8 |10 9 | 0.7 (SD_SCK) * (LCD_EN) 0.18 | 8 7 | 0.16 (LCD_RS) (BTN_EN1) 3.25 | 8 7 | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | 6 5 0.17 (LCD_D5) (BTN_EN2) 3.26 | 6 5 0.9 (SD_MOSI) + * (LCD_D4) 0.15 6 5 | 0.17 (LCD_D5) (BTN_EN2) 3.26 6 5 | 0.9 (SD_MOSI) * (LCD_D6) 1.0 | 4 3 | 1.22 (LCD_D7) (SD_DETECT) 0.27 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 934b74cbb1..bf214761d3 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -228,7 +228,7 @@ #define PS_ON_PIN P2_12 // (12) -#if !defined(TEMP_0_CS_PIN) && DISABLED(USE_ZMAX_PLUG) +#if !defined(TEMP_0_CS_PIN) && !(HAS_Z_AXIS && Z_HOME_DIR) #define TEMP_0_CS_PIN P1_28 #endif diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index bdc49fc236..0916138361 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -186,11 +186,11 @@ /** * ------ - * 5V | 1 2 | GND - * (LCD_EN) P0_18 | 3 4 | P0_17 (LCD_RS) - * (LCD_D4) P0_15 | 5 6 P0_20 (BTN_EN2) - * RESET | 7 8 | P0_19 (BTN_EN1) - * (BTN_ENC) P0_16 | 9 10 | P2_08 (BEEPER) + * (BEEPER) P2_08 |10 9 | P0_16 (BTN_ENC) + * (BTN_EN1) P0_19 | 8 7 | RESET + * (BTN_EN2) P0_20 6 5 | P0_15 (LCD_D4) + * (LCD_RS) P0_17 | 4 3 | P0_18 (LCD_EN) + * GND | 2 1 | 5V * ------ * EXP */ @@ -209,11 +209,11 @@ /** * Ender 3 V2 display SKR E3 Turbo (EXP1) Ender 3 V2 display --> SKR E3 Turbo * ------ ------ RX 8 --> 5 P0_15 - * 5V | 1 2 | GND 5V | 1 2 | GND TX 7 --> 9 P0_16 - * (BTN_E1) A | 3 4 | B (BTN_E2) (LCD_EN) P0_18 | 3 4 | P0_17 (LCD_RS) BEEPER 5 --> 10 P2_08 - * BEEPER | 5 6 ENT (BTN_ENC) (LCD_D4) P0_15 | 5 6 P0_20 (BTN_EN2) - * (SKR_RX1) TX | 7 8 | RX (SKR_TX1) Reset | 7 8 | P0_19 (BTN_EN1) - * NC | 9 10 | NC (BTN_ENC) P0_16 | 9 10 | P2_08 (BEEPER) + * -- |10 9 | -- (BEEPER) P2_08 |10 9 | P0_16 (BTN_ENC) TX 7 --> 9 P0_16 + * (SKR_TX1) RX | 8 7 | TX (SKR_RX1) (BTN_EN1) P0_19 | 8 7 | RESET BEEPER 5 --> 10 P2_08 + * (BTN_ENC) ENT 6 5 | BEEPER (BTN_EN2) P0_20 6 5 | P0_15 (LCD_D4) + * (BTN_E2) B | 4 3 | A (BTN_E1) (LCD_RS) P0_17 | 4 3 | P0_18 (LCD_EN) + * GND | 2 1 | 5V GND | 2 1 | 5V * ------ ------ */ diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 8107f11937..7edfb9196f 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -260,9 +260,9 @@ /** ------ ------ * (BEEPER) 1.31 |10 9 | 1.30 (BTN_ENC) (MISO) 0.8 |10 9 | 0.7 (SD_SCK) * (LCD_EN) 0.18 | 8 7 | 0.16 (LCD_RS) (BTN_EN1) 3.25 | 8 7 | 0.28 (SD_CS2) - * (LCD_D4) 0.15 | 6 5 | 0.17 (LCD_D5) (BTN_EN2) 3.26 | 6 5 | 0.9 (SD_MOSI) + * (LCD_D4) 0.15 6 5 | 0.17 (LCD_D5) (BTN_EN2) 3.26 6 5 | 0.9 (SD_MOSI) * (LCD_D6) 1.0 | 4 3 | 1.22 (LCD_D7) (SD_DETECT) 0.27 | 4 3 | RST - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h index dc7dcd6db6..81c7dc9403 100644 --- a/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h +++ b/Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h @@ -157,11 +157,11 @@ /** * ------ - * 5V | 1 2 | GND - * P0_18 | 3 4 | P0_16 - * P0_15 | 5 6 P3_25 - * P2_11 | 7 8 | P3_26 - * P1_30 | 9 10 | P1_31 + * P1_31 |10 9 | P1_30 + * P3_26 | 8 7 | P2_11 + * P3_25 6 5 | P0_15 + * P0_16 | 4 3 | P0_18 + * GND | 2 1 | 5V * ------ * EXP1 * @@ -182,11 +182,11 @@ #if ENABLED(CR10_STOCKDISPLAY) /** ------ - * 5V | 1 2 | GND - * LCD_EN | 3 4 | LCD_RS - * LCD_D4 | 5 6 EN2 - * KILL | 7 8 | EN1 - * ENC | 9 10 | BEEPER + * BEEPER |10 9 | ENC + * EN1 | 8 7 | KILL + * EN2 6 5 | LCD_D4 + * LCD_RS | 4 3 | LCD_EN + * GND | 2 1 | 5V * ------ */ #define BEEPER_PIN EXP1_10_PIN @@ -197,11 +197,11 @@ #elif ENABLED(MKS_MINI_12864) /** ------ - * 5V | 1 2 | GND - * SPI-MOSI | 3 4 | SPI-CS - * A0 | 5 6 EN2 - * -- | 7 8 | EN1 - * ENC | 9 10 | SPI-SCK + * SCK |10 9 | ENC + * EN1 | 8 7 | -- + * EN2 6 5 | A0 + * CS | 4 3 | MOSI + * GND | 2 1 | 5V * ------ */ #define DOGLCD_CS EXP1_04_PIN diff --git a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h index dcf25da070..73d4bac472 100644 --- a/Marlin/src/pins/mega/pins_HJC2560C_REV2.h +++ b/Marlin/src/pins/mega/pins_HJC2560C_REV2.h @@ -112,7 +112,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) +#if HAS_CUTTER #define SPINDLE_DIR_PIN 16 #define SPINDLE_LASER_ENA_PIN 17 // Pin should have a pullup! #define SPINDLE_LASER_PWM_PIN 9 // Hardware PWM diff --git a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h index 69c60b29ec..0af37bb217 100644 --- a/Marlin/src/pins/mega/pins_MEGACONTROLLER.h +++ b/Marlin/src/pins/mega/pins_MEGACONTROLLER.h @@ -121,7 +121,7 @@ #define CONTROLLER_FAN_PIN FAN2_PIN #endif -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Misc. Functions diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 0f0f42508d..0d24ee6696 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -37,24 +37,28 @@ #define MAX_E_STEPPERS 8 -#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB) - #define FET_ORDER_EFB 1 -#elif MB(RAMPS_13_EEB, RAMPS_14_EEB, RAMPS_PLUS_EEB, RAMPS_14_RE_ARM_EEB, RAMPS_SMART_EEB, RAMPS_DUO_EEB, RAMPS4DUE_EEB) - #define FET_ORDER_EEB 1 -#elif MB(RAMPS_13_EFF, RAMPS_14_EFF, RAMPS_PLUS_EFF, RAMPS_14_RE_ARM_EFF, RAMPS_SMART_EFF, RAMPS_DUO_EFF, RAMPS4DUE_EFF) - #define FET_ORDER_EFF 1 -#elif MB(RAMPS_13_EEF, RAMPS_14_EEF, RAMPS_PLUS_EEF, RAMPS_14_RE_ARM_EEF, RAMPS_SMART_EEF, RAMPS_DUO_EEF, RAMPS4DUE_EEF) - #define FET_ORDER_EEF 1 -#elif MB(RAMPS_13_SF, RAMPS_14_SF, RAMPS_PLUS_SF, RAMPS_14_RE_ARM_SF, RAMPS_SMART_SF, RAMPS_DUO_SF, RAMPS4DUE_SF) || EITHER(SPINDLE_FEATURE, LASER_FEATURE) - #define FET_ORDER_SF 1 -#elif HAS_MULTI_HOTEND && TEMP_SENSOR_BED - #define FET_ORDER_EEB 1 -#elif HAS_MULTI_HOTEND - #define FET_ORDER_EEF 1 -#elif TEMP_SENSOR_BED - #define FET_ORDER_EFB 1 -#else - #define FET_ORDER_EFF 1 +#if NONE(FET_ORDER_EEF, FET_ORDER_EEB, FET_ORDER_EFF, FET_ORDER_EFB, FET_ORDER_SF) + #if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB) + #define FET_ORDER_EFB 1 + #elif MB(RAMPS_13_EEB, RAMPS_14_EEB, RAMPS_PLUS_EEB, RAMPS_14_RE_ARM_EEB, RAMPS_SMART_EEB, RAMPS_DUO_EEB, RAMPS4DUE_EEB) + #define FET_ORDER_EEB 1 + #elif MB(RAMPS_13_EFF, RAMPS_14_EFF, RAMPS_PLUS_EFF, RAMPS_14_RE_ARM_EFF, RAMPS_SMART_EFF, RAMPS_DUO_EFF, RAMPS4DUE_EFF) + #define FET_ORDER_EFF 1 + #elif MB(RAMPS_13_EEF, RAMPS_14_EEF, RAMPS_PLUS_EEF, RAMPS_14_RE_ARM_EEF, RAMPS_SMART_EEF, RAMPS_DUO_EEF, RAMPS4DUE_EEF) + #define FET_ORDER_EEF 1 + #elif MB(RAMPS_13_SF, RAMPS_14_SF, RAMPS_PLUS_SF, RAMPS_14_RE_ARM_SF, RAMPS_SMART_SF, RAMPS_DUO_SF, RAMPS4DUE_SF) + #define FET_ORDER_SF 1 + #elif HAS_MULTI_HOTEND || (HAS_EXTRUDERS && HAS_CUTTER) + #if TEMP_SENSOR_BED + #define FET_ORDER_EEB 1 + #else + #define FET_ORDER_EEF 1 + #endif + #elif TEMP_SENSOR_BED + #define FET_ORDER_EFB 1 + #else + #define FET_ORDER_EFF 1 + #endif #endif #if !(BOTH(IS_ULTRA_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, WYH_L12864, MINIPANEL, REPRAPWORLD_KEYPAD)) diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index fe8c4c6c41..aa1def0b40 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -477,7 +477,7 @@ #endif #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #ifdef I_STOP_PIN #if I_HOME_TO_MIN #define I_MIN_PIN I_STOP_PIN @@ -500,7 +500,7 @@ #undef I_MAX_PIN #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #ifdef J_STOP_PIN #if J_HOME_TO_MIN #define J_MIN_PIN J_STOP_PIN @@ -523,7 +523,7 @@ #undef J_MAX_PIN #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #ifdef K_STOP_PIN #if K_HOME_TO_MIN #define K_MIN_PIN K_STOP_PIN @@ -1027,12 +1027,12 @@ #endif // The I axis, if any, should be the next open extruder port -#if LINEAR_AXES >= 4 && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN) +#if HAS_I_AXIS && !defined(I_DIAG_PIN) && !defined(I_STEP_PIN) && !PIN_EXISTS(I_CS_PIN) #define J_E_INDEX INCREMENT(I_E_INDEX) #else #define J_E_INDEX I_E_INDEX #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #ifndef I_STEP_PIN #define I_STEP_PIN _EPIN(I_E_INDEX, STEP) #define I_DIR_PIN _EPIN(I_E_INDEX, DIR) @@ -1112,12 +1112,12 @@ #endif // The J axis, if any, should be the next open extruder port -#if LINEAR_AXES >= 5 && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN) +#if HAS_J_AXIS && !defined(J_DIAG_PIN) && !defined(J_STEP_PIN) && !PIN_EXISTS(J_CS_PIN) #define K_E_INDEX INCREMENT(J_E_INDEX) #else #define K_E_INDEX J_E_INDEX #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #ifndef J_STEP_PIN #define J_STEP_PIN _EPIN(J_E_INDEX, STEP) #define J_DIR_PIN _EPIN(J_E_INDEX, DIR) @@ -1197,7 +1197,7 @@ #endif // The K axis, if any, should be the next open extruder port -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #ifndef K_STEP_PIN #define K_STEP_PIN _EPIN(K_E_INDEX, STEP) #define K_DIR_PIN _EPIN(K_E_INDEX, DIR) diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 45c09ae33e..165475dae8 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -55,7 +55,6 @@ #define X_MIN_PIN 12 // X- #define Y_MIN_PIN 11 // Y- - #define Z_MIN_PIN 10 // Z- #define X_MAX_PIN 81 // X+ #define Y_MAX_PIN 57 // Y+ @@ -78,15 +77,16 @@ #endif #if ENABLED(BLTOUCH) - #define Z_MIN_PIN 11 // Y-MIN - #define SERVO0_PIN 10 // Z-MIN - #else - #define Z_MIN_PIN 10 + #define Z_MIN_PIN 11 // Y- + #define SERVO0_PIN 10 // Z- #endif #endif #define Z_MAX_PIN 7 +#ifndef Z_MIN_PIN 7 + #define Z_MIN_PIN 10 // Z- +#endif // // Z Probe (when not Z_MIN_PIN) diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 4742ac9b0d..5f373f99d7 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -89,7 +89,7 @@ * BLUE_LED | 8 7 | RED_LED ENCBTN | 8 7 | SDCS * KILL 6 5 | BEEPER 6 5 | MOSI * A0 | 4 3 | LCD_CS SDCD | 4 3 | - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 4697ff61b2..121fb1b045 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -461,7 +461,7 @@ * D17 | 8 7 | D16 D31 | 8 7 | D53 * D23 6 5 D25 D33 6 5 D51 (MOSI) * D27 | 4 3 | D29 D49 | 4 3 | D41 - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ @@ -803,13 +803,13 @@ * FYSETC TFT-81050 display pinout * * Board Display - * ----- ----- - * (SCK) D52 | 1 2 | D50 (MISO) MISO | 1 2 | SCK - * (SD_CS) D53 | 3 4 | D33 (BNT_EN2) (BNT_EN2) MOD_RESET | 3 4 | SD_CS - * (MOSI) D51 | 5 6 D31 (BNT_EN1) (BNT_EN1) LCD_CS | 5 6 MOSI - * RESET | 7 8 | D49 (SD_DET) SD_DET | 7 8 | RESET - * NC | 9 10| GND GND | 9 10| 5V - * ----- ----- + * ------ ------ + * GND |10 9 | -- 5V |10 9 | GND + * (SD_DET) 49 | 8 7 | RESET RESET | 8 7 | (SD_DET) + * (BTN_EN1) 31 6 5 | 51 (MOSI) (MOSI) 6 5 | (LCD_CS) + * (BTN_EN2) 33 | 4 3 | 53 (SD_CS) (SD_CS) | 4 3 | (MOD_RESET) + * (MISO) 50 | 2 1 | 52 (SCK) (SCK) | 2 1 | (MISO) + * ------ ------ * EXP2 EXP1 * * Needs custom cable: diff --git a/Marlin/src/pins/ramps/pins_TT_OSCAR.h b/Marlin/src/pins/ramps/pins_TT_OSCAR.h index 01769fbff0..a07892914e 100644 --- a/Marlin/src/pins/ramps/pins_TT_OSCAR.h +++ b/Marlin/src/pins/ramps/pins_TT_OSCAR.h @@ -226,7 +226,7 @@ // // M3/M4/M5 - Spindle/Laser Control // -#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) && !PIN_EXISTS(SPINDLE_LASER_ENA) +#if HAS_CUTTER && !PIN_EXISTS(SPINDLE_LASER_ENA) #if !NUM_SERVOS // Prefer the servo connector #define SPINDLE_LASER_ENA_PIN 4 // Pullup or pulldown! #define SPINDLE_LASER_PWM_PIN 6 // Hardware PWM diff --git a/Marlin/src/pins/sam/pins_RADDS.h b/Marlin/src/pins/sam/pins_RADDS.h index 7a865b4ad8..da176f4447 100644 --- a/Marlin/src/pins/sam/pins_RADDS.h +++ b/Marlin/src/pins/sam/pins_RADDS.h @@ -286,7 +286,7 @@ #endif // SPARK_FULL_GRAPHICS #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #define BTN_ENC_EN 47 // Detect the presence of the encoder #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h index 65ecd37e62..4bdadd8082 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_11.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_11.h @@ -117,10 +117,6 @@ //#define E3_MS2_PIN ? //#define E3_MS3_PIN ? -#if USES_Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 49 -#endif - #ifndef FIL_RUNOUT_PIN #define FIL_RUNOUT_PIN Y_MIN_PIN #endif diff --git a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h index 76a2d5a398..5273cbcd0e 100644 --- a/Marlin/src/pins/sam/pins_RURAMPS4D_13.h +++ b/Marlin/src/pins/sam/pins_RURAMPS4D_13.h @@ -53,13 +53,6 @@ #define Z_MIN_PIN 47 #define Z_MAX_PIN 43 -// -// Z Probe (when not Z_MIN_PIN) -// -#ifndef Z_MIN_PROBE_PIN - #define Z_MIN_PROBE_PIN 49 -#endif - // // Steppers // @@ -105,7 +98,7 @@ #define E2_CS_PIN 61 #endif -#if USES_Z_MIN_PROBE_PIN +#ifndef Z_MIN_PROBE_PIN #define Z_MIN_PROBE_PIN 49 #endif diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index 02f4a6e985..ba9cc350a8 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -135,7 +135,7 @@ #define LCD_BACKLIGHT_PIN 17 // LCD backlight LED #endif -#if NONE(SPINDLE_FEATURE, LASER_FEATURE) && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // try to use IO Header +#if !HAS_CUTTER && ENABLED(SANGUINOLOLU_V_1_2) && !BOTH(IS_ULTRA_LCD, IS_NEWPANEL) // try to use IO Header #define CASE_LIGHT_PIN 4 // Hardware PWM - see if IO Header is available #endif diff --git a/Marlin/src/pins/sensitive_pins.h b/Marlin/src/pins/sensitive_pins.h index 5f2bd0467e..f9911cc863 100644 --- a/Marlin/src/pins/sensitive_pins.h +++ b/Marlin/src/pins/sensitive_pins.h @@ -155,7 +155,7 @@ #endif -#if LINEAR_AXES >= 4 +#if HAS_I_AXIS #if PIN_EXISTS(I_MIN) #define _I_MIN I_MIN_PIN, @@ -201,7 +201,7 @@ #endif -#if LINEAR_AXES >= 5 +#if HAS_J_AXIS #if PIN_EXISTS(J_MIN) #define _J_MIN J_MIN_PIN, @@ -247,7 +247,7 @@ #endif -#if LINEAR_AXES >= 6 +#if HAS_K_AXIS #if PIN_EXISTS(K_MIN) #define _K_MIN K_MIN_PIN, diff --git a/Marlin/src/pins/stm32f1/pins_BEAST.h b/Marlin/src/pins/stm32f1/pins_BEAST.h index 2ace47822e..d494b29c14 100644 --- a/Marlin/src/pins/stm32f1/pins_BEAST.h +++ b/Marlin/src/pins/stm32f1/pins_BEAST.h @@ -93,7 +93,7 @@ #define FAN_PIN PB10 #endif -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Temperature Sensors diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h index 570d102c47..7b8abb1300 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_CR6.h @@ -113,7 +113,7 @@ #define HEATER_BED_PIN PC9 // HOT BED #define FAN_PIN PC6 // FAN -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED #define CONTROLLER_FAN_PIN PC7 diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index dae43d3c13..704501de10 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -156,14 +156,14 @@ #define USB_CONNECT_INVERTING false /** - * ----- - * 5V | 1 2 | GND - * (LCD_EN) PB7 | 3 4 | PB8 (LCD_RS) - * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) - * RESET | 7 8 | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | 9 10| PA15 (BEEPER) - * ----- - * EXP1 + * ------ + * (BEEPER) PA15 |10 9 | PB6 (BTN_ENC) + * (BTN_EN1) PA9 | 8 7 | RESET + * (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) + * (LCD_RS) PB8 | 4 3 | PB7 (LCD_EN) + * GND | 2 1 | 5V + * ------ + * EXP1 */ #if HAS_WIRED_LCD @@ -195,13 +195,13 @@ #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) /** Creality Ender-2 display pinout - * ----- - * 5V | 1 2 | GND - * (MOSI) PB7 | 3 4 | PB8 (LCD_RS) - * (LCD_A0) PB9 | 5 6 PA10 (BTN_EN2) - * RESET | 7 8 | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | 9 10| PA15 (SCK) - * ----- + * ------ + * (SCK) PA15 |10 9 | PB6 (BTN_ENC) + * (BTN_EN1) PA9 | 8 7 | RESET + * (BTN_EN2) PA10 6 5 | PB9 (LCD_A0) + * (LCD_RS) PB8 | 4 3 | PB7 (MOSI) + * GND | 2 1 | 5V + * ------ * EXP1 */ @@ -228,15 +228,15 @@ /** FYSETC TFT TFT81050 display pinout * - * Board Display - * ----- ----- - * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10) - * (FREE) PB9 | 5 6 PA10 (SD_CS) (PB8) LCD_CS | 5 6 MOSI (SPI1-MOSI) - * RESET | 7 8 | PA9 (MOD_RESET) (PA15) SD_DET | 7 8 | RESET - * (BEEPER) PB6 | 9 10| PA15 (SD_DET) GND | 9 10| 5V - * ----- ----- - * EXP1 EXP1 + * Board Display + * ------ ------ + * (SD_DET) PA15 |10 9 | PB6 (BEEPER) 5V |10 9 | GND + * (MOD_RESET) PA9 | 8 7 | RESET (RESET) | 8 7 | (SD_DET) + * (SD_CS) PA10 6 5 | PB9 (MOSI) 6 5 | (LCD_CS) + * (LCD_CS) PB8 | 4 3 | PB7 (SD_CS) | 4 3 | (MOD_RESET) + * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP1 EXP1 * * Needs custom cable: * diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 8c8043be8b..bbf38e414f 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -120,11 +120,11 @@ /** * SKR Mini E3 V1.0, V1.2 SKR Mini E3 V2.0 * ------ ------ - * 5V | 1 2 | GND 5V | 1 2 | GND - * (LCD_EN) PB7 | 3 4 | PB8 (LCD_RS) (LCD_EN) PB15 | 3 4 | PB8 (LCD_RS) - * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) - * RESET | 7 8 | PA9 (BTN_EN1) RESET | 7 8 | PA9 (BTN_EN1) - * (BTN_ENC) PB6 | 9 10 | PB5 (BEEPER) (BTN_ENC) PA15 | 9 10 | PB5 (BEEPER) + * (BEEPER) PB5 |10 9 | PB6 (BTN_ENC) (BEEPER) PB5 |10 9 | PA15 (BTN_ENC) + * (BTN_EN1) PA9 | 8 7 | RESET (BTN_EN1) PA9 | 8 7 | RESET + * (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) + * (LCD_RS) PB8 | 4 3 | PB7 (LCD_EN) (LCD_RS) PB8 | 4 3 | PB15 (LCD_EN) + * GND | 2 1 | 5V GND | 2 1 | 5V * ------ ------ * EXP1 EXP1 */ @@ -138,14 +138,14 @@ #if EITHER(HAS_DWIN_E3V2, IS_DWIN_MARLINUI) /** - * ------ ------ ------ - * VCC | 1 2 | GND VCC | 1 2 | GND GND | 2 1 | VCC - * A | 3 4 | B A | 3 4 | B B | 4 3 | A - * | 5 6 TX BEEP | 5 6 ENT ENT | 6 5 | BEEP - * | 7 8 | RX TX | 7 8 | RX RX | 8 7 | TX - * BEEP | 9 10 | ENT | 9 10 | | 10 9 | - * ------ ------ ------ - * EXP1 DWIN DWIN (plug) + * ------ ------ ------ + * (ENT) |10 9 | (BEEP) |10 9 | |10 9 | + * (RX) | 8 7 | (RX) | 8 7 | (TX) RX | 8 7 | TX + * (TX) 6 5 | (ENT) 6 5 | (BEEP) ENT | 6 5 | BEEP + * (B) | 4 3 | (A) (B) | 4 3 | (A) B | 4 3 | A + * GND | 2 1 | (VCC) GND | 2 1 | VCC GND | 2 1 | VCC + * ------ ------ ------ + * EXP1 DWIN DWIN (plug) * * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ @@ -206,15 +206,15 @@ /** * TFTGLCD_PANEL_SPI display pinout * - * Board Display - * ------ ------ - * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) LCD_CS | 3 4 | SD_CS (PA10) - * (FREE) PB9 | 5 6 | PA10 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI) - * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE) - * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V - * ------ ------ - * EXP1 EXP1 + * Board Display + * ------ ------ + * (SD_DET) PB5 |10 9 | PB6 (BEEPER) 5V |10 9 | GND + * (MOD_RESET) PA9 | 8 7 | RESET -- | 8 7 | (SD_DET) + * (SD_CS) PA10 6 5 | PB9 (MOSI) | 6 5 | -- + * (LCD_CS) PB8 | 4 3 | PB7 (SD_CS) | 4 3 | (LCD_CS) + * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP1 EXP1 * * Needs custom cable: * @@ -249,15 +249,15 @@ /** * FYSETC TFT TFT81050 display pinout * - * Board Display - * ------ ------ - * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10) - * (FREE) PB9 | 5 6 | PA10 (SD_CS) (PB8) LCD_CS | 5 6 | MOSI (SPI1-MOSI) - * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | RESET - * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V - * ------ ------ - * EXP1 EXP1 + * Board Display + * ------ ------ + * (SD_DET) PB5 |10 9 | PB6 (BEEPER) 5V |10 9 | GND + * (MOD_RESET) PA9 | 8 7 | RESET (RESET) | 8 7 | (SD_DET) + * (SD_CS) PA10 6 5 | PB9 (MOSI) | 6 5 | (LCD_CS) + * (LCD_CS) PB8 | 4 3 | PB7 (SD_CS) | 4 3 | (MOD_RESET) + * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP1 EXP1 * * Needs custom cable: * 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 a6cc5ffa60..a92de805f7 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 @@ -98,7 +98,7 @@ * (LCD_EN) PB6 | 8 7 | PC12 (LCD_RS) (BTN_EN1) PD2 | 8 7 | PA15 (SD_SS) * (LCD_D4) PC13 6 5 | PB7 (LCD_D5) (BTN_EN2) PB8 6 5 | PB5 (MOSI) * (LCD_D6) PC15 | 4 3 | PC14 (LCD_D7) (SD_DETECT) PB9 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 2d33fb9f2c..7d30d6efad 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -87,7 +87,7 @@ #define FAN_PIN PG14 // MAIN BOARD FAN #endif -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Temperature Sensors diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index bf2a55fc7b..cb7e784751 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -143,9 +143,7 @@ #ifndef FAN_PIN #define FAN_PIN PA0 // FAN #endif -#if PIN_EXISTS(FAN) - #define FAN_SOFT_PWM -#endif +#define FAN_SOFT_PWM_REQUIRED // // SD Card diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h index ae54805a94..4941949f81 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4210.h @@ -144,7 +144,7 @@ #define HEATER_BED_PIN PA1 // HOT BED #define FAN_PIN PA2 // FAN -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // SD Card @@ -167,7 +167,7 @@ * PB10 | 8 7 | PE8 * PB14 6 5 | PB13 * PB12 | 4 3 | PB15 - * GND | 2 1 | 5V + * GND | 2 1 | 5V * ------ * EXP1 */ @@ -191,7 +191,7 @@ * PB10 | 8 7 | ? * PA6 6 5 | PA5 * PA4 | 4 3 | PA7 - * GND | 2 1 | 5V + * GND | 2 1 | 5V * ------ * EXP1 */ diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h index 023fca21ce..85d279872d 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V45x.h @@ -97,7 +97,7 @@ // Heaters / Fans // -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // SD Card diff --git a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h index fea5b00b50..0682bfd736 100644 --- a/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_ERYONE_ERY32_MINI.h @@ -38,10 +38,9 @@ //#define DISABLE_DEBUG #define DISABLE_JTAG //#define ENABLE_SPI3 -#define FLASH_EEPROM_EMULATION -#define FAN_SOFT_PWM -#if ENABLED(FLASH_EEPROM_EMULATION) +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION #define EEPROM_PAGE_SIZE (0x800U) // 2KB #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL) #define MARLIN_EEPROM_SIZE (EEPROM_PAGE_SIZE) @@ -118,6 +117,8 @@ #endif #endif +#define FAN_SOFT_PWM_REQUIRED + // // Misc. Functions // diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index e4c741eae7..5468d0b4bd 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -30,10 +30,12 @@ // // Flash EEPROM Emulation // -#define FLASH_EEPROM_EMULATION -#define EEPROM_PAGE_SIZE 0x800 // 2KB -#define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space -#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION) + #define FLASH_EEPROM_EMULATION + #define EEPROM_PAGE_SIZE 0x800 // 2KB + #define EEPROM_START_ADDRESS (0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE) // 256K firmware space + #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE +#endif // // Servos @@ -123,9 +125,9 @@ /** ------ ------ * (BEEPER) PC14 |10 9 | PC13 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SD_SCK) * (LCD_EN) PB9 | 8 7 | PB8 (LCD_RS) (BTN_EN1) PB3 | 8 7 | PB12 (SD_CS2) - * (LCD_D4) PB7 | 6 5 PB6 (LCD_D5) (BTN_EN2) PD2 | 6 5 PB15 (SD_MOSI) + * (LCD_D4) PB7 6 5 | PB6 (LCD_D5) (BTN_EN2) PD2 6 5 | PB15 (SD_MOSI) * (LCD_D6) PB5 | 4 3 | PB4 (LCD_D7) (SD_DETECT) PB11 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 15c6955a83..59fdc4a3c9 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -89,14 +89,19 @@ #define HEATER_BED_PIN PA8 // pin 67 (Hot Bed Mosfet) #define FAN_PIN PA15 // pin 77 (4cm Fan) -#ifdef MAPLE_STM32F1 - #define FAN_SOFT_PWM // Required to avoid issues with heating or STLink - #define FAN_MIN_PWM 35 // Fan will not start in 1-30 range - #define FAN_MAX_PWM 255 + +#if TERN(MAPLE_STM32F1, ENABLED(FAN_SOFT_PWM), ENABLED(FAST_PWM_FAN)) && FAN_MIN_PWM < 5 // Required to avoid issues with heating or STLink + #error "FAN_MIN_PWM must be 5 or higher." // Fan will not start in 1-30 range +#endif + +#if defined(MAPLE_STM32F1) || DISABLED(FAST_PWM_FAN) // STM32 HAL required to allow TIMER2 Hardware PWM + #define FAN_SOFT_PWM_REQUIRED #else - #define FAST_PWM_FAN // STM32 Variant allow TIMER2 Hardware PWM - #define FAN_MIN_PWM 5 - #define FAN_MAX_PWM 255 + #if FAST_PWM_FAN_FREQUENCY <= 1000 // Default 1000 is noisy, max 65K (uint16) + #error "FAST_PWM_FAN_FREQUENCY must be greater than 1000." + #elif FAST_PWM_FAN_FREQUENCY > 65535 + #error "FAST_PWM_FAN_FREQUENCY must be less than 65536." + #endif #endif //#define BEEPER_PIN PD13 // pin 60 (Servo PWM output 5V/GND on Board V0G+) made for BL-Touch sensor diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index e02d1db786..b0303861c9 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -145,7 +145,7 @@ * (LCD_EN) PA4 | 8 7 | PA5 (LCD_RS) (BTN_EN1) PB11 | 8 7 | PA15 (SD_SS) (BTN_EN1) PB11 | 8 7 | RESET * (LCD_D4) PA6 6 5 | PA7 (LCD_D5) (BTN_EN2) PB0 6 5 | PB15 (SD_MOSI) (BTN_EN2) PB0 6 5 | PA6 (LCD_D4) * (LCD_D6) PC4 | 4 3 | PC5 (LCD_D7) (SD_DETECT) PC10 | 4 3 | RESET (LCD_RS) PA5 | 4 3 | PA4 (LCD_EN) - * GND | 2 1 | 5V GND | 2 1 | NC GND | 2 1 | 5V + * GND | 2 1 | 5V GND | 2 1 | -- GND | 2 1 | 5V * ------ ------ ------ * EXP1 EXP2 "Ender-3 EXP1" */ diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index 7171de919d..e189fc3f97 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -91,7 +91,7 @@ #endif #define FAN1_PIN PD13 -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Temperature Sensors diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index bf38955127..6c7e7cbbfa 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -45,7 +45,9 @@ // // EEPROM // -#define FLASH_EEPROM_EMULATION +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION +#endif #if ENABLED(FLASH_EEPROM_EMULATION) // SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h) #define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE) diff --git a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h index eb3af65f32..43aefe97f5 100644 --- a/Marlin/src/pins/stm32f4/pins_ANET_ET4.h +++ b/Marlin/src/pins/stm32f4/pins_ANET_ET4.h @@ -203,19 +203,12 @@ #if ENABLED(SDSUPPORT) - #define SDIO_D0_PIN PC8 - #define SDIO_D1_PIN PC9 - #define SDIO_D2_PIN PC10 - #define SDIO_D3_PIN PC11 - #define SDIO_CK_PIN PC12 - #define SDIO_CMD_PIN PD2 - #if DISABLED(SDIO_SUPPORT) #define SOFTWARE_SPI - #define SDSS SDIO_D3_PIN - #define SD_SCK_PIN SDIO_CK_PIN - #define SD_MISO_PIN SDIO_D0_PIN - #define SD_MOSI_PIN SDIO_CMD_PIN + #define SDSS PC11 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 #endif #ifndef SD_DETECT_PIN diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h index 4cf9768fbe..6d5928e86d 100644 --- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h +++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h @@ -29,8 +29,10 @@ #define BOARD_INFO_NAME "Artillery Ruby" -#define FLASH_EEPROM_EMULATION -//#define I2C_EEPROM +#if NO_EEPROM_SELECTED + #define FLASH_EEPROM_EMULATION + //#define I2C_EEPROM +#endif //#define E2END 0xFFF // 4KB #define HAL_TIMER_RATE F_CPU diff --git a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h index d8a83bef3a..061680aa79 100644 --- a/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h +++ b/Marlin/src/pins/stm32f4/pins_BLACK_STM32F407VE.h @@ -140,25 +140,17 @@ // // Onboard SD support // -#define SDIO_D0_PIN PC8 -#define SDIO_D1_PIN PC9 -#define SDIO_D2_PIN PC10 -#define SDIO_D3_PIN PC11 -#define SDIO_CK_PIN PC12 -#define SDIO_CMD_PIN PD2 - #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif #if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD - - #ifndef SDIO_SUPPORT + #if DISABLED(SDIO_SUPPORT) #define SOFTWARE_SPI // Use soft SPI for onboard SD - #define SDSS SDIO_D3_PIN - #define SD_SCK_PIN SDIO_CK_PIN - #define SD_MISO_PIN SDIO_D0_PIN - #define SD_MOSI_PIN SDIO_CMD_PIN + #define SDSS PC11 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 #endif #endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h index 653ebd82a1..99de2e43e7 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -197,16 +197,16 @@ #endif /** - * -----------------------------------BTT002 V1.0---------------------------------------- - * ------ ------ | - * PA3 | 1 2 | GND 5V | 1 2 | GND | - * NRESET | 3 4 | PC4 (SD_DET) (LCD_D7) PE13 | 3 4 | PE12 (LCD_D6) | - * (MOSI) PA7 | 5 6 | PB0 (BTN_EN2) (LCD_D5) PE11 | 5 6 | PE10 (LCD_D4) | - * (SD_SS) PA4 | 7 8 | PC5 (BTN_EN1) (LCD_RS) PE8 | 7 8 | PE9 (LCD_EN) | - * (SCK) PA5 | 9 10 | PA6 (MISO) (BTN_ENC) PB1 | 9 10 | PE7 (BEEPER) | - * ------ ------ | - * EXP2 EXP1 | - * -------------------------------------------------------------------------------------- + * ---------------------------------BTT002 V1.0--------------------------------- + * ------ ------ | + * (BEEPER) PE7 |10 9 | PB1 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) | + * (LCD_EN) PE9 | 8 7 | PE8 (LCD_RS) (BTN_EN1) PC5 | 8 7 | PA4 (SD_SS) | + * (LCD_D4) PE10 6 5 | PE11 (LCD_D5) (BTN_EN2) PB0 6 5 | PA7 (MOSI) | + * (LCD_D6) PE12 | 4 3 | PE13 (LCD_D7) (SD_DET) PC4 | 4 3 | RESET | + * GND | 2 1 | 5V GND | 2 1 | PA3 | + * ------ ------ | + * EXP1 EXP2 | + * ------------------------------------------------------------------------------ */ #define EXP1_03_PIN PE13 #define EXP1_04_PIN PE12 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index d1f38f5c80..554b2704c7 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -184,24 +184,24 @@ #endif /** - * BTT E3 RRF - * ----- - * 5V | 1 2 | GND - * (LCD_EN) PE11 | 3 4 | PB1 (LCD_RS) - * (LCD_D4) PE10 | 5 6 PB2 (BTN_EN2) - * RESET | 7 8 | PE7 (BTN_EN1) - * (BTN_ENC) PE9 | 9 10| PE8 (BEEPER) - * ----- + * BTT E3 RRF + * ------ + * (BEEPER) PE8 |10 9 | PE9 (BTN_ENC) + * (BTN_EN1) PE7 | 8 7 | RESET + * (BTN_EN2) PB2 6 5 | PE10 (LCD_D4) + * (LCD_RS) PB1 | 4 3 | PE11 (LCD_EN) + * GND | 2 1 | 5V + * ------ * EXP1 */ #if HAS_WIRED_LCD - #if ENABLED(CR10_STOCKDISPLAY) + #if EITHER(CR10_STOCKDISPLAY, LCD_FOR_MELZI) #define BEEPER_PIN PE8 - #define BTN_ENC PE9 + #define BTN_ENC PE9 #define BTN_EN1 PE7 #define BTN_EN2 PB2 @@ -209,6 +209,40 @@ #define LCD_PINS_ENABLE PE11 #define LCD_PINS_D4 PE10 + #if ENABLED(LCD_FOR_MELZI) + + #error "CAUTION! LCD_FOR_MELZI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. Comment out this line to continue." + + /** LCD_FOR_MELZI display pinout + * + * BTT E3 RRF Display Ribbon + * ------ ------ + * (BEEPER) PE8 |10 9 | PE9 (BTN_ENC) GND |10 9 | 5V + * (BTN_EN1) PE7 | 8 7 | RESET BEEPER | 8 7 | ESTOP (RESET) + * (BTN_EN2) PB2 6 5 | PE10 (LCD_D4) (BTN_ENC) ENC_BTN | 6 5 | LCD_SCLK (LCD_D4) + * (LCD_RS) PB1 | 4 3 | PE11 (LCD_EN) (BTN_EN2) ENC_A | 4 3 | LCD_DATA (LCD_EN) + * GND | 2 1 | 5V (BTN_EN1) ENC_B | 2 1 | LCD_CS (LCD_RS) + * ------ ------ + * EXP1 Ribbon + * + * Needs custom cable: + * + * Board Adapter Display Ribbon (coming from display) + * + * EXP1-1 ----------- EXP1-9 + * EXP1-2 ----------- EXP1-10 + * EXP1-3 ----------- EXP1-3 + * EXP1-4 ----------- EXP1-1 + * EXP1-5 ----------- EXP1-5 + * EXP1-6 ----------- EXP1-4 + * EXP1-7 ----------- EXP1-7 + * EXP1-8 ----------- EXP1-8 + * EXP1-9 ----------- EXP1-6 + * EXP1-10 ----------- EXP1-8 + */ + + #endif + #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. Comment out this line to continue." @@ -244,15 +278,15 @@ /** * TFTGLCD_PANEL_SPI display pinout * - * Board Display - * ----- ----- - * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PE11 | 3 4 | PB1 (LCD_CS) (PE7) LCD_CS | 3 4 | SD_CS (PB2) - * (FREE) PE10 | 5 6 | PB2 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI) - * RESET | 7 8 | PE7 (MOD_RESET) (PE8) SD_DET | 7 8 | (FREE) - * (BEEPER) PE9 | 9 10| PE8 (SD_DET) GND | 9 10| 5V - * ----- ----- - * EXP1 EXP1 + * Board Display + * ------ ------ + * (SD_DET) PE8 |10 9 | PE9 (BEEPER) 5V |10 9 | GND + * (MOD_RESET) PE7 | 8 7 | RESET -- | 8 7 | (SD_DET) + * (SD_CS) PB2 6 5 | PE10 (MOSI) 6 5 | -- + * (LCD_CS) PB1 | 4 3 | PE11 (SD_CS) | 4 3 | (LCD_CS) + * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP1 EXP1 * * Needs custom cable: * @@ -275,11 +309,15 @@ #endif #else - #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BTT_E3_RRF." + #error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, LCD_FOR_MELZI, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BTT_E3_RRF." #endif // Alter timing for graphical display - #if IS_U8GLIB_ST7920 + #if ENABLED(LCD_FOR_MELZI) // LCD_FOR_MELZI default timing is too fast. This works but may be reduced. + #define BOARD_ST7920_DELAY_1 200 + #define BOARD_ST7920_DELAY_2 400 + #define BOARD_ST7920_DELAY_3 1200 + #elif IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 600 @@ -293,20 +331,20 @@ /** FYSETC TFT TFT81050 display pinout * - * Board Display - * ----- ----- - * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PE11 | 3 4 | PB1 (LCD_CS) (PE7) MOD_RESET | 3 4 | SD_CS (PB2) - * (FREE) PE10 | 5 6 | PB2 (SD_CS) (PB1) LCD_CS | 5 6 | MOSI (SPI1-MOSI) - * RESET | 7 8 | PE7 (MOD_RESET) (PE8) SD_DET | 7 8 | RESET - * (BEEPER) PE9 | 9 10| PE8 (SD_DET) GND | 9 10| 5V - * ----- ----- - * EXP1 EXP1 + * Board Display + * ------ ------ + * (SD_DET) PE8 |10 9 | PE9 (BEEPER) 5V |10 9 | GND + * (MOD_RESET) PE7 | 8 7 | RESET RESET | 8 7 | (SD_DET) + * (SD_CS) PB2 6 5 | PE10 (MOSI) | 6 5 | (LCD_CS) + * (LCD_CS) PB1 | 4 3 | PE11 (SD_CS) | 4 3 | (MOD_RESET) + * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP1 EXP1 * * Needs custom cable: * * Board Adapter Display - * _________ + * * EXP1-1 ----------- EXP1-10 * EXP1-2 ----------- EXP1-9 * SPI1-4 ----------- EXP1-6 @@ -338,13 +376,6 @@ #if SD_CONNECTION_IS(ONBOARD) #define SDIO_SUPPORT // Use SDIO for onboard SD - #define SDIO_D0_PIN PC8 - #define SDIO_D1_PIN PC9 - #define SDIO_D2_PIN PC10 - #define SDIO_D3_PIN PC11 - #define SDIO_CK_PIN PC12 - #define SDIO_CMD_PIN PD2 - //#define SDIO_CLOCK 48000000 #define SD_DETECT_PIN PC4 #elif SD_CONNECTION_IS(CUSTOM_CABLE) 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 dfa9d8a7b9..7db6c4922e 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -365,14 +365,14 @@ #endif /** - * ------ ------ - * NC | 1 2 | GND 5V | 1 2 | GND - * RESET | 3 4 | PB10 (SD_DETECT) (LCD_D7) PG5 | 3 4 | PG6 (LCD_D6) - * (MOSI) PB15 | 5 6 | PH10 (BTN_EN2) (LCD_D5) PG7 | 5 6 | PG8 (LCD_D4) - * (SD_SS) PB12 | 7 8 | PD10 (BTN_EN1) (LCD_RS) PA8 | 7 8 | PC10 (LCD_EN) - * (SCK) PB13 | 9 10 | PB14 (MISO) (BTN_ENC) PA15 | 9 10 | PC11 (BEEPER) - * ------ ------ - * EXP2 EXP1 + * ------ ------ + * (BEEPER) PC11 |10 9 | PA15 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SCK) + * (LCD_EN) PC10 | 8 7 | PA8 (LCD_RS) (BTN_EN1) PD10 | 8 7 | PB12 (SD_SS) + * (LCD_D4) PG8 6 5 | PG7 (LCD_D5) (BTN_EN2) PH10 6 5 | PB15 (MOSI) + * (LCD_D6) PG6 | 4 3 | PG5 (LCD_D7) (SD_DETECT) PB10 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 */ #define EXP1_03_PIN PG5 #define EXP1_04_PIN PG6 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 9db0459be9..04a7d9e0b4 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -330,7 +330,7 @@ * (LCD_EN) PE9 | 8 7 | PE10 (LCD_RS) (BTN_EN1) PB2 | 8 7 | PA4 (SD_SS) * (LCD_D4) PE12 6 5 | PE13 (LCD_D5) (BTN_EN2) PB1 6 5 | PA7 (MOSI) * (LCD_D6) PE14 | 4 3 | PE15 (LCD_D7) (SD_DETECT) PC15 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ @@ -379,14 +379,14 @@ #if ENABLED(BTT_MOTOR_EXPANSION) /** - * ------ ------ - * NC | 1 2 | GND NC | 1 2 | GND - * NC | 3 4 | M1EN M2EN | 3 4 | M3EN - * M1STP | 5 6 M1DIR M1RX | 5 6 M1DIAG - * M2DIR | 7 8 | M2STP M2RX | 7 8 | M2DIAG - * M3DIR | 9 10 | M3STP M3RX | 9 10 | M3DIAG - * ------ ------ - * EXP2 EXP1 + * ------ ------ + * M3DIAG |10 9 | M3RX M3STP |10 9 | M3DIR + * M2DIAG | 8 7 | M2RX M2STP | 8 7 | M2DIR + * M1DIAG 6 5 | M1RX M1DIR 6 5 | M1STP + * M3EN | 4 3 | M2EN M1EN | 4 3 | -- + * GND | 2 1 | -- GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 */ // M1 on Driver Expansion Module @@ -534,9 +534,9 @@ * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) * 3.3V | 11 | | 6 | PB14 (ESP-MISO) * (ESP-IO0) PD7 | 12 | | 5 | PB13 (ESP-CLK) - * (ESP-IO4) PD10 | 13 | | 4 | NC - * NC | 14 | | 3 | PE15 (ESP-EN) - * (ESP-RX) PD8 | 15 | | 2 | NC + * (ESP-IO4) PD10 | 13 | | 4 | -- + * -- | 14 | | 3 | PE15 (ESP-EN) + * (ESP-RX) PD8 | 15 | | 2 | -- * (ESP-TX) PD9 | 16 | | 1 | PE14 (ESP-RST) * ------- * WIFI 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 1a1ac4ec21..5e424d4105 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -317,7 +317,7 @@ * (LCD_EN) PD11 | 8 7 | PD10 (LCD_RS) (BTN_EN1) PG10 | 8 7 | PB12 (SD_SS) * (LCD_D4) PG2 6 5 | PG3 (LCD_D5) (BTN_EN2) PF11 6 5 | PB15 (MOSI) * (LCD_D6) PG6 | 4 3 | PG7 (LCD_D7) (SD_DETECT) PF12 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ @@ -367,8 +367,8 @@ #if ENABLED(BTT_MOTOR_EXPANSION) /** ----- ----- - * NC | . . | GND NC | . . | GND - * NC | . . | M1EN M2EN | . . | M3EN + * -- | . . | GND -- | . . | GND + * -- | . . | M1EN M2EN | . . | M3EN * M1STP | . . M1DIR M1RX | . . M1DIAG * M2DIR | . . | M2STP M2RX | . . | M2DIAG * M3DIR | . . | M3STP M3RX | . . | M3DIAG @@ -466,13 +466,13 @@ * * The WYH_L12864 connector plug: * - * BEFORE AFTER - * ______ ______ - * GND | 1 2 | 5V 5V | 1 2 | GND - * CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2 - * SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1 - * SCK | 7 8 | BTN_ENC SCK | 7 8 | BTN_ENC - * MOSI | 9 10 | MOSI | 9 10 | + * BEFORE AFTER + * ------ ------ + * -- |10 9 | MOSI -- |10 9 | MOSI + * BTN_ENC | 8 7 | SCK BTN_ENC | 8 7 | SCK + * BTN_EN1 | 6 5 SID BTN_EN1 | 6 5 SID + * BTN_EN2 | 4 3 | CS BTN_EN2 | 4 3 | CS + * 5V | 2 1 | GND GND | 2 1 | 5V * ------ ------ * LCD LCD */ @@ -550,12 +550,12 @@ // /** - * ----- - * TX | 1 2 | GND Enable PG1 // Must be high for module to run - * Enable | 3 4 | GPIO2 Reset PG0 // active low, probably OK to leave floating - * Reset | 5 6 | GPIO0 GPIO2 PF15 // must be high (ESP3D software configures this with a pullup so OK to leave as floating) - * 3.3V | 7 8 | RX GPIO0 PF14 // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) - * ----- + * ------ + * RX | 8 7 | 3.3V GPIO0 PF14 ... Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating) + * GPIO0 | 6 5 | Reset GPIO2 PF15 ... must be high (ESP3D software configures this with a pullup so OK to leave as floating) + * GPIO2 | 4 3 | Enable Reset PG0 ... active low, probably OK to leave floating + * GND | 2 1 | TX Enable PG1 ... Must be high for module to run + * ------ * W1 */ #define ESP_WIFI_MODULE_COM 6 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this 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 196ca46319..4f5ed6c1b4 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 @@ -253,7 +253,7 @@ #define FAN_PIN PB7 // Fan0 #endif -#if EITHER(SPINDLE_FEATURE, LASER_FEATURE) +#if HAS_CUTTER #ifndef SPINDLE_LASER_PWM_PIN #define SPINDLE_LASER_PWM_PIN PB5 #endif @@ -333,14 +333,14 @@ #endif /** - * ------ ------ - * NC | 1 2 | GND 5V | 1 2 | GND - * RESET | 3 4 | PC4 (SD_DETECT) (LCD_D7) PE13 | 3 4 | PE12 (LCD_D6) - * (MOSI) PA7 | 5 6 PB2 (BTN_EN2) (LCD_D5) PE11 | 5 6 PE10 (LCD_D4) - * (SD_SS) PA4 | 7 8 | PE7 (BTN_EN1) (LCD_RS) PE9 | 7 8 | PB1 (LCD_EN) - * (SCK) PA5 | 9 10 | PA6 (MISO) (BTN_ENC) PB0 | 9 10 | PC5 (BEEPER) - * ------ ------ - * EXP2 EXP1 + * ------ ------ + * (BEEPER) PC5 |10 9 | PB0 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) + * (LCD_EN) PB1 | 8 7 | PE9 (LCD_RS) (BTN_EN1) PE7 | 8 7 | PA4 (SD_SS) + * (LCD_D4) PE10 | 6 5 PE11 (LCD_D5) (BTN_EN2) PB2 | 6 5 PA7 (MOSI) + * (LCD_D6) PE12 | 4 3 | PE13 (LCD_D7) (SD_DETECT) PC4 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | -- + * ------ ------ + * EXP1 EXP2 */ #define EXP1_03_PIN PE13 #define EXP1_04_PIN PE12 @@ -365,32 +365,22 @@ // Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2 // #if SD_CONNECTION_IS(LCD) - #define SDSS EXP2_07_PIN #define SD_SS_PIN SDSS #define SD_SCK_PIN EXP2_09_PIN #define SD_MISO_PIN EXP2_10_PIN #define SD_MOSI_PIN EXP2_05_PIN #define SD_DETECT_PIN EXP2_04_PIN - #elif SD_CONNECTION_IS(ONBOARD) - #define SDIO_SUPPORT // Use SDIO for onboard SD - #define SDIO_D0_PIN PC8 - #define SDIO_D1_PIN PC9 - #define SDIO_D2_PIN PC10 - #define SDIO_D3_PIN PC11 - #define SDIO_CK_PIN PC12 - #define SDIO_CMD_PIN PD2 - #elif SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif #if ENABLED(BTT_MOTOR_EXPANSION) /** ----- ----- - * NC | . . | GND NC | . . | GND - * NC | . . | M1EN M2EN | . . | M3EN + * -- | . . | GND -- | . . | GND + * -- | . . | M1EN M2EN | . . | M3EN * M1STP | . . M1DIR M1RX | . . M1DIAG * M2DIR | . . | M2STP M2RX | . . | M2DIAG * M3DIR | . . | M3STP M3RX | . . | M3DIAG @@ -572,9 +562,9 @@ * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI) * 3.3V | 11 | | 6 | PB14 (ESP-MISO) * (ESP-IO0) PB10 | 12 | | 5 | PB13 (ESP-CLK) - * (ESP-IO4) PB11 | 13 | | 4 | NC - * NC | 14 | | 3 | 3.3V (ESP-EN) - * (ESP-RX) PD8 | 15 | | 2 | NC + * (ESP-IO4) PB11 | 13 | | 4 | -- + * -- | 14 | | 3 | 3.3V (ESP-EN) + * (ESP-RX) PD8 | 15 | | 2 | -- * (ESP-TX) PD9 | 16 | | 1 | PC14 (ESP-RST) * ------- * WIFI diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index af316cf4b1..514fad4b89 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -181,7 +181,7 @@ * PE14 | 8 7 | PE12 PC5 | 8 7 | PF11 * PE10 6 5 | PE9 PC4 6 5 | PB15 * PE8 | 4 3 | PE7 PB2 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | NC + * GND | 2 1 | 5V GND | 2 1 | -- * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h index 054da62754..29aff20ffd 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h @@ -139,26 +139,26 @@ #endif /** - * ----- ----- - * 5V | 1 2 | GND 5V | 1 2 | GND - * RESET | 3 4 | PC3 (SD_DETECT) (LCD_D7) PB7 | 3 4 | PB6 (LCD_D6) - * (SD_MOSI) PA7 5 6 | PC11 (BTN_EN2) (LCD_D5) PB14 5 6 | PB13 (LCD_D4) - * (SD_SS) PA4 | 7 8 | PC10 (BTN_EN1) (LCD_RS) PB12 | 7 8 | PB15 (LCD_EN) - * (SD_SCK) PA5 | 9 10| PA6 (SD_MISO) (BTN_ENC) PC12 | 9 10| PC9 (BEEPER) - * ----- ----- - * EXP2 EXP1 + * ------ ------ + * (SD_MISO) PA6 |10 9 | PA5 (SD_SCK) (BEEPER) PC9 |10 9 | PC12 (BTN_ENC) + * (BTN_EN1) PC10 | 8 7 | PA4 (SD_SS) (LCD_EN) PB15 | 8 7 | PB12 (LCD_RS) + * (BTN_EN2) PC11 6 5 | PA7 (SD_MOSI) (LCD_D4) PB13 6 5 | PB14 (LCD_D5) + * (SD_DETECT) PC3 | 4 3 | RESET (LCD_D6) PB6 | 4 3 | PB7 (LCD_D7) + * GND | 2 1 | 5V GND | 2 1 | 5V + * ------ ------ + * EXP2 EXP1 */ /** -* ----- -* (BEEPER) PC9 | 1 2 | PC12 (BTN_ENC) -* (BTN_EN1) PC10 | 3 4 | PB14 (LCD_D5/MISO) -* (BTN_EN2) PC11 5 6 | PB13 (LCD_D4/SCK) -* (LCD_RS) PB12 | 7 8 | PB15 (LCD_EN/MOSI) -* GND | 9 10| 5V -* ----- -* EXP3 -*/ + * ------ + * 5V |10 9 | GND + * (LCD_EN/MOSI) PB15 | 8 7 | PB12 (LCD_RS) + * (LCD_D4/SCK) PB13 6 5 | PC11 (BTN_EN2) + * (LCD_D5/MISO) PB14 | 4 3 | PC10 (BTN_EN1) + * (BTN_ENC) PC12 | 2 1 | PC9 (BEEPER) + * ------ + * EXP3 + */ #define EXP1_03_PIN PB7 #define EXP1_04_PIN PB6 diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 85071034c2..0e0266f1a4 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -203,7 +203,7 @@ * PC11 | 8 7 | PD2 PC6 | 8 7 | PA4 * PC10 6 5 | PC12 PC7 6 5 | PA7 * PD0 | 4 3 | PD1 PB10 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 5V + * GND | 2 1 | 5V GND | 2 1 | 5V * ------ ------ * EXP1 EXP2 */ diff --git a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h index 8560a04375..a9828c5bda 100644 --- a/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h +++ b/Marlin/src/pins/stm32f4/pins_INDEX_REV03.h @@ -119,7 +119,7 @@ #define FAN2_PIN PE4 #define FAN3_PIN PE5 -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // Neopixel Rings #define NEOPIXEL_PIN PC7 diff --git a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h index 2f77c0f9d6..0e960a17e2 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_MONSTER8.h @@ -239,7 +239,7 @@ * (LCD_EN) PE11 | 8 7 | PD10 (LCD_RS) (BTN_EN1) PE9 | 8 7 | PA4 (SPI1 CS) * (LCD_D4) PD9 6 5 | PD8 (LCD_D5) (BTN_EN2) PE8 6 5 | PA7 (SPI1 MOSI) * (LCD_D6) PE15 | 4 3 | PE7 (LCD_D7) (SPI1_RS) PB11 | 4 3 | RESET - * GND | 2 1 | 5V GND | 2 1 | 3.3V + * GND | 2 1 | 5V GND | 2 1 | 3.3V * ------ ------ * EXP1 EXP2 */ @@ -261,25 +261,26 @@ #define EXP2_09_PIN PA5 #define EXP2_10_PIN PA6 -#ifndef SDCARD_CONNECTION - #define SDCARD_CONNECTION ONBOARD -#endif - -#if SD_CONNECTION_IS(ONBOARD) - #define ENABLE_SPI3 - #define SD_SS_PIN -1 - #define SDSS PC9 - #define SD_SCK_PIN PC10 - #define SD_MISO_PIN PC11 - #define SD_MOSI_PIN PC12 - #define SD_DETECT_PIN PC4 // SD_DETECT_PIN doesn't work with NO_SD_HOST_DRIVE disabled -#elif SD_CONNECTION_IS(LCD) - #define ENABLE_SPI1 - #define SDSS EXP2_07_PIN - #define SD_SCK_PIN EXP2_09_PIN - #define SD_MISO_PIN EXP2_10_PIN - #define SD_MOSI_PIN EXP2_05_PIN - #define SD_DETECT_PIN EXP2_04_PIN +#if ENABLED(SDSUPPORT) + #ifndef SDCARD_CONNECTION + #define SDCARD_CONNECTION ONBOARD + #endif + #if SD_CONNECTION_IS(ONBOARD) + #define ENABLE_SPI3 + #define SD_SS_PIN -1 + #define SDSS PC9 + #define SD_SCK_PIN PC10 + #define SD_MISO_PIN PC11 + #define SD_MOSI_PIN PC12 + #define SD_DETECT_PIN PC4 // SD_DETECT_PIN doesn't work with NO_SD_HOST_DRIVE disabled + #elif SD_CONNECTION_IS(LCD) + #define ENABLE_SPI1 + #define SDSS EXP2_07_PIN + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_DETECT_PIN EXP2_04_PIN + #endif #endif #if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI) @@ -339,14 +340,18 @@ // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) #if ENABLED(MKS_MINI_12864) - //#define LCD_BACKLIGHT_PIN -1 - //#define LCD_RESET_PIN -1 - #define DOGLCD_A0 PD11 - #define DOGLCD_CS EXP1_04_PIN - //#define DOGLCD_SCK EXP2_09_PIN - //#define DOGLCD_MOSI EXP2_05_PIN + + #define ENABLE_SPI1 + #define FORCE_SOFT_SPI + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_MOSI EXP2_05_PIN + //#define LCD_BACKLIGHT_PIN -1 + //#define LCD_RESET_PIN -1 #elif ENABLED(FYSETC_MINI_12864_2_1) + #define DOGLCD_CS EXP1_08_PIN #define DOGLCD_A0 EXP1_07_PIN #define LCD_PINS_DC DOGLCD_A0 diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index cf7c9ed8a6..873a4d4ad3 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -35,7 +35,7 @@ // Use soft PWM for fans - PWM is not working properly when paired with STM32 Arduino Core v1.7.0 // This can be removed when Core version is updated and PWM behaviour is fixed. -#define FAN_SOFT_PWM +#define FAN_SOFT_PWM_REQUIRED // // Configure Timers diff --git a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h index 7ccb57e238..0b527a6fdb 100644 --- a/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h +++ b/Marlin/src/pins/stm32f4/pins_STEVAL_3DP001V1.h @@ -48,82 +48,82 @@ // // Limit Switches // -#define X_MIN_PIN 39 // PD8 X_STOP -#define Y_MIN_PIN 40 // PD9 Y_STOP -#define Z_MIN_PIN 41 // PD10 Z_STOP +#define X_MIN_PIN PD8 // X_STOP +#define Y_MIN_PIN PD9 // Y_STOP +#define Z_MIN_PIN PD10 // Z_STOP -#define X_MAX_PIN 44 // PD0 W_STOP -#define Y_MAX_PIN 43 // PA8 V_STOP -#define Z_MAX_PIN 42 // PD11 U_STOP +#define X_MAX_PIN PD0 // W_STOP +#define Y_MAX_PIN PA8 // V_STOP +#define Z_MAX_PIN PD11 // U_STOP // // Z Probe (when not Z_MIN_PIN) // //#ifndef Z_MIN_PROBE_PIN -// #define Z_MIN_PROBE_PIN 16 // PA4 +// #define Z_MIN_PROBE_PIN PA4 // SPI1_CS //#endif // // Filament runout // -//#define FIL_RUNOUT_PIN 53 // PA3 BED_THE +//#define FIL_RUNOUT_PIN PA3 // BED_THERMISTOR_3 // // Steppers // -#define X_STEP_PIN 61 // PE14 X_PWM -#define X_DIR_PIN 62 // PE15 X_DIR -#define X_ENABLE_PIN 60 // PE13 X_RES -#define X_CS_PIN 16 // PA4 SPI_CS +#define X_STEP_PIN PE14 // X_PWM +#define X_DIR_PIN PE15 // X_DIR +#define X_ENABLE_PIN PE13 // X_RESET +#define X_CS_PIN PA4 // SPI1_CS -#define Y_STEP_PIN 64 // PB10 Y_PWM -#define Y_DIR_PIN 65 // PE9 Y_DIR -#define Y_ENABLE_PIN 63 // PE10 Y_RES -#define Y_CS_PIN 16 // PA4 SPI_CS +#define Y_STEP_PIN PB10 // Y_PWM +#define Y_DIR_PIN PE9 // Y_DIR +#define Y_ENABLE_PIN PE10 // Y_RESET +#define Y_CS_PIN PA4 // SPI1_CS -#define Z_STEP_PIN 67 // PC6 Z_PWM -#define Z_DIR_PIN 68 // PC0 Z_DIR -#define Z_ENABLE_PIN 66 // PC15 Z_RES -#define Z_CS_PIN 16 // PA4 SPI_CS +#define Z_STEP_PIN PC6 // Z_PWM +#define Z_DIR_PIN PC0 // Z_DIR +#define Z_ENABLE_PIN PC15 // Z_RESET +#define Z_CS_PIN PA4 // SPI1_CS -#define E0_STEP_PIN 71 // PD12 E1_PW -#define E0_DIR_PIN 70 // PC13 E1_DIR -#define E0_ENABLE_PIN 69 // PC14 E1_RE -#define E0_CS_PIN 16 // PA4 SPI_CS +#define E0_STEP_PIN PD12 // E1_PW +#define E0_DIR_PIN PC13 // E1_DIR +#define E0_ENABLE_PIN PC14 // E1_RESET +#define E0_CS_PIN PA4 // SPI1_CS -#define E1_STEP_PIN 73 // PE5 E2_PWM -#define E1_DIR_PIN 74 // PE6 E2_DIR -#define E1_ENABLE_PIN 72 // PE4 E2_RESE -#define E1_CS_PIN 16 // PA4 SPI_CS +#define E1_STEP_PIN PE5 // E2_PWM +#define E1_DIR_PIN PE6 // E2_DIR +#define E1_ENABLE_PIN PE4 // E2_RESET +#define E1_CS_PIN PA4 // SPI1_CS -#define E2_STEP_PIN 77 // PB8 E3_PWM -#define E2_DIR_PIN 76 // PE2 E3_DIR -#define E2_ENABLE_PIN 75 // PE3 E3_RESE -#define E2_CS_PIN 16 // PA4 SPI_CS +#define E2_STEP_PIN PB8 // E3_PWM +#define E2_DIR_PIN PE2 // E3_DIR +#define E2_ENABLE_PIN PE3 // E3_RESET +#define E2_CS_PIN PA4 // SPI1_CS // needed to pass a sanity check -#define X2_CS_PIN 16 // PA4 SPI_CS -#define Y2_CS_PIN 16 // PA4 SPI_CS -#define Z2_CS_PIN 16 // PA4 SPI_CS -#define Z3_CS_PIN 16 // PA4 SPI_CS -#define E3_CS_PIN 16 // PA4 SPI_CS -#define E4_CS_PIN 16 // PA4 SPI_CS -#define E5_CS_PIN 16 // PA4 SPI_CS +#define X2_CS_PIN PA4 // SPI1_CS +#define Y2_CS_PIN PA4 // SPI1_CS +#define Z2_CS_PIN PA4 // SPI1_CS +#define Z3_CS_PIN PA4 // SPI1_CS +#define E3_CS_PIN PA4 // SPI1_CS +#define E4_CS_PIN PA4 // SPI1_CS +#define E5_CS_PIN PA4 // SPI1_CS #if HAS_L64XX - #define L6470_CHAIN_SCK_PIN 17 // PA5 - #define L6470_CHAIN_MISO_PIN 18 // PA6 - #define L6470_CHAIN_MOSI_PIN 19 // PA7 - #define L6470_CHAIN_SS_PIN 16 // PA4 + #define L6470_CHAIN_SCK_PIN PA5 // SPI1_SCK + #define L6470_CHAIN_MISO_PIN PA6 // SPI1_MISO + #define L6470_CHAIN_MOSI_PIN PA7 // SPI1_MOSI + #define L6470_CHAIN_SS_PIN PA4 // SPI1_CS //#define SD_SCK_PIN L6470_CHAIN_SCK_PIN //#define SD_MISO_PIN L6470_CHAIN_MISO_PIN //#define SD_MOSI_PIN L6470_CHAIN_MOSI_PIN #else - //#define SD_SCK_PIN 13 // PB13 SPI_S - //#define SD_MISO_PIN 12 // PB14 SPI_M - //#define SD_MOSI_PIN 11 // PB15 SPI_M + //#define SD_SCK_PIN PB13 // SPI2_SCK + //#define SD_MISO_PIN PB14 // SPI2_MISO + //#define SD_MOSI_PIN PB15 // SPI2_MOSI #endif /** @@ -144,215 +144,182 @@ // // Temperature Sensors // -#define TEMP_0_PIN 3 // Analog input 3, digital pin 54 PA0 E1_THERMISTOR -#define TEMP_1_PIN 4 // Analog input 4, digital pin 55 PA1 E2_THERMISTOR -#define TEMP_2_PIN 5 // Analog input 5, digital pin 56 PA2 E3_THERMISTOR -#define TEMP_BED_PIN 0 // Analog input 0, digital pin 51 PC2 BED_THERMISTOR_1 -#define TEMP_BED_1_PIN 1 // Analog input 1, digital pin 52 PC3 BED_THERMISTOR_2 -#define TEMP_BED_2_PIN 2 // Analog input 2, digital pin 53 PA3 BED_THERMISTOR_3 +#define TEMP_0_PIN PA0 // Analog Input 3 +#define TEMP_1_PIN PA1 // Analog Input 4 +#define TEMP_2_PIN PA2 // Analog Input 5 +#define TEMP_BED_PIN PC2 // Analog Input 0 +#define TEMP_BED_1_PIN PC3 // Analog Input 1 +#define TEMP_BED_2_PIN PA3 // Analog Input 2 // // Heaters / Fans // -#define HEATER_0_PIN 48 // PC7 E1_HEAT_PWM -#define HEATER_1_PIN 49 // PB0 E2_HEAT_PWM -#define HEATER_2_PIN 50 // PB1 E3_HEAT_PWM -#define HEATER_BED_PIN 46 // PD14 (BED_HEAT_1 FET -#define HEATER_BED_1_PIN 45 // PD13 (BED_HEAT_2 FET -#define HEATER_BED_2_PIN 47 // PD15 (BED_HEAT_3 FET +#define HEATER_0_PIN PC7 // E1_HEAT_PWM +#define HEATER_1_PIN PB0 // E2_HEAT_PWM +#define HEATER_2_PIN PB1 // E3_HEAT_PWM +#define HEATER_BED_PIN PD14 // BED_HEAT_1 FET +#define HEATER_BED_1_PIN PD13 // BED_HEAT_2 FET +#define HEATER_BED_2_PIN PD15 // BED_HEAT_3 FET -#define FAN_PIN 57 // PC4 E1_FAN PWM pin, Part cooling fan FET -#define FAN1_PIN 58 // PC5 E2_FAN PWM pin, Extruder fan FET -#define FAN2_PIN 59 // PE8 E3_FAN PWM pin, Controller fan FET +#define FAN_PIN PC4 // E1_FAN PWM pin, Part cooling fan FET +#define FAN1_PIN PC5 // E2_FAN PWM pin, Extruder fan FET +#define FAN2_PIN PE8 // E3_FAN PWM pin, Controller fan FET #ifndef E0_AUTO_FAN_PIN - #define E0_AUTO_FAN_PIN 58 // FAN1_PIN + #define E0_AUTO_FAN_PIN PC5 // FAN1_PIN #endif // // Misc functions // -#define LED_PIN -1 // 9 // PE1 green LED Heart beat -#define PS_ON_PIN -1 -#define KILL_PIN -1 -#define POWER_LOSS_PIN -1 // PWR_LOSS / nAC_FAULT +#define LED_PIN -1 // PE1 Green LED Heartbeat +#define PS_ON_PIN -1 +#define KILL_PIN -1 +#define POWER_LOSS_PIN -1 // PWR_LOSS / nAC_FAULT // // LCD / Controller // -//#define SD_DETECT_PIN 66 // PA15 SD_CA -//#define BEEPER_PIN 24 // PC9 SDIO_D1 -//#define LCD_PINS_RS 65 // PE9 Y_DIR -//#define LCD_PINS_ENABLE 59 // PE8 E3_FAN -//#define LCD_PINS_D4 10 // PB12 SPI_C -//#define LCD_PINS_D5 13 // PB13 SPI_S -//#define LCD_PINS_D6 12 // PB14 SPI_M -//#define LCD_PINS_D7 11 // PB15 SPI_M -//#define BTN_EN1 57 // PC4 E1_FAN -//#define BTN_EN2 58 // PC5 E2_FAN -//#define BTN_ENC 52 // PC3 BED_THE +//#define SD_DETECT_PIN PA15 // SD_CARD_DETECT +//#define BEEPER_PIN PC9 // SDIO_D1 +//#define LCD_PINS_RS PE9 // Y_DIR +//#define LCD_PINS_ENABLE PE8 // E3_FAN +//#define LCD_PINS_D4 PB12 // SPI2_CS +//#define LCD_PINS_D5 PB13 // SPI2_SCK +//#define LCD_PINS_D6 PB14 // SPI2_MISO +//#define LCD_PINS_D7 PB15 // SPI2_MOSI +//#define BTN_EN1 PC4 // E1_FAN +//#define BTN_EN2 PC5 // E2_FAN +//#define BTN_ENC PC3 // BED_THERMISTOR_2 // // Extension pins // -//#define EXT0_PIN 49 // PB0 E2_HEAT -//#define EXT1_PIN 50 // PB1 E3_HEAT -//#define EXT2_PIN // PB2 not used (tied to ground -//#define EXT3_PIN 39 // PD8 X_STOP -//#define EXT4_PIN 40 // PD9 Y_STOP -//#define EXT5_PIN 41 // PD10 Z_STOP -//#define EXT6_PIN 42 // PD11 -//#define EXT7_PIN 71 // PD12 E1_PW -//#define EXT8_PIN 64 // PB10 Y_PWM +//#define EXT0_PIN PB0 // E2_HEAT +//#define EXT1_PIN PB1 // E3_HEAT +//#define EXT2_PIN PB2 // not used (tied to ground) +//#define EXT3_PIN PD8 // X_STOP +//#define EXT4_PIN PD9 // Y_STOP +//#define EXT5_PIN PD10 // Z_STOP +//#define EXT6_PIN PD11 // U_STOP +//#define EXT7_PIN PD12 // E1_PWM +//#define EXT8_PIN PB10 // Y_PWM // WIFI -// 2 // PD3 CTS -// 3 // PD4 RTS -// 4 // PD5 TX -// 5 // PD6 RX -// 6 // PB5 WIFI_WAKEUP -// 7 // PE11 WIFI_RESET -// 8 // PE12 WIFI_BOOT +// PD3 CTS +// PD4 RTS +// PD5 TX +// PD6 RX +// PB5 WIFI_WAKEUP +// PE11 WIFI_RESET +// PE12 WIFI_BOOT // I2C USER -// 14 // PB7 SDA -// 15 // PB6 SCL +// PB7 SDA +// PB6 SCL // JTAG -// 20 // PA13 JTAG_TMS/SWDIO -// 21 // PA14 JTAG_TCK/SWCLK -// 22 // PB3 JTAG_TDO/SWO +// PA13 JTAG_TMS/SWDIO +// PA14 JTAG_TCK/SWCLK +// PB3 JTAG_TDO/SWO // // Onboard SD support // -#define SDIO_D0_PIN 23 // PC8 SDIO_D0 -#define SDIO_D1_PIN 24 // PC9 SDIO_D1 -//#define SD_CARD_DETECT_PIN 25 // PA15 SD_CARD_DETECT -#define SDIO_D2_PIN 26 // PC10 SDIO_D2 -#define SDIO_D3_PIN 27 // PC11 SDIO_D3 -#define SDIO_CK_PIN 28 // PC12 SDIO_CK -#define SDIO_CMD_PIN 29 // PD2 SDIO_CMD - #ifndef SDCARD_CONNECTION #define SDCARD_CONNECTION ONBOARD #endif #if SD_CONNECTION_IS(ONBOARD) - #define SDIO_SUPPORT // Use SDIO for onboard SD - #ifndef SDIO_SUPPORT + #define SDIO_SUPPORT // Use SDIO for onboard SD + #if DISABLED(SDIO_SUPPORT) #define SOFTWARE_SPI // Use soft SPI for onboard SD - #define SDSS SDIO_D3_PIN - #define SD_SCK_PIN SDIO_CK_PIN - #define SD_MISO_PIN SDIO_D0_PIN - #define SD_MOSI_PIN SDIO_CMD_PIN + #define SDSS PC11 + #define SD_SCK_PIN PC12 + #define SD_MISO_PIN PC8 + #define SD_MOSI_PIN PD2 #endif + + //#define SD_DETECT_PIN PA15 + #endif #ifndef SDSS - #define SDSS 16 // PA4 SPI_CS + #define SDSS PA4 // SPI1_CS #endif // OTG -// 30 // PA11 OTG_DM -// 31 // PA12 OTG_DP +// PA11 OTG_DM +// PA12 OTG_DP // USER_PINS -// 34 // PD7 USER3 -// 35 // PB9 USER1 -// 36 // PE0 USER2 -// 37 // PB4 USER4 +// PD7 USER3 +// PB9 USER1 +// PE0 USER2 +// PB4 USER4 // USERKET -// 38 // PE7 USER_BUTTON +// PE7 USER_BUTTON -// 0 // PA9 TX -// 1 // PA10 RX +// PA9 TX +// PA10 RX // IR/PROBE -// 32 // PD1 IR_OUT -// 33 // PC1 IR_ON +// PD1 IR_OUT +// PC1 IR_ON /** * Logical pin vs. port/pin cross reference * - * PA0 54 // E1_THERMISTOR PA9 0 // TX - * PA1 55 // E2_THERMISTOR PA10 1 // RX - * PA2 56 // E3_THERMISTOR PD3 2 // CTS - * PA3 53 // BED_THERMISTOR_3 PD4 3 // RTS - * PA4 16 // SPI_CS PD5 4 // TX - * PA5 17 // SPI_SCK PD6 5 // RX - * PA6 18 // SPI_MISO PB5 6 // WIFI_WAKEUP - * PA7 19 // SPI_MOSI PE11 7 // WIFI_RESET - * PA8 43 // V_STOP PE12 8 // WIFI_BOOT - * PA9 0 // TX PE1 9 // STATUS_LED - * PA10 1 // RX PB12 10 // SPI_CS - * PA11 30 // OTG_DM PB15 11 // SPI_MOSI - * PA12 31 // OTG_DP PB14 12 // SPI_MISO - * PA13 20 // JTAG_TMS/SWDIO PB13 13 // SPI_SCK - * PA14 21 // JTAG_TCK/SWCLK PB7 14 // SDA - * PA15 25 // SD_CARD_DETECT PB6 15 // SCL - * PB0 49 // E2_HEAT_PWM PA4 16 // SPI_CS - * PB1 50 // E3_HEAT_PWM PA5 17 // SPI_SCK - * PB3 22 // JTAG_TDO/SWO PA6 18 // SPI_MISO - * PB4 37 // USER4 PA7 19 // SPI_MOSI - * PB5 6 // WIFI_WAKEUP PA13 20 // JTAG_TMS/SWDIO - * PB6 15 // SCL PA14 21 // JTAG_TCK/SWCLK - * PB7 14 // SDA PB3 22 // JTAG_TDO/SWO - * PB8 77 // E3_PWM PC8 23 // SDIO_D0 - * PB9 35 // USER1 PC9 24 // SDIO_D1 - * PB10 64 // Y_PWM PA15 25 // SD_CARD_DETECT - * PB12 10 // SPI_CS PC10 26 // SDIO_D2 - * PB13 13 // SPI_SCK PC11 27 // SDIO_D3 - * PB14 12 // SPI_MISO PC12 28 // SDIO_CK - * PB15 11 // SPI_MOSI PD2 29 // SDIO_CMD - * PC0 68 // Z_DIR PA11 30 // OTG_DM - * PC1 33 // IR_ON PA12 31 // OTG_DP - * PC2 51 // BED_THERMISTOR_1 PD1 32 // IR_OUT - * PC3 52 // BED_THERMISTOR_2 PC1 33 // IR_ON - * PC4 57 // E1_FAN PD7 34 // USER3 - * PC5 58 // E2_FAN PB9 35 // USER1 - * PC6 67 // Z_PWM PE0 36 // USER2 - * PC7 48 // E1_HEAT_PWM PB4 37 // USER4 - * PC8 23 // SDIO_D0 PE7 38 // USER_BUTTON - * PC9 24 // SDIO_D1 PD8 39 // X_STOP - * PC10 26 // SDIO_D2 PD9 40 // Y_STOP - * PC11 27 // SDIO_D3 PD10 41 // Z_STOP - * PC12 28 // SDIO_CK PD11 42 // U_STOP - * PC13 70 // E1_DIR PA8 43 // V_STOP - * PC14 69 // E1_RESET PD0 44 // W_STOP - * PC15 66 // Z_RESET PD13 45 // BED_HEAT_2 - * PD0 44 // W_STOP PD14 46 // BED_HEAT_1 - * PD1 32 // IR_OUT PD15 47 // BED_HEAT_3 - * PD2 29 // SDIO_CMD PC7 48 // E1_HEAT_PWM - * PD3 2 // CTS PB0 49 // E2_HEAT_PWM - * PD4 3 // RTS PB1 50 // E3_HEAT_PWM - * PD5 4 // TX PC2 51 // BED_THERMISTOR_1 - * PD6 5 // RX PC3 52 // BED_THERMISTOR_2 - * PD7 34 // USER3 PA3 53 // BED_THERMISTOR_3 - * PD8 39 // X_STOP PA0 54 // E1_THERMISTOR - * PD9 40 // Y_STOP PA1 55 // E2_THERMISTOR - * PD10 41 // Z_STOP PA2 56 // E3_THERMISTOR - * PD11 42 // U_STOP PC4 57 // E1_FAN - * PD12 71 // E1_PWM PC5 58 // E2_FAN - * PD13 45 // BED_HEAT_2 PE8 59 // E3_FAN - * PD14 46 // BED_HEAT_1 PE13 60 // X_RESET - * PD15 47 // BED_HEAT_3 PE14 61 // X_PWM - * PE0 36 // USER2 PE15 62 // X_DIR - * PE1 9 // STATUS_LED PE10 63 // Y_RESET - * PE2 76 // E3_DIR PB10 64 // Y_PWM - * PE3 75 // E3_RESET PE9 65 // Y_DIR - * PE4 72 // E2_RESET PC15 66 // Z_RESET - * PE5 73 // E2_PWM PC6 67 // Z_PWM - * PE6 74 // E2_DIR PC0 68 // Z_DIR - * PE7 38 // USER_BUTTON PC14 69 // E1_RESET - * PE8 59 // E3_FAN PC13 70 // E1_DIR - * PE9 65 // Y_DIR PD12 71 // E1_PWM - * PE10 63 // Y_RESET PE4 72 // E2_RESET - * PE11 7 // WIFI_RESET PE5 73 // E2_PWM - * PE12 8 // WIFI_BOOT PE6 74 // E2_DIR - * PE13 60 // X_RESET PE3 75 // E3_RESET - * PE14 61 // X_PWM PE2 76 // E3_DIR - * PE15 62 // X_DIR PB8 77 // E3_PWM + * PA0 E1_THERMISTOR PD0 W_STOP + * PA1 E2_THERMISTOR PD1 IR_OUT + * PA2 E3_THERMISTOR PD2 SDIO_CMD + * PA3 BED_THERMISTOR_3 PD3 CTS + * PA4 SPI1_CS PD4 RTS + * PA5 SPI1_SCK PD5 TX + * PA6 SPI1_MISO PD6 RX + * PA7 SPI1_MOSI PD7 USER3 + * PA8 V_STOP PD8 X_STOP + * PA9 TX PD9 Y_STOP + * PA10 RX PD10 Z_STOP + * PA11 OTG_DM PD11 U_STOP + * PA12 OTG_DP PD12 E1_PWM + * PA13 JTAG_TMS/SWDIO PD13 BED_HEAT_2 + * PA14 JTAG_TCK/SWCLK PD14 BED_HEAT_1 + * PA15 SD_CARD_DETECT PD15 BED_HEAT_3 + * + * PB0 E2_HEAT_PWM PE0 USER2 + * PB1 E3_HEAT_PWM PE1 STATUS_LED + * PB2 --- PE2 E3_DIR + * PB3 JTAG_TDO/SWO PE3 E3_RESET + * PB4 USER4 PE4 E2_RESET + * PB5 WIFI_WAKEUP PE5 E2_PWM + * PB6 SCL PE6 E2_DIR + * PB7 SDA PE7 USER_BUTTON + * PB8 E3_PWM PE8 E3_FAN + * PB9 USER1 PE9 Y_DIR + * PB10 Y_PWM PE10 Y_RESET + * PB11 --- PE11 WIFI_RESET + * PB12 SPI2_CS PE12 WIFI_BOOT + * PB13 SPI2_SCK PE13 X_RESET + * PB14 SPI2_MISO PE14 X_PWM + * PB15 SPI2_MOSI PE15 X_DIR + * + * PC0 Z_DIR + * PC1 IR_ON + * PC2 BED_THERMISTOR_1 + * PC3 BED_THERMISTOR_2 + * PC4 E1_FAN + * PC5 E2_FAN + * PC6 Z_PWM + * PC7 E1_HEAT_PWM + * PC8 SDIO_D0 + * PC9 SDIO_D1 + * PC10 SDIO_D2 + * PC11 SDIO_D3 + * PC12 SDIO_CK + * PC13 E1_DIR + * PC14 E1_RESET + * PC15 Z_RESET */ diff --git a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h index 6368142c34..bd4798209e 100644 --- a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h +++ b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h @@ -184,12 +184,12 @@ // /** - * ______ - * 5V | 1 2 | GND - * PB15 | 3 4 | PB12 - * PB13 | 5 6 PC5 - * ---- | 7 8 | PC4 - * PB0 | 9 10 | PA14 + * ------ + * PA14 |10 9 | PB0 + * PC4 | 8 7 | -- + * PC5 | 6 5 PB13 + * PB12 | 4 3 | PB15 + * GND | 2 1 | 5V * ------ * EXP1 * @@ -209,12 +209,12 @@ #define EXP1_10_PIN PA14 #if ENABLED(CR10_STOCKDISPLAY) - /** ______ - * 5V | 1 2 | GND - * LCD_EN | 3 4 | LCD_RS - * LCD_D4 | 5 6 EN2 - * RESET | 7 8 | EN1 - * ENC | 9 10 | BEEPER + /** ------ + * BEEPER |10 9 | ENC + * EN1 | 8 7 | RESET + * EN2 | 6 5 LCD_D4 + * LCD_RS | 4 3 | LCD_EN + * GND | 2 1 | 5V * ------ */ #ifdef DISABLE_JTAGSWD @@ -230,12 +230,12 @@ #define BOARD_ST7920_DELAY_3 750 #elif ENABLED(MKS_MINI_12864) - /** ______ - * 5V | 1 2 | GND - * SPI-MOSI | 3 4 | SPI-CS - * A0 | 5 6 EN2 - * -- | 7 8 | EN1 - * ENC | 9 10 | SPI-SCK + /** ------ + * SCK |10 9 | ENC + * EN1 | 8 7 | -- + * EN2 | 6 5 A0 + * CS | 4 3 | MOSI + * GND | 2 1 | 5V * ------ */ #define DOGLCD_CS EXP1_04_PIN diff --git a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h index 75c7217163..48f986e2ca 100644 --- a/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h +++ b/Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h @@ -69,7 +69,7 @@ * (X_DIR) PB15 | · · | PB9 (X_CS) * (LCD_D4) PB13 | · · | AVDD * _CN8_ PB12 | · · | GND - * NC | · · | PC8 (HEATER_0) PA15 | · · | PA5 (SCLK) + * -- | · · | PC8 (HEATER_0) PA15 | · · | PA5 (SCLK) * IOREF | · · | PC9 (BEEPER) PC7 | · · | PA6 (MISO) * RESET | · · | PC10 (SERVO1_PIN) PB5 | · · | PA7 (MOSI) * +3.3V | · · | PC11 (HEATER_BED) PB3 | · · | PD14 (SD_DETECT) @@ -86,7 +86,7 @@ * PF3 | · · | PD4 PF4 | · · | PF15 * PF5 | · · | PD3 (E_STEP) PB6 | · · | PG14 (E_EN) * PF10 | · · | GND (E_DIR) PB2 | · · | PG9 (E_CS) - * NC | · · | PE2 GND | · · | PE8 + * -- | · · | PE2 GND | · · | PE8 * PA7 | · · | PE4 PD13 | · · | PE7 * PF2 | · · | PE5 PD12 | · · | GND * (Y_STEP) PF1 | · · | PE6 (Y_EN) (Z_STEP) PD11 | · · | PE10 (Z_EN) diff --git a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h index 486c10e711..5bfc2551ac 100644 --- a/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h +++ b/Marlin/src/pins/stm32f7/pins_REMRAM_V1.h @@ -44,14 +44,13 @@ #define X_MAX_PIN 59 #define Y_MIN_PIN 60 #define Y_MAX_PIN 61 - #define Z_MIN_PIN 62 #define Z_MAX_PIN 63 #else #define X_STOP_PIN 36 #define Y_STOP_PIN 39 - #define Z_MIN_PIN 62 #define Z_MAX_PIN 42 #endif +#define Z_MIN_PIN 62 // // Z Probe (when not Z_MIN_PIN) diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index cec1a838fc..7cbf9f9d58 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -144,28 +144,28 @@ /** * SKR Mini E3 V3.0 - * ------ - * 5V | 1 2 | GND - * (LCD_EN) PD6 | 3 4 | PB8 (LCD_RS) - * (LCD_D4) PB9 | 5 6 PA10 (BTN_EN2) - * RESET | 7 8 | PA9 (BTN_EN1) - * (BTN_ENC) PA15 | 9 10 | PB5 (BEEPER) - * ------ - * EXP1 + * ------ + * (BEEPER) PB5 |10 9 | PA15 (BTN_ENC) + * (BTN_EN1) PA9 | 8 7 | RESET + * (BTN_EN2) PA10 6 5 | PB9 (LCD_D4) + * (LCD_RS) PB8 | 4 3 | PD6 (LCD_EN) + * GND | 2 1 | 5V + * ------ + * EXP1 */ #define EXP1_09_PIN PA15 #define EXP1_03_PIN PD6 #if EITHER(DWIN_CREALITY_LCD, IS_DWIN_MARLINUI) /** - * ------ ------ ------ - * VCC | 1 2 | GND VCC | 1 2 | GND GND | 2 1 | VCC - * A | 3 4 | B A | 3 4 | B B | 4 3 | A - * | 5 6 TX BEEP | 5 6 ENT ENT | 6 5 | BEEP - * | 7 8 | RX TX | 7 8 | RX RX | 8 7 | TX - * BEEP | 9 10 | ENT | 9 10 | | 10 9 | - * ------ ------ ------ - * EXP1 DWIN DWIN (plug) + * ------ ------ ------ + * (ENT) |10 9 | (BEEP) |10 9 | |10 9 | + * (RX) | 8 7 | (RX) | 8 7 | (TX) RX | 8 7 | TX + * (TX) 6 5 | (ENT) 6 5 | (BEEP) ENT | 6 5 | BEEP + * (B) | 4 3 | (A) (B) | 4 3 | (A) B | 4 3 | A + * GND | 2 1 | (VCC) GND | 2 1 | VCC GND | 2 1 | VCC + * ------ ------ ------ + * EXP1 DWIN DWIN (plug) * * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ @@ -226,15 +226,15 @@ /** * TFTGLCD_PANEL_SPI display pinout * - * Board Display - * ------ ------ - * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) LCD_CS | 3 4 | SD_CS (PA10) - * (FREE) PB9 | 5 6 | PA10 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI) - * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE) - * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V - * ------ ------ - * EXP1 EXP1 + * Board Display + * ------ ------ + * (BEEPER) PB6 |10 9 | PB5 (SD_DET) 5V |10 9 | GND + * RESET | 8 7 | PA9 (MOD_RESET) -- | 8 7 | (SD_DET) + * PB9 6 5 | PA10 (SD_CS) (MOSI) | 6 5 | -- + * PB7 | 4 3 | PB8 (LCD_CS) (SD_CS) | 4 3 | (LCD_CS) + * GND | 2 1 | 5V (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP1 EXP1 * * Needs custom cable: * @@ -269,15 +269,15 @@ /** * FYSETC TFT TFT81050 display pinout * - * Board Display - * ------ ------ - * 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK) - * (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) MOD_RESET | 3 4 | SD_CS (PA10) - * (FREE) PB9 | 5 6 | PA10 (SD_CS) (PB8) LCD_CS | 5 6 | MOSI (SPI1-MOSI) - * RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | RESET - * (BEEPER) PB6 | 9 10 | PB5 (SD_DET) GND | 9 10 | 5V - * ------ ------ - * EXP1 EXP1 + * Board Display + * ------ ------ + * (SD_DET) PB5 |10 9 | PB6 (BEEPER) 5V |10 9 | GND + * (MOD_RESET) PA9 | 8 7 | RESET (RESET) | 8 7 | (SD_DET) + * (SD_CS) PA10 6 5 | PB9 (FREE) (MOSI) | 6 5 | (LCD_CS) + * (LCD_CS) PB8 | 4 3 | PB7 (FREE) (SD_CS) | 4 3 | (MOD_RESET) + * 5V | 2 1 | GND (SCK) | 2 1 | (MISO) + * ------ ------ + * EXP1 EXP1 * * Needs custom cable: * diff --git a/Marlin/src/sd/Sd2Card.cpp b/Marlin/src/sd/Sd2Card.cpp index a81932d494..3402bfaee3 100644 --- a/Marlin/src/sd/Sd2Card.cpp +++ b/Marlin/src/sd/Sd2Card.cpp @@ -392,50 +392,51 @@ bool DiskIODriver_SPI_SD::readData(uint8_t *dst) { #if ENABLED(SD_CHECK_AND_RETRY) #ifdef FAST_CRC - static const uint16_t crctab16[] PROGMEM = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 - }; + static const uint16_t crctab16[] PROGMEM = { + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, + 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, + 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, + 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, + 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, + 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, + 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, + 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, + 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, + 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, + 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, + 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, + 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, + 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, + 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, + 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, + 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, + 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, + 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, + 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, + 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, + 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, + 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 + }; // faster CRC-CCITT // uses the x^16,x^12,x^5,x^1 polynomial. - static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { - uint16_t crc = 0; - for (size_t i = 0; i < n; i++) { - crc = pgm_read_word(&crctab16[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); + static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { + uint16_t crc = 0; + for (size_t i = 0; i < n; i++) + crc = pgm_read_word(&crctab16[(crc >> 8 ^ data[i]) & 0xFF]) ^ (crc << 8); + return crc; } - return crc; - } + #else + // slower CRC-CCITT // uses the x^16,x^12,x^5,x^1 polynomial. static uint16_t CRC_CCITT(const uint8_t *data, size_t n) { @@ -449,7 +450,9 @@ bool DiskIODriver_SPI_SD::readData(uint8_t *dst) { } return crc; } + #endif + #endif // SD_CHECK_AND_RETRY bool DiskIODriver_SPI_SD::readData(uint8_t *dst, const uint16_t count) { diff --git a/Marlin/src/sd/cardreader.h b/Marlin/src/sd/cardreader.h index 5e93dad30d..1e51320735 100644 --- a/Marlin/src/sd/cardreader.h +++ b/Marlin/src/sd/cardreader.h @@ -120,7 +120,7 @@ public: static void mount(); static void release(); - static inline bool isMounted() { return flag.mounted; } + static bool isMounted() { return flag.mounted; } // Handle media insert/remove static void manage_media(); @@ -133,7 +133,7 @@ public: static uint8_t autofile_index; // Next auto#.g index to run, plus one. Ignored by autofile_check when zero. static void autofile_begin(); // Begin check. Called automatically after boot-up. static bool autofile_check(); // Check for the next auto-start file and run it. - static inline void autofile_cancel() { autofile_index = 0; } + static void autofile_cancel() { autofile_index = 0; } #endif // Basic file ops @@ -143,7 +143,7 @@ public: static bool fileExists(const char * const name); static void removeFile(const char * const name); - static inline char* longest_filename() { return longFilename[0] ? longFilename : filename; } + static char* longest_filename() { return longFilename[0] ? longFilename : filename; } #if ENABLED(LONG_FILENAME_HOST_SUPPORT) static void printLongPath(char * const path); // Used by M33 #endif @@ -168,18 +168,18 @@ public: static void endFilePrintNow(TERN_(SD_RESORT, const bool re_sort=false)); static void abortFilePrintNow(TERN_(SD_RESORT, const bool re_sort=false)); static void fileHasFinished(); - static inline void abortFilePrintSoon() { flag.abort_sd_printing = isFileOpen(); } - static inline void pauseSDPrint() { flag.sdprinting = false; } - static inline bool isPrinting() { return flag.sdprinting; } - static inline bool isPaused() { return isFileOpen() && !isPrinting(); } + static void abortFilePrintSoon() { flag.abort_sd_printing = isFileOpen(); } + static void pauseSDPrint() { flag.sdprinting = false; } + static bool isPrinting() { return flag.sdprinting; } + static bool isPaused() { return isFileOpen() && !isPrinting(); } #if HAS_PRINT_PROGRESS_PERMYRIAD - static inline uint16_t permyriadDone() { + static uint16_t permyriadDone() { if (flag.sdprintdone) return 10000; if (isFileOpen() && filesize) return sdpos / ((filesize + 9999) / 10000); return 0; } #endif - static inline uint8_t percentDone() { + static uint8_t percentDone() { if (flag.sdprintdone) return 100; if (isFileOpen() && filesize) return sdpos / ((filesize + 99) / 100); return 0; @@ -218,20 +218,20 @@ public: #endif // Current Working Dir - Set by cd, cdup, cdroot, and diveToFile(true, ...) - static inline char* getWorkDirName() { workDir.getDosName(filename); return filename; } - static inline SdFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } + static char* getWorkDirName() { workDir.getDosName(filename); return filename; } + static SdFile& getWorkDir() { return workDir.isOpen() ? workDir : root; } // Print File stats - static inline uint32_t getFileSize() { return filesize; } - static inline uint32_t getIndex() { return sdpos; } - static inline bool isFileOpen() { return isMounted() && file.isOpen(); } - static inline bool eof() { return getIndex() >= getFileSize(); } + static uint32_t getFileSize() { return filesize; } + static uint32_t getIndex() { return sdpos; } + static bool isFileOpen() { return isMounted() && file.isOpen(); } + static bool eof() { return getIndex() >= getFileSize(); } // File data operations - static inline int16_t get() { int16_t out = (int16_t)file.read(); sdpos = file.curPosition(); return out; } - static inline int16_t read(void *buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } - static inline int16_t write(void *buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } - static inline void setIndex(const uint32_t index) { file.seekSet((sdpos = index)); } + static int16_t get() { int16_t out = (int16_t)file.read(); sdpos = file.curPosition(); return out; } + static int16_t read(void *buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; } + static int16_t write(void *buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; } + static void setIndex(const uint32_t index) { file.seekSet((sdpos = index)); } // TODO: rename to diskIODriver() static DiskIODriver* diskIODriver() { return driver; } diff --git a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp index a1a3b7d50e..9ff9cd77bc 100644 --- a/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp +++ b/Marlin/src/sd/usb_flashdrive/lib-uhs2/usbhost.cpp @@ -47,7 +47,7 @@ void MAX3421e::regWr(uint8_t reg, uint8_t data) { spiSend(reg | 0x02); spiSend(data); ncs(); -}; +} // multiple-byte write // return a pointer to memory position after last written diff --git a/buildroot/bin/mftest b/buildroot/bin/mftest index 9a58ba9cfc..77e53ff9ac 100755 --- a/buildroot/bin/mftest +++ b/buildroot/bin/mftest @@ -150,7 +150,7 @@ if ((AUTO_BUILD)); then *) SYS='uni' ;; esac echo ; echo -n "Auto " ; ((AUTO_BUILD == 2)) && echo "Upload..." || echo "Build..." - MB=$( grep -E "^\s*#define MOTHERBOARD" Marlin/Configuration.h | awk '{ print $3 }' | $SED 's/BOARD_//' ) + MB=$( grep -E "^\s*#define MOTHERBOARD" Marlin/Configuration.h | awk '{ print $3 }' | $SED 's/BOARD_//;s/\r//' ) [[ -z $MB ]] && { echo "Error - Can't read MOTHERBOARD setting." ; exit 1 ; } BLINE=$( grep -E "define\s+BOARD_$MB\b" Marlin/src/core/boards.h ) BNUM=$( $SED -E 's/^.+BOARD_[^ ]+ +([0-9]+).+$/\1/' <<<"$BLINE" ) diff --git a/buildroot/share/PlatformIO/scripts/marlin.py b/buildroot/share/PlatformIO/scripts/marlin.py index 2114a05fb3..8ac36b7d59 100644 --- a/buildroot/share/PlatformIO/scripts/marlin.py +++ b/buildroot/share/PlatformIO/scripts/marlin.py @@ -49,13 +49,8 @@ def encrypt_mks(source, target, env, new_name): key = [0xA3, 0xBD, 0xAD, 0x0D, 0x41, 0x11, 0xBB, 0x8D, 0xDC, 0x80, 0x2D, 0xD0, 0xD2, 0xC4, 0x9B, 0x1E, 0x26, 0xEB, 0xE3, 0x33, 0x4A, 0x15, 0xE4, 0x0A, 0xB3, 0xB1, 0x3C, 0x93, 0xBB, 0xAF, 0xF7, 0x3E] # If FIRMWARE_BIN is defined by config, override all - import re - patt = re.compile("^\\s*#define\\s+FIRMWARE_BIN\\s+\"?(.+)\"?") - with open(join("Marlin", "Configuration.h"), encoding="utf-8") as f: - for line in f: - m = patt.search(line) - if m != None: - new_name = m.group(1) + mf = env["MARLIN_FEATURES"] + if "FIRMWARE_BIN" in mf: new_name = mf["FIRMWARE_BIN"] fwpath = target[0].path fwfile = open(fwpath, "rb") diff --git a/buildroot/share/PlatformIO/scripts/offset_and_rename.py b/buildroot/share/PlatformIO/scripts/offset_and_rename.py index 00803b722e..581a06e91e 100644 --- a/buildroot/share/PlatformIO/scripts/offset_and_rename.py +++ b/buildroot/share/PlatformIO/scripts/offset_and_rename.py @@ -57,7 +57,6 @@ if pioutil.is_pio_build(): def rename_target(source, target, env): firmware = os.path.join(target[0].dir.path, board.get("build.rename")) - import shutil - shutil.copy(target[0].path, firmware) + os.rename(target[0].path, firmware) marlin.add_post_action(rename_target) diff --git a/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/startup.S b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/startup.S new file mode 100644 index 0000000000..81999dda6a --- /dev/null +++ b/buildroot/share/PlatformIO/variants/MARLIN_ARTILLERY_RUBY/startup.S @@ -0,0 +1,124 @@ + /** + ****************************************************************************** + * @file startup_stm32f401xc.s + * @author MCD Application Team + * @version V2.4.2 + * @date 13-November-2015 + * @brief STM32F401xCxx Devices vector table for GCC based toolchains. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT 2015 STMicroelectronics

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None + */ + + .section .text.Reset_Handler + .globl Reset_Handler + .type Reset_Handler, %function +Reset_Handler: +/* Check for magic code at the end of SRAM to detemine whether to jump to DFU */ + ldr r0, =0x2000FFF0 // End of SRAM for your CPU + ldr r1, =0xDEADBEEF + ldr r2, [r0, #0] + str r0, [r0, #0] // Invalidate + cmp r2, r1 + beq Jump_To_DFU + +/* Original Reset_Handler code */ + ldr sp, =_estack /* set stack pointer */ + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ + bl __libc_init_array +/* Call the application's entry point.*/ + bl main + bx lr + +Jump_To_DFU: + ldr r0, =0x40023844 // RCC_APB2ENR + ldr r1, =0x00004000 // ENABLE SYSCFG CLOCK + str r1, [r0, #0] + ldr r0, =0x40013800 // SYSCFG_MEMRMP + ldr r1, =0x00000001 // MAP ROM AT ZERO + str r1, [r0, #0] + ldr r0, =0x1FFF0000 // ROM BASE + ldr sp, [r0, #0] // SP @ +0 + ldr r0, [r0, #4] // PC @ +4 + bx r0 +.size Reset_Handler, .-Reset_Handler + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/buildroot/share/git/mffp b/buildroot/share/git/mffp index 0680b3dba5..ab4dd4c0b7 100755 --- a/buildroot/share/git/mffp +++ b/buildroot/share/git/mffp @@ -6,7 +6,7 @@ # By default: `git push upstream HEAD:bugfix-2.0.x` # -usage() { echo "usage: `basename $0` [1|2] [ref]" 1>&2 } +usage() { echo "usage: `basename $0` [1|2] [ref]" 1>&2 ; } [[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { usage ; exit 1; } @@ -17,7 +17,7 @@ elif [[ $# == 1 ]]; then MFINFO=$(mfinfo) || exit 1 REF=${1:-HEAD} else - usage + usage ; exit 1 fi IFS=' ' read -a INFO <<< "$MFINFO" diff --git a/buildroot/share/git/mfnew b/buildroot/share/git/mfnew index 6d067a7f08..48703e67a1 100755 --- a/buildroot/share/git/mfnew +++ b/buildroot/share/git/mfnew @@ -5,9 +5,7 @@ # Create a new branch from the default target with the given name # -usage() { - echo "usage: `basename $0` [1|2] [name]" 1>&2 -} +usage() { echo "usage: `basename $0` [1|2] [name]" 1>&2 ; } [[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { usage; exit 1; } diff --git a/buildroot/share/vscode/auto_build.py b/buildroot/share/vscode/auto_build.py index ac8432729f..5bd769478e 100644 --- a/buildroot/share/vscode/auto_build.py +++ b/buildroot/share/vscode/auto_build.py @@ -72,7 +72,7 @@ from __future__ import print_function from __future__ import division -import sys,os +import sys,os,re pwd = os.getcwd() # make sure we're executing from the correct directory level pwd = pwd.replace('\\', '/') @@ -123,7 +123,7 @@ from datetime import datetime, date, time # ########################################################################################## -def get_answer(board_name, cpu_label_txt, cpu_a_txt, cpu_b_txt): +def get_answer(board_name, question_txt, options, default_value=1): if python_ver == 2: import Tkinter as tk @@ -151,10 +151,10 @@ def get_answer(board_name, cpu_label_txt, cpu_a_txt, cpu_b_txt): root_get_answer.protocol("WM_DELETE_WINDOW", disable_event) root_get_answer.resizable(False, False) - root_get_answer.radio_state = 1 # declare variables used by TK and enable + root_get_answer.radio_state = default_value # declare variables used by TK and enable global get_answer_val - get_answer_val = 2 # return get_answer_val, set default to match radio_state default + get_answer_val = default_value # return get_answer_val, set default to match radio_state default radio_state = tk.IntVar() radio_state.set(get_answer_val) @@ -162,35 +162,27 @@ def get_answer(board_name, cpu_label_txt, cpu_a_txt, cpu_b_txt): l1 = tk.Label(text=board_name, fg="light green", bg="dark green", font="default 14 bold").grid(row=0, columnspan=2, sticky='EW', ipadx=2, ipady=2) - l2 = tk.Label(text=cpu_label_txt).grid(row=1, pady=4, columnspan=2, sticky='EW') - - b4 = tk.Radiobutton( - text=cpu_a_txt, - fg="black", - bg="lightgray", - relief=tk.SUNKEN, - selectcolor="green", - variable=radio_state, - value=1, - indicatoron=0, - command=CPU_exit_3 - ).grid(row=2, pady=1, ipady=2, ipadx=10, columnspan=2) - - b5 = tk.Radiobutton( - text=cpu_b_txt, - fg="black", - bg="lightgray", - relief=tk.SUNKEN, - selectcolor="green", - variable=radio_state, - value=2, - indicatoron=0, - command=CPU_exit_3 - ).grid(row=3, pady=1, ipady=2, ipadx=10, columnspan=2) # use same variable but inverted so they will track - - b6 = tk.Button(text="Cancel", fg="red", command=kill_session).grid(row=4, column=0, padx=4, pady=4, ipadx=2, ipady=2) - - b7 = tk.Button(text="Continue", fg="green", command=got_answer).grid(row=4, column=1, padx=4, pady=4, ipadx=2, ipady=2) + l2 = tk.Label(text=question_txt).grid(row=1, pady=4, columnspan=2, sticky='EW') + + buttons = [] + + for index, val in enumerate(options): + buttons.append( + tk.Radiobutton( + text=val, + fg="black", + bg="lightgray", + relief=tk.SUNKEN, + selectcolor="green", + variable=radio_state, + value=index + 1, + indicatoron=0, + command=CPU_exit_3 + ).grid(row=index + 2, pady=1, ipady=2, ipadx=10, columnspan=2)) + + b6 = tk.Button(text="Cancel", fg="red", command=kill_session).grid(row=(2 + len(options)), column=0, padx=4, pady=4, ipadx=2, ipady=2) + + b7 = tk.Button(text="Continue", fg="green", command=got_answer).grid(row=(2 + len(options)), column=1, padx=4, pady=4, ipadx=2, ipady=2) def got_answer_(): root_get_answer.destroy() @@ -485,6 +477,11 @@ def get_env_from_line(line, start_position): return env, next_position +def invalid_board(): + print('ERROR - invalid board') + print(board_name) + raise SystemExit(0) # quit if unable to find board + # scan pins.h for board name and return the environment(s) found def get_starting_env(board_name_full, version): # get environment starting point @@ -496,48 +493,26 @@ def get_starting_env(board_name_full, version): with open(path, 'r') as myfile: pins_h = myfile.read() - env_A = '' - env_B = '' - env_C = '' - board_name = board_name_full[6:] # only use the part after "BOARD_" since we're searching the pins.h file pins_h = pins_h.split('\n') - environment = '' - board_line = '' - cpu_A = '' - cpu_B = '' - i = 0 list_start_found = False - for lines in pins_h: - i = i + 1 # i is always one ahead of the index into pins_h - if 0 < lines.find("Unknown MOTHERBOARD value set in Configuration.h"): - break # no more - if 0 < lines.find('1280'): + possible_envs = None + for i, line in enumerate(pins_h): + if 0 < line.find("Unknown MOTHERBOARD value set in Configuration.h"): + invalid_board(); + if list_start_found == False and 0 < line.find('1280'): list_start_found = True - if list_start_found == False: # skip lines until find start of CPU list + elif list_start_found == False: # skip lines until find start of CPU list continue - board = lines.find(board_name) - comment_start = lines.find('// ') - cpu_A_loc = comment_start - cpu_B_loc = 0 - if board > 0: # need to look at the next line for environment info - cpu_line = pins_h[i] - comment_start = cpu_line.find('// ') - env_A, next_position = get_env_from_line(cpu_line, comment_start) # get name of environment & start of search for next - env_B, next_position = get_env_from_line(cpu_line, next_position) # get next environment, if it exists - env_C, next_position = get_env_from_line(cpu_line, next_position) # get next environment, if it exists - break - return env_A, env_B, env_C - -# Scan input string for CPUs that users may need to select from -# return: CPU name -def get_CPU_name(environment): - CPU_list = ('1280', '2560', '644', '1284', 'LPC1768', 'DUE') - CPU_name = '' - for CPU in CPU_list: - if 0 < environment.find(CPU): - return CPU + # Use a regex to find the board. Make sure it is surrounded by separators so the full boardname + # will be matched, even if multiple exist in a single MB macro. This avoids problems with boards + # such as MALYAN_M200 and MALYAN_M200_V2 where one board is a substring of the other. + if re.search(r'MB.*[\(, ]' + board_name + r'[, \)]', line): + # need to look at the next line for environment info + possible_envs = re.findall(r'env:([^ ]+)', pins_h[i + 1]) + break + return possible_envs # get environment to be used for the build @@ -549,71 +524,81 @@ def get_env(board_name, ver_Marlin): print(board_name) raise SystemExit(0) # no environment so quit - def invalid_board(): - print('ERROR - invalid board') - print(board_name) - raise SystemExit(0) # quit if unable to find board + possible_envs = get_starting_env(board_name, ver_Marlin) - CPU_question = (('1280', '2560', '1280 or 2560 CPU?'), ('644', '1284', '644 or 1284 CPU?')) + if not possible_envs: + no_environment() - if 0 < board_name.find('MELZI'): - get_answer( - board_name, " Which flavor of Melzi? ", "Melzi (Optiboot bootloader)", "Melzi " - ) + # Proceed to ask questions based on the available environments to filter down to a smaller list. + # If more then one remains after this filtering the user will be prompted to choose between + # all remaining options. + + # Filter selection based on CPU choice + CPU_questions = [ + {'options':['1280', '2560'], 'text':'1280 or 2560 CPU?', 'default':2}, + {'options':['644', '1284'], 'text':'644 or 1284 CPU?', 'default':2}, + {'options':['STM32F103RC', 'STM32F103RE'], 'text':'MCU Type?', 'default':1}] + + for question in CPU_questions: + if any(question['options'][0] in env for env in possible_envs) and any(question['options'][1] in env for env in possible_envs): + get_answer(board_name, question['text'], [question['options'][0], question['options'][1]], question['default']) + possible_envs = [env for env in possible_envs if question['options'][get_answer_val - 1] in env] + + # Choose which STM32 framework to use, if both are available + if [env for env in possible_envs if '_maple' in env] and [env for env in possible_envs if '_maple' not in env]: + get_answer(board_name, 'Which STM32 Framework should be used?', ['ST STM32 (Preferred)', 'Maple (Deprecated)']) if 1 == get_answer_val: - target_env = 'melzi_optiboot' + possible_envs = [env for env in possible_envs if '_maple' not in env] else: - target_env = 'melzi' - else: - env_A, env_B, env_C = get_starting_env(board_name, ver_Marlin) + possible_envs = [env for env in possible_envs if '_maple' in env] - if env_A == '': - no_environment() - if env_B == '': - return env_A # only one environment so finished + # Both USB and non-USB STM32 options exist, filter based on these + if any('STM32F103R' in env for env in possible_envs) and any('_USB' in env for env in possible_envs) and any('_USB' not in env for env in possible_envs): + get_answer(board_name, 'USB Support?', ['USB', 'No USB']) + if 1 == get_answer_val: + possible_envs = [env for env in possible_envs if '_USB' in env] + else: + possible_envs = [env for env in possible_envs if '_USB' not in env] - CPU_A = get_CPU_name(env_A) - CPU_B = get_CPU_name(env_B) + if not possible_envs: + no_environment() + if len(possible_envs) == 1: + return possible_envs[0] # only one environment so finished - for item in CPU_question: - if CPU_A == item[0]: - get_answer(board_name, item[2], item[0], item[1]) - if 2 == get_answer_val: - target_env = env_B - else: - target_env = env_A - return target_env + target_env = None - if env_A == 'LPC1768': - if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'LPC1768_debug_and_upload'): - target_env = 'LPC1768_debug_and_upload' - else: - target_env = 'LPC1768' - elif env_A == 'DUE': - target_env = 'DUE' - if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'DUE_debug'): - target_env = 'DUE_debug' - elif env_B == 'DUE_USB': - get_answer(board_name, 'DUE Download Port?', '(Native) USB port', 'Programming port') - if 1 == get_answer_val: - target_env = 'DUE_USB' - else: - target_env = 'DUE' - elif env_A == 'STM32F103RC_btt' or env_A == 'STM32F103RE_btt': - if env_A == 'STM32F103RE_btt': - get_answer(board_name, 'MCU Type?', 'STM32F103RC', 'STM32F103RE') - if 1 == get_answer_val: - env_A = 'STM32F103RC_btt' - target_env = env_A - if env_A == 'STM32F103RC_btt': - get_answer(board_name, 'RCT6 Flash Size?', '512K', '256K') - if 1 == get_answer_val: - target_env += '_512K' - get_answer(board_name, 'USB Support?', 'USB', 'No USB') - if 1 == get_answer_val: - target_env += '_USB' + # A few environments require special behavior + if 'LPC1768' in possible_envs: + if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'LPC1768_debug_and_upload'): + target_env = 'LPC1768_debug_and_upload' else: - invalid_board() + target_env = 'LPC1768' + elif 'DUE' in possible_envs: + target_env = 'DUE' + if build_type == 'traceback' or (build_type == 'clean' and get_build_last() == 'DUE_debug'): + target_env = 'DUE_debug' + elif 'DUE_USB' in possible_envs: + get_answer(board_name, 'DUE Download Port?', ['(Native) USB port', 'Programming port']) + if 1 == get_answer_val: + target_env = 'DUE_USB' + else: + target_env = 'DUE' + else: + options = possible_envs + # Perform some substitutions for environment names which follow a consistent + # naming pattern and are very commonly used. This is fragile code, and replacements + # should only be made here for stable environments unlikely to change often. + for i, option in enumerate(options): + if 'melzi' in option: + options[i] = 'Melzi' + elif 'sanguino1284p' in option: + options[i] = 'sanguino1284p' + if 'optiboot' in option: + options[i] = options[i] + ' (Optiboot Bootloader)' + if 'optimized' in option: + options[i] = options[i] + ' (Optimized for Size)' + get_answer(board_name, 'Which environment?', options) + target_env = possible_envs[get_answer_val - 1] if build_type == 'traceback' and target_env != 'LPC1768_debug_and_upload' and target_env != 'DUE_debug' and Marlin_ver == 2: print("ERROR - this board isn't setup for traceback") diff --git a/buildroot/tests/STM32F103RET6_creality b/buildroot/tests/STM32F103RET6_creality index ca7573cf16..8eda5f801d 100755 --- a/buildroot/tests/STM32F103RET6_creality +++ b/buildroot/tests/STM32F103RET6_creality @@ -30,7 +30,7 @@ exec_test $1 $2 "Ender 3 v2 with MarlinUI" "$3" restore_configs opt_set MOTHERBOARD BOARD_CREALITY_V452 SERIAL_PORT 1 opt_disable NOZZLE_TO_PROBE_OFFSET -opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN \ +opt_enable NOZZLE_AS_PROBE Z_SAFE_HOMING Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN FAN_SOFT_PWM \ PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE exec_test $1 $2 "Creality V4.5.2 PROBE_ACTIVATION_SWITCH, Probe Tare" "$3" diff --git a/buildroot/tests/STM32F103RE_btt_USB b/buildroot/tests/STM32F103RE_btt_USB index c63a90e436..7b264ea283 100755 --- a/buildroot/tests/STM32F103RE_btt_USB +++ b/buildroot/tests/STM32F103RE_btt_USB @@ -15,7 +15,7 @@ exec_test $1 $2 "BigTreeTech SKR E3 DIP v1.0 - Basic Configuration" "$3" restore_configs opt_set MOTHERBOARD BOARD_BTT_SKR_CR6 SERIAL_PORT -1 SERIAL_PORT_2 2 TEMP_SENSOR_BED 1 -opt_enable CR10_STOCKDISPLAY \ +opt_enable CR10_STOCKDISPLAY FAN_SOFT_PWM \ NOZZLE_AS_PROBE Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN Z_SAFE_HOMING \ PROBE_ACTIVATION_SWITCH PROBE_TARE PROBE_TARE_ONLY_WHILE_INACTIVE \ PROBING_HEATERS_OFF PREHEAT_BEFORE_PROBING diff --git a/buildroot/tests/rumba32 b/buildroot/tests/rumba32 index f26af33610..833769d0b9 100755 --- a/buildroot/tests/rumba32 +++ b/buildroot/tests/rumba32 @@ -11,7 +11,7 @@ restore_configs opt_set MOTHERBOARD BOARD_RUMBA32_V1_0 SERIAL_PORT -1 \ TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130 opt_disable PIDTEMP -opt_enable PIDTEMPBED +opt_enable PIDTEMPBED FAN_SOFT_PWM opt_disable THERMAL_PROTECTION_BED exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection disabled" "$3" @@ -19,12 +19,13 @@ exec_test $1 $2 "RUMBA32 V1.0 with TMC2130, PID Bed, and bed thermal protection restore_configs opt_set MOTHERBOARD BOARD_RUMBA32_V1_1 SERIAL_PORT -1 \ TEMP_SENSOR_BED 1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208 -opt_enable PIDTEMPBED EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER +opt_enable PIDTEMPBED FAN_SOFT_PWM EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER exec_test $1 $2 "RUMBA32 V1.1 with TMC2130, TMC2208, PID Bed, EEPROM settings, and graphic LCD controller" "$3" # Build examples restore_configs opt_set MOTHERBOARD BOARD_RUMBA32_MKS SERIAL_PORT -1 X_DRIVER_TYPE TMC2130 Y_DRIVER_TYPE TMC2208 +opt_enable FAN_SOFT_PWM exec_test $1 $2 "RUMBA32 MKS Default Config with Mixed TMC Drivers" "$3" # cleanup diff --git a/buildroot/tests/teensy31 b/buildroot/tests/teensy31 index 10dde2be99..7465a67fdd 100755 --- a/buildroot/tests/teensy31 +++ b/buildroot/tests/teensy31 @@ -14,7 +14,7 @@ exec_test $1 $2 "Teensy3.1 with default config" "$3" # Zero endstops, as with a CNC # restore_configs -opt_set MOTHERBOARD BOARD_TEENSY31_32 +opt_set MOTHERBOARD BOARD_TEENSY31_32 X_HOME_DIR 0 Y_HOME_DIR 0 Z_HOME_DIR 0 opt_disable USE_XMIN_PLUG USE_YMIN_PLUG USE_ZMIN_PLUG exec_test $1 $2 "Teensy3.1 with Zero Endstops" "$3" diff --git a/buildroot/web-ui/data/www/webmarlin-class.js b/buildroot/web-ui/data/www/webmarlin-class.js index 393fd88eef..2cfc4cbfba 100644 --- a/buildroot/web-ui/data/www/webmarlin-class.js +++ b/buildroot/web-ui/data/www/webmarlin-class.js @@ -349,18 +349,18 @@ class jsLog { var wmGCommands = { CustomCmd : new wmGCommandItem('',null,null,'Custom command'), - MoveFw : new wmGCommandItem('G1','Y{0}',10,'Move forward on Y axis'), - MoveBw : new wmGCommandItem('G1','Y-{0}',10,'Move backward on Y axis'), - MoveSx : new wmGCommandItem('G1','X{0}',10,'Move left on X axis'), - MoveDx : new wmGCommandItem('G1','X-{0}',10,'Move right on X axis'), - MoveUp : new wmGCommandItem('G1','Z{0}',10,'Move up on Z axis'), - MoveDw : new wmGCommandItem('G1','Z-{0}',10,'Move down on Z axis'), + MoveFw : new wmGCommandItem('G1','Y{0}',10,'Move Y forward'), + MoveBw : new wmGCommandItem('G1','Y-{0}',10,'Move Y backward'), + MoveSx : new wmGCommandItem('G1','X{0}',10,'Move X left'), + MoveDx : new wmGCommandItem('G1','X-{0}',10,'Move X right'), + MoveUp : new wmGCommandItem('G1','Z{0}',10,'Move Z up'), + MoveDw : new wmGCommandItem('G1','Z-{0}',10,'Move Z down'), FillRetrive : new wmGCommandItem('G10',null,null,'Retract filament'), FillExtrude : new wmGCommandItem('GYYYY',null,null,'Extrude filament'), - MoveHome : new wmGCommandItem('G28',null,null,'Go home on all axis'), - MoveHomeX : new wmGCommandItem('G28','X',null,'Go home on X axis'), - MoveHomeY : new wmGCommandItem('G28','Y',null,'Go home on Y axis'), - MoveHomeZ : new wmGCommandItem('G28','Z',null,'Go home on Z axis'), + MoveHome : new wmGCommandItem('G28',null,null,'Home all axes'), + MoveHomeX : new wmGCommandItem('G28','X',null,'Home X axis'), + MoveHomeY : new wmGCommandItem('G28','Y',null,'Home Y axis'), + MoveHomeZ : new wmGCommandItem('G28','Z',null,'Home Z axis'), StepEnable : new wmGCommandItem('M17','{0}','E X Y Z','Enable stepper'), StepEnableAll : new wmGCommandItem('M17',null,null,'Enable all steppers'), StepDisable : new wmGCommandItem('M18','{0}','E X Y Z','Disable stepper'), diff --git a/ini/avr.ini b/ini/avr.ini index e4d64de712..b13596afe1 100644 --- a/ini/avr.ini +++ b/ini/avr.ini @@ -13,6 +13,7 @@ # AVR (8-bit) Common Environment values # [common_avr8] +platform = atmelavr@~3.4 build_flags = ${common.build_flags} -Wl,--relax board_build.f_cpu = 16000000L src_filter = ${common.default_src_filter} + @@ -21,7 +22,6 @@ src_filter = ${common.default_src_filter} + # ATmega2560 # [env:mega2560] -platform = atmelavr extends = common_avr8 board = megaatmega2560 @@ -33,7 +33,6 @@ board = megaatmega2560 # BOARD_EINSTART_S # [env:mega2560ext] -platform = atmelavr extends = env:mega2560 board_build.variant = MARLIN_MEGA_EXTENDED extra_scripts = ${common.extra_scripts} @@ -43,7 +42,6 @@ extra_scripts = ${common.extra_scripts} # ATmega1280 # [env:mega1280] -platform = atmelavr extends = common_avr8 board = megaatmega1280 @@ -61,7 +59,6 @@ build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide # MightyBoard ATmega1280 # [env:MightyBoard1280] -platform = atmelavr extends = mega_extended_optimized board = megaatmega1280 @@ -69,7 +66,6 @@ board = megaatmega1280 # MightyBoard ATmega2560 # [env:MightyBoard2560] -platform = atmelavr extends = mega_extended_optimized board = megaatmega2560 @@ -77,7 +73,6 @@ board = megaatmega2560 # RAMBo # [env:rambo] -platform = atmelavr extends = common_avr8 board = reprap_rambo @@ -85,7 +80,6 @@ board = reprap_rambo # FYSETC F6 V1.3 / V1.4 # [env:FYSETC_F6] -platform = atmelavr extends = common_avr8 board = fysetc_f6_13 @@ -93,7 +87,6 @@ board = fysetc_f6_13 # Sanguinololu (ATmega644p) # [env:sanguino644p] -platform = atmelavr extends = common_avr8 board = sanguino_atmega644p @@ -101,19 +94,10 @@ board = sanguino_atmega644p # Sanguinololu (ATmega1284p) # [env:sanguino1284p] -platform = atmelavr extends = common_avr8 board = sanguino_atmega1284p board_upload.maximum_size = 126976 -# -# Melzi and clones (ATmega1284p) -# -[env:melzi] -platform = atmelavr -extends = env:sanguino1284p -upload_speed = 57600 - # # Sanguinololu (ATmega1284p stock bootloader with tuned flags) # @@ -122,22 +106,24 @@ upload_speed = 57600 build_flags = ${common.build_flags} -fno-tree-scev-cprop -fno-split-wide-types -Wl,--relax -mcall-prologues [env:sanguino1284p_optimized] -platform = atmelavr -extends = env:melzi +extends = env:sanguino1284p build_flags = ${tuned_1284p.build_flags} # -# Melzi and clones (alias for sanguino1284p_optimized) +# Melzi and clones (ATmega1284p) # +[env:melzi] +extends = env:sanguino1284p +upload_speed = 57600 + [env:melzi_optimized] -platform = atmelavr -extends = env:sanguino1284p_optimized +extends = env:sanguino1284p_optimized +upload_speed = 57600 # # Melzi and clones (Optiboot bootloader) # [env:melzi_optiboot] -platform = atmelavr extends = common_avr8 board = sanguino_atmega1284p upload_speed = 115200 @@ -147,29 +133,5 @@ board_upload.maximum_size = 130048 # Melzi and clones (Zonestar Melzi2 with tuned flags) # [env:melzi_optiboot_optimized] -platform = atmelavr extends = env:melzi_optiboot build_flags = ${tuned_1284p.build_flags} - -# -# AT90USB1286 boards using CDC bootloader -# - BRAINWAVE -# - BRAINWAVE_PRO -# - SAV_MKI -# - TEENSYLU -# -[env:at90usb1286_cdc] -platform = teensy -extends = common_avr8 -board = marlin_at90usb1286 -lib_ignore = ${env:common_avr8.lib_ignore}, Teensy_ADC, NativeEthernet - -# -# AT90USB1286 boards using DFU bootloader -# - Printrboard -# - Printrboard Rev.F -# - ? 5DPRINT ? -# -[env:at90usb1286_dfu] -platform = teensy -extends = env:at90usb1286_cdc diff --git a/ini/due.ini b/ini/due.ini index 9123af8cdc..28b6838307 100644 --- a/ini/due.ini +++ b/ini/due.ini @@ -21,7 +21,6 @@ board = due src_filter = ${common.default_src_filter} + + [env:DUE_USB] -platform = atmelsam extends = env:DUE board = dueUSB @@ -29,7 +28,6 @@ board = dueUSB # Archim SAM # [common_DUE_archim] -platform = atmelsam extends = env:DUE board = marlin_archim build_flags = ${common.build_flags} @@ -39,5 +37,4 @@ extra_scripts = ${common.extra_scripts} Marlin/src/HAL/DUE/upload_extra_script.py [env:DUE_archim] -platform = ${common_DUE_archim.platform} extends = common_DUE_archim diff --git a/ini/esp32.ini b/ini/esp32.ini index 0815486cc9..4ac6b96f5c 100644 --- a/ini/esp32.ini +++ b/ini/esp32.ini @@ -24,12 +24,10 @@ monitor_speed = 250000 #board_build.flash_mode = qio [env:FYSETC_E4] -platform = espressif32@2.1.0 extends = env:esp32 board_build.partitions = default_16MB.csv [env:PANDA] -platform = espressif32@2.1.0 extends = env:esp32 build_flags = ${env:esp32.build_flags} -DUSE_ESP32_EXIO -DUSE_ESP32_TASK_WDT lib_deps = ${common.lib_deps} @@ -40,5 +38,4 @@ monitor_speed = 115200 [env:mks_tinybee] extends = env:esp32 -platform = espressif32@2.1.0 board_build.partitions = default_8MB.csv diff --git a/ini/features.ini b/ini/features.ini index 5f69fcca25..eb3be400b1 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -18,7 +18,7 @@ POSTMORTEM_DEBUGGING = src_filter=+ + + + + + src_filter=+ + + + + + HAS_STEALTHCHOP = src_filter=+ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster diff --git a/ini/lpc176x.ini b/ini/lpc176x.ini index 3c5f43764b..95f5637a5d 100644 --- a/ini/lpc176x.ini +++ b/ini/lpc176x.ini @@ -34,11 +34,9 @@ build_flags = ${common.build_flags} -DU8G_HAL_LINKS -IMarlin/src/HAL/LPC17 # NXP LPC176x ARM Cortex-M3 # [env:LPC1768] -platform = ${common_LPC.platform} extends = common_LPC board = nxp_lpc1768 [env:LPC1769] -platform = ${common_LPC.platform} extends = common_LPC board = nxp_lpc1769 diff --git a/ini/native.ini b/ini/native.ini index fe5fe3a5d0..5355284992 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -52,12 +52,10 @@ extends = simulator_common build_flags = ${simulator_common.build_flags} -ldl -lpthread -lSDL2 -lSDL2_net -lGL [env:simulator_linux_debug] -platform = ${simulator_linux.platform} extends = simulator_linux build_type = debug [env:simulator_linux_release] -platform = ${simulator_linux.platform} extends = simulator_linux build_type = release build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags} @@ -92,13 +90,11 @@ build_flags = -lSDL2 [env:simulator_macos_debug] -platform = ${env:simulator_linux_release.platform} extends = env:simulator_linux_debug build_flags = ${env:simulator_linux_debug.build_flags} ${simulator_macos.build_flags} -ggdb -Og -D_THREAD_SAFE build_unflags = ${simulator_macos.build_unflags} [env:simulator_macos_release] -platform = ${env:simulator_linux_release.platform} extends = env:simulator_linux_release build_flags = ${env:simulator_linux_release.build_flags} ${simulator_macos.build_flags} build_unflags = ${simulator_macos.build_unflags} @@ -110,7 +106,6 @@ build_unflags = ${simulator_macos.build_unflags} # pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-glm mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-dlfcn # [env:simulator_windows] -platform = ${simulator_common.platform} extends = simulator_common src_build_flags = ${simulator_common.src_build_flags} -fpermissive build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp diff --git a/ini/stm32f0.ini b/ini/stm32f0.ini index 4559f115bd..d6251344c3 100644 --- a/ini/stm32f0.ini +++ b/ini/stm32f0.ini @@ -23,7 +23,6 @@ # Malyan M200 v2 (STM32F070RB) # [env:STM32F070RB_malyan] -platform = ${common_stm32.platform} extends = common_stm32 board = marlin_malyanM200v2 build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED @@ -34,7 +33,6 @@ build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED # Malyan M200 v2 (STM32F070CB) # [env:STM32F070CB_malyan] -platform = ${common_stm32.platform} extends = common_stm32 board = malyanm200_f070cb build_flags = ${common_stm32.build_flags} @@ -45,7 +43,6 @@ build_flags = ${common_stm32.build_flags} # Malyan M300 (STM32F070CB) # [env:malyan_M300] -platform = ${common_stm32.platform} extends = common_stm32 board = malyanm300_f070cb build_flags = ${common_stm32.build_flags} diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 969bb815da..878ccd6f7c 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -42,7 +42,6 @@ extra_scripts = ${common.extra_scripts} # STM32F103RC # [common_STM32F103RC_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC monitor_speed = 115200 @@ -51,7 +50,6 @@ monitor_speed = 115200 # MEEB_3DP (STM32F103RCT6 with 512K) # [env:STM32F103RC_meeb] -platform = ${common_stm32f1.platform} extends = common_STM32F103RC_maple board = marlin_MEEB_3DP build_flags = ${common_stm32f1.build_flags} @@ -75,7 +73,6 @@ upload_protocol = dfu # FYSETC STM32F103RC # [env:STM32F103RC_fysetc_maple] -platform = ${common_stm32f1.platform} extends = common_STM32F103RC_maple extra_scripts = ${common_stm32f1.extra_scripts} buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py @@ -91,7 +88,6 @@ upload_protocol = serial # STM32F103RC_btt_USB_maple ......... RCT6 with 256K (USB mass storage) # [env:STM32F103RC_btt_maple] -platform = ${common_stm32f1.platform} extends = common_STM32F103RC_maple board_build.address = 0x08007000 board_build.ldscript = STM32F103RC_SKR_MINI_256K.ld @@ -102,7 +98,6 @@ build_flags = ${common_stm32f1.build_flags} monitor_speed = 115200 [env:STM32F103RC_btt_USB_maple] -platform = ${common_stm32f1.platform} extends = env:STM32F103RC_btt_maple build_flags = ${env:STM32F103RC_btt_maple.build_flags} -DUSE_USB_COMPOSITE lib_deps = ${env:STM32F103RC_btt_maple.lib_deps} @@ -112,7 +107,6 @@ lib_deps = ${env:STM32F103RC_btt_maple.lib_deps} # Generic STM32F103RE environment # [env:STM32F103RE_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RE monitor_speed = 115200 @@ -121,7 +115,6 @@ monitor_speed = 115200 # Creality (STM32F103RET6) # [env:STM32F103RET6_creality_maple] -platform = ${common_stm32f1.platform} extends = env:STM32F103RE_maple build_flags = ${common_stm32f1.build_flags} -DTEMP_TIMER_CHAN=4 board_build.address = 0x08007000 @@ -139,7 +132,6 @@ upload_protocol = jlink # STM32F103RE_btt_USB_maple ......... RET6 (USB mass storage) # [env:STM32F103RE_btt_maple] -platform = ${common_stm32f1.platform} extends = env:STM32F103RE_maple board_build.address = 0x08007000 board_build.ldscript = STM32F103RE_SKR_MINI_512K.ld @@ -150,7 +142,6 @@ debug_tool = stlink upload_protocol = stlink [env:STM32F103RE_btt_USB_maple] -platform = ${common_stm32f1.platform} extends = env:STM32F103RE_btt_maple build_flags = ${env:STM32F103RE_btt_maple.build_flags} -DUSE_USB_COMPOSITE lib_deps = ${common_stm32f1.lib_deps} @@ -160,7 +151,6 @@ lib_deps = ${common_stm32f1.lib_deps} # Geeetech GTM32 (STM32F103VET6) # [env:STM32F103VE_GTM32] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE build_flags = ${common_stm32f1.build_flags} @@ -174,7 +164,6 @@ upload_protocol = serial # Longer 3D board in Alfawise U20 (STM32F103VET6) # [env:STM32F103VE_longer_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE board_build.address = 0x08010000 @@ -191,7 +180,6 @@ build_unflags = ${common_stm32f1.build_unflags} # MKS Robin Mini (STM32F103VET6) # [env:mks_robin_mini_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE extra_scripts = ${common_stm32f1.extra_scripts} @@ -203,7 +191,6 @@ build_flags = ${common_stm32f1.build_flags} # MKS Robin Nano (STM32F103VET6) # [env:mks_robin_nano35_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE extra_scripts = ${common_stm32f1.extra_scripts} @@ -217,7 +204,6 @@ upload_protocol = jlink # MKS Robin (STM32F103ZET6) # [env:mks_robin_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103ZE extra_scripts = ${common_stm32f1.extra_scripts} @@ -229,7 +215,6 @@ build_flags = ${common_stm32f1.build_flags} # MKS Robin Pro (STM32F103ZET6) # [env:mks_robin_pro_maple] -platform = ${common_stm32f1.platform} extends = env:mks_robin_maple extra_scripts = ${common_stm32f1.extra_scripts} buildroot/share/PlatformIO/scripts/mks_robin_pro.py @@ -238,7 +223,6 @@ extra_scripts = ${common_stm32f1.extra_scripts} # TRIGORILLA PRO (STM32F103ZET6) # [env:trigorilla_pro_maple] -platform = ${common_stm32f1.platform} extends = env:mks_robin_maple extra_scripts = ${common_stm32f1.extra_scripts} @@ -247,7 +231,6 @@ extra_scripts = ${common_stm32f1.extra_scripts} # MKS Robin E3 with TMC2209 # [env:mks_robin_e3_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC extra_scripts = ${common_stm32f1.extra_scripts} @@ -260,7 +243,6 @@ build_flags = ${common_stm32f1.build_flags} # - LVGL UI # [env:mks_robin_e3p_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE extra_scripts = ${common_stm32f1.extra_scripts} @@ -274,7 +256,6 @@ upload_protocol = jlink # MKS Robin Lite/Lite2 (STM32F103RCT6) # [env:mks_robin_lite_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC extra_scripts = ${common_stm32f1.extra_scripts} @@ -284,7 +265,6 @@ extra_scripts = ${common_stm32f1.extra_scripts} # MKS ROBIN LITE3 (STM32F103RCT6) # [env:mks_robin_lite3_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC extra_scripts = ${common_stm32f1.extra_scripts} @@ -294,7 +274,6 @@ extra_scripts = ${common_stm32f1.extra_scripts} # JGAurora A5S A1 (STM32F103ZET6) # [env:jgaurora_a5s_a1_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103ZE board_build.address = 0x0800A000 @@ -309,7 +288,6 @@ build_flags = ${common_stm32f1.build_flags} # Malyan M200 (STM32F103CB) # [env:STM32F103CB_malyan_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = marlin_malyanM200 build_flags = ${common_stm32f1.build_flags} @@ -322,7 +300,6 @@ lib_ignore = ${common_stm32f1.lib_ignore} # Chitu boards like Tronxy X5s (STM32F103ZET6) # [env:chitu_f103_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = marlin_CHITU_F103 extra_scripts = ${common_stm32f1.extra_scripts} @@ -338,7 +315,6 @@ build_unflags = ${common_stm32f1.build_unflags} # Use this target if G28 or G29 are always failing. # [env:chitu_v5_gpio_init_maple] -platform = ${common_stm32f1.platform} extends = env:chitu_f103_maple build_flags = ${env:chitu_f103_maple.build_flags} -DCHITU_V5_Z_MIN_BUGFIX @@ -346,7 +322,6 @@ build_flags = ${env:chitu_f103_maple.build_flags} -DCHITU_V5_Z_MIN_BUGFIX # FLYmaker FLY Mini (STM32F103RCT6) # [env:FLY_MINI_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103RC board_build.address = 0x08005000 @@ -364,7 +339,6 @@ build_flags = ${common_stm32f1.build_flags} # STM32F103VE_ZM3E4V2_USB_maple ......... VET6 with 512K # [ZONESTAR_ZM3E_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 platform_packages = tool-stm32duino board_build.address = 0x08005000 @@ -380,20 +354,17 @@ lib_deps = ${common_stm32f1.lib_deps} lib_ignore = Adafruit NeoPixel, SPI, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster, TMCStepper [env:STM32F103RC_ZM3E2_USB_maple] -platform = ${ZONESTAR_ZM3E_maple.platform} extends = ZONESTAR_ZM3E_maple board = genericSTM32F103RC board_build.ldscript = ZONESTAR_ZM3E_256K.ld [env:STM32F103VC_ZM3E4_USB_maple] -platform = ${ZONESTAR_ZM3E_maple.platform} extends = ZONESTAR_ZM3E_maple board = genericSTM32F103VC board_build.ldscript = ZONESTAR_ZM3E_256K.ld build_flags = ${ZONESTAR_ZM3E_maple.build_flags} -DTONE_TIMER=1 -DTONE_CHANNEL=2 [env:STM32F103VE_ZM3E4V2_USB_maple] -platform = ${ZONESTAR_ZM3E_maple.platform} extends = ZONESTAR_ZM3E_maple board = genericSTM32F103VE board_build.ldscript = ZONESTAR_ZM3E_512K.ld @@ -404,7 +375,6 @@ board_upload.maximum_size = 499712 # ERYONE ERY32 Mini (STM32F103VET6) # [env:ERYONE_ERY32_MINI_maple] -platform = ${common_stm32f1.platform} extends = common_stm32f1 board = genericSTM32F103VE build_flags = ${common_stm32f1.build_flags} diff --git a/ini/stm32f1.ini b/ini/stm32f1.ini index a2cd1b0f58..939f51ffbf 100644 --- a/ini/stm32f1.ini +++ b/ini/stm32f1.ini @@ -30,7 +30,6 @@ monitor_speed = 115200 # STM32F103RE # [env:STM32F103RE] -platform = ${common_stm32.platform} extends = common_stm32 board = genericSTM32F103RE monitor_speed = 115200 @@ -39,7 +38,6 @@ monitor_speed = 115200 # STM32F103VE # [env:STM32F103VE] -platform = ${common_stm32.platform} extends = common_stm32 board = genericSTM32F103VE monitor_speed = 115200 @@ -48,7 +46,6 @@ monitor_speed = 115200 # STM32F103ZE # [env:STM32F103ZE] -platform = ${common_stm32.platform} extends = common_stm32 board = genericSTM32F103ZE monitor_speed = 115200 @@ -60,7 +57,6 @@ monitor_speed = 115200 # STM32F103RC_btt_USB ......... RCT6 with 256K (USB mass storage) # [env:STM32F103RC_btt] -platform = ${common_stm32.platform} extends = common_STM32F103RC_variant build_flags = ${common_STM32F103RC_variant.build_flags} -DTIMER_SERVO=TIM5 @@ -68,7 +64,6 @@ board_build.offset = 0x7000 board_upload.offset_address = 0x08007000 [env:STM32F103RC_btt_USB] -platform = ${common_stm32.platform} extends = env:STM32F103RC_btt platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${env:STM32F103RC_btt.build_flags} @@ -83,7 +78,6 @@ build_unflags = ${common_stm32.build_unflags} -DUSBD_USE_CDC # Uses HAL STM32 to support Marlin UI for TFT screen with optional touch panel # [env:mks_robin] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx @@ -98,7 +92,6 @@ build_unflags = ${stm32_variant.build_unflags} # MKS Robin E3/E3D (STM32F103RCT6) with TMC2209 # [env:mks_robin_e3] -platform = ${common_stm32.platform} extends = common_STM32F103RC_variant board_build.encrypt = Robin_e3.bin board_build.offset = 0x5000 @@ -114,7 +107,6 @@ debug_tool = stlink # Creality (STM32F103RET6) # [env:STM32F103RET6_creality] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103RE board_build.variant = MARLIN_F103Rx @@ -139,7 +131,6 @@ upload_protocol = jlink # STM32F103RE_btt_USB ......... RET6 (USB mass storage) # [env:STM32F103RE_btt] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103RE board_build.variant = MARLIN_F103Rx @@ -154,7 +145,6 @@ debug_tool = jlink upload_protocol = jlink [env:STM32F103RE_btt_USB] -platform = ${common_stm32.platform} extends = env:STM32F103RE_btt platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${env:STM32F103RE_btt.build_flags} @@ -167,7 +157,6 @@ build_unflags = ${stm32_variant.build_unflags} -DUSBD_USE_CDC # board Hispeedv1 # [env:flsun_hispeedv1] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx @@ -184,7 +173,6 @@ build_unflags = ${stm32_variant.build_unflags} # MKS Robin Nano V1.2 and V2 # [env:mks_robin_nano35] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx @@ -203,7 +191,6 @@ upload_protocol = jlink # Mingda MPX_ARM_MINI # [env:mingda_mpx_arm_mini] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx @@ -217,7 +204,6 @@ build_unflags = ${stm32_variant.build_unflags} # Malyan M200 (STM32F103CB) # [env:STM32F103CB_malyan] -platform = ${common_stm32.platform} extends = common_stm32 board = malyanm200_f103cb build_flags = ${common_stm32.build_flags} @@ -229,7 +215,6 @@ src_filter = ${common.default_src_filter} + # FLYmaker FLY Mini (STM32F103RCT6) # [env:FLY_MINI] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103RC board_build.variant = MARLIN_F103Rx @@ -241,7 +226,6 @@ build_flags = ${stm32_variant.build_flags} -DSS_TIMER=4 # MKS Robin Mini (STM32F103VET6) # [env:mks_robin_mini] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx @@ -255,7 +239,6 @@ build_flags = ${stm32_variant.build_flags} # MKS Robin Lite/Lite2 (STM32F103RCT6) # [env:mks_robin_lite] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103RC board_build.variant = MARLIN_F103Rx @@ -267,7 +250,6 @@ board_upload.offset_address = 0x08005000 # MKS ROBIN LITE3 (STM32F103RCT6) # [env:mks_robin_lite3] -platform = ${common_stm32.platform} extends = env:mks_robin_lite board_build.encrypt = mksLite3.bin @@ -275,7 +257,6 @@ board_build.encrypt = mksLite3.bin # MKS Robin Pro (STM32F103ZET6) # [env:mks_robin_pro] -platform = ${common_stm32.platform} extends = env:mks_robin board_build.encrypt = Robin_pro.bin @@ -284,7 +265,6 @@ board_build.encrypt = Robin_pro.bin # - LVGL UI # [env:mks_robin_e3p] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx @@ -301,7 +281,6 @@ upload_protocol = jlink # JGAurora A5S A1 (STM32F103ZET6) # [env:jgaurora_a5s_a1] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx @@ -317,7 +296,6 @@ extra_scripts = ${stm32_variant.extra_scripts} # FYSETC STM32F103RC # [env:STM32F103RC_fysetc] -platform = ${common_stm32.platform} extends = common_STM32F103RC_variant extra_scripts = ${common_STM32F103RC_variant.extra_scripts} buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py @@ -329,10 +307,9 @@ upload_protocol = serial # Longer 3D board in Alfawise U20 (STM32F103VET6) # [env:STM32F103VE_longer] -platform = ${common_stm32.platform} +extends = stm32_variant lib_deps = ${common.lib_deps} https://github.com/tpruvot/STM32_Servo_OpenDrain/archive/2.0.zip -extends = stm32_variant board = genericSTM32F103VE board_build.variant = MARLIN_F103VE_LONGER board_build.rename = project.bin @@ -348,7 +325,6 @@ debug_tool = stlink # TRIGORILLA PRO (STM32F103ZET6) # [env:trigorilla_pro] -platform = ${stm32_variant.platform} extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx @@ -361,7 +337,6 @@ build_unflags = ${stm32_variant.build_unflags} # Chitu boards like Tronxy X5s (STM32F103ZET6) # [env:chitu_f103] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F103ZE board_build.variant = MARLIN_F103Zx @@ -377,7 +352,6 @@ extra_scripts = ${stm32_variant.extra_scripts} # Use this target if G28 or G29 are always failing. # [env:chitu_v5_gpio_init] -platform = ${common_stm32.platform} extends = env:chitu_f103 build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX @@ -389,7 +363,6 @@ build_flags = ${env:chitu_f103.build_flags} -DCHITU_V5_Z_MIN_BUGFIX # STM32F103VE_ZM3E4V2_USB ......... VET6 with 512K # [ZONESTAR_ZM3E] -platform = ${common_stm32.platform} extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board_upload.offset_address = 0x08005000 @@ -401,20 +374,17 @@ build_flags = ${common_stm32.build_flags} build_unflags = ${stm32_variant.build_unflags} -DUSBD_USE_CDC [env:STM32F103RC_ZM3E2_USB] -platform = ${ZONESTAR_ZM3E.platform} extends = ZONESTAR_ZM3E board = genericSTM32F103RC board_build.variant = MARLIN_F103Rx [env:STM32F103VC_ZM3E4_USB] -platform = ${ZONESTAR_ZM3E.platform} extends = ZONESTAR_ZM3E board = genericSTM32F103VC board_build.variant = MARLIN_F103Vx build_flags = ${ZONESTAR_ZM3E.build_flags} -DTIMER_TONE=TIM1 [env:STM32F103VE_ZM3E4V2_USB] -platform = ${ZONESTAR_ZM3E.platform} extends = ZONESTAR_ZM3E board = genericSTM32F103VE board_build.variant = MARLIN_F103Vx diff --git a/ini/stm32f4.ini b/ini/stm32f4.ini index d7c80cf0e9..f721f3075d 100644 --- a/ini/stm32f4.ini +++ b/ini/stm32f4.ini @@ -23,7 +23,6 @@ # ARMED (STM32) # [env:ARMED] -platform = ${common_stm32.platform} extends = common_stm32 board = armed_v1 build_flags = ${common_stm32.build_flags} @@ -34,7 +33,6 @@ build_flags = ${common_stm32.build_flags} # 'STEVAL-3DP001V1' STM32F401VE board - https://www.st.com/en/evaluation-tools/steval-3dp001v1.html # [env:STM32F401VE_STEVAL] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STEVAL_STM32F401VE build_flags = ${stm32_variant.build_flags} @@ -45,7 +43,6 @@ build_flags = ${stm32_variant.build_flags} # STM32F401RC # [env:FYSETC_CHEETAH_V20] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_FYSETC_CHEETAH_V20 board_build.offset = 0x8000 @@ -55,7 +52,6 @@ build_flags = ${stm32_variant.build_flags} -DSTM32F401xC # FLYF407ZG # [env:FLYF407ZG] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_FLY_F407ZG @@ -66,7 +62,6 @@ upload_protocol = dfu # FYSETC S6 (STM32F446RET6 ARM Cortex-M4) # [env:FYSETC_S6] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_fysetc_s6 board_build.offset = 0x10000 @@ -80,7 +75,6 @@ upload_command = dfu-util -a 0 -s 0x08010000:leave -D "$SOURCE" # FYSETC S6 new bootloader # [env:FYSETC_S6_8000] -platform = ${common_stm32.platform} extends = env:FYSETC_S6 board = marlin_fysetc_s6 board_build.offset = 0x8000 @@ -93,7 +87,6 @@ upload_command = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE" # Shield - https://github.com/jmz52/Hardware # [env:STM32F407VE_black] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_blackSTM32F407VET6 build_flags = ${stm32_variant.build_flags} @@ -103,7 +96,6 @@ build_flags = ${stm32_variant.build_flags} # STM32F407VET6 Index Mobo Rev 03 # [env:Index_Mobo_Rev03] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_index_mobo_rev03 build_flags = ${stm32_variant.build_flags} @@ -117,7 +109,6 @@ extra_scripts = ${stm32_variant.extra_scripts} # Comment out board_build.offset = 0x10000 if you don't plan to use OpenBLT/flashing directly to 0x08000000. # [env:Anet_ET4_OpenBLT] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx @@ -137,7 +128,6 @@ upload_protocol = jlink # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) # [env:BIGTREE_SKR_PRO] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_BigTree_SKR_Pro board_build.offset = 0x8000 @@ -149,7 +139,6 @@ upload_protocol = stlink # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_SKR_PRO_usb_flash_drive] -platform = ${common_stm32.platform} extends = env:BIGTREE_SKR_PRO platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} -DSTM32F407_5ZX @@ -159,7 +148,6 @@ build_unflags = ${env:BIGTREE_SKR_PRO.build_unflags} -DUSBCON -DUSBD_USE_CDC # BigTreeTech E3 RRF (STM32F407VGT6 ARM Cortex-M4) # [env:BIGTREE_E3_RRF] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_BIGTREE_E3_RRF @@ -173,7 +161,6 @@ build_flags = ${stm32_variant.build_flags} # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) # [env:BIGTREE_GTR_V1_0] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_BigTree_GTR_v1 board_build.offset = 0x8000 @@ -183,7 +170,6 @@ build_flags = ${stm32_variant.build_flags} -DSTM32F407IX # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_GTR_V1_0_usb_flash_drive] -platform = ${common_stm32.platform} extends = env:BIGTREE_GTR_V1_0 platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} -DSTM32F407IX @@ -193,7 +179,6 @@ build_unflags = ${env:BIGTREE_GTR_V1_0.build_unflags} -DUSBCON -DUSBD_USE_CD # BigTreeTech BTT002 V1.0 (STM32F407VGT6 ARM Cortex-M4) # [env:BIGTREE_BTT002] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_BigTree_BTT002 board_build.offset = 0x8000 @@ -208,7 +193,6 @@ build_flags = ${stm32_variant.build_flags} # BigTreeTech BTT002 V1.x with 512k of flash (STM32F407VET6 ARM Cortex-M4) # [env:BIGTREE_BTT002_VET6] -platform = ${env:BIGTREE_BTT002.platform} extends = env:BIGTREE_BTT002 board = marlin_BigTree_BTT002_VET6 @@ -216,7 +200,6 @@ board = marlin_BigTree_BTT002_VET6 # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_SKR_2] -platform = ${common_stm32.platform} extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board = marlin_STM32F407VGT6_CCM @@ -234,13 +217,11 @@ upload_protocol = stlink # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Media Share Support # [env:BIGTREE_SKR_2_USB] -platform = ${common_stm32.platform} extends = env:BIGTREE_SKR_2 build_flags = ${env:BIGTREE_SKR_2.build_flags} -DUSBD_USE_CDC_MSC build_unflags = ${env:BIGTREE_SKR_2.build_unflags} -DUSBD_USE_CDC [env:BIGTREE_SKR_2_USB_debug] -platform = ${common_stm32.platform} extends = env:BIGTREE_SKR_2_USB build_flags = ${env:BIGTREE_SKR_2_USB.build_flags} -O0 build_unflags = ${env:BIGTREE_SKR_2_USB.build_unflags} -Os -NDEBUG @@ -249,7 +230,6 @@ build_unflags = ${env:BIGTREE_SKR_2_USB.build_unflags} -Os -NDEBUG # Bigtreetech SKR V2.0 F429 (STM32F429VGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_SKR_2_F429] -platform = ${common_stm32.platform} extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board = marlin_STM32F429VGT6 @@ -267,13 +247,11 @@ upload_protocol = stlink # BigTreeTech SKR V2.0 F429 (STM32F429VGT6 ARM Cortex-M4) with USB Media Share Support # [env:BIGTREE_SKR_2_F429_USB] -platform = ${common_stm32.platform} extends = env:BIGTREE_SKR_2_F429 build_flags = ${env:BIGTREE_SKR_2_F429.build_flags} -DUSBD_USE_CDC_MSC build_unflags = ${env:BIGTREE_SKR_2_F429.build_unflags} -DUSBD_USE_CDC [env:BIGTREE_SKR_2_F429_USB_debug] -platform = ${common_stm32.platform} extends = env:BIGTREE_SKR_2_F429_USB build_flags = ${env:BIGTREE_SKR_2_F429_USB.build_flags} -O0 build_unflags = ${env:BIGTREE_SKR_2_F429_USB.build_unflags} -Os -NDEBUG @@ -282,7 +260,6 @@ build_unflags = ${env:BIGTREE_SKR_2_F429_USB.build_unflags} -Os -NDEBUG # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) # [env:BIGTREE_OCTOPUS_V1] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_BigTree_Octopus_v1 board_build.offset = 0x8000 @@ -293,7 +270,6 @@ build_flags = ${stm32_variant.build_flags} # BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_OCTOPUS_V1_USB] -platform = ${common_stm32.platform} extends = env:BIGTREE_OCTOPUS_V1 platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC @@ -307,7 +283,6 @@ build_flags = ${stm_flash_drive.build_flags} # BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) # [env:BIGTREE_OCTOPUS_PRO_V1_F429] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_BigTree_Octopus_Pro_v1_F429 board_build.offset = 0x8000 @@ -318,7 +293,6 @@ build_flags = ${stm32_variant.build_flags} # BigTreeTech Octopus Pro V1.0 (STM32F429ZGT6 ARM Cortex-M4) with USB Flash Drive Support # [env:BIGTREE_OCTOPUS_PRO_V1_F429_USB] -platform = ${common_stm32.platform} extends = env:BIGTREE_OCTOPUS_PRO_V1_F429 platform_packages = ${stm_flash_drive.platform_packages} build_unflags = -DUSBD_USE_CDC @@ -332,7 +306,6 @@ build_flags = ${stm_flash_drive.build_flags} # Lerdge base # [lerdge_common] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407ZGT6 board_build.variant = MARLIN_LERDGE @@ -349,7 +322,6 @@ extra_scripts = ${common_stm32.extra_scripts} # Lerdge X (STM32F407VE) # [env:LERDGEX] -platform = ${lerdge_common.platform} extends = lerdge_common board_build.encrypt = Lerdge_X_firmware_force.bin @@ -357,7 +329,6 @@ board_build.encrypt = Lerdge_X_firmware_force.bin # Lerdge X with USB Flash Drive Support # [env:LERDGEX_usb_flash_drive] -platform = ${env:LERDGEX.platform} extends = env:LERDGEX platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} @@ -366,7 +337,6 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # Lerdge S (STM32F407ZG) # [env:LERDGES] -platform = ${lerdge_common.platform} extends = lerdge_common board_build.encrypt = Lerdge_firmware_force.bin @@ -374,7 +344,6 @@ board_build.encrypt = Lerdge_firmware_force.bin # Lerdge S with USB Flash Drive Support # [env:LERDGES_usb_flash_drive] -platform = ${env:LERDGES.platform} extends = env:LERDGES platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} @@ -383,7 +352,6 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # Lerdge K (STM32F407ZG) # [env:LERDGEK] -platform = ${lerdge_common.platform} extends = lerdge_common board_build.encrypt = Lerdge_K_firmware_force.bin build_flags = ${lerdge_common.build_flags} -DLERDGEK @@ -392,7 +360,6 @@ build_flags = ${lerdge_common.build_flags} -DLERDGEK # Lerdge K with USB Flash Drive Support # [env:LERDGEK_usb_flash_drive] -platform = ${env:LERDGEK.platform} extends = env:LERDGEK platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} @@ -401,7 +368,6 @@ build_flags = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags} # RUMBA32 # [env:rumba32] -platform = ${common_stm32.platform} extends = stm32_variant board = rumba32_f446ve board_build.variant = MARLIN_F446VE @@ -418,7 +384,6 @@ upload_protocol = dfu # MKS Robin Pro V2 # [env:mks_robin_pro2] -platform = ${common_stm32.platform} extends = stm32_variant platform_packages = ${stm_flash_drive.platform_packages} board = genericSTM32F407VET6 @@ -440,7 +405,6 @@ build_flags = -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7 # MKS Robin Nano V3 # [env:mks_robin_nano_v3] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx @@ -457,7 +421,6 @@ upload_protocol = jlink # Currently, using a STM32duino fork, until USB Host get merged # [env:mks_robin_nano_v3_usb_flash_drive] -platform = ${common_stm32.platform} extends = env:mks_robin_nano_v3 platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} @@ -471,7 +434,6 @@ build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} # Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged # [env:mks_robin_nano_v3_usb_flash_drive_msc] -platform = ${common_stm32.platform} extends = env:mks_robin_nano_v3_usb_flash_drive build_flags = ${env:mks_robin_nano_v3_usb_flash_drive.build_flags} -DUSBD_USE_CDC_MSC @@ -482,7 +444,6 @@ build_unflags = -DUSBD_USE_CDC # 5 TMC2209 uart mode on board # [env:mks_eagle] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx @@ -500,7 +461,6 @@ upload_protocol = jlink # Currently, using a STM32duino fork, until USB Host get merged # [env:mks_eagle_usb_flash_drive] -platform = ${common_stm32.platform} extends = env:mks_eagle platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} @@ -514,7 +474,6 @@ build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags} # Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged # [env:mks_eagle_usb_flash_drive_msc] -platform = ${common_stm32.platform} extends = env:mks_eagle_usb_flash_drive build_flags = ${env:mks_eagle_usb_flash_drive.build_flags} -DUSBD_USE_CDC_MSC @@ -530,7 +489,6 @@ build_flags = -DPIN_WIRE_SCL=PB8 -DPIN_WIRE_SDA=PB9 # MKS Monster8 # [env:mks_monster8] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx @@ -548,7 +506,6 @@ upload_protocol = jlink # Currently, using a STM32duino fork, until USB Host get merged # [env:mks_monster8_usb_flash_drive] -platform = ${common_stm32.platform} extends = env:mks_monster8 platform_packages = ${stm_flash_drive.platform_packages} build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1_CAN.build_flags} @@ -562,7 +519,6 @@ build_flags = ${stm_flash_drive.build_flags} ${stm32f4_I2C1_CAN.build_flag # Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged # [env:mks_monster8_usb_flash_drive_msc] -platform = ${common_stm32.platform} extends = env:mks_monster8_usb_flash_drive build_flags = ${env:mks_monster8_usb_flash_drive.build_flags} -DUSBD_USE_CDC_MSC @@ -572,7 +528,6 @@ build_unflags = -DUSBD_USE_CDC # TH3D EZBoard v2.0 (STM32F405RGT6 ARM Cortex-M4) # [env:TH3D_EZBoard_V2] -platform = ${common_stm32.platform} extends = stm32_variant board = genericSTM32F405RG board_build.variant = MARLIN_TH3D_EZBOARD_V2 @@ -588,7 +543,6 @@ upload_protocol = stlink # - MKS Robin Nano-S V1.3 (STM32F407VET6) 4 TMC2225 + 1 Pololu Plug # [env:mks_robin_nano_v1_3_f4] -platform = ${common_stm32.platform} extends = stm32_variant board = marlin_STM32F407VGT6_CCM board_build.variant = MARLIN_F4x7Vx @@ -610,12 +564,12 @@ upload_protocol = jlink # Artillery Ruby # [env:Artillery_Ruby] -platform = ${common_stm32.platform} extends = common_stm32 board = marlin_Artillery_Ruby build_flags = ${common_stm32.build_flags} -DSTM32F401xC -DTARGET_STM32F4 -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS -DUSB_PRODUCT=\"Artillery_3D_Printer\" + -DFLASH_DATA_SECTOR=1U -DFLASH_BASE_ADDRESS=0x08004000 extra_scripts = ${common_stm32.extra_scripts} pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py diff --git a/ini/stm32f7.ini b/ini/stm32f7.ini index 200740589b..62755c846d 100644 --- a/ini/stm32f7.ini +++ b/ini/stm32f7.ini @@ -25,7 +25,6 @@ # being readily available based on STM32F7 MCUs # [env:NUCLEO_F767ZI] -platform = ${common_stm32.platform} extends = common_stm32 board = nucleo_f767zi build_flags = ${common_stm32.build_flags} -DTIMER_SERIAL=TIM9 @@ -34,6 +33,5 @@ build_flags = ${common_stm32.build_flags} -DTIMER_SERIAL=TIM9 # REMRAM_V1 # [env:REMRAM_V1] -platform = ${common_stm32.platform} extends = common_stm32 board = remram_v1 diff --git a/ini/stm32g0.ini b/ini/stm32g0.ini index 99f167a4df..171945ffe2 100644 --- a/ini/stm32g0.ini +++ b/ini/stm32g0.ini @@ -23,17 +23,17 @@ # BigTree SKR mini E3 V3.0 (STM32G0B1RET6 ARM Cortex-M0+) # [env:STM32G0B1RE_btt] -platform = ststm32@~14.1.0 -platform_packages = framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/main.zip -extends = stm32_variant -board = marlin_STM32G0B1RE +extends = stm32_variant +platform = ststm32@~14.1.0 +platform_packages = framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/main.zip +board = marlin_STM32G0B1RE board_build.offset = 0x2000 board_upload.offset_address = 0x08002000 -build_flags = ${stm32_variant.build_flags} - -DADC_RESOLUTION=12 - -DPIN_SERIAL4_RX=PC_11 -DPIN_SERIAL4_TX=PC_10 - -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 - -DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4 - -DSTEP_TIMER_IRQ_PRIO=0 -upload_protocol = stlink -debug_tool = stlink +build_flags = ${stm32_variant.build_flags} + -DADC_RESOLUTION=12 + -DPIN_SERIAL4_RX=PC_11 -DPIN_SERIAL4_TX=PC_10 + -DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024 + -DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4 + -DSTEP_TIMER_IRQ_PRIO=0 +upload_protocol = stlink +debug_tool = stlink diff --git a/ini/stm32h7.ini b/ini/stm32h7.ini index 16d1067e52..b0cb10866c 100644 --- a/ini/stm32h7.ini +++ b/ini/stm32h7.ini @@ -23,7 +23,6 @@ # BigTreeTech SKR SE BX (STM32H743IIT6 ARM Cortex-M7) # [env:BTT_SKR_SE_BX] -platform = ${common_stm32.platform} extends = stm32_variant platform_packages = framework-arduinoststm32@https://github.com/thisiskeithb/Arduino_Core_STM32/archive/biqu-bx-workaround.zip board = marlin_BTT_SKR_SE_BX diff --git a/ini/teensy.ini b/ini/teensy.ini index ef1ad766bc..ab0617b5b7 100644 --- a/ini/teensy.ini +++ b/ini/teensy.ini @@ -9,43 +9,72 @@ # # ################################# +# +# Teensy AVR +# +[teensy_avr] +platform = teensy +platform_packages = toolchain-atmelavr@~1.70300.0 +extends = common_avr8 +lib_ignore = ${env:common_avr8.lib_ignore}, NativeEthernet + +# +# AT90USB1286 boards using CDC bootloader +# e.g., BRAINWAVE, BRAINWAVE_PRO, SAV_MKI, TEENSYLU +# +[env:at90usb1286_cdc] +extends = teensy_avr +board = marlin_at90usb1286 +lib_ignore = ${teensy_avr.lib_ignore}, Teensy_ADC + +# +# AT90USB1286 boards using DFU bootloader +# e.g., Printrboard, Printrboard Rev.F, 5DPRINT +# +[env:at90usb1286_dfu] +extends = env:at90usb1286_cdc + # # Teensy++ 2.0 # [env:teensy20] -platform = teensy -extends = common_avr8 -board = teensy2pp -lib_ignore = ${env:common_avr8.lib_ignore}, NativeEthernet +extends = teensy_avr +board = teensy2pp + +# +# Teensy 3.x - 4.x +# +[teensy_arm] +platform = teensy@~4.12.0 +src_filter = ${common.default_src_filter} +lib_ignore = NativeEthernet # # Teensy 3.1 / 3.2 (ARM Cortex-M4) # [env:teensy31] -platform = teensy@~4.12.0 -board = teensy31 -src_filter = ${common.default_src_filter} + -lib_ignore = NativeEthernet +extends = teensy_arm +board = teensy31 +src_filter = ${teensy_arm.src_filter} + # # Teensy 3.5 / 3.6 (ARM Cortex-M4) # [env:teensy35] -platform = teensy@~4.12.0 -board = teensy35 -src_filter = ${common.default_src_filter} + -lib_ignore = NativeEthernet +extends = teensy_arm +board = teensy35 +src_filter = ${teensy_arm.src_filter} + [env:teensy36] -platform = teensy@~4.12.0 -board = teensy36 -src_filter = ${common.default_src_filter} + -lib_ignore = NativeEthernet +extends = teensy_arm +board = teensy36 +src_filter = ${teensy_arm.src_filter} + # # Teensy 4.0 / 4.1 (ARM Cortex-M7) # [env:teensy41] -platform = teensy@~4.12.0 -board = teensy41 -src_filter = ${common.default_src_filter} + +extends = teensy_arm +board = teensy41 +src_filter = ${teensy_arm.src_filter} + +lib_ignore = diff --git a/platformio.ini b/platformio.ini index 01fd7aec99..1a16d61e22 100644 --- a/platformio.ini +++ b/platformio.ini @@ -205,6 +205,7 @@ default_src_filter = + - - + - - - + - - - -